/* CEO Banking Simulator — gaya antarmuka
   Palet: indigo malam (ruang kendali), porselen (kertas laporan), kuningan (aksen brankas). */
:root {
  --ink: #14213d;
  --ink-2: #1e3358;
  --ink-3: #2b4675;
  --paper: #eef2f7;
  --card: #ffffff;
  --line: #d6dfeb;
  --text: #17223a;
  --muted: #56667f;
  --gold: #c9972b;
  --gold-d: #9b7114;
  --gold-l: #f4e3b8;
  --ok: #1d8f6a;
  --ok-bg: #e2f4ec;
  --warn: #b26a06;
  --warn-bg: #fdf0db;
  --bad: #c0392b;
  --bad-bg: #fbe5e2;
  --cyan: #3fc1c9;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .08), 0 6px 18px -8px rgba(20, 33, 61, .25);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--ink-3); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: 24px; text-align: center; background: var(--bad-bg); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--card); cursor: pointer;
  font-weight: 700; font-size: .95rem; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-3); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #d9a93c; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #fff; }
.btn-ghost-light { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
.btn-icon { min-height: 40px; width: 40px; padding: 0; background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-link { background: none; border: none; padding: 0; color: var(--ink-3); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 0; }
.btn-help {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--ink-3); font-weight: 800; font-size: .8rem; cursor: pointer; flex: 0 0 auto; padding: 0;
}
.btn-help:hover { background: var(--ink); color: #fff; }

/* ---------- Layar ---------- */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.is-active { display: block; }
.screen-center.is-active { display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.screen-scroll { padding: 32px 16px 64px; }

/* ---------- Beranda ---------- */
#screen-home {
  position: relative; overflow: hidden; color: #e9eef7;
  background:
    radial-gradient(1200px 600px at 85% 110%, rgba(63,193,201,.18), transparent 60%),
    radial-gradient(900px 500px at -10% -20%, rgba(201,151,43,.18), transparent 60%),
    var(--ink);
}
/* Adegan 3D tetap di belakang konten beranda sejak halaman dibuka */
.home-scene { position: fixed; inset: 0; pointer-events: none; touch-action: none; }
.home-scene canvas { display: block; width: 100% !important; height: 100% !important; }
.home-scene.is-static {
  opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
.home-shade {
  position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20,33,61,.9) 0%, rgba(20,33,61,.62) 34%, rgba(20,33,61,.05) 62%, rgba(20,33,61,0) 100%),
    linear-gradient(to top, rgba(11,18,34,.55), transparent 28%);
}
.home-fs {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,.3); background: rgba(20,33,61,.6); color: #fff; cursor: pointer; backdrop-filter: blur(6px);
}
.home-fs:hover { background: var(--ink-3); border-color: var(--gold); }
.explore-bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 41;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; width: min(760px, calc(100% - 32px));
  padding: 10px 12px 10px 18px; border-radius: 999px; background: rgba(20,33,61,.82); border: 1px solid rgba(201,151,43,.6); color: #e9eef7; backdrop-filter: blur(8px);
}
.explore-bar[hidden] { display: none; }
.explore-bar p { margin: 0; font-size: .85rem; flex: 1 1 260px; }
#screen-home.exploring .home-wrap, #screen-home.exploring .home-shade, #screen-home.exploring .home-fs { display: none; }
#screen-home.exploring .home-scene { pointer-events: auto; z-index: 40; cursor: grab; }
#screen-home.exploring .home-scene:active { cursor: grabbing; }
.no-scroll, .no-scroll body { overflow: hidden; }
.home-wrap {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 56px 20px 48px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 48px; align-items: start;
}
.brand-mark { color: var(--gold); margin-bottom: 18px; }
.brand-mark svg rect:not([fill]) { fill: #e9eef7; }
.home-title {
  font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 800; line-height: .95; letter-spacing: -.035em;
  margin: 0 0 24px; color: #fff; max-width: 9ch;
}
.home-title span { display: block; color: var(--gold); font-size: .42em; letter-spacing: .02em; margin-bottom: .25em; }
.home-lede { font-size: 1.15rem; max-width: 34em; color: #c9d3e4; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.disclaimer { font-size: .85rem; color: #9fb0cb; max-width: 40em; border-left: 3px solid var(--gold); padding-left: 12px; }
.home-board { display: grid; gap: 16px; }
.home-board .panel-card { color: var(--text); }

/* ---------- Kartu umum ---------- */
.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; box-shadow: var(--shadow); }
.card-title { font-size: 1rem; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.section-title h3, .section-title h2 { margin: 0; }

/* ---------- Papan skor ---------- */
.leaderboard { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.leaderboard li { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 4px 10px; padding: 10px 4px; border-top: 1px solid var(--line); align-items: center; }
.leaderboard li:first-child { border-top: 0; }
.leaderboard li.muted { display: block; }
.lb-rank { font-weight: 800; color: var(--muted); text-align: center; }
.lb-rank.r1 { color: var(--gold-d); }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; font-size: 1.1rem; }
.lb-meta { grid-column: 2 / 4; font-size: .8rem; color: var(--muted); }
.leaderboard li.is-me { background: var(--gold-l); border-radius: var(--radius-s); }
.leaderboard button.lb-open { all: unset; cursor: pointer; display: contents; }
.last-body .big-name { font-size: 1.3rem; font-weight: 800; }
.last-body .big-score { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; }

/* ---------- Form nickname ---------- */
.form-card { width: min(460px, 100%); }
.field-label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: #fff; font-size: 1.05rem;
}
input[type="text"]:focus { border-color: var(--ink-3); outline: none; box-shadow: 0 0 0 3px rgba(43,70,117,.15); }
.field-hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.field-error { color: var(--bad); font-weight: 600; font-size: .9rem; min-height: 1.2em; margin: 6px 0 0; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.form-actions.end { justify-content: flex-end; }

/* ---------- Kondisi awal ---------- */
.intro-wrap, .result-wrap { max-width: 1040px; margin: 0 auto; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 46em; }
.intro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 20px 0; }
.glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.glossary dt { font-weight: 800; color: var(--ink); }
.glossary dd { margin: 0; color: var(--text); }
.howto-mini { margin-top: 16px; }
.flow-steps { margin: 0 0 10px; padding-left: 1.3em; }
.flow-steps li { margin-bottom: 6px; }

/* ---------- Topbar & tata letak permainan ---------- */
.screen-game.is-active { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar {
  height: var(--topbar); flex: 0 0 var(--topbar); display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--ink); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.tb-time { font-weight: 700; background: rgba(255,255,255,.08); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tb-focus { color: var(--gold-l); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-quarter { font-size: .85rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); white-space: nowrap; }
.tb-quarter[data-status="ok"] { color: #8fe0bf; }
.tb-quarter[data-status="bad"] { color: #ffb4a8; }
.tb-quarter.is-warning { box-shadow: inset 0 0 0 1.5px #e2a03a; }
.tb-health { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-left: auto; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.tb-ceo { font-size: .9rem; color: #c9d3e4; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.game-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr); }
.stage-col { display: flex; flex-direction: column; min-height: 0; background: var(--ink); }
.stage { position: relative; flex: 1 1 auto; min-height: 260px; overflow: hidden; background: linear-gradient(#1b2c4f, #0f1a31); }
.scene-host { position: absolute; inset: 0; touch-action: none; }
.scene-host canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.scene-host canvas:active { cursor: grabbing; }
.scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-label {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: .75rem; font-weight: 700;
  color: #fff; background: rgba(20,33,61,.82); border: 1px solid rgba(201,151,43,.7); padding: 3px 8px; border-radius: 999px;
  transition: opacity .2s, background-color .15s; font-family: inherit; line-height: 1.3; cursor: pointer;
}
.scene-label:hover { background: rgba(201,151,43,.92); color: #14213d; }
.scene-labels.off { display: none; }
.scene-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sc-btn {
  width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,33,61,.75); color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer; backdrop-filter: blur(4px);
}
.sc-btn:hover { background: var(--ink-3); }
.sc-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-l); }
.scene-hint { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: .75rem; color: rgba(255,255,255,.7); pointer-events: none; }
.stage-toggle { display: none; }
.sc-btn svg { display: block; margin: auto; }
/* Layar penuh untuk panggung 3D permainan (API Fullscreen + cadangan CSS) */
.stage:fullscreen { width: 100vw; height: 100vh; min-height: 0; }
.stage:-webkit-full-screen { width: 100vw; height: 100vh; min-height: 0; }
.stage.is-pseudo-full { position: fixed; inset: 0; z-index: 45; height: auto; min-height: 0; }
.stage:fullscreen .stage-toggle { display: none; }
.stage.is-pseudo-full .stage-toggle { display: none; }

/* Dashboard 2D cadangan saat Three.js gagal */
.fallback2d { position: absolute; inset: 0; padding: 18px 18px 30px; color: #e9eef7; overflow: auto; display: grid; align-content: start; gap: 16px; }
.fb-caption { font-size: .8rem; color: #b8c4da; margin: 8px 0 0; }
.fallback2d .fb-note { font-size: .85rem; background: rgba(201,151,43,.15); border: 1px solid rgba(201,151,43,.5); border-radius: var(--radius); padding: 8px 12px; }
.fb-room { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; }
.fb-tower { position: relative; height: 210px; display: flex; align-items: flex-end; justify-content: center; }
.fb-tower .tw { width: 70px; background: repeating-linear-gradient(to bottom, #2b4675 0 10px, #3fc1c9 10px 12px); border: 2px solid var(--gold); border-bottom: 0; border-radius: 6px 6px 0 0; transition: height .8s; }
.fb-tower .ring { position: absolute; bottom: -6px; width: 130px; height: 14px; border-radius: 50%; border: 3px solid var(--ok); }
.fb-panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fb-tile { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 10px; }
.fb-tile .v { font-size: 1.25rem; font-weight: 800; }
.fb-tile .l { font-size: .75rem; color: #b8c4da; }
.fb-tile.pulse { animation: pulse 1s ease; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,151,43,.7); } 100% { box-shadow: 0 0 0 14px rgba(201,151,43,0); } }
.fb-branches { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fb-branches i { width: 8px; height: 8px; border-radius: 2px; background: var(--cyan); opacity: .8; }

/* Strip KPI di bawah adegan */
.kpi-strip { flex: 0 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 1px; background: rgba(255,255,255,.08); }
.ks-item { background: var(--ink); color: #fff; padding: 8px 10px; min-width: 0; }
.ks-label { font-size: .72rem; color: #a9b7cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks-val { font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
.ks-item .delta { font-size: .72rem; }
.ks-item[data-status="ok"] { box-shadow: inset 0 -3px 0 var(--ok); }
.ks-item[data-status="warn"] { box-shadow: inset 0 -3px 0 #e2a03a; }
.ks-item[data-status="bad"] { box-shadow: inset 0 -3px 0 #e2604f; }
.ks-item.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--ink-3); } 100% { background: var(--ink); } }

/* Panel kanan */
.panel-col { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-left: 1px solid var(--line); }
.tabs { flex: 0 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 8px 8px 0; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab {
  flex: 0 0 auto; border: 0; background: transparent; padding: 10px 12px; min-height: 44px; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; cursor: pointer; border-radius: 8px 8px 0 0; position: relative;
}
.tab:hover { color: var(--text); background: var(--paper); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tab .badge { display: inline-block; min-width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-left: 6px; vertical-align: middle; }
.week-flow { flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wf-step { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; background: #fff; cursor: pointer; white-space: nowrap; min-height: 32px; }
.wf-step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-size: .75rem; }
.wf-step.done { color: var(--ok); border-color: #b9e2d2; }
.wf-step.done .n { background: var(--ok); color: #fff; }
.wf-step.current { color: var(--ink); border-color: var(--gold); background: var(--gold-l); }
.wf-step.current .n { background: var(--ink); color: #fff; }
.panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.panel { display: none; }
.panel.is-active { display: block; animation: panelIn .18s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel > * + * { margin-top: 14px; }

/* ---------- Kartu KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: relative;
  display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--line);
}
.kpi[data-status="ok"] { border-top-color: var(--ok); }
.kpi[data-status="warn"] { border-top-color: #e2a03a; }
.kpi[data-status="bad"] { border-top-color: var(--bad); }
.kpi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.kpi-label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.kpi-val { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.15; }
.kpi-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-desc { font-size: .78rem; color: var(--muted); }
.kpi.is-target { background: linear-gradient(#fffaf0, #fff); }
.kpi .tgt-flag { font-size: .7rem; font-weight: 800; color: var(--gold-d); }
.delta { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.delta.good { color: var(--ok); }
.delta.badc { color: var(--bad); }
.delta.flat { color: var(--muted); }
.ks-item .delta.good { color: #6fe0b5; }
.ks-item .delta.badc { color: #ff9c8f; }
.ks-item .delta.flat { color: #a9b7cf; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.neutral { background: var(--paper); color: var(--muted); }
.chip.gold { background: var(--gold-l); color: var(--gold-d); }

/* ---------- Grafik ---------- */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chart-controls button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; min-height: 34px; }
.chart-controls button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart .lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--ink-3); stroke-width: 2.5; }
.chart .area { fill: rgba(43,70,117,.08); }
.chart .dot { fill: var(--ink-3); }
.chart .ref { stroke: var(--gold); stroke-dasharray: 4 4; }
.chart .bar-pos { fill: var(--ok); }
.chart .bar-neg { fill: var(--bad); }
.chart-caption { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- Laporan, berita, rapat ---------- */
.report-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.change-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.change-table th, .change-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.change-table th:first-child, .change-table td:first-child { text-align: left; }
.change-table thead th { background: var(--paper); font-size: .78rem; color: var(--muted); }
.change-table tr:last-child td { border-bottom: 0; }
.cause-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cause-list li { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: var(--radius-s); padding: 8px 10px; font-size: .9rem; }
.cause-list li[data-type="risk"], .cause-list li[data-type="incident"] { border-left-color: var(--bad); }
.cause-list li[data-type="delayed"] { border-left-color: var(--gold); }
.cause-list li[data-type="good"] { border-left-color: var(--ok); }
.cause-list li[data-type="news"] { border-left-color: var(--cyan); }
.lesson {
  background: var(--ink); color: #e9eef7; border-radius: var(--radius-l); padding: 16px 18px;
}
.lesson h4 { color: var(--gold); margin-bottom: 6px; font-size: .95rem; }
.lesson p { margin: 0 0 8px; }
.lesson p:last-child { margin: 0; }
.lesson .term { color: #fff; font-weight: 800; }
.news-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.news-card .tag { font-size: .75rem; font-weight: 800; color: var(--ink-3); }
.news-card h4 { margin: 4px 0 6px; font-size: 1.05rem; }
.event-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px; border-left: 6px solid var(--gold); }
.event-card .ev-icon { font-size: 1.6rem; float: right; margin-left: 8px; }
.event-card h3 { margin: 4px 0 8px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.director { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem; }
.director .who { font-weight: 800; line-height: 1.2; }
.director .role { font-size: .78rem; color: var(--muted); }
.director .say { grid-column: 1 / -1; margin: 0; font-size: .9rem; }
.director .rec { grid-column: 1 / -1; font-size: .8rem; font-weight: 700; color: var(--ink-3); background: var(--paper); border-radius: var(--radius-s); padding: 6px 8px; }
.director .extra { grid-column: 1 / -1; font-size: .8rem; color: var(--bad); font-weight: 600; margin: 0; }
.tally { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Keputusan ---------- */
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px; background: #fff; border: 2px solid var(--line);
  border-radius: var(--radius); cursor: pointer; text-align: left; width: 100%;
}
.option:hover { border-color: var(--ink-3); }
.option[aria-checked="true"] { border-color: var(--gold); background: #fffaf0; box-shadow: 0 0 0 3px rgba(201,151,43,.2); }
.option .letter { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-weight: 800; }
.option[aria-checked="true"] .letter { background: var(--gold); color: var(--ink); }
.option .o-label { font-weight: 800; display: block; }
.option .o-hint { font-size: .85rem; color: var(--muted); display: block; margin-top: 2px; }
.option .o-backers { font-size: .75rem; color: var(--ink-3); display: block; margin-top: 4px; font-weight: 600; }
.ctrl-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--paper); padding: 4px; border-radius: var(--radius); }
.seg button { border: 0; background: transparent; padding: 8px 6px; min-height: 40px; border-radius: 8px; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg-note { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.ctrl-row + .ctrl-row { margin-top: 14px; }
.ctrl-row label, .ctrl-row .lbl { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin-bottom: 6px; }
input[type="range"] { width: 100%; accent-color: var(--ink-3); min-height: 32px; }
.alloc-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 72px; gap: 10px; align-items: center; padding: 4px 0; }
.alloc-row .an { font-size: .85rem; font-weight: 600; }
.alloc-row .av { font-size: .85rem; font-weight: 800; text-align: right; }
.budget-total { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-s); font-weight: 700; margin-top: 8px; font-size: .9rem; }
.run-bar { position: sticky; bottom: -16px; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.run-bar .btn { flex: 1 1 220px; }

/* ---------- Target ---------- */
.target-list { display: grid; gap: 10px; }
.target {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.target-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.target-name { font-weight: 800; }
.progress { height: 12px; background: var(--paper); border-radius: 999px; overflow: hidden; position: relative; margin: 10px 0 4px; }
.progress .fill { height: 100%; background: var(--ink-3); border-radius: 999px; transition: width .6s ease; }
.progress .fill.ok { background: var(--ok); }
.progress .fill.warn { background: #e2a03a; }
.progress .fill.bad { background: var(--bad); }
.progress .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(20,33,61,.25); }
.target-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.weeks-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.weeks-mini div { font-size: .72rem; text-align: center; padding: 4px 2px; border-radius: 6px; background: var(--paper); color: var(--muted); }
.weeks-mini div.hit { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.weeks-mini div.miss { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.weeks-mini div.now { outline: 2px solid var(--gold); }

/* Penetapan target (modal) */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pick {
  border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fff; cursor: pointer; text-align: left; width: 100%; display: block;
}
.pick:hover { border-color: var(--ink-3); }
.pick[aria-pressed="true"] { border-color: var(--gold); background: #fffaf0; }
.pick .pk-title { font-weight: 800; display: block; }
.pick .pk-desc { font-size: .8rem; color: var(--muted); display: block; margin-top: 4px; }
.pick .pk-now { font-size: .78rem; color: var(--ink-3); display: block; margin-top: 6px; font-weight: 600; }
.level-seg { display: flex; gap: 4px; margin-top: 8px; }
.level-seg button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; font-size: .78rem; font-weight: 700; cursor: pointer; min-height: 36px; }
.level-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.focus-grid .pick .ico { font-size: 1.4rem; }

/* ---------- Keuangan ---------- */
.fin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .9rem; }
.fin-table th, .fin-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table thead th { background: var(--ink); color: #fff; font-size: .8rem; }
.fin-table tr.total td { font-weight: 800; background: var(--paper); }
.fin-table td.neg { color: var(--bad); }
.fin-note { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.table-wrap { overflow-x: auto; }

/* ---------- Riwayat ---------- */
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.h-when { font-weight: 800; color: var(--ink-3); font-size: .85rem; }
.h-ev { font-weight: 700; }
.h-choice { font-size: .88rem; }
.h-fx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------- Skor ---------- */
.score-break { display: grid; gap: 8px; }
.sb-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 4px 10px; align-items: center; }
.sb-row .sb-name { font-weight: 700; font-size: .9rem; }
.sb-row .sb-pts { text-align: right; font-weight: 800; }
.sb-row .sb-bar { grid-column: 1 / -1; height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.sb-row .sb-bar span { display: block; height: 100%; background: var(--ink-3); }
.sb-row .sb-detail { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.penalty { color: var(--bad); font-weight: 700; }

/* ---------- Hasil akhir ---------- */
.result-hero { background: var(--ink); color: #fff; border-radius: var(--radius-l); padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.result-score { font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; line-height: .9; color: var(--gold); letter-spacing: -.04em; }
.result-score small { font-size: .3em; color: #c9d3e4; letter-spacing: 0; }
.result-grade { font-size: 1.5rem; font-weight: 800; margin: 0 0 6px; }
.result-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; margin-top: 16px; }
.journey { margin: 0; padding-left: 1.2em; }
.journey li { margin-bottom: 8px; }
.save-status { padding: 10px 14px; border-radius: var(--radius); font-weight: 600; font-size: .9rem; }
.save-status.ok { background: var(--ok-bg); color: var(--ok); }
.save-status.err { background: var(--bad-bg); color: var(--bad); }
.save-status.wait { background: var(--paper); color: var(--muted); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,18,36,.6); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; background: var(--paper); border-radius: var(--radius-l); width: min(860px, 100%); max-height: calc(100dvh - 32px);
  overflow-y: auto; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
.modal-x { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.6rem; cursor: pointer; color: var(--muted); border-radius: 50%; }
.modal-x:hover { background: #fff; }
.modal h2 { padding-right: 36px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; position: sticky; bottom: -22px; background: linear-gradient(transparent, var(--paper) 35%); padding: 16px 0 4px; }
.modal-actions .spacer { margin-right: auto; align-self: center; font-size: .85rem; color: var(--muted); }
.toast-host { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(520px, calc(100% - 24px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--gold); animation: toastIn .25s ease; font-size: .92rem; }
.toast.term { border-left-color: var(--cyan); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.why { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }
.did-you-know { margin-top: 12px; }
.quiz { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.quiz h4 { margin: 0 0 6px; }
.quiz-opts { display: grid; gap: 8px; margin: 8px 0; }
.quiz-opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; color: inherit; padding: 10px 12px; min-height: 44px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--gold); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt .letter { font-weight: 800; color: var(--gold-d); }
.quiz-opt.is-right { border-color: var(--ok); background: var(--ok-bg); }
.quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.quiz-exp { margin: 6px 0; }
.quarter-review { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.quarter-review[data-status="ok"] { border-color: var(--ok); background: var(--ok-bg); }
.quarter-review[data-status="warn"] { border-color: var(--warn); background: var(--warn-bg); }
.quarter-review[data-status="bad"] { border-color: var(--bad); background: var(--bad-bg); }
.quarter-review h3 { margin: 0; font-size: 1rem; }
.quarter-review p { margin: 6px 0 0; }
.qr-score strong { font-size: 1.4rem; }
.quarter-list { list-style: none; margin: 10px 0 0; padding: 0; }
.quarter-list li { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.eval-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin: 12px 0; }
.eval-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.eval-stat .v { font-weight: 800; font-size: 1.2rem; }
.eval-stat .l { font-size: .8rem; color: var(--muted); }

@media (min-width: 1021px) {
  .toast-host { left: auto; right: 16px; bottom: auto; top: 68px; transform: none; width: 420px; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1020px) {
  .home-wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .home-wrap { padding-top: 38vh; }
  .home-shade { background: linear-gradient(to bottom, rgba(20,33,61,0) 0%, rgba(20,33,61,.15) 30%, rgba(20,33,61,.82) 52%, rgba(20,33,61,.94) 100%); }
  .screen-game.is-active { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 20; }
  .game-layout { display: block; }
  .stage { height: 42vh; min-height: 240px; flex: none; }
  .stage.collapsed { height: 0; min-height: 0; }
  .stage.collapsed > *:not(.stage-toggle) { display: none; }
  .stage-toggle {
    display: block; position: absolute; left: 10px; top: 10px; z-index: 3; border: 1px solid rgba(255,255,255,.25);
    background: rgba(20,33,61,.8); color: #fff; font-weight: 700; font-size: .8rem; padding: 8px 12px; border-radius: 999px; min-height: 36px; cursor: pointer;
  }
  .stage.collapsed .stage-toggle { position: static; margin: 6px 10px; }
  .stage.collapsed { height: auto; }
  .kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .panel-col { border-left: 0; }
  .tabs { position: sticky; top: var(--topbar); z-index: 15; }
  .panels { overflow: visible; }
  .run-bar { bottom: 0; }
  .tb-focus, .tb-ceo { display: none; }
  .result-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .tb-name, .tb-health .hl { display: none; }
  .topbar { gap: 8px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-val { font-size: 1.15rem; }
  .alloc-row { grid-template-columns: minmax(0,1fr) 64px; }
  .alloc-row input { grid-column: 1 / -1; grid-row: 2; }
  .result-hero { grid-template-columns: 1fr; padding: 20px; }
  .eval-grid { grid-template-columns: 1fr 1fr; }
  .glossary dl { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
  .scene-hint { display: none; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; max-height: 100dvh; height: 100dvh; padding: 18px 16px; }
  .fb-room { grid-template-columns: 1fr; }
  .fb-tower { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 10 pemain terakhir ---------- */
.recent-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); counter-reset: rc 1; }
.recent-list li { counter-increment: rc; border-bottom: 1px solid var(--line); }
.recent-item { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 4px; font-size: .88rem; }
.recent-item::before { content: counter(rc); color: var(--muted); font-weight: 800; text-align: center; grid-row: span 2; align-self: center; }
.recent-item:hover, .recent-item:focus-visible { background: var(--paper); border-radius: var(--radius-s); }
.recent-item .rn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .rs { font-weight: 800; text-align: right; }
.recent-item .rd { grid-column: 2 / 4; font-size: .75rem; color: var(--muted); }

/* ---------- Papan iklan ---------- */
.ad-card .btn { width: 100%; margin-top: 4px; }
.ad-mini { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.ad-mini-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border-radius: var(--radius-s); font-size: .9rem; }
.ad-mini-btn:hover, .ad-mini-btn:focus-visible { background: var(--paper); }
.ad-mini-btn .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--gold-l); }
.ad-preview { border-radius: var(--radius); padding: 18px; color: #fff; display: grid; gap: 4px; min-height: 130px; align-content: center; border: 4px solid var(--gold); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.ad-preview strong { font-size: 1.3rem; line-height: 1.2; }
.ad-preview span { font-size: .92rem; opacity: .92; }
.ad-preview em { font-style: normal; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; opacity: .75; margin-top: 6px; }
.ad-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }
.ad-form input[type="email"], .ad-form input[type="url"], .ad-form input[type="tel"], .ad-form input[type="number"], .ad-form input[type="date"] {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; color: inherit;
}
.ad-form input:focus { border-color: var(--ink-3); outline: none; box-shadow: 0 0 0 3px rgba(43,70,117,.15); }
.ad-dates { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: .82rem; cursor: pointer; }
.swatch span { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); }
.swatch[aria-pressed="true"] { border-color: var(--gold); background: #fffaf0; }
.ad-total { margin: 12px 0 0; padding: 10px 12px; background: var(--gold-l); border-radius: var(--radius); font-size: .95rem; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink-3); }
.ad-code { font-size: 1.2rem; letter-spacing: .06em; color: var(--ink); background: var(--gold-l); padding: 2px 8px; border-radius: var(--radius-s); }
.ad-summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.ad-summary dt { color: var(--muted); font-weight: 600; }
.ad-summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .ad-form-grid { grid-template-columns: 1fr; }
  .ad-summary { grid-template-columns: 1fr; }
}

/* ---------- Nama bank di papan skor ---------- */
.lb-bank { display: block; font-weight: 600; font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last-body .big-bank { font-weight: 700; color: var(--ink-3); margin-top: -2px; margin-bottom: 4px; }
.recent-item .rb { font-weight: 600; color: var(--ink-3); }
.lb-bank-line { margin: -6px 0 6px; font-weight: 700; color: var(--ink-3); }
