/* Bahasa visual mengikuti situs Lomba Nasional Milad Sidogiri 290:
   kertas krem, tinta gelap, aksen olive, font Sora + Cenzo, strip & ornamen. */
@font-face { font-family: 'Sora'; font-weight: 100 800; font-display: swap; src: url('fonts/Sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-weight: 100 800; font-display: swap; src: url('fonts/Sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cenzo'; font-weight: 400; font-display: swap; src: url('fonts/TRTCENZO-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Cenzo'; font-weight: 700; font-display: swap; src: url('fonts/TRTCENZO-Bold.ttf') format('truetype'); }

:root {
  --ink: #24211c;
  --paper: #efede7;
  --paper2: #e5e2da;
  --olive: #8a7c4c;
  --olive-d: #675c37;
  --olive-l: #c3b68b;
  --olive-p: #e8e2cd;
  --grey: #7c7b77;
  --grey-l: #a9a7a2;
  --line: rgba(36, 33, 28, 0.13);
  --ok: #2e7d2e;   --ok-bg: #dbeedb;
  --bad: #a94442;  --bad-bg: #f4dede;
  --warn: #8a6d1f; --warn-bg: #f7ecd0;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --disp: 'Cenzo', 'Sora', system-ui, sans-serif;
  --body: 'Sora', system-ui, sans-serif;
  /* nama lama yang masih dipakai di style inline */
  --gold: var(--olive-d); --green: var(--ok); --red: var(--bad); --orange: var(--warn); --text: var(--ink); --muted: var(--grey);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-weight: 400; font-size: 14px;
  -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: 10px;
}
/* strip atas & bawah khas situs Milad */
body::before { content: ''; display: block; height: 10px; background: linear-gradient(90deg, var(--olive) 0 26%, var(--paper2) 26% 92%, var(--grey) 92%); }
body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 10px; z-index: 40; background: linear-gradient(90deg, var(--grey) 0 8%, var(--paper2) 8% 74%, var(--olive) 74%); }

a { color: var(--olive-d); text-decoration: none; transition: color 380ms var(--ease); }
a:hover { color: var(--olive); }
h1, h2, h3 { margin: 0 0 .6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 23px; } h2 { font-size: 19px; } h3 { font-size: 15px; }
.disp { font-family: var(--disp); font-weight: 400; letter-spacing: -0.04em; }
.muted { color: var(--grey); }
.hide { display: none !important; }
[dir="auto"] { unicode-bidi: plaintext; }
.wrap { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 40px); }
.narrow { max-width: 560px; }

/* label kecil berhuruf kapital dengan garis olive */
.eyebrow { display: flex; align-items: center; gap: 14px; font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--olive-d); }
.eyebrow::before { content: ''; width: 40px; height: 2px; background: var(--olive); }

