/* Layout: adegan 3D penuh layar; HUD di atas, kartu fase kiri bawah, dok area di bawah, panel & laporan sebagai laci kanan (bottom sheet di ponsel). */
:root {
  --ink: #0f1d24;
  --ink-2: #16282f;
  --ink-3: #1f343c;
  --line: #2b454e;
  --paper: #f3ebdd;
  --muted: #9fb3b8;
  --saffron: #f2a541;
  --teal: #3fb4a4;
  --coral: #e8836b;
  --blue: #7fa7e8;
  --violet: #8d8fe0;
  --good: #5bc78a;
  --warn: #f2c14e;
  --bad: #ef6b5b;
  --glass: rgba(15, 29, 36, 0.86);
  --f-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 18px 50px rgba(5, 12, 16, 0.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--f-body); font-size: 14px; line-height: 1.5; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--saffron); font-weight: 700; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; background: linear-gradient(#f0c39b, #e9d9c4); touch-action: none; }
#stage canvas { display: block; cursor: grab; touch-action: none; }
#pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; margin: -14px 0 0 -12px;
  background: var(--glass); border: 1px solid rgba(243, 235, 221, 0.18); border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--paper);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); transition: background 0.15s, border-color 0.15s; will-change: transform; }
.pin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 3px rgba(242, 165, 65, 0.25); }
.pin:hover, .pin.is-hover { background: var(--saffron); color: var(--ink); border-color: var(--saffron); }
.pin:hover .pin-dot, .pin.is-hover .pin-dot { background: var(--ink); }
body.no-labels .pin-label { display: none; }
body.no-labels .pin { padding: 4px; }

