:root{
  --bg:#101014; --bg2:#17171f; --panel:#1d1d27; --line:#2c2c3a;
  --text:#f2f0e9; --muted:#9a97a8; --gold:#ffc53d; --gold2:#ff9f1c;
  --red:#ff4757; --green:#2ed573;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; padding:0; background:var(--bg); color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif; overflow-x:hidden;}
body.danger{ background:#180d10; }
#game{ position:relative; max-width:480px; margin:0 auto; min-height:100dvh;
  display:flex; flex-direction:column; padding:18px 20px 22px; overflow:hidden;}
header{ display:flex; justify-content:space-between; align-items:center; }
header h1{ font-size:21px; letter-spacing:.28em; margin:0; font-weight:800; }
#mute{ background:none; border:0; font-size:19px; cursor:pointer; padding:6px; }
#modeTag{ text-align:center; color:var(--muted); font-size:11px; letter-spacing:.24em; margin:8px 0 4px; }
#dots{ display:flex; gap:8px; justify-content:center; margin:4px 0 10px; }
.dot{ width:9px; height:9px; border-radius:50%; background:#33333f; }
.dot.now{ background:var(--gold); box-shadow:0 0 8px var(--gold); }
.dot.done{ background:#5a5a6a; }
#machine{ background:linear-gradient(180deg,var(--bg2),var(--panel)); border:1px solid var(--line);
  border-radius:22px; padding:22px 20px 18px; text-align:center; position:relative;
  box-shadow:0 18px 40px rgba(0,0,0,.45); }
body.danger #machine{ border-color:#5a2330; box-shadow:0 0 34px rgba(255,71,87,.22), 0 18px 40px rgba(0,0,0,.45); }
#reels{ display:flex; gap:10px; justify-content:center; margin-bottom:8px; }
#reels span{ width:46px; height:56px; border-radius:10px; background:#0c0c11; border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:800; color:var(--gold); }
#reels span.bad{ color:var(--red); }
#pot{ font-size:76px; font-weight:900; line-height:1.05; letter-spacing:.01em; color:var(--gold);
  font-variant-numeric:tabular-nums; text-shadow:0 4px 26px rgba(255,197,61,.25); }
#pot.zero{ color:var(--red); text-shadow:none; }
#pressCount{ font-size:13px; letter-spacing:.3em; color:var(--muted); margin:2px 0 14px; font-variant-numeric:tabular-nums; }
.risk-head{ display:flex; justify-content:space-between; font-size:11px; letter-spacing:.18em; color:var(--muted); }
.risk-head b{ color:var(--text); font-size:12px; }
#riskBar{ height:10px; border-radius:99px; background:#0c0c11; border:1px solid var(--line); overflow:hidden; margin:6px 0 10px; }
#riskFill{ height:100%; width:3%; border-radius:99px; background:linear-gradient(90deg,var(--gold),var(--gold2),var(--red)); transition:width .35s ease; }
#survLine{ font-size:12.5px; color:var(--muted); min-height:16px; margin:0 0 2px; }
#message{ font-size:16px; font-weight:700; min-height:22px; margin:4px 0 0; }
#controls{ display:flex; flex-direction:column; gap:12px; margin-top:18px; }
#pressBtn{ border:0; border-radius:18px; padding:20px 12px 16px; cursor:pointer;
  background:linear-gradient(180deg,var(--gold),var(--gold2)); color:#231600;
  font-size:30px; font-weight:900; letter-spacing:.24em;
  box-shadow:0 10px 26px rgba(255,159,28,.35); }
#pressBtn small{ display:block; font-size:12px; letter-spacing:.3em; font-weight:700; opacity:.8; margin-top:2px; }
#pressBtn:active{ transform:scale(.985); }
#pressBtn:disabled{ filter:grayscale(.7) brightness(.6); cursor:default; box-shadow:none; }
#cashBtn{ border:1px solid var(--green); border-radius:18px; padding:15px 12px; cursor:pointer;
  background:rgba(46,213,115,.1); color:var(--green); font-size:18px; font-weight:800; letter-spacing:.18em; }
#cashBtn:disabled{ filter:grayscale(.7) brightness(.6); cursor:default; }
#settlement{ margin-top:18px; background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:20px; text-align:center; }
#settleTitle{ margin:0 0 8px; font-size:27px; font-weight:900; letter-spacing:.06em; }
#settleTitle.win{ color:var(--green); }
#settleTitle.lose{ color:var(--red); }
#settleLine{ margin:0 0 6px; font-size:15px; line-height:1.5; }
#settleSub{ margin:0 0 14px; font-size:12.5px; color:var(--muted); line-height:1.5; }
#shareCard{ white-space:pre-wrap; word-break:break-word; text-align:left; background:#0c0c11;
  border:1px dashed var(--line); border-radius:12px; padding:12px 14px; font-size:13px; line-height:1.55; margin:0 0 14px; }
#settlement .row{ display:flex; gap:9px; justify-content:center; flex-wrap:wrap; }
#settlement .row button{ border-radius:12px; padding:11px 14px; cursor:pointer; font-weight:800; letter-spacing:.08em; font-size:13px;
  background:#262633; color:var(--text); border:1px solid var(--line); }
#nextBtn{ background:linear-gradient(180deg,var(--gold),var(--gold2)) !important; color:#231600 !important; border:0 !important; }
#copied{ font-size:12px; color:var(--green); min-height:15px; margin:10px 0 0; }
#stats{ margin-top:auto; padding-top:18px; text-align:center; font-size:11.5px; letter-spacing:.14em; color:var(--muted); font-variant-numeric:tabular-nums; }
#card{ position:absolute; inset:0; background:rgba(10,10,14,.9); display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center; padding:30px; z-index:5; }
#card[hidden]{ display:none; }
#card-title{ font-size:40px; font-weight:900; letter-spacing:.18em; margin:0 0 12px; color:var(--gold); }
#card-sub{ color:var(--muted); line-height:1.7; font-size:14.5px; margin:0 0 26px; }
#start{ border:0; border-radius:16px; padding:16px 34px; cursor:pointer; font-size:17px; font-weight:900; letter-spacing:.2em;
  background:linear-gradient(180deg,var(--gold),var(--gold2)); color:#231600; box-shadow:0 10px 26px rgba(255,159,28,.35); }
#coinLayer{ position:fixed; inset:0; pointer-events:none; z-index:9; }
.coin{ position:fixed; width:16px; height:16px; border-radius:50%; pointer-events:none;
  background:radial-gradient(circle at 35% 35%, #ffe9a8, var(--gold) 60%, var(--gold2)); }