/* ornamen sudut (titik halftone & kisi) */
.orn { position: fixed; pointer-events: none; z-index: 0; background-repeat: no-repeat; background-size: cover; animation: ornGlow 11s ease-in-out infinite; }
.orn-bawah { left: -6vw; bottom: -8vw; width: 55vw; height: 42vw; background-image: url('img/ornamen-bawah-sm.png'); background-position: left bottom; opacity: .35; }
.orn-atas { right: -4vw; top: -8vw; width: 40vw; height: 38vw; background-image: url('img/ornamen-atas-sm.png'); background-position: right top; opacity: .3; animation-delay: .4s; }
@keyframes ornGlow { 50% { opacity: .5; transform: scale(1.03); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* tombol & form */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 4px; border: 1px solid rgba(36, 33, 28, .25);
  background: transparent; color: var(--ink); font: 600 13.5px var(--body);
  cursor: pointer; text-decoration: none; user-select: none; white-space: nowrap;
  transition: background-color 380ms var(--ease), color 380ms var(--ease), border-color 380ms var(--ease), transform 380ms var(--ease), box-shadow 380ms var(--ease);
}
.btn:hover { border-color: var(--olive); color: var(--olive-d); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.96); box-shadow: none; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover, .btn.green:hover, .btn.red:hover, .btn.blue:hover { background: var(--olive-d); border-color: var(--olive-d); color: #fff; box-shadow: 0 16px 30px -14px rgba(36, 33, 28, .4); }
.btn.green { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.red { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.blue { background: var(--olive); color: #fff; border-color: var(--olive); }
.btn:disabled:hover { box-shadow: none; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.big { height: 50px; padding: 0 26px; font-size: 15px; letter-spacing: .04em; }
.btn kbd { font: 600 10px var(--body); opacity: .6; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; }
input, select, textarea {
  font: 400 14px var(--body); color: var(--ink); background: var(--paper);
  border: 1px solid rgba(36, 33, 28, .18); border-radius: 2px; padding: 0 12px; height: 40px; max-width: 100%; outline: none;
}
textarea { width: 100%; min-height: 84px; padding: 10px 12px; height: auto; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--olive); outline-offset: 1px; }
label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--paper2); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; }
.card + .card { margin-top: 14px; }
.card h3 { font-size: 15px; }
.pill {
  display: inline-block; padding: 5px 10px; border-radius: 3px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: #ecece6; color: #7a7a72;
}
.pill.gold { background: var(--olive-p); color: var(--olive-d); }
.pill.red { background: var(--bad-bg); color: var(--bad); }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.orange { background: var(--warn-bg); color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; border-bottom: 2px solid var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); text-align: left; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
tbody tr:hover { background: rgba(138, 124, 76, .06); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grey-l); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 4px; z-index: 99; max-width: 90vw; font-size: 13.5px; animation: riseIn 400ms var(--ease); }
.toast.err { background: var(--bad); color: #fff; font-weight: 600; }
.conn { font-size: 12px; color: var(--ok); font-weight: 600; }
.conn.bad { color: var(--bad); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 34px; }
.brand b { font-family: var(--disp); font-weight: 400; font-size: 20px; letter-spacing: -0.03em; }

/* ===== menu utama ===== */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(20px, 3vw, 36px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: center; }
.hero h1 { font-family: var(--disp); font-weight: 400; font-size: clamp(40px, 5.6vw, 80px); line-height: .94; letter-spacing: -0.045em; margin: 22px 0 18px; }
.hero h1 span { display: block; color: var(--olive); }
.hero p { font-size: 15px; line-height: 1.6; color: #4b4740; margin: 0; }
.hero img { width: 100%; max-width: 420px; justify-self: end; animation: riseIn 1s var(--ease) both; }
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.menu a { display: block; color: var(--ink); }
.menu .card { height: 100%; transition: transform 520ms var(--ease), box-shadow 520ms var(--ease), border-color 380ms; }
.menu a:hover .card { transform: translateY(-6px); box-shadow: 0 20px 40px -22px rgba(36, 33, 28, .32); border-color: var(--olive-l); }
.menu .no { font-family: var(--disp); font-size: 30px; color: var(--olive); line-height: 1; margin-bottom: 14px; }
.ip { font: 700 clamp(17px, 2.2vw, 24px) var(--body); color: var(--olive-d); letter-spacing: -0.01em; margin: 8px 0; word-break: break-all; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero img { order: -1; justify-self: start; max-width: 240px; } }

/* ===== Layar LED ===== */
body.led { overflow: hidden; height: 100vh; padding: 0; font-size: 1.5vw; }
body.led::after { height: 1vh; }
body.led::before { height: 1vh; }
.led-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; height: 8vh; padding: 0 2.4vw; border-bottom: 1px solid var(--line); }
.led-head .brand img { height: 5.2vh; }
.led-head .t1 { font-family: var(--disp); font-size: 2.1vw; letter-spacing: -0.03em; }
.led-head .t2 { font-size: .8vw; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--olive-d); display: flex; align-items: center; gap: .8vw; }
.led-head .t2::before { content: ''; width: 2.4vw; height: 2px; background: var(--olive); }
.led-main { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 25vw; gap: 1.6vw; padding: 1.6vw 2.4vw; height: calc(100vh - 10vh - 18vh); }
.led-q { background: rgba(229, 226, 218, .85); border: 1px solid var(--line); border-radius: .5vw; padding: 2vw 2.4vw; display: flex; flex-direction: column; min-height: 0; animation: riseIn 700ms var(--ease); }
.led-q .badges { display: flex; gap: .6vw; flex-wrap: wrap; margin-bottom: 2vh; }
.led-q .badges .pill { font-size: .85vw; padding: .45vw .9vw; }
.led-q .turn { font-family: var(--disp); font-size: 2.2vw; color: var(--olive); margin-bottom: 1.2vh; letter-spacing: -0.03em; }
.led-q .soal { font-size: 2.7vw; font-weight: 400; line-height: 1.4; letter-spacing: -0.01em; flex: 1; overflow: hidden; white-space: pre-wrap; }
.led-q .jawab { margin-top: 1.4vh; font-size: 2.3vw; font-weight: 600; color: var(--olive-d); background: var(--olive-p); border-left: .35vw solid var(--olive); padding: 1.2vh 1.4vw; white-space: pre-wrap; animation: riseIn 600ms var(--ease); }
.led-side { display: flex; flex-direction: column; gap: 1.2vw; min-height: 0; }
.bell { border-radius: .5vw; padding: 1.3vw; text-align: center; font-size: 1.5vw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; background: var(--paper2); color: var(--grey); border: 1px solid var(--line); }
.bell.open { background: var(--olive); color: #fff; border-color: var(--olive); animation: pulse 1.1s infinite; }
.bell.done { background: transparent; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .7vw rgba(138, 124, 76, .25); } }
.timer { text-align: center; font-family: var(--disp); font-size: 6vw; line-height: 1; font-variant-numeric: tabular-nums; min-height: 6vw; }
.timer small { display: block; font-family: var(--body); font-size: .8vw; letter-spacing: .2em; text-transform: uppercase; color: var(--grey); font-weight: 700; margin-top: .4vw; }
.timer.warn { color: var(--bad); }
.queue { background: rgba(229, 226, 218, .85); border: 1px solid var(--line); border-radius: .5vw; padding: 1.2vw; flex: 1; overflow: hidden; }
.queue h3 { font-size: .8vw; font-weight: 700; letter-spacing: .2em; color: var(--grey); margin-bottom: .9vw; }
.qi { display: flex; align-items: center; gap: .9vw; padding: .8vw; border-radius: .35vw; margin-bottom: .5vw; background: var(--paper); font-size: 1.5vw; font-weight: 600; animation: riseIn 400ms var(--ease); }
.qi .n { width: 2.4vw; height: 2.4vw; border-radius: 50%; display: grid; place-items: center; background: var(--paper2); font-family: var(--disp); font-size: 1.3vw; flex: none; }
.qi .ms { margin-left: auto; font-size: .9vw; color: var(--grey); font-weight: 400; }
.qi.now { background: var(--ink); color: var(--paper); }
.qi.now .n { background: var(--olive); color: #fff; }
.qi.now .ms { color: var(--olive-l); }
.qi.win { background: var(--ok); color: #fff; }
.qi.win .ms { color: #fff; }
.locked { font-size: .95vw; color: var(--grey); margin-top: .6vw; line-height: 1.5; }
.locked b { color: var(--bad); }
.led-board { position: fixed; z-index: 3; left: 0; right: 0; bottom: 1vh; height: 17vh; padding: 1.1vh 2.4vw; display: grid; grid-template-columns: repeat(11, 1fr); gap: .45vw; background: var(--ink); }
.chip { background: rgba(239, 237, 231, .06); border-radius: .3vw; padding: .45vw .6vw; overflow: hidden; position: relative; border-top: 2px solid transparent; }
.chip .nm { font-size: .78vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(239, 237, 231, .7); }
.chip .pt { font-family: var(--disp); font-size: 1.9vw; color: var(--paper); font-variant-numeric: tabular-nums; line-height: 1.15; }
.chip.top { border-top-color: var(--olive-l); }
.chip.out { opacity: .28; }
.chip.rest::after { content: 'ISTIRAHAT'; position: absolute; bottom: .35vw; right: .45vw; font-size: .55vw; font-weight: 700; letter-spacing: .1em; color: var(--olive-l); }
.chip.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 55% { background: var(--olive); } }
.led-full { position: fixed; z-index: 2; inset: calc(1vh + 8vh) 0 1vh 0; padding: 2.2vw 5vw; }
.led-title { display: grid; grid-template-columns: 1.2fr .8fr; gap: 4vw; align-items: center; }
.led-title .eyebrow { font-size: .9vw; }
.led-title .eyebrow::before { width: 3vw; }
.led-title .big { font-family: var(--disp); font-size: 6.2vw; line-height: .94; letter-spacing: -0.045em; margin: 3vh 0; }
.led-title .big span { display: block; color: var(--olive); }
.led-title .sub { font-size: 1.3vw; line-height: 1.6; color: #4b4740; }
.led-title .satu { font-size: 1.4vw; font-weight: 200; letter-spacing: .42em; text-transform: uppercase; color: var(--grey); margin: 3vh 0; display: flex; align-items: center; gap: 1.5vw; }
.led-title .satu::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--grey-l), transparent); }
.led-title img { width: 100%; animation: riseIn 1.2s var(--ease) both; }
.led-title #judul-babak { font-family: var(--disp); font-size: 2.2vw; color: var(--olive-d); letter-spacing: -0.02em; }
.led-full h2 { font-family: var(--disp); font-weight: 400; font-size: 2.8vw; letter-spacing: -0.03em; margin: 1vh 0 2vh; }
.stand { columns: 2; column-gap: 3vw; }
.stand .sr { display: flex; gap: 1.2vw; align-items: center; padding: .5vw 1.2vw; border-radius: .35vw; margin-bottom: .4vw; background: rgba(229, 226, 218, .9); break-inside: avoid; font-size: 1.35vw; font-weight: 600; animation: riseIn 600ms var(--ease) both; }
.stand .sr .rk { width: 2.6vw; font-family: var(--disp); font-weight: 400; font-size: 1.7vw; color: var(--olive); }
.stand .sr .pt { margin-left: auto; font-family: var(--disp); font-weight: 400; font-size: 1.8vw; font-variant-numeric: tabular-nums; }
.stand .sr:nth-child(-n+3) { background: var(--ink); color: var(--paper); }
.stand .sr:nth-child(-n+3) .rk { color: var(--olive-l); }
.stand .sr.out { opacity: .35; background: transparent; color: var(--ink); }
.unlock { position: fixed; inset: 0; background: rgba(239, 237, 231, .92); display: grid; place-items: center; z-index: 50; cursor: pointer; text-align: center; }
.unlock img { width: 22vw; margin-bottom: 3vh; }
.unlock div { font-size: 1.6vw; font-weight: 600; }

/* ===== Operator ===== */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.op-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.op-q .soal { font-size: 19px; white-space: pre-wrap; line-height: 1.55; margin: 14px 0 10px; }
.op-q .jawab { font-size: 16px; font-weight: 600; color: var(--olive-d); white-space: pre-wrap; background: var(--olive-p); border-left: 3px solid var(--olive); padding: 8px 12px; }
.op-q .jawab:empty { display: none; }
.op-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.op-status { font-family: var(--disp); font-size: 24px; letter-spacing: -0.02em; margin: 14px 0 4px; }
.op-queue .qrow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 4px; background: var(--paper); margin-bottom: 5px; }
.op-queue .qrow.now { background: var(--ink); color: var(--paper); }
.op-queue .qrow .ms { margin-left: auto; color: var(--grey); font-size: 12.5px; }
.op-stand td { padding: 7px 8px; }
.op-stand tr.out td { opacity: .45; }
.log { max-height: 300px; overflow: auto; }
.log td { padding: 6px 8px; font-size: 12.5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .btn { border-radius: 99px; height: 34px; font-size: 12.5px; border-color: transparent; background: var(--paper2); }
.tabs .btn.active { background: var(--olive); color: #fff; }
.seg .btn.primary { background: var(--olive-d); border-color: var(--olive-d); color: #fff; }
.op-stand .btn.small { height: 26px; font-size: 11.5px; padding: 0 9px; }
@media (max-width: 960px) { .op-grid { grid-template-columns: 1fr; } }

/* ===== HP Regu ===== */
body.regu { height: 100dvh; overflow: hidden; padding: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.rg { position: relative; z-index: 1; display: flex; flex-direction: column; height: calc(100dvh - 20px); padding: 14px 16px; gap: 12px; }
.rg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rg-head .nm { font-family: var(--disp); font-size: 24px; letter-spacing: -0.03em; line-height: 1.05; }
.rg-head .muted { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }
.rg-head .pt { font-family: var(--disp); font-size: 34px; color: var(--olive); text-align: right; line-height: 1; }
.rg-head .pt small { display: block; font-family: var(--body); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--grey); font-weight: 700; }
.rg-info { text-align: center; min-height: 20px; font-size: 13px; color: var(--grey); }
.buzzer {
  flex: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--paper2); color: var(--grey);
  font: 400 40px/1.1 var(--disp); letter-spacing: -0.03em; display: grid; place-items: center; text-align: center; padding: 16px;
  touch-action: none; transition: transform 120ms; /* warna berganti seketika agar respons bel terasa langsung */
}
.buzzer small { display: block; font: 600 13px/1.5 var(--body); letter-spacing: .06em; margin-top: 12px; opacity: .85; }
.buzzer.wait { background: var(--warn-bg); color: var(--warn); border-color: rgba(138, 109, 31, .3); }
.buzzer.open { background: var(--olive); color: #fff; border-color: var(--olive-d); box-shadow: inset 0 -8px 0 var(--olive-d); font-size: 64px; }
.buzzer.open:active { transform: scale(.97); box-shadow: inset 0 -2px 0 var(--olive-d); }
.buzzer.queued { background: var(--ink); color: var(--paper); }
.buzzer.locked { background: var(--bad-bg); color: var(--bad); border-color: rgba(169, 68, 66, .3); }
.buzzer.win { background: var(--ok); color: #fff; }
.rg-login { position: relative; z-index: 1; max-width: 400px; margin: 0 auto; padding: 12vh 24px 0; }
.rg-login img { width: 180px; margin-bottom: 28px; }
.rg-login h2 { font-family: var(--disp); font-weight: 400; font-size: 34px; letter-spacing: -0.04em; margin: 16px 0 8px; }
.rg-login input { width: 100%; height: 56px; font-size: 26px; font-weight: 600; text-align: center; letter-spacing: .3em; text-transform: uppercase; margin: 22px 0 12px; }

/* cetak kartu kode regu */
@media print {
  body { background: #fff; }
  body::before, body::after, .orn { display: none; }
  .noprint { display: none !important; }
  .codes { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .codes div { border: 1px dashed #000; padding: 14px; text-align: center; font-size: 12px; }
  .codes b { font: 700 26px var(--body); letter-spacing: .15em; display: block; margin: 6px 0; }
}
.codes { display: none; }
td .row { flex-wrap: nowrap; }
table.mid td { vertical-align: middle; }

/* ===== Komponen babak 2–final ===== */
.qhead { display: flex; gap: .6vw; flex-wrap: wrap; align-items: center; margin-bottom: 2vh; }
.qhead .pill { font-size: .85vw; padding: .45vw .9vw; }
/* TTS */
.tts-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.tts-grid { display: grid; gap: 2px; }
.tts-cell { width: var(--cs); height: var(--cs); position: relative; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--cs) * .55); line-height: 1; }
.tts-cell.slot { background: var(--paper); border: 1px solid rgba(36, 33, 28, .28); }
.tts-cell.k { background: var(--olive-p); border-color: var(--olive); }
.tts-cell.now { outline: 3px solid var(--ink); outline-offset: -2px; z-index: 1; }
.tts-cell .no { position: absolute; top: 1px; left: 3px; font-size: calc(var(--cs) * .24); font-weight: 600; color: var(--grey); }
.tts-cell .ki { position: absolute; bottom: 1px; right: 3px; font-size: calc(var(--cs) * .22); font-weight: 700; color: var(--olive-d); }
.tts-cell.ans { color: var(--olive-l); }
.tts-clue { font-size: 1.9vw; line-height: 1.35; margin-top: 1.5vh; }
.tts-clue b { font-family: var(--disp); font-weight: 400; color: var(--olive); margin-right: .6vw; }
.kunci-row { display: flex; gap: .4vw; align-items: center; margin-top: 1.2vh; flex-wrap: wrap; }
.kunci-row .lbl { font-size: .8vw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--olive-d); margin-right: .8vw; }
.kunci-row span.k { width: 2.6vw; height: 2.6vw; display: grid; place-items: center; background: var(--olive-p); border: 1px solid var(--olive); font-weight: 700; font-size: 1.4vw; }
.pattern { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pattern span { width: 30px; height: 34px; display: grid; place-items: center; background: var(--paper); border: 1px solid rgba(36, 33, 28, .28); font-weight: 700; font-size: 18px; }
/* Misteri */
.clues { list-style: none; margin: 0; padding: 0; flex: 1; overflow: hidden; }
.clues li { display: flex; gap: 1.2vw; align-items: baseline; padding: 1.1vh 0; border-bottom: 1px solid var(--line); font-size: 2.2vw; line-height: 1.35; animation: riseIn 600ms var(--ease); }
.clues li .n { font-family: var(--disp); color: var(--olive); font-size: 1.8vw; min-width: 2.4vw; }
.clues li:last-child { font-weight: 600; }
.clues li.wait { color: var(--grey-l); font-size: 1.4vw; font-weight: 400; }
.notices { display: flex; gap: .5vw; flex-wrap: wrap; margin-top: 1vh; }
.notices .pill { font-size: .8vw; }
/* Papan Materi */
.papan { display: grid; grid-template-columns: repeat(7, 1fr); gap: .8vw; flex: 1; align-content: center; }
.papan .mh { font-size: 1vw; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--olive-d); padding-bottom: .6vh; border-bottom: 2px solid var(--ink); }
.papan .bx { display: grid; place-items: center; height: 11vh; background: var(--ink); color: var(--paper); font-family: var(--disp); font-size: 3vw; border-radius: .3vw; }
.papan .bx.used { background: transparent; color: var(--grey-l); border: 1px dashed var(--grey-l); font-size: 1.6vw; }
.papan .bx.none { background: transparent; }
/* Garapan & pamungkas status */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8vw; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: .35vw; padding: .9vw 1vw; }
.tile .nm { font-weight: 600; font-size: 1.2vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .st { font-size: .9vw; color: var(--grey); margin-top: .3vw; }
.tile.done { background: var(--ink); color: var(--paper); }
.tile.done .st { color: var(--olive-l); }
.tile.ok { background: var(--ok); color: #fff; }
.tile.ok .st, .tile.no .st { color: inherit; }
.tile.no { background: var(--bad-bg); color: var(--bad); }
.pam-q { display: grid; gap: 1vh; margin: 1vh 0 2vh; }
.pam-q div { font-size: 1.6vw; line-height: 1.4; padding: .9vh 1vw; background: var(--paper); border-left: .3vw solid var(--olive); }
.pam-q b { font-family: var(--disp); font-weight: 400; color: var(--olive); margin-right: .8vw; }
/* Duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2vw; align-items: center; margin: 2vh 0; }
.duel .side { text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: .5vw; padding: 2vh 1vw; }
.duel .side .role { font-size: .85vw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--olive-d); }
.duel .side .nm { font-family: var(--disp); font-size: 2.6vw; letter-spacing: -0.03em; margin: 1vh 0; }
.duel .side .pt { font-family: var(--disp); font-size: 5vw; line-height: 1; }
.duel .side.win { background: var(--ink); color: var(--paper); }
.duel .side.win .role { color: var(--olive-l); }
.duel .vs { font-family: var(--disp); font-size: 3vw; color: var(--olive); }
.duel-materi { text-align: center; font-family: var(--disp); font-size: 3.4vw; color: var(--olive-d); letter-spacing: -0.03em; }
.duel-log { display: flex; gap: .5vw; justify-content: center; margin-top: 2vh; }
.duel-log span { width: 2.4vw; height: 2.4vw; display: grid; place-items: center; border-radius: 50%; background: var(--paper2); font-weight: 700; font-size: 1vw; }
.duel-log span.b { background: var(--ok-bg); color: var(--ok); }
.duel-log span.s { background: var(--bad-bg); color: var(--bad); }
.duel-log span.t { background: var(--warn-bg); color: var(--warn); }
/* Juara */
.juara { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 2vw; align-items: end; margin-top: 4vh; }
.juara .jc { text-align: center; background: var(--paper2); border: 1px solid var(--line); border-radius: .5vw; padding: 3vh 1vw; animation: riseIn 900ms var(--ease) both; }
.juara .jc.j1 { background: var(--ink); color: var(--paper); padding: 6vh 1vw; }
.juara .jc .t { font-size: .95vw; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--olive); }
.juara .jc .nm { font-family: var(--disp); font-size: 3vw; letter-spacing: -0.03em; margin: 1.5vh 0; line-height: 1; }
.juara .jc.j1 .nm { font-size: 4.2vw; }
.juara .jc .pt { font-size: 1.4vw; font-weight: 600; opacity: .8; }
.harapan { text-align: center; margin-top: 3vh; font-size: 1.5vw; }
.harapan b { font-family: var(--disp); font-weight: 400; font-size: 2vw; }
.led-board.f8 { grid-template-columns: repeat(8, 1fr); }
.led-board.f8 .chip .pt { font-size: 2.6vw; }
.led-board.f8 .chip .nm { font-size: 1vw; }
.chip .cards { position: absolute; top: .45vw; right: .5vw; display: flex; gap: .25vw; }
.chip .cards i { width: .55vw; height: .55vw; border-radius: 50%; background: var(--olive-l); }
.chip .cards i.x { background: rgba(239, 237, 231, .15); }

/* ===== HP: panel tambahan ===== */
.rg-extra { display: flex; flex-direction: column; gap: 8px; }
.rg-extra .row { justify-content: center; }
.kartu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kartu .btn { height: 48px; font-size: 12px; white-space: normal; line-height: 1.15; padding: 0 6px; }
.kartu .btn.pakai { opacity: .35; text-decoration: line-through; }
.kartu .btn.pending { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.panel { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; -webkit-user-select: text; user-select: text; }
.panel .soal { background: var(--paper2); border-radius: 6px; padding: 12px 14px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.stage { background: var(--paper2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.stage label { margin-bottom: 8px; }
.stage .row { flex-wrap: nowrap; }
.stage .row input { flex: 1; min-width: 0; height: 46px; font-size: 18px; }
.stage .st { font-size: 12.5px; margin-top: 6px; color: var(--grey); }
.stage .st.ok { color: var(--ok); font-weight: 600; }
.stage .st.no { color: var(--bad); font-weight: 600; }
.lvl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lvl .btn { height: 88px; flex-direction: column; font-size: 13px; }
.lvl .btn b { font-family: var(--disp); font-weight: 400; font-size: 30px; }
.lvl .btn.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel textarea { min-height: 120px; font-size: 16px; }
.bigmsg { text-align: center; padding: 20px 10px; }
.bigmsg .disp { font-size: 34px; }
.pribadi { background: var(--olive-p); border-left: 3px solid var(--olive); padding: 8px 10px; font-size: 14px; }

/* ===== Operator: panel ===== */
.words td, .words th { padding: 5px 7px; font-size: 12.5px; }
.words tr.done td { opacity: .45; }
.words tr.now td { background: var(--olive-p); }
.pbtn { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.pbtn .mh { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--grey); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn .btn { height: 44px; padding: 0; font-family: var(--disp); font-weight: 400; font-size: 18px; }
.gtab td, .gtab th { padding: 5px 6px; font-size: 12.5px; vertical-align: middle; }
.gtab select { height: 30px; padding: 0 4px; font-size: 12px; }
.tick { color: var(--ok); font-weight: 700; }
.cross { color: var(--bad); font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; max-height: 120px; overflow: auto; }
.checks label { display: flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); font-size: 12.5px; margin: 0; }
.checks input { height: auto; }
.clue-list { margin: 8px 0; padding-left: 20px; }
.clue-list li { padding: 3px 0; font-size: 13.5px; }
.clue-list li.on { font-weight: 700; }
.clue-list li.off { color: var(--grey-l); }
.subtle { font-size: 12.5px; color: var(--grey); }
.hint { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.kgrid { display: inline-grid; gap: 2px; margin-top: 10px; }
.kgrid div { width: 30px; height: 30px; display: grid; place-items: center; font-size: 13px; font-weight: 700; position: relative; }
.kgrid div.slot { background: var(--paper); border: 1px solid rgba(36, 33, 28, .28); cursor: pointer; }
.kgrid div.k { background: var(--olive); color: #fff; }
.kgrid div i { position: absolute; top: 0; right: 2px; font-size: 9px; font-style: normal; }

/* QR code untuk menyambungkan HP regu */
.qr-row { display: flex; align-items: center; gap: 18px; margin: 10px 0 14px; }
.qr { width: 150px; height: 150px; flex: none; background: #fff; padding: 6px; border-radius: 8px; image-rendering: pixelated; }
@media (max-width: 520px) { .qr-row { flex-direction: column; align-items: flex-start; } }
.led-qr { position: absolute; right: 5vw; bottom: 3vh; display: flex; align-items: center; gap: 1.2vw; background: #fff; padding: 1vw 1.4vw 1vw 1vw; border-radius: 1vw; box-shadow: 0 .6vw 2vw rgba(36, 33, 28, .12); }
.led-qr img { width: 9vw; height: 9vw; image-rendering: pixelated; }
.led-qr b { display: block; font-family: var(--disp); font-weight: 400; font-size: 1.5vw; color: var(--ink); letter-spacing: -0.02em; }
.led-qr span { display: block; font-size: 1.05vw; color: var(--olive-d); font-weight: 700; margin-top: .6vh; }
.codes .qr { width: 110px; height: 110px; padding: 0; margin: 4px auto 0; display: block; }

/* ===== REDESIGN 2026-11-15 (SAKA) — hanya tampilan, logika tidak diubah ===== */
/* Operator: topbar menempel saat scroll supaya aksi selalu terjangkau */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); padding-top: 12px; }
.round-pick { display: flex; flex-direction: column; gap: 4px; }
.round-lbl { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-d); margin: 0; }
#selRound { height: 48px; font-size: 15px; font-weight: 600; min-width: 320px; }
/* Operator: kartu soal aktif sebagai HERO */
.op-hero { border: 2px solid var(--olive); background: #f6f3ea; }
.op-hero .soal { font-size: 23px; }
.op-hero .op-status { font-size: 28px; }
/* 3 aksi utama tiap soal: Buka Bel / BENAR / SALAH — paling besar, sejajar */
.hero-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-actions .btn { height: 62px; font-size: 18px; letter-spacing: .02em; }
.hero-actions .btn kbd { font-size: 11px; }
@media (max-width: 640px) { .hero-actions { grid-template-columns: 1fr; } .hero-actions .btn { height: 56px; } }
/* Operator: judul seksi lebih mudah dipindai */
.op-grid .card > h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-d); }
/* Operator: antrean bel lebih terbaca */
.op-queue .qrow { font-size: 15px; padding: 10px 12px; }
.op-queue .qrow .ms { font-weight: 700; }
.op-queue .qrow.now .ms { color: var(--olive-l); }
/* Operator: kolom kanan (timer/klasemen/koreksi/riwayat) lebih ringkas */
.op-side .card { padding: 16px 18px; }
.op-stand td { padding: 9px 8px; }

/* HP Regu: kepala lebih tegas, poin lebih besar */
.rg-head.rg-card { background: var(--paper2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.rg-head .nm { font-size: 26px; }
.rg-head .pt { font-size: 46px; }
/* HP Regu: strip info soal satu baris yang jelas */
.rg-info.rg-strip { background: var(--paper2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 15px; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.rg-info.rg-strip #hptimer { font-size: 18px; }
/* HP Regu: bel lebih besar — target jempol */
.buzzer { font-size: 48px; min-height: 200px; }
.buzzer small { font-size: 14px; }
.buzzer.open { font-size: 76px; }
/* HP Regu: panel & area tambahan lebih lega dan konsisten */
.panel { gap: 14px; }
.rg-extra { gap: 10px; }
.stage { padding: 16px; }
.pattern span { width: 36px; height: 40px; font-size: 20px; }
.kartu .btn { height: 56px; font-size: 13px; }
/* HP Regu: layar login sebagai kartu */
.rg-login { background: var(--paper2); border: 1px solid var(--line); border-radius: 10px; padding: 7vh 24px 28px; margin: 6vh auto 0; }

/* Admin: tab lebih besar dan mudah disentuh */
.tabs .btn { height: 40px; font-size: 13.5px; padding: 0 16px; }
/* Admin: form tambah soal — 4 kolom berlabel jelas */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-grid > div { min-width: 0; }
.form-grid input, .form-grid select { width: 100%; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
#tab-soal .grid2 textarea { min-height: 110px; }
/* Admin: hitungan terisi/kebutuhan sebagai pil */
#qCount span { display: inline-block; padding: 3px 9px; margin: 2px 2px 2px 0; border-radius: 3px; background: var(--paper); border: 1px solid var(--line); font-weight: 600; }
/* Admin: grid Kata Kunci TTS — target sentuh lebih besar (38px, selaras dengan JS) */
.kgrid { gap: 3px; }
.kgrid div { width: 38px; height: 38px; font-size: 16px; }
.kgrid div i { font-size: 10px; }
/* Admin: zona reset diberi peringatan jelas */
.card.danger { border: 2px solid var(--bad); background: #fbf2f1; }
.card.danger h3 { color: var(--bad); }
.danger-note { font-weight: 700; color: var(--bad); margin: 0 0 8px; }
/* Admin: kartu QR cetak lebih rapi */
@media print {
  .codes div { padding: 16px; }
  .codes b { font-size: 28px; }
  .codes div small { font-size: 11px; line-height: 1.4; display: block; margin-top: 4px; }
}