/* HUD */
.hud-stats, .hud-actions, .hud-brand { pointer-events: auto; }
#hud { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px; pointer-events: none; flex-wrap: nowrap; }
.hud-brand { display: flex; align-items: center; gap: 10px; background: var(--glass); border-radius: var(--r); padding: 8px 14px 8px 10px; backdrop-filter: blur(8px); min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: conic-gradient(from 210deg, var(--saffron), var(--teal), var(--saffron)); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 5px 5px 50% 50%; background: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-family: var(--f-display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.date-chip { font-size: 12px; color: var(--saffron); font-weight: 600; }
.hud-stats { display: flex; gap: 6px; background: var(--glass); border-radius: var(--r); padding: 6px; backdrop-filter: blur(8px); overflow-x: auto; scrollbar-width: none; flex: 1 1 0; min-width: 0; }
.hud-stats::-webkit-scrollbar { display: none; }
.stat { display: flex; flex-direction: column; padding: 4px 10px; border-radius: var(--r-sm); min-width: 92px; flex: none; }
.stat-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.stat-value { font-family: var(--f-mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.good .stat-value { color: var(--good); } .stat.warn .stat-value { color: var(--warn); } .stat.bad .stat-value { color: var(--bad); }
.stat.flash { animation: flash 0.9s ease; }
@keyframes flash { 0% { background: rgba(242, 165, 65, 0.35); } 100% { background: transparent; } }
.hud-actions { display: flex; gap: 6px; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); min-height: 40px; }
.icon-btn:hover { border-color: var(--saffron); }
.icon-btn svg, .dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.warnings { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 78px); left: 16px; display: flex; flex-direction: column; gap: 6px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; z-index: 3; }
.warn-chip { pointer-events: auto; background: var(--glass); border-left: 4px solid var(--warn); border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px; backdrop-filter: blur(8px); }
.warn-chip.bad { border-color: var(--bad); }
.warn-chip small { display: block; color: var(--muted); }

/* Kartu fase */
.phase-card { position: absolute; left: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); width: min(360px, calc(100vw - 32px)); background: var(--glass); border-radius: var(--r); padding: 14px; backdrop-filter: blur(10px); box-shadow: var(--shadow); z-index: 4; display: flex; flex-direction: column; gap: 10px; }
.phase-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.phase-row h3 { font-size: 18px; }
.weeks { display: flex; gap: 4px; }
.weeks i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.weeks i.done { background: var(--teal); } .weeks i.now { background: var(--saffron); }
.mini-goals { display: flex; flex-direction: column; gap: 7px; }
.mini-goal { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; }
.mini-goal .bar { grid-column: 1 / -1; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 3px; transition: width 0.6s ease; }
.bar.ok > span { background: var(--good); } .bar.mid > span { background: var(--saffron); } .bar.low > span { background: var(--bad); }

/* Tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--ink-3); font-weight: 600; font-size: 14px; text-align: center; }
.btn:hover:not(:disabled) { border-color: var(--saffron); }
.btn.primary { background: var(--saffron); border-color: var(--saffron); color: var(--ink); font-weight: 700; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.danger { border-color: rgba(239, 107, 91, 0.6); color: #ffb4a9; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 165, 65, 0.55); } 50% { box-shadow: 0 0 0 9px rgba(242, 165, 65, 0); } }

/* Dok area */
.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; z-index: 5; pointer-events: none; }
.dock::-webkit-scrollbar { display: none; }
.dock button { pointer-events: auto; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 13px; border-radius: 999px; border: 1px solid rgba(243, 235, 221, 0.12); background: var(--glass); font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
.dock button:hover, .dock button.active { border-color: var(--saffron); background: var(--ink-3); }
.dock .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.dock-home { margin-left: auto; }

/* Laci panel */
.drawer { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 72px); right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); width: min(460px, calc(100vw - 32px)); background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); z-index: 8; display: flex; flex-direction: column; animation: slideIn 0.28s cubic-bezier(.2,.8,.2,1); }
.sheet { width: min(760px, calc(100vw - 32px)); z-index: 9; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; }
.close-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-2); font-size: 22px; line-height: 1; flex: none; }
.close-btn:hover { border-color: var(--saffron); }
.drawer-body { overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.drawer-body > * { flex-shrink: 0; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.drawer-foot:empty { display: none; }

.section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.section > h3 { font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section > p { margin: 0; }
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card.hl { border-color: var(--saffron); }
.card h4 { margin: 0; font-size: 15px; font-family: var(--f-display); }
.card p { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.kpi { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-family: var(--f-mono); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .d { font-size: 12px; }
.up { color: var(--good); } .down { color: var(--bad); } .warn-t { color: var(--warn); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ink-3); color: var(--muted); letter-spacing: 0.02em; white-space: nowrap; }
.pill.good { background: rgba(91, 199, 138, 0.16); color: var(--good); }
.pill.warn { background: rgba(242, 193, 78, 0.16); color: var(--warn); }
.pill.bad { background: rgba(239, 107, 91, 0.16); color: var(--bad); }
.pill.info { background: rgba(63, 180, 164, 0.16); color: var(--teal); }
.pill.accent { background: rgba(242, 165, 65, 0.18); color: var(--saffron); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--ink-2); }
td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
td:first-child { font-family: var(--f-body); }
tr:last-child td { border-bottom: none; }
tr.total td { font-weight: 700; border-top: 1px solid var(--muted); }
.dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dl .sum { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 700; color: var(--paper); }

.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; }
.seg button { flex: 1 1 auto; min-height: 36px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 10px; }
.seg button.on { background: var(--saffron); color: var(--ink); }
.seg button:hover:not(.on) { color: var(--paper); background: var(--ink-3); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .lbl { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.field select { background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; min-height: 40px; }
input[type="range"] { width: 100%; accent-color: var(--saffron); min-height: 28px; }
input[type="text"] { background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; width: 100%; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.switch input { width: 40px; height: 22px; appearance: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: left 0.15s; }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { left: 21px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-3); font-size: 18px; font-weight: 700; }
.stepper button:hover { border-color: var(--saffron); }
.stepper .num { min-width: 34px; text-align: center; font-weight: 700; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; min-height: 42px; }
.tabs button.on { color: var(--paper); border-color: var(--saffron); }

.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notes li { position: relative; padding-left: 18px; }
.notes li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 2px; background: var(--saffron); transform: rotate(45deg); }

.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.flow .step { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; text-align: center; position: relative; min-width: 0; }
.flow .step .v { font-family: var(--f-mono); font-weight: 700; font-size: 17px; }
.flow .step .k { font-size: 11px; color: var(--muted); }
.flow .step:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--saffron); font-weight: 700; z-index: 1; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-family: var(--f-body); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.goal-opt { cursor: pointer; text-align: left; border: 1px solid var(--line); background: var(--ink-2); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.goal-opt.on { border-color: var(--saffron); background: rgba(242, 165, 65, 0.08); box-shadow: inset 0 0 0 1px var(--saffron); }
.goal-opt .t { font-weight: 700; }
.goal-opt .tension { font-size: 12px; color: var(--muted); }
.check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: inline-grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; }
.goal-opt.on .check { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }

.event-card { border: 1px solid var(--line); background: var(--ink-2); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; animation: newsIn 0.45s cubic-bezier(.2,.8,.2,1); }
@keyframes newsIn { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.event-card h3 { font-size: 21px; }
.choice { text-align: left; border: 1px solid var(--line); background: var(--ink-3); border-radius: var(--r-sm); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; min-height: 56px; }
.choice:hover:not(:disabled) { border-color: var(--saffron); }
.choice .c-label { font-weight: 700; }
.choice .c-cost { font-family: var(--f-mono); font-weight: 700; color: var(--saffron); }
.choice .c-desc { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.grade { font-family: var(--f-display); font-size: 64px; line-height: 1; font-weight: 800; color: var(--saffron); }
.pillar { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 3px 10px; font-size: 13px; align-items: center; }
.pillar .bar { grid-column: 1 / -1; }

.tech-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.tech-card .meta b { color: var(--paper); font-family: var(--f-mono); font-weight: 700; }
.tech-card .impact { font-size: 13px; color: var(--teal); }
.risk { font-size: 12px; color: #f0b6a9; }

.journal-item { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.journal-item .when { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }

.term { border-bottom: 1px dotted var(--muted); cursor: help; }
.tip { position: fixed; z-index: 40; max-width: 290px; background: var(--paper); color: var(--ink); font-size: 13px; padding: 9px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow); pointer-events: none; }

.toasts { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 80px); left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow); animation: toastIn 0.3s ease, toastOut 0.4s ease 2.8s forwards; text-align: center; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: var(--ink); }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }

.start { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding-inline: 16px; padding-block: 24px; background: radial-gradient(circle at 70% 20%, rgba(242, 165, 65, 0.18), transparent 60%), rgba(15, 29, 36, 0.55); backdrop-filter: blur(3px); overflow-y: auto; }
.start-card { width: min(560px, 100%); background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.start-card h1 { font-size: clamp(36px, 7vw, 56px); line-height: 0.98; font-weight: 800; }
.start-card h1 span { display: block; font-size: 0.42em; color: var(--saffron); font-weight: 700; letter-spacing: 0.01em; margin-top: 8px; }
.lede { margin: 0; color: #d6dcd8; font-size: 15px; max-width: 60ch; }
.fine { margin: 0; color: var(--muted); font-size: 12px; }
#startBody { display: flex; flex-direction: column; gap: 10px; }

.dialog, .load-error { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 12, 16, 0.55); padding-inline: 16px; }
.dialog-card { width: min(440px, 100%); background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.dialog-card p { margin: 0; color: #d6dcd8; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.coach { position: fixed; inset: auto 0 0 0; z-index: 45; display: flex; justify-content: center; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 140px); pointer-events: none; }
.coach-card { pointer-events: auto; width: min(420px, 100%); background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; animation: newsIn 0.35s ease; }
.coach-card .eyebrow { color: #a8611a; }
.coach-card p { margin: 0; }
.coach-card .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.coach-card .btn.ghost { background: transparent; color: var(--ink); border-color: rgba(15, 29, 36, 0.3); }
.coach-actions { display: flex; gap: 8px; justify-content: flex-end; }
.coach-ring { position: fixed; z-index: 44; border: 3px solid var(--saffron); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5, 12, 16, 0.35); pointer-events: none; transition: all 0.35s ease; }

.scene-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); background: var(--glass); padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--muted); z-index: 2; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; animation: toastOut 0.6s ease 7s forwards; }

.empty { padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--muted); font-size: 13px; }
.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin: 0; }
.big-num { font-family: var(--f-mono); font-size: 26px; font-weight: 700; }

