/*
VOICE: prime-time TV game show — tense, glamorous, a little theatrical.
IDEA: the studio floor: spotlit stage, rows of silver briefcases, two glowing money boards, the banker's call.
PICTURE: the 4×4 wall of briefcases flanked by blue (low) and gold (high) value boards.
COLOUR and TYPE: midnight navy stage, gold for money, silver cases, one hot red for DEAL. Oswald for numbers, Noto Sans TC Black for Chinese.
LAYOUT: board — cases — board on desktop; cases then two-column boards on phones. Modals are studio panels.
*/
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Noto+Sans+TC:wght@500;700;900&display=swap');
:root {
  color-scheme: dark;
  --bg: #04060d; --navy: #0a1430; --navy2: #102257; --panel: #0c1633; --line: rgba(255, 215, 120, .22);
  --fg: #f4f1e8; --muted: #9aa3bd; --gold: #f5c542; --gold2: #b8860b; --gold3: #fff1b8;
  --blue: #2f6bff; --red: #e0262b; --green: #2ecc71;
  --num: 'Oswald', 'Noto Sans TC', Impact, sans-serif;
  --font: 'Noto Sans TC', -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh; overflow-x: clip;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(80, 130, 255, .35), transparent 70%),
    radial-gradient(40% 40% at 10% 0%, rgba(245, 197, 66, .12), transparent 70%),
    radial-gradient(40% 40% at 90% 0%, rgba(245, 197, 66, .12), transparent 70%),
    linear-gradient(180deg, #071029 0%, var(--bg) 55%);
  background-attachment: fixed;
}
body::before { /* stage floor glow */
  content: ""; position: fixed; inset: auto 0 0 0; height: 40vh; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 100% at 50% 100%, rgba(47, 107, 255, .22), transparent 70%);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num, .money { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(4, 8, 22, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1180px; margin: 0 auto; height: 56px; padding: 0 22px; display: flex; align-items: center; gap: 24px; }
.logo { font-weight: 900; font-size: 20px; letter-spacing: .04em; white-space: nowrap; background: linear-gradient(180deg, var(--gold3), var(--gold) 55%, var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: #c9cfe2; white-space: nowrap; font-weight: 500; }
.links a:hover, .links a.on { color: var(--gold); }
.lang { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12px; color: #c9cfe2; cursor: pointer; white-space: nowrap; flex-shrink: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 0 22px 120px; }
.view { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* hero */
.eyebrow { color: var(--gold); font-size: 14px; font-weight: 700; letter-spacing: .12em; }
.hero { text-align: center; padding: 72px 0 40px; position: relative; }
.hero::before { /* spotlight cones */
  content: ""; position: absolute; inset: -40px -10vw 0; z-index: -1; pointer-events: none;
  background: conic-gradient(from 160deg at 18% -10%, transparent 0 8deg, rgba(255, 240, 200, .10) 10deg 22deg, transparent 24deg),
              conic-gradient(from 178deg at 82% -10%, transparent 0 8deg, rgba(255, 240, 200, .10) 10deg 22deg, transparent 24deg);
}
.hero h1 { font-size: clamp(68px, 14vw, 156px); line-height: 1; font-weight: 900; margin: 0; letter-spacing: .02em;
  background: linear-gradient(180deg, #fffbe6 0%, var(--gold) 45%, var(--gold2) 60%, #ffe58a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 40px rgba(245, 197, 66, .35)); }
.hero p { font-size: clamp(18px, 2.2vw, 24px); color: #d7dcf0; margin: 22px auto 0; max-width: 640px; line-height: 1.5; white-space: pre-line; font-weight: 500; }
.deco { display: flex; justify-content: center; gap: clamp(8px, 2vw, 18px); margin: 46px auto 0; max-width: 640px; }
.deco .box { width: clamp(52px, 11vw, 96px); pointer-events: none; }
.deco .box:nth-child(3) { transform: translateY(-10px) scale(1.12); }
h2.big { font-size: clamp(36px, 5vw, 56px); margin: 72px 0 28px; font-weight: 900; letter-spacing: .02em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 28px; font-size: 17px; font-weight: 700; cursor: pointer; transition: transform .15s, filter .2s, opacity .2s;
  background: linear-gradient(180deg, #ffe58a, var(--gold) 50%, var(--gold2)); color: #1a1200; box-shadow: 0 4px 0 #6b4e00, 0 10px 24px rgba(245, 197, 66, .25); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #6b4e00; }
.btn.ghost { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.btn.blue { background: linear-gradient(180deg, #5b8cff, var(--blue) 50%, #1640b8); color: #fff; box-shadow: 0 4px 0 #0b2470, 0 10px 24px rgba(47, 107, 255, .3); }
.btn.gray { background: linear-gradient(180deg, #3a4462, #1d2540); color: #fff; box-shadow: 0 4px 0 #0a0f20; }
.btn.big { padding: 18px 40px; font-size: 22px; }
.btn:disabled { opacity: .4; cursor: default; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.center { justify-content: center; text-align: center; }

/* cards */
.card { background: linear-gradient(180deg, rgba(20, 36, 84, .85), rgba(10, 20, 48, .9)); border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .4); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.mode { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; }
.mode h3 { font-size: 38px; font-weight: 900; margin: 6px 0 12px; }
.mode p { color: #c3cae0; font-size: 17px; line-height: 1.55; margin: 0 0 26px; max-width: 360px; }
.mode .tag { font-family: var(--num); font-size: 15px; letter-spacing: .1em; color: var(--gold); }
.mode.daily { border-color: rgba(245, 197, 66, .55); background: radial-gradient(120% 120% at 100% 0%, rgba(245, 197, 66, .22), transparent 55%), linear-gradient(180deg, rgba(20, 36, 84, .9), rgba(10, 20, 48, .95)); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how .card { padding: 30px; }
.how .n { font-family: var(--num); font-size: 52px; color: var(--gold); line-height: 1; }
.how h4 { font-size: 21px; margin: 12px 0 8px; font-weight: 900; }
.how p { color: #c3cae0; margin: 0; line-height: 1.6; }

/* ===== game floor ===== */
.game { padding-top: 22px; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #c9cfe2; font-size: 15px; font-weight: 700; }
.hud .pips { display: flex; gap: 6px; }
.hud .pip { width: 30px; height: 8px; border-radius: 4px; background: #1d2747; position: relative; }
.hud .pip.peek::after { content: ""; position: absolute; left: 50%; top: -9px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--gold); }
.hud .pip.ok { background: var(--green); } .hud .pip.no { background: var(--red); } .hud .pip.cur { background: #fff; }
.peekchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: rgba(245, 197, 66, .08); color: var(--gold); font-size: 14px; font-weight: 700; border: 1px solid rgba(245, 197, 66, .45); cursor: pointer; white-space: nowrap; }
.peekchip.on { background: var(--gold); color: #1a1200; }
.peekchip:disabled { opacity: .35; cursor: default; }
.hint { text-align: center; font-size: clamp(26px, 4vw, 42px); font-weight: 900; margin: 22px 0 26px; min-height: 1.2em; letter-spacing: .02em; text-shadow: 0 4px 20px rgba(0, 0, 0, .6); }
.hint.peek { color: var(--gold); }
.table { display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px; gap: 28px; align-items: start; }
.board { display: grid; gap: 7px; }
.board .v { padding: 8px 14px; border-radius: 6px; font-family: var(--num); font-size: 17px; font-weight: 600; letter-spacing: .03em; text-align: right; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #4f82ff, #1f4fd6 55%, #12348f); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 8px rgba(47, 107, 255, .25); transition: all .45s; }
.board.hi .v { background: linear-gradient(180deg, #ffe58a, var(--gold) 50%, var(--gold2)); color: #2a1c00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 10px rgba(245, 197, 66, .3); }
.board .v.out { background: #0d1220 !important; color: #39415c !important; box-shadow: none !important; text-decoration: line-through; }
.boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 16px; max-width: 560px; margin: 12px auto 0; width: 100%; }

/* silver briefcase */
.box { aspect-ratio: 1.28 / 1; position: relative; border: 0; padding: 0; cursor: pointer; border-radius: 9px;
  background: linear-gradient(180deg, #fbfcfd 0%, #d9dde3 30%, #a8afba 52%, #c7ccd4 70%, #eef0f3 100%);
  box-shadow: inset 0 0 0 2px #8f97a3, inset 0 -6px 0 rgba(0, 0, 0, .12), 0 10px 22px rgba(0, 0, 0, .55);
  display: grid; place-items: center; transition: transform .15s, box-shadow .25s, filter .25s; }
.box::before { /* handle */
  content: ""; position: absolute; left: 32%; right: 32%; top: -11px; height: 13px; border: 4px solid #7d8590; border-bottom: 0; border-radius: 8px 8px 0 0; }
.box::after { /* latches + seam */
  content: ""; position: absolute; left: 8px; right: 8px; top: 26%; height: 2px; background: rgba(60, 66, 78, .35);
  box-shadow: 14px -5px 0 -0px transparent; }
.box .plate { font-family: var(--num); font-weight: 700; font-size: clamp(18px, 2.8vw, 28px); color: var(--gold); background: #0b0f1a; padding: 2px 12px; border-radius: 6px; min-width: 52%; box-shadow: inset 0 0 0 2px #2a2f3d; line-height: 1.25; }
.box:hover:not(:disabled) { transform: translateY(-4px); filter: brightness(1.05); }
.box:disabled { cursor: default; }
.box.mine { background: linear-gradient(180deg, #fff6cc 0%, #f5c542 35%, #b8860b 55%, #e9b93a 75%, #ffe58a 100%); box-shadow: inset 0 0 0 2px #8a6408, 0 0 0 3px rgba(245, 197, 66, .35), 0 0 34px rgba(245, 197, 66, .55); }
.box.mine::before { border-color: #8a6408; }
.box.mine .lbl { position: absolute; bottom: -22px; left: 0; right: 0; font-size: 12px; font-weight: 900; color: var(--gold); letter-spacing: .08em; }
.box.opened { background: #070b16; box-shadow: inset 0 0 0 2px #1c2440; }
.box.opened::before, .box.opened::after { display: none; }
.box.opened .plate { background: none; box-shadow: none; color: #59627e; font-size: clamp(12px, 1.8vw, 17px); text-decoration: line-through; }
.box.peeked { box-shadow: inset 0 0 0 2px #8f97a3, 0 0 0 3px var(--gold), 0 10px 22px rgba(0, 0, 0, .55); }
.box .pv { position: absolute; bottom: -22px; left: -6px; right: -6px; font-family: var(--num); font-size: 13px; color: var(--gold); white-space: nowrap; }
.box.flip { animation: flip .5s ease; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(80deg); } 100% { transform: rotateX(0); } }
.peekmode .box.closed:not(:disabled) { box-shadow: inset 0 0 0 2px #8f97a3, 0 0 0 3px var(--gold), 0 0 26px rgba(245, 197, 66, .5); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.15); } }
.reveal-pop { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--num); font-size: clamp(64px, 13vw, 140px); font-weight: 700; pointer-events: none; opacity: 0; z-index: 30; text-shadow: 0 8px 0 rgba(0, 0, 0, .5), 0 0 40px currentColor; }
.reveal-pop.on { animation: pop 1.1s ease both; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }
.reveal-pop.good { color: #6ea0ff; } .reveal-pop.bad { color: var(--gold); }

/* ===== studio panels (modals) ===== */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(2, 4, 12, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; padding: 18px; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: min(680px, 100%); text-align: center; max-height: calc(100vh - 36px); overflow: auto; padding: 36px; border-radius: 22px; animation: rise .35s cubic-bezier(.2, .8, .2, 1);
  background: radial-gradient(120% 80% at 50% 0%, #17306f, #0a1430 70%); border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(245, 197, 66, .12), 0 30px 80px rgba(0, 0, 0, .7); }
@keyframes rise { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: clamp(22px, 3.4vw, 32px); line-height: 1.35; margin: 10px 0 24px; font-weight: 900; }
.badge { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #1a1200; background: var(--gold); }
.qtimer { height: 6px; background: #1d2747; border-radius: 6px; overflow: hidden; margin-top: 20px; }
.qtimer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), #fff1b8); transform-origin: left; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; font-size: 18px; font-weight: 700; cursor: pointer; border-radius: 999px; color: #fff;
  background: linear-gradient(180deg, #1d3b8f, #0f2160); border: 2px solid rgba(245, 197, 66, .6); transition: transform .12s, background .2s, opacity .3s; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: 16px; background: var(--gold); color: #1a1200; }
.opt:hover:not(:disabled) { background: linear-gradient(180deg, #2a4fb3, #15307f); }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt:disabled { cursor: default; }
.opt.right { background: linear-gradient(180deg, #27b863, #137a3d); border-color: #b8ffd3; }
.opt.wrong { background: linear-gradient(180deg, #e0262b, #8f1115); border-color: #ffc2c2; }
.opt.dim { opacity: .35; }
.verdict { font-size: 30px; font-weight: 900; margin-top: 22px; }
.verdict.ok { color: #5cf09a; } .verdict.no { color: #ff6b6b; }
.effect { color: #d7dcf0; margin: 8px 0 22px; line-height: 1.6; }
.banker { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #2a3a6b, #0a1430); border: 2px solid var(--gold); display: grid; place-items: center; overflow: hidden; animation: ring .8s ease-in-out 2; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }
.led { margin: 16px auto 6px; padding: 14px 22px; border-radius: 12px; background: #020409; box-shadow: inset 0 0 0 2px #1d2747, inset 0 0 30px rgba(245, 197, 66, .12); display: inline-block; min-width: 70%; }
.offer { font-family: var(--num); font-size: clamp(52px, 11vw, 104px); font-weight: 700; line-height: 1; letter-spacing: .02em; color: var(--gold); text-shadow: 0 0 18px rgba(245, 197, 66, .6); }
.withbonus { color: #ffe58a; font-size: 15px; margin-top: 8px; font-weight: 700; }
.prev { color: var(--muted); font-size: 14px; margin: 10px 0 26px; font-family: var(--num); letter-spacing: .03em; }
.dealbtn { width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; font-size: 30px; font-weight: 900; color: #fff; letter-spacing: .06em;
  background: radial-gradient(circle at 50% 35%, #ff6b6b, var(--red) 45%, #7a0a0d 100%);
  box-shadow: 0 0 0 8px #c9ced6, 0 0 0 12px #6f7682, 0 10px 0 12px #3d434e, 0 26px 40px rgba(224, 38, 43, .45); transition: transform .12s, filter .2s; }
.dealbtn:hover { filter: brightness(1.1); }
.dealbtn:active { transform: translateY(4px); }
.deal-row { display: flex; align-items: center; justify-content: center; gap: 44px; flex-wrap: wrap; margin-top: 18px; }
.final-cases { display: flex; justify-content: center; gap: 36px; margin: 16px 0 6px; flex-wrap: wrap; }
.final-cases button { background: none; border: 0; cursor: pointer; color: var(--fg); font-weight: 900; font-size: 17px; display: grid; gap: 18px; justify-items: center; }
.final-cases .box { width: 150px; pointer-events: none; }
.final-cases button:hover .box { transform: translateY(-4px); }

/* results */
.result { text-align: center; padding: 64px 0 40px; }
.result .score { font-family: var(--num); font-size: clamp(76px, 16vw, 176px); font-weight: 700; line-height: 1; margin-top: 10px; color: var(--gold);
  text-shadow: 0 8px 0 rgba(0, 0, 0, .55), 0 0 60px rgba(245, 197, 66, .45); }
.result .of { color: #d7dcf0; font-size: 18px; margin-top: 18px; line-height: 1.7; }
.result .of b { color: var(--gold); font-family: var(--num); font-weight: 600; }
.result .squares { font-size: 26px; letter-spacing: 4px; margin: 24px 0 32px; }
.reveal-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; max-width: 760px; margin: 40px auto 0; }
.reveal-grid div { background: #0b1430; border: 1px solid #1d2747; border-radius: 8px; padding: 10px 4px; font-family: var(--num); font-size: 14px; color: #c9cfe2; }
.reveal-grid div b { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.reveal-grid div.me { background: linear-gradient(180deg, #ffe58a, var(--gold2)); color: #1a1200; border-color: var(--gold); }
.reveal-grid div.me b { color: #4a3600; }

/* tables */
.tabs { display: inline-flex; background: #0b1430; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.tabs button { background: none; border: 0; padding: 8px 18px; border-radius: 999px; font-size: 14px; color: var(--muted); cursor: pointer; font-weight: 700; }
.tabs button.on { background: var(--gold); color: #1a1200; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 16px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 17px; }
th.num, td.num { text-align: right; } td.num { font-family: var(--num); font-size: 18px; }
tr.me td { color: var(--gold); }
td.rank { width: 56px; color: var(--muted); font-family: var(--num); }
tbody tr:nth-child(-n+3) td.rank { color: var(--gold); font-weight: 700; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* forms */
.field { display: block; margin-bottom: 16px; text-align: left; }
.field span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.input { width: 100%; background: #070d1f; border: 1px solid #24305a; border-radius: 10px; padding: 13px 15px; font-size: 16px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--gold); }
.input.ok { border-color: rgba(46, 204, 113, .6); }
.auth { max-width: 440px; margin: 80px auto; text-align: center; }
.auth h2 { font-size: 44px; font-weight: 900; margin: 0 0 10px; }
.auth p { color: var(--muted); margin: 0 0 30px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 32px 0; }
.stat { background: linear-gradient(180deg, rgba(20, 36, 84, .85), rgba(10, 20, 48, .9)); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.stat b { display: block; font-family: var(--num); font-size: 34px; color: var(--gold); font-weight: 600; }
.stat span { color: var(--muted); font-size: 14px; }

/* admin */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qrow { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.qrow .c { color: var(--muted); font-size: 13px; }
.qrow .q small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.qrow .q small b { color: #5cf09a; font-weight: 500; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid #24305a; background: none; cursor: pointer; }
.chip.on { border-color: var(--green); color: var(--green); }
.chip.danger { color: #ff6b6b; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); background: #0b1430; border: 1px solid var(--gold); padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: .3s; z-index: 40; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 30px; height: 30px; border: 3px solid #1d2747; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 120px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 900px) {
  .table { grid-template-columns: 1fr 1fr; gap: 18px; }
  .table .boxes { grid-column: 1 / -1; grid-row: 1; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .board .v { padding: 6px 6px; font-size: 14px; text-align: center; }
  .how { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-inner { gap: 12px; padding: 0 14px; }
  .logo { font-size: 18px; }
  .links { gap: 12px; font-size: 13px; }
  main { padding: 0 14px 100px; }
  .card { padding: 26px; }
  .boxes { gap: 30px 9px; }
  .box::before { top: -9px; height: 10px; border-width: 3px; }
  .box .plate { padding: 1px 6px; }
  .box .pv, .box.mine .lbl { font-size: 11px; bottom: -19px; }
  .hud { font-size: 13px; gap: 8px; }
  .hud .pip { width: 14px; }
  .peekchip { padding: 5px 10px; font-size: 13px; }
  .hint { margin: 16px 0 18px; }
  .sheet { padding: 26px 18px; }
  .opts { grid-template-columns: 1fr; }
  .opt { font-size: 17px; padding: 12px 14px; }
  .dealbtn { width: 120px; height: 120px; font-size: 26px; }
  .deal-row { gap: 30px; }
  .final-cases .box { width: 112px; }
  .hero { padding: 52px 0 30px; }
  .grid2 { grid-template-columns: 1fr; }
  .qrow { grid-template-columns: 1fr; gap: 8px; }
  .reveal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== classic 26-case layout ===== */
.boxes.classic { grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 720px; gap: 26px 12px; }
.boxes.classic .box .plate { font-size: clamp(15px, 2.2vw, 24px); }
.boxes.classic .box.opened .plate { font-size: clamp(10px, 1.3vw, 14px); }
.table { grid-template-columns: 150px minmax(0, 1fr) 150px; }
.board { gap: 5px; } .board .v { padding: 5px 12px; font-size: 15px; }
.hud .num { font-family: var(--num); color: var(--gold); white-space: nowrap; }
h3.sect { font-size: 22px; font-weight: 900; margin: 48px 0 14px; }
.offerbars { max-width: 640px; margin: 0 auto; display: grid; gap: 8px; }
.ob { display: grid; grid-template-columns: 28px minmax(0, 1fr) 110px; gap: 10px; align-items: center; font-family: var(--num); }
.ob span { color: var(--muted); text-align: right; }
.ob i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #1f4fd6, #4f82ff); }
.ob b { text-align: right; font-weight: 600; color: #d7dcf0; }
.ob.taken i { background: linear-gradient(90deg, var(--gold2), var(--gold)); box-shadow: 0 0 14px rgba(245,197,66,.5); }
.ob.taken b { color: var(--gold); }

/* ===== Deal (green) / No deal (red): identical size ===== */
.choice { width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; font-size: 28px; font-weight: 900; color: #fff; letter-spacing: .04em;
  box-shadow: 0 0 0 8px #c9ced6, 0 0 0 12px #6f7682, 0 10px 0 12px #3d434e, 0 26px 40px rgba(0,0,0,.45); transition: transform .12s, filter .2s; }
.choice.deal { background: radial-gradient(circle at 50% 35%, #7dffb0, #1fbf5f 45%, #0a6b30 100%); box-shadow: 0 0 0 8px #c9ced6, 0 0 0 12px #6f7682, 0 10px 0 12px #3d434e, 0 26px 40px rgba(31,191,95,.45); }
.choice.nodeal { background: radial-gradient(circle at 50% 35%, #ff7b7b, var(--red) 45%, #7a0a0d 100%); box-shadow: 0 0 0 8px #c9ced6, 0 0 0 12px #6f7682, 0 10px 0 12px #3d434e, 0 26px 40px rgba(224,38,43,.45); }
.choice:hover { filter: brightness(1.1); }
.choice:active { transform: translateY(4px); }
.deal-row { gap: 56px; }

/* ===== auth, quota ===== */
.linkbtn { background: none; border: 0; color: #c9cfe2; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--gold); }
.auth.card { max-width: 460px; margin: 64px auto; text-align: left; padding: 36px; }
.auth.card h2 { text-align: center; } .auth.card > p { text-align: center; line-height: 1.6; }
.authfoot { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.authfoot a, .note a { color: var(--gold); }
.quota { margin: 34px auto 0; display: grid; gap: 6px; justify-items: center; }
.quota b { font-family: var(--num); font-size: 22px; color: var(--gold); letter-spacing: .02em; }
.quota span { color: var(--muted); font-size: 14px; }
.quota-line { flex-basis: 100%; color: var(--muted); font-size: 14px; margin-top: 4px; }
.note { color: var(--muted); font-size: 14px; margin: -8px 0 18px; }

@media (max-width: 900px) { .table { grid-template-columns: 1fr 1fr; } .board .v { font-size: 13px; padding: 5px 4px; } }
@media (max-width: 600px) {
  .boxes.classic { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 7px; }
  .boxes.classic .box .plate { font-size: 16px; padding: 1px 4px; }
  .boxes.classic .box.opened .plate { font-size: 10px; }
  .box.mine .lbl { font-size: 10px; }
  .ob { grid-template-columns: 22px minmax(0, 1fr) 92px; }
  .choice { width: 118px; height: 118px; font-size: 24px; }
  .deal-row { gap: 34px; }
  .auth.card { padding: 26px 20px; margin: 36px auto; }
  .links { gap: 10px; font-size: 12px; } .linkbtn { font-size: 12px; }
}

.guest { color: #c3cae0; font-style: italic; }

/* ===== sign-in pop-up ===== */
.authbtn { background: linear-gradient(180deg, #ffe58a, var(--gold) 50%, var(--gold2)); color: #1a1200; border: 0; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.authbtn:hover { filter: brightness(1.08); }
.sheet { position: relative; }
.sheet.auth-sheet { width: min(440px, 100%); text-align: left; padding: 30px 30px 26px; }
.authtabs { display: flex; width: 100%; margin: 30px 0 14px; }
.authtabs button { flex: 1; font-size: 16px; padding: 10px; }
.authsub { color: #c3cae0; font-size: 14px; line-height: 1.6; margin: 0 0 18px; text-align: center; }
.autherr { color: #ff8a8a; font-size: 14px; min-height: 20px; margin: -4px 0 12px; }
.xclose { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.xclose:hover { background: rgba(255,255,255,.16); }
.modal[data-closable="1"] { cursor: pointer; } .modal[data-closable="1"] .sheet { cursor: default; }
@media (max-width: 600px) { .authbtn { padding: 6px 11px; font-size: 12px; } .sheet.auth-sheet { padding: 26px 18px 20px; } }

#board { scroll-margin-top: 70px; }
#board .tabs { margin-bottom: 14px; }
@media (max-width: 600px) { #lb td, #lb th { white-space: nowrap; padding: 13px 6px; font-size: 14px; } #lb td.num { font-size: 15px; } #lb td.rank { width: 30px; } }
