/* ============================================================
   Mode layar informasi sekolah (TV / monitor lobi)
   Dirancang untuk dibaca dari jarak beberapa meter.
   ============================================================ */

:root {
  --d-bg:     #0B1424;
  --d-panel:  #14213A;
  --d-line:   #24365A;
  --d-text:   #F2F5FB;
  --d-muted:  #94A7C6;
  --d-gold:   #E6B93C;
  --d-navy:   #1F3864;
  --d-free:   #4ADE80;
  --d-busy:   #F87171;
  --d-soon:   #FBBF24;
}

* { box-sizing: border-box; }

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

.screen { display: flex; flex-direction: column; height: 100vh; }

/* Kepala layar */
.d-head {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 34px; background: linear-gradient(90deg, var(--d-navy), var(--d-bg));
  border-bottom: 3px solid var(--d-gold);
}
.d-head img, .d-head .crest {
  width: 58px; height: 58px; border-radius: 12px; object-fit: contain;
  background: linear-gradient(150deg, var(--d-gold), #8C6A00);
  display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: #fff;
}
.d-head h1 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.9rem); letter-spacing: -.01em; }
.d-head p  { margin: 2px 0 0; color: var(--d-muted); font-size: clamp(.8rem, 1vw, 1rem); }
.d-clock   { margin-left: auto; text-align: right; }
.d-clock .t { font-size: clamp(1.9rem, 3.4vw, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.d-clock .t .s { font-size: .5em; color: var(--d-gold); }
.d-clock .d { color: var(--d-muted); font-size: clamp(.8rem, 1.1vw, 1.05rem); margin-top: 4px; }

/* Badan slide */
.d-body { flex: 1; position: relative; overflow: hidden; }
.slide {
  position: absolute; inset: 0; padding: 26px 34px; opacity: 0; visibility: hidden;
  transition: opacity .45s ease; display: flex; flex-direction: column;
}
.slide.on { opacity: 1; visibility: visible; }
.slide h2 {
  margin: 0 0 16px; font-size: clamp(1.1rem, 1.7vw, 1.6rem); color: var(--d-gold);
  display: flex; align-items: center; gap: 12px; flex: none;
}
.slide h2 .count { margin-left: auto; font-size: .85rem; color: var(--d-muted); font-weight: 600; }
.slide-inner { flex: 1; min-height: 0; overflow: hidden; }

/* Slide jam besar */
.big-clock { display: grid; place-content: center; text-align: center; height: 100%; }
.big-clock .time { font-size: clamp(5rem, 17vw, 15rem); font-weight: 800; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-clock .time .s { font-size: .32em; color: var(--d-gold); }
.big-clock .date { font-size: clamp(1.2rem, 3vw, 2.4rem); color: var(--d-muted); margin-top: 14px; }
.big-clock .state { margin-top: 22px; font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 700; color: var(--d-gold); }

/* Jam pembelajaran */
.period-hero { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.period-top { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.period-top .no { font-size: clamp(2rem, 4.6vw, 4rem); font-weight: 800; letter-spacing: -.02em; }
.period-top .time { font-size: clamp(1.2rem, 2.4vw, 2rem); color: var(--d-muted); font-variant-numeric: tabular-nums; }
.period-top .live {
  margin-left: auto; background: rgba(74,222,128,.16); color: var(--d-free); font-weight: 800;
  padding: 8px 18px; border-radius: 999px; font-size: clamp(.85rem, 1.3vw, 1.15rem);
}
.bar { height: 10px; background: var(--d-panel); border-radius: 99px; overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; background: var(--d-gold); }

.class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow: hidden; }
.class-cell { background: var(--d-panel); border: 1px solid var(--d-line); border-radius: 12px; padding: 12px 14px; }
.class-cell b { display: block; font-size: clamp(.95rem, 1.35vw, 1.25rem); }
.class-cell span { display: block; color: var(--d-muted); font-size: clamp(.75rem, 1.05vw, .95rem); }
.class-cell .subj { color: var(--d-gold); font-weight: 700; }

/* Tabel besar */
table.d-table { width: 100%; border-collapse: collapse; font-size: clamp(.9rem, 1.35vw, 1.3rem); }
table.d-table th {
  text-align: left; padding: 10px 14px; color: var(--d-muted); font-size: .78em;
  border-bottom: 2px solid var(--d-line); font-weight: 700;
}
table.d-table td { padding: 12px 14px; border-bottom: 1px solid var(--d-line); }
table.d-table tr.now td { background: rgba(230,185,60,.13); }
table.d-table tr.now td:first-child { box-shadow: inset 4px 0 var(--d-gold); }
table.d-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Kartu ruangan pada layar */
.rooms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.room-tile {
  background: var(--d-panel); border-left: 6px solid var(--d-free); border-radius: 12px; padding: 12px 16px;
}
.room-tile.busy { border-left-color: var(--d-busy); }
.room-tile.soon { border-left-color: var(--d-soon); }
.room-tile.off  { border-left-color: var(--d-muted); opacity: .65; }
.room-tile b { display: block; font-size: clamp(.95rem, 1.3vw, 1.25rem); }
.room-tile span { color: var(--d-muted); font-size: clamp(.75rem, 1.05vw, .95rem); }
.room-tile .act { color: var(--d-text); margin-top: 4px; display: block; }

/* Prestasi */
.ach-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; height: 100%; }
.ach-medal {
  width: clamp(90px, 12vw, 170px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #F5D57A, var(--d-gold) 55%, #8C6A00);
  color: #3A2C00; font-weight: 800; font-size: clamp(1rem, 2vw, 1.8rem); text-align: center; line-height: 1.1; padding: 12px;
}
.ach-hero h3 { margin: 0 0 10px; font-size: clamp(1.4rem, 3.2vw, 2.8rem); line-height: 1.15; }
.ach-hero p  { margin: 0; font-size: clamp(1rem, 1.8vw, 1.5rem); color: var(--d-muted); }
.ach-hero p b { color: var(--d-text); }

/* Daftar agenda / pengumuman / berita */
.d-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.d-list li { background: var(--d-panel); border-radius: 12px; padding: 14px 18px; display: flex; gap: 18px; align-items: flex-start; }
.d-list .when { flex: none; font-weight: 800; color: var(--d-gold); font-variant-numeric: tabular-nums; min-width: 110px; font-size: clamp(.9rem, 1.3vw, 1.2rem); }
.d-list b { font-size: clamp(.95rem, 1.4vw, 1.3rem); font-weight: 700; display: block; }
.d-list small { color: var(--d-muted); font-size: clamp(.78rem, 1.05vw, 1rem); }
.d-list .tag { margin-left: auto; flex: none; background: var(--d-navy); color: #D7E0F2; padding: 4px 12px; border-radius: 999px; font-size: .8em; font-weight: 700; }

.ann-card { background: var(--d-panel); border-left: 6px solid var(--d-gold); border-radius: 12px; padding: 18px 22px; margin-bottom: 12px; }
.ann-card b { font-size: clamp(1rem, 1.6vw, 1.5rem); display: block; margin-bottom: 4px; }
.ann-card p { margin: 0; color: var(--d-muted); font-size: clamp(.85rem, 1.25vw, 1.15rem); }

/* Kaki layar */
.d-foot {
  display: flex; align-items: center; gap: 16px; padding: 10px 0 10px 24px;
  background: var(--d-panel); border-top: 1px solid var(--d-line); overflow: hidden;
}
.d-foot .tag { flex: none; background: var(--d-gold); color: #2A2000; font-weight: 800; padding: 5px 14px; border-radius: 999px; font-size: clamp(.7rem, .95vw, .9rem); }
.d-track { display: flex; gap: 80px; white-space: nowrap; animation: dslide 40s linear infinite; font-size: clamp(.85rem, 1.25vw, 1.15rem); font-weight: 600; }
@keyframes dslide { from { transform: translateX(0) } to { transform: translateX(-50%) } }

.dots { position: absolute; right: 34px; bottom: 14px; display: flex; gap: 7px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--d-line); display: block; }
.dots i.on { background: var(--d-gold); width: 26px; border-radius: 99px; }

.d-tools { position: fixed; top: 12px; right: 12px; display: flex; gap: 8px; opacity: 0; transition: opacity .2s; z-index: 30; }
body:hover .d-tools { opacity: 1; }
.d-tools button, .d-tools a {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-size: .82rem; cursor: pointer; text-decoration: none;
}

/* Pengumuman darurat */
.emergency {
  position: fixed; inset: 0; z-index: 50; background: #B42318; color: #fff;
  display: none; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6vw;
}
.emergency.on { display: flex; animation: flash 1.4s ease-in-out infinite alternate; }
@keyframes flash { from { background: #B42318 } to { background: #8E1B12 } }
.emergency h2 { font-size: clamp(2rem, 6vw, 5rem); margin: 0 0 20px; letter-spacing: -.02em; }
.emergency p  { font-size: clamp(1.1rem, 3vw, 2.4rem); margin: 0; max-width: 22ch; line-height: 1.35; }

@media (max-width: 900px) {
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .rooms-grid { grid-template-columns: 1fr; }
  .ach-hero { grid-template-columns: 1fr; text-align: center; place-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .d-track, .emergency.on { animation: none; }
}
