:root {
  --p-green: #0f6e4f;
  --p-gold: #e0b23d;
  --p-bg: #06231a;
  --p-panel: #0c3527;
  --p-panel-2: #0f4130;
  --p-text: #eef7f2;
  --p-muted: #a9c9bd;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

.papan {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(224,178,61,0.10) 0, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(15,110,79,0.35) 0, transparent 50%),
    var(--p-bg);
}

.papan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2.5rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.papan-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.papan-brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.papan-brand h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 700;
}

.papan-brand p {
  margin: 0;
  color: var(--p-muted);
  font-size: 0.95rem;
}

.papan-clock {
  text-align: right;
}

.papan-clock .time {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--p-gold);
}

.papan-clock .date {
  color: var(--p-muted);
  font-size: 1rem;
  margin-top: .35rem;
}

.papan-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  padding: 1.5rem 2.5rem;
  min-height: 0;
}

.panel {
  background: linear-gradient(180deg, var(--p-panel), var(--p-panel-2));
  border-radius: 1.1rem;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1.4rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Never let a panel's content spill past its own rounded card and
     overlap whatever sits next to or below it on the board. */
  overflow: hidden;
}

.panel h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--p-muted);
  margin: 0 0 1rem;
}

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 0.7rem;
  flex: 1;
  min-height: 0;
}

.prayer-tile {
  background: rgba(255,255,255,0.04);
  border-radius: 0.9rem;
  padding: 0.7rem 0.75rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.prayer-tile.next {
  background: rgba(224,178,61,0.16);
  border-color: rgba(224,178,61,0.55);
}

.prayer-tile .label {
  font-size: clamp(0.75rem, 1.4vh, 0.95rem);
  color: var(--p-muted);
}

.prayer-tile.next .label {
  color: var(--p-gold);
}

.prayer-tile .value {
  font-size: clamp(1.2rem, 2.6vh, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: .2rem;
}

.countdown-box {
  margin-top: 0.75rem;
  flex-shrink: 0;
  text-align: center;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background: rgba(15,110,79,0.35);
  border: 1px dashed rgba(224,178,61,0.5);
}

.countdown-box .cd-label {
  color: var(--p-muted);
  font-size: 0.9rem;
}

.countdown-box .cd-value {
  font-size: clamp(1.3rem, 2.8vh, 2.1rem);
  font-weight: 700;
  color: var(--p-gold);
  font-variant-numeric: tabular-nums;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.slider-panel {
  flex: 1.4;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.slider-track img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.slider-track img.active {
  opacity: 1;
}

.slider-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
  padding: 1.5rem 1.25rem 1rem;
  z-index: 2;
}

.slider-caption h3 {
  margin: 0;
  font-size: 1.15rem;
}

.slider-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--p-muted);
  font-size: 1.1rem;
}

.info-panel {
  flex: 1;
  position: relative;
}

.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-area::-webkit-scrollbar {
  display: none;
}

/* Soft fade at the bottom hints there's more content below the fold. */
.panel-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.75rem;
  background: linear-gradient(0deg, var(--p-panel-2), transparent);
  pointer-events: none;
  border-radius: 0 0 1.1rem 1.1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  font-size: 0.92rem;
}

.info-row:last-child { border-bottom: none; }

.info-row .k { color: var(--p-muted); }
.info-row .v { font-weight: 600; text-align: right; }

.info-group-label {
  color: var(--p-gold);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0.7rem 0 0.15rem;
}

.papan-ticker {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  padding: 0.9rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.papan-ticker .ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 35s linear infinite;
  font-size: 1.15rem;
}

.papan-ticker .ticker-track span {
  margin-right: 4rem;
  color: var(--p-text);
}

.papan-ticker .ticker-track span i {
  color: var(--p-gold);
  margin-right: 0.5rem;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.sunnah-panel {
  max-height: 18vh;
}

.sunnah-panel .scroll-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.15rem 2rem;
  align-content: start;
}

@media (max-width: 1100px) {
  .papan-body { grid-template-columns: 1fr; }
}

/*
 * The board is designed for a fixed-size TV/monitor (hence the hard
 * `overflow: hidden` above), but someone will inevitably open the link on a
 * phone to sanity-check it - let it scroll and shrink instead of clipping.
 */
@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  .papan {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto auto;
  }

  .papan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.75rem;
  }

  .papan-clock {
    text-align: left;
  }

  .papan-clock .time {
    font-size: 2.1rem;
  }

  .papan-body {
    padding: 1rem 1.25rem;
    gap: 1rem;
  }

  .prayer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prayer-tile .value {
    font-size: 1.4rem;
  }

  .slider-panel {
    min-height: 220px;
  }

  .info-panel,
  .sunnah-panel {
    max-height: 40vh;
  }

  .papan-ticker .ticker-track {
    font-size: 0.95rem;
  }
}
