:root {
  --bg: #0b1424; --bg2: #101d33; --panel: rgba(17, 30, 52, .82); --line: rgba(140, 180, 255, .16);
  --ink: #eef3ff; --dim: #93a4c4; --accent: #ffcf3f; --accent2: #ff5d73; --good: #46e08a; --bad: #ff5d73; --info: #59b8ff;
  --tile: #f7f0e1; --tile-ink: #1e2433; --felt1: #0f3d3a; --felt2: #08211f;
  --r: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Bungee', 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(1200px 700px at 70% -10%, #1d3566 0%, transparent 60%), radial-gradient(900px 600px at -10% 110%, #3a1740 0%, transparent 55%), var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; overflow-x: hidden; }
.bg-grid { position: fixed; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%); opacity: .35; pointer-events: none; z-index: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; transition: transform .12s, filter .12s, background .2s; touch-action: manipulation; }
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.primary { background: linear-gradient(180deg, #ffd95a, #ffb21f); color: #2b1a00; box-shadow: 0 4px 0 #b77800, 0 8px 20px rgba(255, 190, 40, .25); }
.primary:hover:not(:disabled) { filter: brightness(1.07); }
.secondary { background: linear-gradient(180deg, #4fc0ff, #2d86ff); color: #fff; box-shadow: 0 4px 0 #1a56b5; }
.danger { background: linear-gradient(180deg, #ff7a8b, #e83a54); color: #fff; box-shadow: 0 4px 0 #a01d33; }
.good { background: linear-gradient(180deg, #5cf09c, #22b863); color: #04260f; box-shadow: 0 4px 0 #11783d; }
.ghost { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.ghost:hover { background: rgba(255, 255, 255, .13); }
.sm { padding: 7px 12px; font-size: 13px; }
.big { padding: 15px 18px; font-size: 18px; width: 100%; margin-top: 14px; font-family: var(--display); font-weight: 400; letter-spacing: .5px; }
input, select { width: 100%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .6px; color: var(--dim); margin: 12px 0 6px; text-transform: uppercase; }
code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px); padding: 14px; }
.panel h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 1.2px; color: var(--accent); display: flex; justify-content: space-between; align-items: center; }
.panel h3 small { color: var(--dim); font-weight: 600; letter-spacing: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row > * { flex: 1; }
.hint { color: var(--dim); font-size: 13px; margin: 6px 0; }
.error { margin-top: 10px; background: rgba(255, 93, 115, .15); border: 1px solid rgba(255, 93, 115, .5); padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.stamp { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: #ffe07a; background: rgba(255, 207, 63, .12); border: 1px dashed rgba(255, 207, 63, .5); padding: 5px 10px; border-radius: 999px; }
.screen { position: relative; z-index: 1; }

/* ---------- WELCOME ---------- */
#welcome { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 48px 20px; min-height: 100vh; }
.logo { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 8vw, 96px); line-height: .92; margin: 18px 0 10px; text-shadow: 0 4px 0 #d23a52, 0 10px 30px rgba(255, 93, 115, .35); }
.logo span { color: var(--accent); text-shadow: 0 4px 0 #a86a00, 0 10px 40px rgba(255, 207, 63, .35); }
.tagline { font-size: 20px; color: #c9d6f2; margin: 0 0 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 20px; }
.chips li { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.entry { padding: 20px; }
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, .25); padding: 5px; border-radius: 12px; }
.tab { flex: 1; background: transparent; color: var(--dim); padding: 9px; font-size: 14px; }
.tab.on { background: rgba(255, 255, 255, .1); color: var(--ink); }
.seats { display: grid; gap: 8px; margin-top: 10px; }
.seat { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; background: rgba(0, 0, 0, .22); padding: 6px 8px; border-radius: 12px; border-left: 4px solid var(--c, #fff); }
.seat .av { font-size: 24px; background: rgba(255,255,255,.08); border-radius: 10px; width: 40px; height: 40px; padding: 0; }
.seat input { padding: 7px 10px; }
.seat .x { background: transparent; color: var(--dim); padding: 6px 10px; }
.seat .tag { font-size: 11px; color: var(--dim); font-weight: 800; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { font-size: 22px; padding: 6px 8px; background: rgba(255,255,255,.06); border: 2px solid transparent; }
.avatars button.on { border-color: var(--accent); background: rgba(255, 207, 63, .15); }
.disclaimer { font-size: 11px; color: var(--dim); text-align: center; margin: 12px 0 0; }
.lobby { max-width: 520px; margin: 10vh auto; text-align: center; }
.lobby .seat { text-align: left; }
.code { font-family: var(--display); letter-spacing: 4px; color: var(--accent); font-weight: 400; }

/* ---------- GAME LAYOUT ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: rgba(8, 15, 28, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tb-left, .tb-right { display: flex; gap: 8px; align-items: center; }
.brand { font-family: var(--display); font-size: 15px; white-space: nowrap; }
.brand b { font-weight: 400; color: var(--accent); }
.pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(255, 207, 63, .15); color: var(--accent); white-space: nowrap; }
.pill.dim { background: rgba(255,255,255,.08); color: var(--dim); }
.icon { background: rgba(255,255,255,.06); padding: 7px 9px; font-size: 16px; border-radius: 10px; }
.icon.on { background: rgba(255, 207, 63, .25); }
.meter-wrap { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 380px; }
.meter-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--dim); white-space: nowrap; }
.meter { flex: 1; height: 12px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, #46e08a, #ffcf3f 55%, #ff5d73); border-radius: 999px; transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.meter-wrap.hot .meter i { animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }
.crisis-banner { position: sticky; top: 52px; z-index: 19; text-align: center; padding: 7px 12px; font-weight: 800; background: repeating-linear-gradient(45deg, #ffcf3f 0 18px, #1a1a1a 18px 36px); color: #fff; text-shadow: 0 2px 4px #000; font-size: 14px; }
.crisis-banner span { background: rgba(0,0,0,.75); padding: 3px 10px; border-radius: 8px; }
.arena { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; padding: 14px; max-width: 1400px; margin: 0 auto; align-items: start; }
.side { display: grid; gap: 12px; position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow: auto; scrollbar-width: thin; }

/* ---------- BOARD ---------- */
.board-col { display: flex; justify-content: center; perspective: 1400px; }
.board-stage { --size: min(calc(100vh - 92px), 100%, 900px); position: relative; width: var(--size); aspect-ratio: 1; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .8, .2, 1); container-type: inline-size; }
.board-stage.tilt { transform: rotateX(32deg) scale(.9) translateY(-4%); }
.board { position: absolute; inset: 0; display: grid; grid-template-columns: 1.55fr repeat(9, 1fr) 1.55fr; grid-template-rows: 1.55fr repeat(9, 1fr) 1.55fr; gap: 2px; padding: 2px; border-radius: 18px; background: radial-gradient(circle at 50% 45%, var(--felt1), var(--felt2)); box-shadow: 0 0 0 6px #1c2a44, 0 0 0 8px #0a1220, 0 30px 70px rgba(0, 0, 0, .6); }
.tile { position: relative; background: var(--tile); color: var(--tile-ink); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2px; cursor: pointer; transition: transform .15s, box-shadow .2s; font-size: max(7px, 1.05cqi); line-height: 1.1; }
.tile:hover { transform: translateY(-2px); z-index: 2; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.tile .bar { position: absolute; background: var(--g); }
.tile.side-b .bar { top: 0; left: 0; right: 0; height: 22%; }
.tile.side-t .bar { bottom: 0; left: 0; right: 0; height: 22%; }
.tile.side-l .bar { right: 0; top: 0; bottom: 0; width: 22%; }
.tile.side-r .bar { left: 0; top: 0; bottom: 0; width: 22%; }
.tile .ic { font-size: max(11px, 2.1cqi); }
.tile .nm { font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .pr { font-weight: 600; opacity: .7; }
.tile.side-b { padding-top: 24%; } .tile.side-t { padding-bottom: 24%; }
.tile.side-l { padding-right: 24%; } .tile.side-r { padding-left: 24%; }
.tile.corner { background: linear-gradient(145deg, #fff6d5, #f2dc9c); font-size: max(8px, 1.15cqi); }
.tile.corner .ic { font-size: max(16px, 3.6cqi); }
.tile.special { background: #ece4f7; }
.tile.special.berita { background: #ffe1e1; }
.tile.special.tax { background: #e9ecef; }
.tile.owned { box-shadow: inset 0 0 0 3px var(--oc); }
.tile .own { position: absolute; top: 2px; right: 2px; width: 30%; max-width: 18px; aspect-ratio: 1; border-radius: 50%; background: var(--oc); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.tile .lv { position: absolute; left: 2px; top: 2px; font-size: max(9px, 1.5cqi); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.tile .st { position: absolute; bottom: 1px; right: 2px; font-size: max(9px, 1.4cqi); }
.tile.mort { filter: grayscale(.9) brightness(.85); }
.tile.target { animation: targetGlow 1s infinite; z-index: 3; }
@keyframes targetGlow { 50% { box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--accent); transform: translateY(-2px); } }
.tile.land { animation: landPop .6s; }
@keyframes landPop { 30% { transform: scale(1.12); box-shadow: 0 0 0 4px #fff, 0 0 30px var(--accent); z-index: 4; } }

.tokens { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.token { position: absolute; left: 0; top: 0; width: 5.2%; aspect-ratio: 1; margin: -2.6% 0 0 -2.6%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--c); border: 2px solid #fff; display: grid; place-items: center; font-size: max(12px, 2.6cqi); box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 8px 16px rgba(0,0,0,.4); transition: transform .14s ease-out; will-change: transform; z-index: 5; }
.token.me::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px dashed var(--c); animation: spin 6s linear infinite; }
.token.active { z-index: 6; }
.token.hop { animation: hop .14s ease-out; }
.token.out { opacity: .25; filter: grayscale(1); }
@keyframes hop { 50% { margin-top: -4.4%; } }
@keyframes spin { to { transform: rotate(360deg); } }
.board-stage.tilt .token { box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 18px 20px rgba(0,0,0,.4); }

/* ---------- HUD (tengah papan) ---------- */
.hud { position: absolute; inset: 14.2%; display: flex; flex-direction: column; gap: 1.6cqi; padding: 2cqi; border-radius: 14px; background: radial-gradient(circle at 50% 0%, rgba(255, 207, 63, .08), transparent 60%), rgba(6, 14, 26, .55); overflow: auto; }
.hud::before { content: 'NEGERI\ANGADI-NGADI'; white-space: pre; position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%) rotate(-8deg); font-family: var(--display); font-size: 9cqi; line-height: .95; text-align: center; color: rgba(255, 207, 63, .06); pointer-events: none; }
.hud > * { position: relative; }
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dice-row { display: flex; gap: 10px; align-items: center; }
.die { --d: clamp(38px, 7.5cqi, 66px); width: var(--d); height: var(--d); flex: none; background: linear-gradient(145deg, #fff, #e3e3ea); border-radius: 22%; box-shadow: inset 0 -4px 0 #c5c5d1, 0 6px 14px rgba(0,0,0,.4); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); padding: calc(var(--d) * .13); }
.die span { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.die i { display: block; width: 72%; height: 72%; flex: none; border-radius: 50%; background: #1b2238; }
.die.red i { background: #e23a52; }
.die.roll { animation: roll .7s cubic-bezier(.3, .7, .4, 1); }
@keyframes roll { 0% { transform: translateY(-40px) rotate(0) scale(.7); } 40% { transform: translateY(6px) rotate(400deg) scale(1.05); } 70% { transform: translateY(-8px) rotate(620deg); } 100% { transform: rotate(720deg); } }
.mood { font-size: clamp(22px, 4.6cqi, 40px); width: clamp(38px, 7.5cqi, 66px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px dashed rgba(255,255,255,.25); }
.mood.pop { animation: moodPop .6s; }
@keyframes moodPop { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } }
.pot { text-align: right; }
.pot span { display: block; font-size: 10px; letter-spacing: 1px; color: var(--dim); font-weight: 800; }
.pot b { font-family: var(--display); font-weight: 400; font-size: clamp(14px, 2.6cqi, 22px); color: var(--good); }
.turn-banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--c, #fff) 30%, transparent), transparent); border-left: 4px solid var(--c, #fff); font-weight: 800; }
.turn-banner .av { font-size: 26px; }
.turn-banner small { display: block; font-weight: 600; color: var(--dim); }
.actions { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.act-title { font-family: var(--display); font-weight: 400; font-size: clamp(15px, 2.6cqi, 22px); margin: 0; }
.act-text { margin: 0; color: #cdd8f0; font-size: 14px; }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; }
.act-row > button { flex: 1 1 auto; }
.act-main { font-size: clamp(16px, 2.8cqi, 22px); padding: 14px; font-family: var(--display); font-weight: 400; letter-spacing: .5px; }
.waiting { color: var(--dim); font-style: italic; text-align: center; padding: 10px; }
.dots::after { content: '…'; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } }
.deed { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: var(--tile); color: var(--tile-ink); border-radius: 12px; padding: 10px 12px; border-top: 10px solid var(--g, #999); }
.deed .ic { font-size: 30px; }
.deed b { display: block; font-size: 15px; }
.deed small { color: #555; }
.price-tag { font-family: var(--display); font-weight: 400; font-size: 20px; }
.price-tag s { opacity: .5; font-size: 14px; margin-right: 6px; }
.auction-box { text-align: center; }
.auction-bid { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 4cqi, 34px); color: var(--accent); }
.timer-bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.timer-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--accent)); }
.bidders { display: grid; gap: 6px; }
.bidder { display: flex; gap: 6px; align-items: center; }
.bidder > span { min-width: 90px; font-weight: 800; font-size: 13px; }
.bidder button { flex: 1; padding: 8px 6px; font-size: 13px; }

/* ---------- SIDEBAR ---------- */
.players { display: grid; gap: 8px; }
.pcard { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.25); border-left: 4px solid var(--c); transition: background .3s, transform .3s; }
.pcard.active { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 28%, transparent), rgba(0,0,0,.2)); transform: translateX(4px); }
.pcard.out { opacity: .4; filter: grayscale(1); }
.pcard .av { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.07); }
.pcard .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .sub { font-size: 11px; color: var(--dim); display: flex; gap: 8px; flex-wrap: wrap; }
.pcard .cash { font-family: var(--display); font-weight: 400; font-size: 15px; text-align: right; }
.pcard .cash.neg { color: var(--bad); }
.pcard .props { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
.pcard .props i { width: 12px; height: 8px; border-radius: 2px; background: var(--g); }
.pcard .props i.m { opacity: .35; }
.pcard.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.04); } }
.hand { display: grid; gap: 8px; }
.jcard { display: grid; grid-template-columns: 34px 1fr; gap: 8px; text-align: left; background: linear-gradient(135deg, #2a1d4d, #1a2547); border: 1px solid rgba(190, 150, 255, .35); padding: 8px 10px; border-radius: 12px; font-weight: 600; }
.jcard .ji { font-size: 24px; }
.jcard b { display: block; font-size: 13px; color: #e6d7ff; }
.jcard small { font-size: 11px; color: #b8b1d6; line-height: 1.3; display: block; }
.jcard.usable { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.jcard.usable:hover { filter: brightness(1.2); }
.empty { color: var(--dim); font-size: 13px; font-style: italic; }
.log { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; font-size: 13px; scrollbar-width: thin; }
.log p { margin: 0; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.04); border-left: 3px solid transparent; }
.log .lg-good { border-color: var(--good); } .log .lg-bad { border-color: var(--bad); }
.log .lg-news { border-color: var(--info); } .log .lg-crisis { border-color: var(--accent); background: rgba(255, 207, 63, .1); font-weight: 800; }
.log .lg-muted { color: var(--dim); } .log .lg-chat { border-color: #c08bff; }
.chat { display: flex; gap: 6px; margin-top: 8px; }
.chat button { padding: 8px 12px; background: rgba(255,255,255,.1); }

/* ---------- OVERLAY ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(3, 7, 15, .7); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); animation: fade .2s; }
.modal-card { position: relative; width: min(640px, 100%); max-height: 88vh; overflow: auto; background: #111d33; border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); animation: rise .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-x { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.08); padding: 6px 10px; }
.modal h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; color: var(--accent); }
.modal h4 { margin: 16px 0 6px; color: var(--accent); }
.modal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.modal td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.modal td:last-child { text-align: right; font-weight: 800; }
.modal tr.cur td { color: var(--accent); }
.rules li { margin-bottom: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px) scale(.96); opacity: 0; } }
.asset { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.04); margin-bottom: 6px; border-left: 4px solid var(--g, #888); }
.asset .btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.asset .btns button { padding: 6px 9px; font-size: 12px; }
.asset small { color: var(--dim); display: block; }
.tradecols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tradecols label.ck { display: flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 600; font-size: 13px; margin: 4px 0; }
.tradecols input[type=checkbox] { width: auto; }

.cardshow { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(3, 7, 15, .55); perspective: 1200px; cursor: pointer; }
.bigcard { width: min(360px, 86vw); aspect-ratio: 5 / 7; border-radius: 22px; position: relative; transform-style: preserve-3d; animation: flipIn .8s cubic-bezier(.2, .9, .3, 1.1) both; }
.bigcard .face { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; padding: 24px; display: flex; flex-direction: column; justify-content: center; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.bigcard .back { background: repeating-linear-gradient(45deg, #ffcf3f 0 14px, #ffb21f 14px 28px); transform: rotateY(180deg); font-family: var(--display); font-size: 40px; color: #6b3f00; display: grid; place-items: center; }
.bigcard .front { background: linear-gradient(160deg, #fff8e6, #f1e2bd); color: #22202b; border: 6px solid #fff; }
.bigcard.berita .front { background: linear-gradient(160deg, #fff, #ffe3e3); border-color: #e23a52; }
.bigcard.nasib .front { background: linear-gradient(160deg, #f7f0ff, #e2d4ff); border-color: #7b4ce0; }
.bigcard.jurus .front { background: linear-gradient(160deg, #2a1d4d, #1a2547); color: #fff; border-color: #c08bff; }
.bigcard.crisis .front { background: repeating-linear-gradient(45deg, #ffcf3f 0 22px, #ffc21a 22px 44px); border-color: #1a1a1a; }
.bigcard .deck { font-family: var(--display); font-size: 15px; letter-spacing: 1px; margin-bottom: 8px; }
.bigcard.berita .deck { color: #e23a52; } .bigcard.nasib .deck { color: #7b4ce0; } .bigcard.jurus .deck { color: #c08bff; }
.bigcard .bi { font-size: 64px; margin: 4px 0 8px; }
.bigcard h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.15; }
.bigcard p { margin: 0; font-size: 16px; }
.bigcard .tap { position: absolute; bottom: 14px; left: 0; right: 0; font-size: 11px; opacity: .55; }
@keyframes flipIn { 0% { transform: translateY(60vh) rotateY(180deg) rotateZ(-20deg) scale(.4); } 60% { transform: translateY(-10px) rotateY(-10deg) scale(1.04); } 100% { transform: none; } }

.meme { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0,0,0,.78); animation: fade .2s; }
.meme-box { width: min(560px, 92vw); background: #000; border-radius: 18px; overflow: hidden; border: 3px solid var(--accent); box-shadow: 0 0 60px rgba(255, 207, 63, .3); }
.meme-box video { width: 100%; display: block; max-height: 60vh; background: #000; }
.meme-cap { padding: 12px 16px; background: #111; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.meme-cap b { font-family: var(--display); font-weight: 400; color: var(--accent); font-size: 18px; display: block; }
.meme-cap small { color: var(--dim); }
.meme .live { position: absolute; top: 12px; left: 12px; background: #e23a52; color: #fff; padding: 3px 8px; font-weight: 800; font-size: 12px; border-radius: 6px; }

.flash { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(255, 207, 63, .25), rgba(0,0,0,.6)); animation: fade .3s; }
.flash-text { font-family: var(--display); font-size: clamp(32px, 7vw, 76px); text-align: center; color: #fff; text-shadow: 0 6px 0 #e23a52, 0 0 40px rgba(255,93,115,.6); animation: slam .5s cubic-bezier(.2, .9, .3, 1.4); padding: 0 16px; }
.flash-text small { display: block; font-family: var(--font); font-size: clamp(14px, 2.2vw, 20px); font-weight: 800; text-shadow: 0 2px 6px #000; margin-top: 10px; }
@keyframes slam { 0% { transform: scale(3); opacity: 0; } }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }

.floats { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.float { position: absolute; font-family: var(--display); font-size: 18px; white-space: nowrap; animation: floatUp 1.5s ease-out forwards; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,.6); transform: translate(-50%, -50%); }
.float.pos { color: var(--good); } .float.neg { color: var(--bad); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -240%) scale(1); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; width: 100%; height: 100%; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px); z-index: 90; background: #1c2a44; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2); max-width: 92vw; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* minigame */
.mg { text-align: center; }
.mg-track { position: relative; height: 46px; border-radius: 12px; background: linear-gradient(90deg, #ff5d73 0%, #ffcf3f 30%, #46e08a 45%, #46e08a 55%, #ffcf3f 70%, #ff5d73 100%); margin: 16px 0; overflow: hidden; border: 2px solid #fff3; }
.mg-needle { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; background: #fff; box-shadow: 0 0 12px #fff, 0 0 0 2px #000; border-radius: 3px; }
.mg-zone { position: absolute; top: 0; bottom: 0; left: 46%; width: 8%; border-left: 2px dashed #04260f; border-right: 2px dashed #04260f; }
.mash { font-size: 30px; padding: 26px; width: 100%; }
.mg-big { font-family: var(--display); font-size: 40px; margin: 8px 0; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 20px 0; }
.podium div { text-align: center; padding: 10px; border-radius: 12px 12px 0 0; background: rgba(255,255,255,.08); min-width: 90px; }
.podium .p1 { height: 170px; background: linear-gradient(180deg, #ffcf3f55, #ffcf3f11); }
.podium .p2 { height: 130px; } .podium .p3 { height: 100px; }
.podium .av { font-size: 38px; }
.settings-grid { display: grid; gap: 10px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: rgba(255,255,255,.06); font-size: 13px; }
.seg button.on { background: rgba(255, 207, 63, .25); color: var(--accent); }

/* ---------- RESPONSIF ---------- */
@media (max-width: 1060px) {
  .arena { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 900px) {
  #welcome { grid-template-columns: 1fr; padding: 28px 16px; gap: 22px; }
  .meter-label, .brand { display: none; }
}
@media (max-width: 720px) {
  .arena { padding: 8px; gap: 10px; }
  .board-col { flex-direction: column; align-items: center; }
  .board-stage { --size: calc(100vw - 16px); }
  body > .hud { position: fixed; inset: auto 0 0 0; z-index: 30; max-height: 52vh; border-radius: 18px 18px 0 0; background: rgba(9, 17, 31, .96); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0,0,0,.5); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  .die { --d: 42px; } .mood { width: 42px; }
  body { padding-bottom: 44vh; }
  .tb-left .pill.dim { display: none; }
  .topbar { padding: 6px 8px; gap: 6px; }
  .tb-right { gap: 4px; }
  .icon { padding: 6px 7px; font-size: 14px; }
  #btnHelp { display: none; }
  .pill { font-size: 10px; padding: 3px 7px; }
  .meter-wrap { gap: 4px; min-width: 50px; }
  .meter-wrap b { font-size: 12px; }
  .toast { bottom: auto; top: 58px; transform: translateX(-50%) translateY(-160px); }
  .toast.show { transform: translateX(-50%) translateY(0); }
  body > .hud { max-height: 46vh; }
  body > .hud::before { display: none; }
  .crisis-banner { top: 50px; font-size: 12px; }
  .tile .nm { display: none; }
  .tile .pr { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
