:root { --red: #b8102c; --gold: #ffd23f; --pink: #ff6fa8; --cream: #fff3d6; --ink: #1a0a14; --bg: #0e0716; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; -webkit-text-size-adjust: 100%; }
#wrap { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s; mix-blend-mode: screen; }
#flash.on { opacity: 0.35; transition: none; }

/* HUD */
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 0; pointer-events: none; z-index: 5; transition: opacity 0.2s; }
#hud.dim { opacity: 0.25; }
#hud .stat { background: rgba(20, 8, 20, 0.72); border: 1px solid rgba(255, 210, 63, 0.35); border-radius: 12px; padding: 6px 12px; min-width: 88px; backdrop-filter: blur(6px); }
#hud .stat small { display: block; font-size: 10px; letter-spacing: 2px; color: var(--gold); font-weight: 800; }
#hud .stat b { display: block; font-family: "Baloo 2", sans-serif; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
#hBadges { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; flex: 1; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 5px 9px; border-radius: 999px; background: #333; color: #fff; }
.badge.pink { background: var(--pink); color: var(--ink); } .badge.orange { background: #ff8c3a; color: var(--ink); } .badge.green { background: #8bff6a; color: var(--ink); } .badge.grey { background: rgba(255,255,255,0.15); }
#hud .tools { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.ico { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(20, 8, 20, 0.72); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(6px); }
.ico:hover { background: rgba(255, 255, 255, 0.15); }

/* knoppen */
.btn { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 18px; padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer; color: var(--ink); background: var(--gold); box-shadow: 0 4px 0 #a67c00, 0 10px 24px rgba(0, 0, 0, 0.35); transition: transform 0.08s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a67c00; }
.btn.primary { background: linear-gradient(180deg, #ffd23f, #ffb020); font-size: 22px; padding: 14px 30px; }
.btn.ghost { background: transparent; color: var(--cream); border: 2px solid rgba(255, 243, 214, 0.4); box-shadow: none; }
.btn.small { font-size: 15px; padding: 9px 16px; }
.btn.bank { pointer-events: auto; background: linear-gradient(180deg, #8bff6a, #3fc25a); font-size: 15px; padding: 10px 16px; box-shadow: 0 3px 0 #1f7a33; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* overlays */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 20%, rgba(184, 16, 44, 0.45), rgba(8, 3, 14, 0.85) 70%); backdrop-filter: blur(5px); z-index: 10; overflow: auto; }
.overlay.hidden { display: none; }
.panel { width: min(560px, 100%); max-height: 100%; overflow: auto; text-align: center; background: rgba(26, 10, 20, 0.92); border: 2px solid rgba(255, 210, 63, 0.5); border-radius: 22px; padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 6px rgba(184, 16, 44, 0.35); }
.panel.wide { width: min(880px, 100%); text-align: left; }
.kicker { margin: 0; font-size: 12px; letter-spacing: 6px; color: var(--gold); font-weight: 800; }
.logo { margin: 4px 0 8px; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(30px, 7vw, 46px); line-height: 1; letter-spacing: 0.04em; color: var(--gold); text-shadow: 0 3px 0 #7a0d45, 0 0 24px rgba(255, 210, 63, 0.45); }
.logo span { display: block; font-size: clamp(46px, 11vw, 78px); letter-spacing: 0.06em; color: var(--cream); text-shadow: 0 4px 0 #7a0d45, 0 0 28px rgba(255, 110, 168, 0.65); margin-top: 4px; }
.sub { margin: 0 auto 14px; max-width: 460px; font-size: 15px; line-height: 1.5; color: #f3dfe6; }
.sub.small { font-size: 13.5px; }
.howto { text-align: left; display: grid; gap: 7px; margin: 0 auto 14px; max-width: 480px; }
.ht { font-size: 13.5px; line-height: 1.45; background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 8px 10px; }
.ht b:first-child { color: var(--gold); margin-right: 4px; }
.kbd { display: inline-block; font: 700 11px/1.6 system-ui; padding: 0 6px; border: 1px solid rgba(255, 255, 255, 0.45); border-bottom-width: 2px; border-radius: 5px; margin: 0 2px; }
.note { font-size: 13px; color: #ffd7a8; margin: 0 0 12px; }
.best { margin: 10px 0 0; font-size: 13px; color: #f3c9d6; }
.foot { margin: 14px 0 0; font-size: 12px; } .foot a { color: var(--gold); text-decoration: none; }
.panel .btn + .btn { margin-left: 8px; }

/* prijzenkast */
.shop-head { display: flex; align-items: center; gap: 12px; }
.shop-head h2 { margin: 0; font-family: "Baloo 2", sans-serif; font-size: 28px; flex: 1; }
.shop-head .spaar { font-weight: 800; color: var(--gold); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.prize { display: grid; grid-template-columns: 52px 1fr; gap: 6px 10px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.prize.is-can { border-color: rgba(255, 210, 63, 0.6); background: rgba(255, 210, 63, 0.08); }
.prize.is-owned { opacity: 0.85; border-color: rgba(139, 255, 106, 0.5); }
.p-icon { font-size: 34px; text-align: center; grid-row: span 2; }
.p-body b { display: block; font-size: 15px; } .p-body small { display: block; font-size: 12px; color: #e6cfd8; line-height: 1.35; } .p-body em { color: var(--gold); font-style: normal; }
.p-act { display: flex; align-items: center; justify-content: space-between; gap: 8px; grid-column: 2; }
.price { font-weight: 800; font-size: 13px; color: var(--gold); } .owned { color: #8bff6a; font-weight: 800; font-size: 13px; } .need { font-size: 12px; color: #c9a9b8; }

/* resultaat */
.score small { display: block; font-size: 11px; letter-spacing: 3px; color: var(--gold); font-weight: 800; }
.score b { display: block; font-family: "Baloo 2", sans-serif; font-size: 56px; line-height: 1; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 14px auto; max-width: 420px; text-align: left; font-size: 13.5px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255, 255, 255, 0.15); padding: 4px 0; }
.submit { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.submit input { flex: 1; max-width: 200px; font: 700 15px "Nunito", sans-serif; padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: #fff; }
.rank { list-style: none; margin: 8px auto 12px; padding: 0; max-width: 360px; text-align: left; font-size: 13.5px; }
.rank li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 4px 8px; border-radius: 8px; }
.rank li.me { background: rgba(255, 210, 63, 0.18); } .rank em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--gold); }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* melding */
.toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -10px); padding: 10px 18px; border-radius: 999px; background: rgba(20, 8, 20, 0.85); border: 1px solid rgba(255, 255, 255, 0.25); font-weight: 800; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 6; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.card { background: linear-gradient(180deg, #ff6fa8, #b8125f); border-color: #ffd23f; }
.toast.jackpot { background: linear-gradient(180deg, #ffd23f, #ff8c3a); color: var(--ink); font-size: 20px; }
.toast.bad { background: rgba(60, 20, 30, 0.9); }

@media (max-width: 640px) {
  #hud { flex-wrap: wrap; row-gap: 6px; } #hud .tools { flex-basis: 100%; }
  #hud .stat { min-width: 70px; padding: 5px 9px; } #hud .stat b { font-size: 19px; }
  #hud .tools { gap: 6px; } .ico { width: 36px; height: 36px; font-size: 15px; }
  .btn.bank { font-size: 13px; padding: 8px 12px; }
  .howto { gap: 5px; } .ht { font-size: 12.5px; }
  .panel { padding: 16px 14px 14px; } .panel .btn + .btn { margin-left: 0; margin-top: 8px; }
  .stats { grid-template-columns: 1fr; }
}

/* tafelkeuze en tafelnavigatie */
.nav { display: flex; align-items: center; gap: 6px; }
.nav .lbl { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 92px; height: 42px; padding: 0 12px; border-radius: 21px; border: 1px solid rgba(255, 210, 63, 0.45); background: rgba(20, 8, 20, 0.72); color: #fff; cursor: pointer; backdrop-filter: blur(6px); font: 800 14px "Baloo 2", sans-serif; line-height: 1; }
.nav .lbl small { font: 700 9px "Nunito", sans-serif; letter-spacing: 1.5px; color: var(--gold); margin-top: 2px; }
.nav .lbl.on { background: rgba(255, 210, 63, 0.22); }
.nav.hidden { display: none; }
.choose { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(620px, calc(100% - 24px)); text-align: center; background: rgba(20, 8, 20, 0.82); border: 1px solid rgba(255, 210, 63, 0.45); border-radius: 18px; padding: 10px 14px 12px; backdrop-filter: blur(6px); z-index: 6; }
.choose.hidden { display: none; }
.choose p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; color: #f3dfe6; } .choose p b { color: var(--gold); }
.tbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tbtns .btn { position: relative; }
.tbtns .btn.busy::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff2a2a; box-shadow: 0 0 8px #ff2a2a; }
.tbtns .btn.here { outline: 3px solid #8bff6a; }

/* ranglijst en rangen */
.rank-line { line-height: 1.6; } .rank-line .rk { font-weight: 800; color: var(--gold); font-size: 15px; }
.rank-line small { color: #f3c9d6; }
.progress { display: block; height: 6px; margin: 6px auto 0; max-width: 260px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress b { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff8c3a); }
.tabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 4px; }
.tabbtn { font: 800 13px "Nunito", sans-serif; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: var(--cream); cursor: pointer; }
.tabbtn.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.rank li small { font-size: 12px; margin-left: 4px; }
.ladder-h { margin: 12px 0 4px; font-family: "Baloo 2", sans-serif; font-size: 16px; color: var(--gold); }
.ladder { list-style: none; margin: 0 auto; padding: 0; max-width: 360px; text-align: left; font-size: 12.5px; }
.ladder li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 3px 8px; border-radius: 8px; color: #e6cfd8; }
.ladder li.on { background: rgba(255, 210, 63, 0.18); color: #fff; } .ladder em { font-style: normal; color: var(--gold); }
@media (max-width: 640px) { .nav .lbl { min-width: 74px; height: 36px; font-size: 12px; } .choose p { font-size: 12.5px; } .tbtns .btn { font-size: 13px; padding: 8px 12px; } }