/* Layar sempit / ponsel */
@media (max-width: 900px) {
  .hud-actions .icon-btn span { display: none; }
  .brand-text strong { max-width: 150px; }
  .stat { min-width: 84px; padding: 3px 8px; }
  .stat-value { font-size: 14px; }
}
@media (max-width: 720px) {
  #hud { padding: 8px 10px; gap: 6px; flex-wrap: wrap; }
  .hud-brand { order: 1; flex: 1 1 auto; padding: 6px 10px 6px 8px; }
  .hud-actions { order: 2; margin-left: 0; }
  .hud-stats { order: 3; flex: 1 1 100%; }
  .icon-btn { padding: 8px 10px; }
  .warnings { top: calc(env(safe-area-inset-top, 0px) + 116px); left: 10px; }
  .phase-card { left: 10px; right: 10px; width: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 66px); padding: 12px; gap: 8px; }
  .phase-card .mini-goals { display: none; }
  .phase-card.expanded .mini-goals { display: flex; }
  .drawer, .sheet { top: auto; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 62px); width: auto; height: min(62vh, 100% - 180px); border-radius: 18px; animation: sheetUp 0.3s cubic-bezier(.2,.8,.2,1); }
  .sheet { left: 0; right: 0; bottom: 0; height: min(86vh, 100% - 64px); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dock { padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .dock-home { margin-left: 0; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow .step:nth-child(2)::after { display: none; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-hint { display: none; }
  .coach { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 200px); }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Online: identitas pemain, peringkat, papan iklan ---------- */
input[type="number"], input[type="email"], textarea { background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; width: 100%; color: inherit; font: inherit; }
textarea { resize: vertical; min-height: 76px; }
input[type="file"] { width: 100%; font-size: 13px; color: var(--muted); }
input[type="text"]:focus, input[type="number"]:focus, textarea:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: #d6dcd8; line-height: 1.45; cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--saffron); }
.start-online { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 14px; }
.start-online .seg { flex-wrap: wrap; }
.recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.recent li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.recent li span:first-child { min-width: 0; overflow-wrap: anywhere; }
tr.me td { background: rgba(242, 165, 65, 0.12); }
.ad-form { display: flex; flex-direction: column; gap: 12px; }
.ad-total { font-size: 15px; padding: 10px 12px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ad-card { flex-direction: row; align-items: center; gap: 12px; }
.ad-card img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; background: #0b1419; }
.ad-card > div { min-width: 0; }
.ad-card h4 { overflow-wrap: anywhere; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); padding: 0; flex: none; display: inline-block; }
.ad-card .ad-swatch { width: 54px; height: 54px; border-radius: 8px; }
.ad-swatch.on { border-color: var(--paper); box-shadow: 0 0 0 2px var(--saffron); }
.t-saffron { background: #f2a541; } .t-teal { background: #3fb4a4; } .t-coral { background: #e8836b; }
.t-blue { background: #7fa7e8; } .t-violet { background: #8d8fe0; } .t-ink { background: #16282f; }
