:root {
  --bg: #10172A;
  --panel: rgba(12, 18, 34, 0.94);
  --field: #0A0F1E;
  --line: rgba(238, 241, 247, 0.14);
  --line-strong: rgba(238, 241, 247, 0.32);
  --text: #EEF1F7;
  --muted: #AEB6C8;
  /* tombol & aksen netral (abu-abu terang + teks hitam), tanpa warna mencolok */
  --accent: #E4E4E4;        /* yang terpilih, fokus, aksen kecil */
  --accent-ink: #111214;
  --cta: #E4E4E4;           /* tombol utama */
  --cta-hover: #FFFFFF;
  --cta-ink: #111214;
  --warn: #F2A7AB;
  --warn-bg: rgba(179, 18, 31, 0.16);
  --danger: #FFA3A3;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

#panel {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 352px;
  max-height: calc(100vh - 16px - 52px);
  max-height: calc(100dvh - 16px - 52px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 20px 18px;
}

/* scrollbar tipis gelap (panel & daftar lagu), bukan scrollbar putih bawaan Windows */
#panel, .music-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 241, 247, 0.22) transparent;
}
#panel::-webkit-scrollbar, .music-list::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-track, .music-list::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
#panel::-webkit-scrollbar-thumb, .music-list::-webkit-scrollbar-thumb {
  background: rgba(238, 241, 247, 0.22);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
#panel::-webkit-scrollbar-thumb:hover, .music-list::-webkit-scrollbar-thumb:hover { background-color: rgba(238, 241, 247, 0.4); }
#panel::-webkit-scrollbar-button, .music-list::-webkit-scrollbar-button { display: none; height: 0; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  line-height: 0.95;
}
.panel-head .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

/* jumlah pengunjung (dari /api/visits) */
.visits {
  margin: 2px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}
.visits[hidden] { display: none; }
.panel-head { flex-wrap: wrap; }
.panel-head > div:first-child { flex: 1 1 0; min-width: 0; }
.panel-head > .ghost { flex-shrink: 0; }
.visits-row { flex-basis: 100%; }
.visits span { white-space: nowrap; }
.visits svg { color: var(--accent); flex-shrink: 0; }
.visits strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* teks khusus pembaca layar */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Saweria: pil kecil di header (kelihatan juga waktu panel diciutkan) + kartu ajakan di panel.
   Satu-satunya warna hangat di panel, warnanya ngikut oranye Saweria. */
.visits-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.visits-row .visits { margin: 0; }
.sawer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border: 1px solid rgba(255, 178, 64, 0.45);
  border-radius: 999px;
  background: rgba(255, 178, 64, 0.08);
  color: #FFC861;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.sawer-pill:hover { background: rgba(255, 178, 64, 0.18); border-color: rgba(255, 178, 64, 0.8); }
