/* Ruang Juri — 3D page. HUD sits over the canvas; the canvas is the page. */

#ruang-main {
  padding: 18px clamp(16px, 3vw, 40px) 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.ruang-wrap {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 120px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f1512, #0b0e0c);
}
:root[data-theme='light'] .ruang-wrap { background: linear-gradient(180deg, #f4f1ea, #e9e4d9); }
:root[data-theme='light'] .hud-top { background: linear-gradient(180deg, rgba(247,248,247,.92), transparent); }
:root[data-theme='light'] .hud-chip,
:root[data-theme='light'] .legend,
:root[data-theme='light'] .hud-live,
:root[data-theme='light'] .ruang-side { background: rgba(255,255,255,.94); }
:root[data-theme='light'] .hud-actions .btn { background: rgba(255,255,255,.9); }
:root[data-theme='light'] .hud-chip .v { color: var(--ink); }

#scene {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  outline: none;
}
#scene:active { cursor: grabbing; }

/* ---------- HUD ---------- */
.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, rgba(11, 14, 12, .82), transparent);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-title .tiny { color: var(--amber); letter-spacing: .14em; }
.hud-title h1 {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 500;
  letter-spacing: -.04em;
  margin: 6px 0 3px;
}
.hud-sub { font: 10.5px var(--mono); color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; }
.hud-actions { display: flex; gap: 8px; }
.hud-actions .btn { background: rgba(20, 26, 22, .8); backdrop-filter: blur(6px); }

.hud-strip {
  position: absolute;
  left: 22px;
  bottom: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 70%;
}
.hud-chip {
  background: rgba(18, 24, 20, .84);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 9px 13px;
  backdrop-filter: blur(8px);
  display: grid;
  gap: 3px;
  min-width: 96px;
}
.hud-chip .k { font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.hud-chip .v { font: 500 17px var(--mono); color: var(--ink); letter-spacing: -.02em; }
.hud-chip .v small { font-size: 11px; color: var(--muted-2); }

.hud-live {
  position: absolute;
  bottom: 92px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(18, 24, 20, .9);
  border: 1px solid var(--warn-bg);
  border-left: 2px solid var(--warn);
  border-radius: 4px;
  padding: 9px 14px;
  font: 11px var(--mono);
  letter-spacing: .05em;
  color: var(--warn);
  backdrop-filter: blur(8px);
  max-width: 420px;
}
.hud-live[hidden] { display: none; }
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
  flex: none;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

.legend {
  position: absolute;
  right: 18px;
  bottom: 52px;
  display: grid;
  gap: 6px;
  background: rgba(18, 24, 20, .82);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 13px;
  backdrop-filter: blur(8px);
}
.legend .lg {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 10.5px var(--mono);
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend .lg .st { color: var(--muted-2); margin-left: auto; padding-left: 10px; }

.hud-hint {
  position: absolute;
  bottom: 18px;
  right: 18px;
  left: auto;
  text-align: right;
  font: 9.5px var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-2);
  pointer-events: none;
}

/* ---------- side panel ---------- */
.ruang-side {
  position: absolute;
  top: 118px;
  right: clamp(16px, 3vw, 40px);
  width: 288px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: rgba(16, 21, 18, .96);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 18px;
  backdrop-filter: blur(12px);
  z-index: 20;
  display: grid;
  gap: 14px;
  align-content: start;
}
.ruang-side[hidden] { display: none; }
.rp-head { display: flex; align-items: center; justify-content: space-between; }

.j-seat {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .12s;
}
.j-seat:hover { border-color: var(--line-strong); }
.j-seat.busy { border-color: var(--warn-bg); background: color-mix(in srgb, var(--warn) 7%, var(--panel)); }
.j-seat .dotaccent { width: 8px; height: 8px; border-radius: 2px; }
.j-seat .nm { font-size: 13px; font-weight: 500; }
.j-seat .rl { font: 9px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); margin-top: 2px; }
.j-seat .cnt { font: 10.5px var(--mono); color: var(--muted); }
.j-seat.busy .cnt { color: var(--warn); }

@media (max-width: 900px) {
  .ruang-wrap { min-height: calc(100vh - 230px); }
  .hud-top { padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .hud-title h1 { font-size: 19px; margin: 4px 0 2px; }
  .hud-actions { gap: 6px; }
  .hud-actions .btn { padding: 7px 10px; font-size: 10px; }
  .hud-strip {
    left: 16px; right: 16px; bottom: 46px;
    max-width: none;
    gap: 6px;
  }
  .hud-chip { min-width: 0; flex: 1 1 40%; padding: 7px 9px; }
  .hud-chip .v { font-size: 14px; }
  .hud-live { left: 16px; right: 16px; bottom: 132px; font-size: 10px; max-width: none; }
  .legend { display: none; }
  .ruang-side { left: 12px; right: 12px; width: auto; top: 108px; }
  .hud-hint { display: none; }
}


/* ============================================================
   Videotron mode: full-bleed room, huge type, no chrome.
   Designed for a projector / LED wall read from several metres.
   ============================================================ */
body.video-mode .app {
  grid-template-columns: 1fr;
}
body.video-mode aside,
body.video-mode .hud-top,
body.video-mode .hud-strip,
body.video-mode .hud-live,
body.video-mode .legend,
body.video-mode .hud-hint,
body.video-mode header,
body.video-mode .ruang-side {
  display: none !important;
}
body.video-mode #ruang-main {
  padding: 0;
  min-height: 100vh;
}
body.video-mode .ruang-wrap {
  position: fixed;
  inset: 0;
  border: 0;
  border-radius: 0;
  min-height: 100vh;
  z-index: 1;
}
body.video-mode #scene { cursor: default; }

/* ---------- overlay ---------- */
.vt {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* generous safe margins: LED walls often overscan 5-8% of the edge */
  padding: clamp(26px, 4.6vh, 60px) clamp(34px, 5.2vw, 118px);
  color: #f5f2ea;
  background:
    linear-gradient(180deg, rgba(8, 12, 10, .62) 0%, rgba(8, 12, 10, 0) 22%),
    linear-gradient(0deg, rgba(8, 12, 10, .76) 0%, rgba(8, 12, 10, 0) 30%);
}
.vt[hidden] { display: none; }

.vt-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.vt-brand {
  font: 500 clamp(13px, 1.1vw, 19px) var(--mono);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #f2b16b;
}
.vt-event {
  font: 500 clamp(13px, 1.15vw, 20px) var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, .62);
  text-align: right;
}

.vt-hero {
  align-self: end;
  max-width: 62%;
  margin-bottom: clamp(6px, 1vw, 16px);
}
.vt-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 500 clamp(14px, 1.35vw, 24px) var(--mono);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #ffd9a8;
  margin-bottom: clamp(10px, 1.1vw, 20px);
}
.vt-kicker::before {
  content: '';
  width: clamp(26px, 2.4vw, 44px);
  height: 3px;
  background: #f2b16b;
  border-radius: 2px;
}
.vt-kicker.live::after {
  content: '';
  width: clamp(9px, .8vw, 14px);
  height: clamp(9px, .8vw, 14px);
  border-radius: 50%;
  background: #ff9d8f;
  margin-left: 4px;
  animation: vtPulse 1.2s ease-in-out infinite;
}
@keyframes vtPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.72); }
}
.vt-main {
  font-size: clamp(38px, 6vw, 108px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .94;
  text-shadow: 0 4px 34px rgba(0, 0, 0, .55);
}
.vt-main em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: #f2b16b;
}
.vt-sub {
  margin-top: clamp(12px, 1.3vw, 24px);
  font: 400 clamp(16px, 1.6vw, 28px) var(--mono);
  letter-spacing: .07em;
  color: rgba(245, 242, 234, .78);
  max-width: 46ch;
}

/* ---------- kutipan komentar juri (muncul saat penilaian ditutup) ---------- */
.vt-quote {
  margin-top: clamp(14px, 1.6vw, 26px);
  padding: clamp(14px, 1.6vw, 24px) clamp(16px, 1.8vw, 28px);
  border-left: 3px solid #f2b16b;
  background: linear-gradient(90deg, rgba(242, 177, 107, .10), rgba(242, 177, 107, .02) 70%, transparent);
  border-radius: 0 12px 12px 0;
  max-width: 74ch;
  animation: vtQuoteIn .6s cubic-bezier(.22, 1, .36, 1);
}
@keyframes vtQuoteIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.vt-quote-k {
  font: 500 clamp(9px, .85vw, 12px) var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, .45);
  margin-bottom: clamp(6px, .7vw, 10px);
}
.vt-quote-k b { color: #ffd9a8; font-weight: 500; }
.vt-quote-t {
  font: 400 clamp(17px, 2vw, 34px)/1.26 var(--serif);
  font-style: italic;
  color: #fff9ef;
  text-wrap: balance;
}
/* banner juara saat status final ditangani oleh .vt-kicker (teks "Juara N · final") */
@media (max-width: 700px) {
  .vt-quote { max-width: 100%; }
  .vt-quote-t { font-size: clamp(15px, 4.4vw, 22px); }
}

.vt-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 48px);
}
.vt-progress { flex: 1; min-width: 0; }
.vt-bar {
  height: clamp(6px, .6vw, 10px);
  background: rgba(245, 242, 234, .17);
  border-radius: 999px;
  overflow: hidden;
}
.vt-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2bd6, #22e6ff);
  transition: width .5s ease;
}
.vt-count {
  margin-top: clamp(10px, .95vw, 16px);
  font: 500 clamp(17px, 1.75vw, 32px) var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, .72);
}
.vt-count #vt-done { color: #f5f2ea; }
.vt-of { margin: 0 .18em; opacity: .5; }

.vt-judges {
  display: flex;
  gap: clamp(8px, .9vw, 18px);
  align-items: flex-end;
  flex: none;
}
.vt-judge {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: clamp(66px, 6vw, 108px);
}
.vt-judge .sw {
  width: clamp(26px, 2.6vw, 44px);
  height: clamp(4px, .42vw, 7px);
  border-radius: 999px;
  background: var(--sw);
}
.vt-judge.working .sw {
  box-shadow: 0 0 0 3px rgba(255, 217, 168, .28), 0 0 22px var(--sw);
  animation: vtPulse 1.3s ease-in-out infinite;
}
.vt-judge .nm {
  font: 500 clamp(12px, 1.15vw, 20px) var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, .68);
  white-space: nowrap;
}
.vt-judge.working .nm { color: #ffd9a8; }

.vt-exit {
  position: absolute;
  top: clamp(18px, 2.4vw, 34px);
  right: clamp(18px, 2.4vw, 34px);
  z-index: 9;
  background: rgba(14, 20, 17, .78);
  border: 1px solid rgba(245, 242, 234, .22);
  color: rgba(245, 242, 234, .8);
  font: 500 11px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  opacity: .42;
  font-size: 12px;
  transition: opacity .18s;
  backdrop-filter: blur(8px);
}
.vt-exit:hover { opacity: 1; }
.vt-exit[hidden] { display: none; }
body.video-mode.idle .vt-exit { opacity: 0; }

@media (max-width: 900px) {
  .vt-hero { max-width: 100%; }
  .vt-judges { display: none; }
}