.sawer-pill:active { transform: scale(0.96); }
.sawer-pill svg { transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.sawer-pill:hover svg { transform: rotate(-12deg) scale(1.1); }

.sawer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'pick title go' 'pick desc desc';
  align-items: center;
  gap: 4px 10px;
  padding: 12px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(255, 170, 60, 0.2), transparent 55%) padding-box,
    linear-gradient(#0D1326, #0D1326) padding-box,
    linear-gradient(115deg, #FFD25A, #FF9A3D 50%, #FF5E7A) border-box;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease;
}
/* kilau yang lewat sesekali (dan waktu disorot) */
.sawer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 220, 160, 0.16) 50%, transparent 62%);
  transform: translateX(-110%);
  animation: sawer-sheen 7s ease-in-out 2.5s infinite;
  pointer-events: none;
}
@keyframes sawer-sheen {
  0%, 82% { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}
.sawer:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(255, 140, 60, 0.7);
}
.sawer:active { transform: translateY(0) scale(0.985); transition-duration: 80ms; }
.sawer:focus-visible { outline: 2px solid #FFC861; outline-offset: 2px; }
.sawer-pick {
  grid-area: pick;
  align-self: center;
  display: grid;
  filter: drop-shadow(0 3px 8px rgba(255, 130, 60, 0.45));
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sawer:hover .sawer-pick { transform: rotate(-10deg) scale(1.06); }
.sawer-text { display: contents; }
.sawer-text strong {
  grid-area: title;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.sawer-text span { grid-area: desc; color: var(--muted); font-size: 13px; line-height: 1.4; }
.sawer-go {
  grid-area: go;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 9px 6px 11px;
  border-radius: 999px;
  background: linear-gradient(115deg, #FFD25A, #FF9A3D);
  color: #1A1206;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
}
.sawer-go svg { transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.sawer:hover .sawer-go svg { transform: translate(2px, -2px); }
/* link Saweria di label pojok kiri bawah (labelnya sendiri nggak bisa diklik, cuma link ini) */
.sim-sawer {
  pointer-events: auto;
  color: #FFC861;
  font-weight: 700;
  text-decoration: none;
}
.sim-sawer:hover { color: #FFD98F; text-decoration: underline; text-underline-offset: 2px; }
.sim-sawer:focus-visible { outline: 2px solid #FFC861; outline-offset: 2px; border-radius: 3px; }

/* ajakan Saweria di HUD POV: muncul sekali per browser setelah ±30 detik di POV (lihat app.js) */
.sawer-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 6px 8px 10px;
  border: 1px solid rgba(255, 178, 64, 0.5);
  border-radius: 10px;
  background:
    radial-gradient(120% 200% at 0% 50%, rgba(255, 170, 60, 0.2), transparent 60%),
    rgba(255, 178, 64, 0.06);
  animation: sawer-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sawer-nudge[hidden] { display: none; }
@keyframes sawer-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.sawer-nudge > svg { flex-shrink: 0; color: #FF9A3D; }
.sawer-nudge p { margin: 0; flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.sawer-nudge p strong { color: var(--text); }
.sawer-nudge-go {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 9px 6px 11px;
  border-radius: 999px;
  background: linear-gradient(115deg, #FFD25A, #FF9A3D);
  color: #1A1206;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sawer-nudge-go:hover { transform: translateY(-1px); }
.sawer-nudge-go:active { transform: scale(0.96); }
.sawer-nudge-x {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.sawer-nudge-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

@media (prefers-reduced-motion: reduce) {
  .sawer::after { animation: none; }
  .sawer-nudge { animation: none; }
}

#panelBody {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#panel.collapsed #panelBody { display: none; }

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ghost {
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
}
.ghost:hover { color: var(--text); border-color: var(--line-strong); }

.cat-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cat-title { margin: 0; color: var(--muted); font-size: 14px; }
.seg.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.three button { min-height: 44px; font-size: 15px; }
.cat-note { margin: 0; min-height: 18px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.finder .fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.finder label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.finder input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
}
.finder input::placeholder { color: #5E6780; }

.error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
}

.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 6px;
  background: var(--cta);
  color: var(--cta-ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  transition: background-color 120ms ease, transform 120ms ease;
}
.primary:hover { background: var(--cta-hover); }
.primary:active { transform: scale(0.98); }

.seat-btn {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  transition: background-color 120ms ease, transform 120ms ease;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
}
.seat-btn:hover { background: rgba(255, 255, 255, 0.08); }
.seat-btn:active { transform: scale(0.98); }

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.card h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
}
.card .mine {
  margin: -2px 0 10px;
  color: var(--accent);
  font-size: 15px;
}
.card dl {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.35;
}
.card dl > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
}
.card dt { color: var(--muted); }
.card .sub-dd { color: var(--muted); font-size: 13px; }
.card dd { margin: 0; }

.views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.views button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  font-size: 14px;
}
.views button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

/* tab jenis tiket */
.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tabs button {
  min-height: 44px;
  border: 0;
  background: var(--field);
  color: var(--muted);
  font-size: 15px;
}
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.08); color: var(--accent); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.finder[hidden], .fest-form[hidden] { display: none; }

.fest-form { display: flex; flex-direction: column; gap: 10px; }
.mini-title { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.grid3 button {
  min-height: 42px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  font-size: 13px;
  line-height: 1.2;
}
.grid3 button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.fest-form .hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.height-field { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 14px; }
.height-row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; }
.height-row input {
  width: 96px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}
.height-row input::placeholder { color: #5E6780; }
.height-row input[aria-invalid="true"] { border-color: var(--danger); }

.card .warn-line {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
  line-height: 1.4;
}
.card .lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.card .lead strong { color: var(--text); }
.card .povgo { margin-top: 14px; }

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  font-size: 15px;
  color: var(--text);
}
.music-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

.card .hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* tandai kursi: nama pengunjung di kursi + cari teman */
.names {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.names-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.names-title + .names-list { margin-bottom: 0; }
.names .names-title:not(:first-child) { margin-top: 12px; }
.names-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.names-form input, .friends input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.names-form input::placeholder, .friends input::placeholder { color: #5E6780; }
.names-form .primary { width: auto; min-height: 44px; margin: 0; padding: 0 16px; font-size: 19px; }
.names-form .primary:disabled { opacity: 0.6; cursor: default; }
.names .fine, .friends .fine { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.names-me { margin: 0; font-size: 15px; line-height: 1.4; }
.names-me strong { color: var(--accent); }
.names-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.names-btns .ghost { min-height: 36px; padding: 6px 10px; }
.names-msg {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 95, 162, 0.12);
  color: #FFB3D3;
  font-size: 13.5px;
  line-height: 1.4;
}
.names-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.names-list li {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.name-go {
  overflow: hidden;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid rgba(255, 95, 162, 0.45);
  border-radius: 999px;
  background: rgba(255, 95, 162, 0.12);
  color: #FFD1E4;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-go:hover { background: rgba(255, 95, 162, 0.22); }
.name-go em { font-style: normal; font-weight: 400; color: var(--muted); }
.name-where { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.name-flag {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6F7891;
  font-size: 14px;
}
.name-flag:hover { color: var(--danger); background: rgba(255, 163, 163, 0.08); }
.names-empty { color: var(--muted); font-size: 14px; }
.friends h2 { margin: 0 0 4px; font-size: 26px; }
.friends #friendsCount { margin: 0 0 8px; }
.friends .names-list { margin-top: 8px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
}
.toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.legend h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
}
.legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.legend li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
}
.sw {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}
.price {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fine {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.update-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.update-note strong { color: var(--accent); }

.note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#tooltip {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  transform: translate(14px, 14px);
  max-width: 240px;
  padding: 8px 10px;
  background: rgba(10, 15, 30, 0.95);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}
#tooltip strong {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
}

/* Pratinjau "dari kursi": kotak transparan, isinya digambar WebGL di belakangnya */
.pip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 340px;
  height: 200px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  box-shadow: 0 0 0 4px rgba(10, 15, 30, 0.6);
}
.pip[hidden] { display: none; }
.pip-open {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  text-align: left;
}
.pip-open:hover .pip-tag { background: var(--accent); color: var(--accent-ink); }
.pip-tag, .pip-where {
  margin: 0 0 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 15, 30, 0.88);
  font-size: 13px;
  line-height: 1.3;
}
.pip-tag {
  margin-left: 8px;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
}
.pip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.88);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.pip-close:hover { color: var(--text); }

/* HUD saat mode "Dari kursi" */
.pov-hud {
  position: fixed;
  left: calc(16px + 352px + 16px);
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.pov-hud[hidden] { display: none; }
#panel.collapsed ~ .pov-hud { left: 16px; bottom: 48px; }
.pov-btns { display: flex; gap: 6px; flex-shrink: 0; }
.pov-btns [aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.pov-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pov-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
}
.pov-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.pov-ctrls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.zoom {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--muted);
}
.zoom output { color: var(--text); font-variant-numeric: tabular-nums; }
.zoom input { width: 100%; min-height: 28px; accent-color: var(--accent); }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.seg[hidden] { display: none; }
.seg button {
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  background: var(--field);
  font-size: 14px;
  color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pov-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* panah di tepi layar ke arah posisi kamu (POV dari panggung, kalau labelnya di luar layar) */
.you-arrow {
  position: fixed;
  z-index: 4;
  margin: 0;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.you-arrow[hidden] { display: none; }
.you-arrow-ic { display: inline-block; font-size: 18px; line-height: 1; }

.seg.wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.wide button { min-height: 44px; font-size: 15px; }
.pip-close.static { position: static; }

/* label "simulasi": selalu di kiri bawah, di semua mode (ikut ke screenshot yang dibagikan).
   Panel dibuat berhenti di atasnya supaya nggak ketutup. */
.sim-badge {
  position: fixed;
  left: 16px;
  bottom: 10px;
  z-index: 9;
  margin: 0;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
}
/* mode "sembunyikan semua": cuma label pojok kiri bawah, bar musik, dan tombol "Tampilkan" yang tersisa */
body.ui-hidden #panel,
body.ui-hidden .pov-hud,
body.ui-hidden .pip,
body.ui-hidden .you-arrow,
body.ui-hidden #tooltip { display: none !important; }
.show-ui {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(10, 15, 30, 0.85);
  color: var(--text);
  font-size: 14px;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.show-ui:hover, .show-ui:focus-visible { opacity: 1; }
.show-ui[hidden] { display: none; }
.show-ui svg { color: var(--accent); }
.pov-btns .icon-btn { display: inline-flex; align-items: center; justify-content: center; padding-left: 10px; padding-right: 10px; }

/* kredit pembuat, ikut di label pojok kiri bawah */
.sim-badge .credit { color: var(--accent); font-weight: 700; }

/* pemutar musik: bar mini. Pemutar YouTube-nya tetap jalan tapi nggak ditampilkan (cuma audio),
   kecuali browser nahan suara otomatis dan user perlu ngetuk tombol putarnya. */
.music {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 292px;
  padding: 5px 5px 5px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  z-index: 6;
}
.music[hidden] { display: none; }
.music-bar { display: flex; align-items: center; gap: 2px; }
.music-title {
  flex: 1;
  min-width: 0;
  margin: 0 4px 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  color: var(--accent);
}
/* judul lagu = tombol buka daftar lagu */
.music-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -6px;
  padding: 4px 4px 4px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.music-pick:hover { background: rgba(255, 255, 255, 0.07); }
.music-pick .chev { flex-shrink: 0; color: var(--muted); transition: transform 0.15s; }
.music-pick[aria-expanded="true"] .chev { transform: rotate(180deg); }
.music-list {
  list-style: none;
  margin: 6px 7px 4px 0;
  padding: 4px 0 0;
  border-top: 1px solid var(--line);
  max-height: min(300px, 40vh);
  overflow-y: auto;
}
.music-list[hidden] { display: none; }
.music-list button {
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.music-list button:hover { background: rgba(255, 255, 255, 0.07); }
.music-list button[aria-current="true"] { color: var(--accent); font-weight: 700; }
.music-list button[aria-current="true"]::before { content: "▶ "; font-size: 11px; }
.mbtn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mbtn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.mbtn[aria-expanded="true"] { color: var(--accent); }
.mbtn .ic-play { display: none; }
.music.paused .mbtn .ic-play { display: block; }
.music.paused .mbtn .ic-pause { display: none; }
/* equalizer kecil: gerak waktu lagu jalan */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 14px; flex-shrink: 0; }
.eq i { display: block; width: 3px; height: 40%; border-radius: 1px; background: var(--accent); }
.music.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.music.playing .eq i:nth-child(2) { animation-delay: -0.3s; }
.music.playing .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.vol { margin: 6px 8px 6px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.vol[hidden] { display: none; }
.vol input { flex: 1; accent-color: var(--accent); }
.music-hint { margin: 6px 8px 4px 0; color: var(--accent); font-size: 13px; line-height: 1.4; }
.music-hint[hidden] { display: none; }
.player {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 200px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
/* suara diblok browser: tampilkan pemutarnya supaya bisa diketuk.
   opacity < 1 supaya video nggak dijadikan "overlay" GPU (penyebab kotak gelap di kanvas). */
.music.needs-tap .player {
  position: relative;
  width: auto;
  height: 150px;
  margin: 0 7px 6px 0;
  opacity: 0.99;
  pointer-events: auto;
  z-index: auto;
  border-radius: 10px;
}

/* peringatan awal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 16, 0.72);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(460px, 100%);
  padding: 22px 22px 20px;
  background: #0E1426;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}
.modal-card h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.05;
  color: var(--accent);
}
.modal-card ul { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }

.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  margin: 0;
  color: var(--text);
}

@media (max-width: 720px) {
  #panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: 40vh;
    max-height: 40dvh;
    border-radius: 16px 16px 0 0;
    padding: 12px 16px 12px;
  }
  /* HP: panel ringkas (judul 1 baris) supaya stadion dapat ruang lebih */
  .panel-head { align-items: center; }
  .panel-head h1 { font-size: 24px; line-height: 1; }
  .panel-head .sub { font-size: 13px; margin-top: 3px; }
  .panel-head .sub-long { display: none; }
  .panel-head .ghost { min-height: 38px; padding: 6px 12px; font-size: 14px; }
  #panelBody { margin-top: 12px; gap: 12px; }
  #tooltip { display: none; }
  .pip {
    top: 12px;
    right: 12px;
    bottom: auto;
    width: min(40vw, 168px);
    height: 100px;
  }
  .pip-tag { font-size: 13px; }
  .pip-where { display: none; }
  .pov-hud,
  #panel.collapsed ~ .pov-hud {
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: auto;
    padding: 10px 12px;
  }
  .pov-title { font-size: 18px; }
  .pov-meta { font-size: 12px; margin-top: 2px; }
  .pov-ctrls { margin-top: 6px; gap: 6px 8px; flex-wrap: wrap; }
  .zoom { flex: 1 1 130px; flex-direction: row; align-items: center; gap: 8px; }
  .zoom span { white-space: nowrap; }
  .seg button { min-height: 36px; padding: 4px 10px; }
  .pov-btns .ghost { min-height: 36px; padding: 6px 10px; }
  .pov-hint { margin-top: 4px; font-size: 11px; }
  /* peringatan simulasi di HP cukup label di kiri bawah */
  .pov-hint { display: none; }
  .sim-badge { left: 12px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); padding: 4px 8px; font-size: 12px; }
  .music { top: 12px; left: 12px; right: 12px; width: auto; padding-left: 10px; }
  .show-ui { top: 12px; left: 12px; }
  /* mode sembunyikan: bar musik ke kanan supaya nggak nabrak tombol "Tampilkan" */
  body.ui-hidden .music { left: auto; width: 240px; }
  body.pip-on .music { right: calc(12px + min(40vw, 168px) + 8px); }
  body.pip-on .music .mbtn#musicMore, body.pip-on .music .eq { display: none; }
  /* di POV panel tertutup nempel di bawah; bar musik di atasnya (--panel-space diisi app.js) */
  body.pov .music { top: auto; bottom: calc(var(--panel-space, 110px) + 8px); left: auto; right: 12px; width: 240px; }
  .music-title { font-size: 15px; margin-left: 6px; }
  .mbtn { width: 32px; height: 32px; }
  .sawer-nudge { margin-top: 8px; gap: 8px; padding: 6px 4px 6px 8px; }
  .sawer-nudge p { font-size: 12px; }
}
/* HP sempit: label pojok cukup "♥" biar nggak kepotong */
@media (max-width: 380px) {
  .sim-sawer-word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .music.playing .eq i { animation: none; height: 70%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}

/* BTS: 4 kategori tribun (2 x 2) & 4 blok floor (A–D) */
.seg.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.two button { min-height: 44px; font-size: 15px; }
.seg.two button:nth-child(3) { border-left: 0; }
.seg.two button:nth-child(n+3) { border-top: 1px solid var(--line); }
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.grid4 button {
  min-height: 42px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  font-size: 15px;
  font-weight: 700;
}
.grid4 button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
