/* Fonts are served from our own site, not Google (see the privacy statement). Licences: fonts/OFL-*.txt */
@font-face{font-family:"Bebas Neue";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/bebas-neue-latin-ext.woff2?v=16c95ce45a) format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"Bebas Neue";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/bebas-neue-latin.woff2?v=a7c90c8924) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"Inter";font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/inter-latin-ext.woff2?v=34b9c504ca) format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"Inter";font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/inter-latin.woff2?v=3100e775e8) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"Noto Serif SC";font-style:normal;font-weight:700;font-display:swap;src:url(fonts/noto-serif-sc-700-subset.woff2?v=d19fcbc801) format("woff2")}
/* Macao Lucky Eight · neon casino night: lacquer red, black, gold */
:root{
  --bg:#0c0306; --bg2:#1c060c; --card:rgba(40,8,16,.72); --line:rgba(245,196,81,.22);
  --text:#f7ead7; --muted:#c9a98f; --red:#ff2a4d; --red-deep:#b3122e; --gold:#f5c451; --gold-deep:#b8862b;
  --jade:#3fd39a; --ivory:#f6efdf; --bad:#ff7a85;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  min-height:100vh; color:var(--text); font:15px/1.45 Inter,system-ui,sans-serif;
  background:
    radial-gradient(ellipse 80% 45% at 50% -5%, rgba(255,42,77,.32), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(245,196,81,.10), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(245,196,81,.035) 46px 47px),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  background-attachment:fixed;
}
/* background: red with gold waves (vector, crops to any screen), fixed behind every screen */
.bgart{position:fixed; inset:0; z-index:-1; pointer-events:none; background:#4e0810 url(art/bg/bg.svg?v=6a3cc69482) center/cover no-repeat}
.bgart::after{content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(12,3,6,.05), rgba(12,3,6,.25))}
.wrap{max-width:520px; margin:0 auto; padding:18px 16px 28px}
.screen{display:none}
.screen.active{display:block; animation:fadein .35s ease}
@keyframes fadein{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}

/* ---------- title ---------- */
.title{text-align:center; margin:6px 0 18px; position:relative}
/* hanging lanterns at the top corners of the title frame */
.lanterns{position:absolute; left:10px; right:10px; top:-8px; display:flex; justify-content:space-between; pointer-events:none}
.lanterns svg{width:46px; height:95px; transform-origin:50% 0; filter:drop-shadow(0 0 10px rgba(255,59,79,.65)) drop-shadow(0 0 22px rgba(255,140,60,.25))}
@media (prefers-reduced-motion:no-preference){
  .lanterns svg{animation:sway 4.5s ease-in-out infinite}
  .lanterns svg + svg{animation-duration:5.2s; animation-delay:-1.3s}
}
@keyframes sway{0%,100%{transform:rotate(3deg)}50%{transform:rotate(-3deg)}}
.eyebrow{font-family:"Noto Serif SC",serif; color:var(--gold); letter-spacing:.3em; font-size:14px; opacity:.85}
h1{margin:4px 0 2px; font-family:"Bebas Neue",Impact,sans-serif; font-weight:400; line-height:.9; letter-spacing:.04em}
h1 .neon{display:block; font-size:62px; color:#ffe3e8;
  text-shadow:0 0 4px #fff, 0 0 12px var(--red), 0 0 26px var(--red), 0 0 48px rgba(255,42,77,.6)}
h1 .neon.gold{font-size:44px; color:#fff6d8;
  text-shadow:0 0 4px #fff, 0 0 12px var(--gold), 0 0 28px var(--gold-deep)}
@media (prefers-reduced-motion:no-preference){ h1 .neon:first-child{animation:flicker 7s infinite} }
@keyframes flicker{0%,92%,100%{opacity:1}93%{opacity:.55}94%{opacity:1}96%{opacity:.7}97%{opacity:1}}

/* ---------- cards, setup ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin-top:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
.label{font-size:11px; text-transform:uppercase; letter-spacing:.16em; color:var(--gold); margin-bottom:10px}
.prow{display:flex; gap:8px; margin-bottom:8px}
.prow input{flex:1; min-width:0; background:rgba(0,0,0,.35); border:1px solid var(--line); color:var(--text); border-radius:10px; padding:10px 12px; font:inherit}
.prow input:disabled{opacity:.6}
.kind{border:1px solid var(--line); background:transparent; color:var(--text); border-radius:10px; padding:0 12px; font:600 13px Inter,sans-serif; cursor:pointer}
.kind.cpu{color:var(--gold); border-color:var(--gold-deep)}
.rm{border:0; background:transparent; color:var(--muted); font-size:22px; padding:0 6px; cursor:pointer}
.addp{width:100%; border:1px dashed var(--line); background:transparent; color:var(--muted); border-radius:10px; padding:10px; font:inherit; cursor:pointer}
.seg{display:flex; gap:6px}
.seg button{flex:1; border:1px solid var(--line); background:rgba(0,0,0,.3); color:var(--muted); border-radius:10px; padding:10px 6px; font:600 14px Inter,sans-serif; cursor:pointer}
.seg button.on{color:#1b0a04; background:linear-gradient(180deg,#ffe08a,var(--gold)); border-color:var(--gold)}
.seg.mini{margin:-2px 0 10px} .seg.mini button{padding:6px; font-size:12px}
.rules{margin-top:16px; color:var(--muted); font-size:14px}
.rules summary{cursor:pointer; color:var(--gold); text-align:center; letter-spacing:.12em; text-transform:uppercase; font-size:12px}
.rules .body{margin-top:10px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 14px}
.rules ul{margin:6px 0 8px; padding-left:18px}
.rules b{color:var(--text)}

/* ---------- buttons ---------- */
.btn{display:block; width:100%; border:0; border-radius:12px; padding:14px; font:700 16px Inter,sans-serif; letter-spacing:.02em; cursor:pointer; color:var(--text); transition:transform .08s ease, filter .15s}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.6; filter:saturate(.25) brightness(.75); cursor:default}
.btn-primary{background:linear-gradient(180deg,#ff4d6a,var(--red-deep)); box-shadow:0 0 18px rgba(255,42,77,.35), inset 0 1px 0 rgba(255,255,255,.25)}
.btn-gold{background:linear-gradient(180deg,#ffe28f,var(--gold) 55%,var(--gold-deep)); color:#2a1204; box-shadow:0 0 18px rgba(245,196,81,.3)}
.btn-ghost{background:rgba(20,3,8,.55); border:1px solid var(--line); color:#ead2bd}
.btn.small{font-size:12px; padding:9px; letter-spacing:.06em}
.btnrow{display:flex; gap:10px} .btnrow .btn{flex:1}

/* ---------- game ---------- */
.board{display:flex; flex-wrap:wrap; gap:6px; align-items:stretch}
.pchip{flex:1 1 30%; min-width:0; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:6px 9px}
.pchip.active{border-color:var(--red); box-shadow:0 0 14px rgba(255,42,77,.35)}
.pn{font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.pn .cpu{margin-left:5px; font-size:9px; text-transform:uppercase; letter-spacing:.08em; color:var(--gold)}
.pv{font-family:"Bebas Neue",sans-serif; font-size:24px; line-height:1; letter-spacing:.04em}
.goal{flex-basis:100%; text-align:right; font-size:11px; color:#f3dccb; text-shadow:0 1px 2px rgba(0,0,0,.7); letter-spacing:.1em}

.tilerow{display:flex; gap:12px; margin:12px 0 4px; align-items:stretch}
.tile{width:118px; flex:none; border-radius:12px; padding:9px 8px 10px; text-align:center; position:relative; color:#3a1a10;
  background:linear-gradient(180deg,#fffaf0,var(--ivory) 70%,#e2d4b6);
  box-shadow:0 5px 0 #3fa37a, 0 6px 0 #1e5c43, 0 10px 18px rgba(0,0,0,.5)}
.tile.flip{animation:flip .5s ease}
@keyframes flip{0%{transform:rotateY(90deg)}100%{transform:none}}
.tile .ch{font-family:"Noto Serif SC",serif; font-size:40px; line-height:1.1; color:var(--red-deep)}
.tile.t-jade .ch,.tile.t-lantern .ch{color:#1f8a5e}
.tile.t-four .ch,.tile.t-typhoon .ch{color:#1d3f8a}
.tile.t-eight .ch{color:#b07a12}
.tile .nm{font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.06em; margin-top:2px}
.tile .fx{font-size:11px; line-height:1.3; margin-top:4px; color:#6b4a36}
.tile .prize{position:absolute; top:-8px; right:-8px; width:26px; height:26px; border-radius:50%; background:var(--red); color:var(--gold); font-weight:700; line-height:26px; box-shadow:0 0 10px rgba(255,42,77,.7)}
.meta{flex:1; min-width:0; display:flex; flex-direction:column; gap:8px}
.round{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:6px 12px; display:flex; align-items:flex-end; justify-content:space-between; gap:8px}
.round small{display:block; font-size:10px; text-transform:uppercase; letter-spacing:.16em; color:var(--gold)}
#roundScore{font-family:"Bebas Neue",sans-serif; font-size:30px; line-height:1; color:#fff6d8; text-shadow:0 0 12px rgba(245,196,81,.5)}
.dleft{font-size:11px; color:var(--muted); text-align:right; padding-bottom:3px} .dleft b{display:block; color:var(--text); font-size:18px; line-height:1.1}

/* pile of drawn fortune tiles: newest on top, tap for the counts */
.pile{flex:1; display:flex; align-items:center; gap:12px; background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:8px 12px; color:var(--text); font:inherit; text-align:left; cursor:pointer}
.pile:active{border-color:var(--gold)}
.stack{position:relative; width:44px; height:56px; flex:none}
.stack i{position:absolute; left:0; top:0; width:38px; height:48px; border-radius:6px; display:grid; place-items:center;
  font:700 18px/1 "Noto Serif SC",serif; font-style:normal; color:var(--red-deep);
  background:linear-gradient(180deg,#fffaf0,var(--ivory) 70%,#e2d4b6); box-shadow:0 2px 0 #3fa37a, 0 3px 0 #1e5c43, 0 4px 8px rgba(0,0,0,.45)}
.stack i.small{font-size:12px}
.stack i.t-jade,.stack i.t-lantern{color:#1f8a5e} .stack i.t-four,.stack i.t-typhoon{color:#1d3f8a} .stack i.t-eight{color:#b07a12}
.stack i.empty{background:rgba(0,0,0,.3); box-shadow:none; border:1px dashed var(--line)}
.ptext small{display:block; font-size:10px; text-transform:uppercase; letter-spacing:.16em; color:var(--gold)}
.ptext b{display:block; font-family:"Bebas Neue",sans-serif; font-weight:400; font-size:24px; line-height:1.05; letter-spacing:.04em}

.sheet{position:fixed; inset:0; z-index:9; display:none; align-items:center; justify-content:center; padding:16px; background:rgba(7,1,3,.8)}
.sheet.on{display:flex; animation:fadein .2s ease}
.sheet .box{width:100%; max-width:360px; background:linear-gradient(180deg,#2a0812,#14040a); border:1px solid var(--gold-deep); border-radius:16px;
  padding:16px; box-shadow:0 0 30px rgba(255,42,77,.3)}
.sheet h2{margin:0 0 4px; font:400 26px/1 "Bebas Neue",sans-serif; letter-spacing:.06em; color:var(--gold)}
.sheet .row{display:flex; align-items:center; gap:10px; padding:7px 0; border-top:1px solid rgba(245,196,81,.12)}
.sheet .row .ch{width:44px; font:700 20px/1 "Noto Serif SC",serif; color:var(--gold); text-align:center; flex:none}
.sheet .row .nm{flex:1; font-size:14px}
.sheet .row .n{font-size:14px; color:var(--muted); white-space:nowrap} .sheet .row .n b{color:var(--text)}
.sheet .btn{margin-top:12px}

.section-label{display:flex; justify-content:space-between; font-size:10px; text-transform:uppercase; letter-spacing:.16em; color:#f6dcc6; text-shadow:0 1px 2px rgba(0,0,0,.6); margin:14px 0 6px}
.fulls{color:var(--gold)}
.tray,.kept-tray{min-height:76px; border-radius:14px; padding:10px; display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:center}
.tray{background:radial-gradient(ellipse at 50% 30%, #1f5a3c, #0f3121 75%); border:2px solid var(--gold-deep); box-shadow:inset 0 0 26px rgba(0,0,0,.6)}
.tray.empty{color:rgba(247,234,215,.55); font-size:13px; letter-spacing:.1em}
.kept-tray{background:rgba(20,3,8,.45); border:1px dashed var(--line); min-height:54px; justify-content:flex-start}
.group{display:flex; gap:4px; padding:5px; border-radius:10px; border:1px solid var(--line); background:rgba(245,196,81,.05)}
.group .die{width:34px; height:34px; border-radius:7px}
.group .pip{width:6px; height:6px}
.deadzone{display:flex; gap:4px; padding-left:10px; border-left:1px dashed rgba(255,255,255,.2)}

/* dice: red translucent with gold pips; the gold die with red pips */
.die{width:48px; height:48px; border-radius:10px; position:relative; transform:rotate(var(--die-rot,0deg));
  background:linear-gradient(145deg, rgba(255,90,110,.92), rgba(196,16,48,.86) 55%, rgba(120,6,26,.92));
  box-shadow:inset 0 2px 3px rgba(255,255,255,.45), inset 0 -3px 6px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.45)}
.die.gold{background:linear-gradient(145deg,#fff1b8,var(--gold) 50%,var(--gold-deep)); box-shadow:inset 0 2px 3px rgba(255,255,255,.7), inset 0 -3px 6px rgba(90,50,0,.4), 0 0 14px rgba(245,196,81,.55)}
.pip{position:absolute; width:9px; height:9px; border-radius:50%; background:radial-gradient(circle at 35% 35%, #fff4c4, var(--gold) 60%, var(--gold-deep)); transform:translate(-50%,-50%)}
.die.gold .pip{background:radial-gradient(circle at 35% 35%, #ff6b80, var(--red-deep))}
.p1{left:25%;top:25%}.p2{left:50%;top:25%}.p3{left:75%;top:25%}.p4{left:25%;top:50%}.p5{left:50%;top:50%}.p6{left:75%;top:50%}.p7{left:25%;top:75%}.p8{left:50%;top:75%}.p9{left:75%;top:75%}
.die.sel{cursor:pointer}
.die.chosen{outline:3px solid var(--gold); outline-offset:3px; transform:rotate(0) translateY(-4px)}
.die.dead{filter:grayscale(1) brightness(.45); width:30px; height:30px; border-radius:6px}
.die.dead .pip{width:5px; height:5px}
.die.roll{animation:roll .55s cubic-bezier(.3,1.4,.5,1)}
@keyframes roll{0%{transform:translateY(-30px) rotate(-200deg) scale(.6); opacity:0}100%{transform:rotate(var(--die-rot,0deg))}}

.selinfo{min-height:22px; text-align:center; margin-top:10px; color:var(--muted)}
.selinfo b{color:var(--gold)} .selinfo .bad{color:var(--bad)}
.msg{text-align:center; font-weight:600; min-height:22px; margin:4px 0; text-shadow:0 1px 3px rgba(0,0,0,.7)}
.msg.warn{color:var(--gold)} .msg.bad{color:#ffd1d6}
.last{text-align:center; font-size:12px; color:#f3dccb; text-shadow:0 1px 2px rgba(0,0,0,.7); min-height:18px; margin-bottom:10px}
.foot{margin-top:18px}

/* ---------- game over ---------- */
.winner{text-align:center; font-family:"Bebas Neue",sans-serif; font-size:40px; letter-spacing:.05em; color:#fff6d8; text-shadow:0 0 16px rgba(245,196,81,.6)}
.strow{display:flex; gap:10px; padding:8px 4px; border-bottom:1px solid var(--line)}
.strow:last-child{border-bottom:0}
.strow .rank{width:20px; color:var(--muted)} .strow .nm{flex:1} .strow .sc{font-weight:700}
.strow.win .nm,.strow.win .sc{color:var(--gold)}

.sitefoot{text-align:center; font-size:11px; color:var(--muted); margin-top:28px}
.sitefoot a{color:var(--muted)}

/* ---------- gold medallion (八) ---------- */
.medal{width:74px; height:74px; margin:0 auto 6px; border-radius:50%; display:grid; place-items:center; position:relative;
  background:radial-gradient(circle at 35% 30%, #fff3c2, var(--gold) 45%, var(--gold-deep) 80%, #6e4a12);
  box-shadow:0 0 0 3px #6e4a12, 0 0 0 5px var(--gold), 0 0 28px rgba(245,196,81,.55), inset 0 -4px 8px rgba(80,40,0,.45)}
.medal::before{content:""; position:absolute; inset:9px; border-radius:50%; border:1.5px dashed rgba(110,74,18,.7)}
.medal span{font-family:"Noto Serif SC",serif; font-size:36px; color:var(--red-deep); text-shadow:0 1px 0 rgba(255,240,200,.7)}
.medal.mini{width:34px; height:34px; margin:0; box-shadow:0 0 0 2px #6e4a12, 0 0 0 3px var(--gold), 0 0 14px rgba(245,196,81,.5)}
.medal.mini::before{inset:4px; border-width:1px}
.medal.mini span{font-size:17px}
@media (prefers-reduced-motion:no-preference){ .title .medal{animation:spin 9s ease-in-out infinite} }
@keyframes spin{0%,80%,100%{transform:rotateY(0)}88%{transform:rotateY(180deg)}96%{transform:rotateY(360deg)}}

/* small gold dragon arching over the title sign */
#setup .title{margin-top:58px}
.crest{position:absolute; left:50%; top:-64px; width:250px; margin-left:-125px; pointer-events:none;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.6)) drop-shadow(0 0 10px rgba(245,196,81,.35))}

/* ---------- neon: tube borders and the game-screen sign ---------- */
.title{padding:14px 10px 16px; border-radius:20px; background:rgba(20,3,8,.6); border:2px solid rgba(255,120,140,.9);
  box-shadow:0 0 6px #fff inset, 0 0 10px var(--red), 0 0 22px rgba(255,42,77,.6), inset 0 0 18px rgba(255,42,77,.35)}
.sign{display:flex; align-items:center; justify-content:center; gap:10px; margin:0 0 12px; padding:8px 12px; border-radius:14px;
  border:2px solid rgba(255,214,120,.9); box-shadow:0 0 8px var(--gold), inset 0 0 12px rgba(245,196,81,.3)}
.sign .zh{font-family:"Noto Serif SC",serif; font-size:20px; color:#ffe3e8; text-shadow:0 0 6px #fff, 0 0 14px var(--red), 0 0 26px var(--red)}
.sign .en{font-family:"Bebas Neue",sans-serif; font-size:28px; letter-spacing:.08em; color:#e9fffb; text-shadow:0 0 5px #fff, 0 0 12px #2fe6c8, 0 0 24px #1aa892}
@media (prefers-reduced-motion:no-preference){ .sign .en{animation:flicker 9s infinite 2s} }
.tray{border:2px solid rgba(255,120,140,.95); box-shadow:inset 0 0 26px rgba(0,0,0,.6), 0 0 10px var(--red), 0 0 22px rgba(255,42,77,.45)}
.pchip.active{box-shadow:0 0 6px #fff inset, 0 0 12px var(--red), 0 0 22px rgba(255,42,77,.5)}
.last b{color:var(--gold)}

/* ---------- reveal: the red envelope opens / Lucky Eight hits ---------- */
.reveal{position:fixed; inset:0; display:none; flex-direction:column; align-items:center; justify-content:center; gap:18px;
  background:radial-gradient(circle at 50% 42%, #4a0816, #12020a 60%, #070103); z-index:10; cursor:pointer}
.reveal.on{display:flex; animation:fadein .25s ease}
.reveal .who{font-weight:700; font-size:18px; text-align:center; padding:0 24px; color:#fff6d8; text-shadow:0 0 12px rgba(245,196,81,.6)}
.cash{font-family:"Bebas Neue",sans-serif; font-size:64px; line-height:1; color:#fff6d8; letter-spacing:.03em;
  text-shadow:0 0 6px #fff, 0 0 18px var(--gold), 0 0 36px var(--gold-deep)}
/* splash cards: Red Envelope, Lucky Eight, Heavenly Peaches (蟠桃) and the Eight Immortals (八仙過海) */
.rcard{width:min(330px,88vw); text-align:center; padding:22px 16px 18px; border-radius:20px; position:relative;
  background:radial-gradient(circle at 50% 0%, #e8233f, #a50f27 55%, #5e0814); color:#fff6d8;
  box-shadow:0 0 0 3px var(--gold), 0 0 0 7px #6e0a1a, 0 0 0 8px var(--gold-deep), 0 0 50px rgba(255,42,77,.6), 0 20px 50px rgba(0,0,0,.6);
  animation:pop .6s cubic-bezier(.3,1.6,.5,1)}
.rcard .zh{font-family:"Noto Serif SC",serif; font-size:64px; line-height:1.05; color:var(--gold); letter-spacing:.06em;
  text-shadow:0 0 6px #fff3c2, 0 0 22px var(--gold), 0 3px 0 #6e0a1a}
.rcard .nm{font-family:"Bebas Neue",sans-serif; font-size:26px; letter-spacing:.14em; margin-top:2px; color:#ffe3e8}
.rcard .who{font-weight:700; font-size:16px; margin-top:12px}
.rcard .cash{margin-top:6px}
.trio{display:flex; justify-content:center; gap:10px; margin-top:14px}
.trio .pc{display:flex; flex-direction:column; align-items:center; opacity:0; animation:peachin .55s cubic-bezier(.3,1.6,.5,1) forwards}
.trio .pc b{font-family:"Bebas Neue",sans-serif; font-size:24px; letter-spacing:.06em; color:#fff6d8; text-shadow:0 0 8px rgba(245,196,81,.7)}
.peach{width:70px; height:75px; filter:drop-shadow(0 4px 6px rgba(0,0,0,.4))}
@keyframes peachin{0%{opacity:0; transform:translateY(-30px) scale(.4)}100%{opacity:1; transform:none}}
.rcard.imm .zh{font-size:58px}
.eights{display:flex; justify-content:center; gap:4px; margin-top:14px}
.eights i{font:700 26px/1 "Noto Serif SC",serif; font-style:normal; color:var(--gold); opacity:0; text-shadow:0 0 10px var(--gold);
  animation:fadein .4s ease forwards}
.eights i:nth-child(1){animation-delay:.3s} .eights i:nth-child(2){animation-delay:.45s} .eights i:nth-child(3){animation-delay:.6s}
.eights i:nth-child(4){animation-delay:.75s} .eights i:nth-child(5){animation-delay:.9s} .eights i:nth-child(6){animation-delay:1.05s}
.eights i:nth-child(7){animation-delay:1.2s} .eights i:nth-child(8){animation-delay:1.35s}
.waves{display:block; width:100%; height:34px; margin-top:8px}
@media (prefers-reduced-motion:no-preference){ .waves path{animation:sea 2.4s ease-in-out infinite alternate} .waves path+path{animation-delay:-1.2s} }
@keyframes sea{from{transform:translateX(-10px)}to{transform:translateX(10px)}}
/* Red Envelope: the seal pops, the flap opens, a gold slip with the prize slides out */
.envart{position:relative; width:160px; height:112px; margin:58px auto 4px; perspective:600px}
.envart .body{position:absolute; inset:0; border-radius:8px; z-index:2; background:linear-gradient(180deg,#ff3b55,#c4102c);
  box-shadow:0 0 0 3px var(--gold), 0 0 22px rgba(255,214,120,.45), 0 10px 22px rgba(0,0,0,.5)}
.envart .body::before{content:""; position:absolute; inset:7px; border:1px solid rgba(255,214,120,.7); border-radius:4px}
.envart .body::after{content:""; position:absolute; left:0; right:0; bottom:0; height:60%; border-radius:0 0 8px 8px;
  background:linear-gradient(160deg,transparent 49%,rgba(0,0,0,.18) 50%) left/50% 100% no-repeat, linear-gradient(200deg,transparent 49%,rgba(0,0,0,.18) 50%) right/50% 100% no-repeat}
.envart .flap{position:absolute; left:0; right:0; top:0; height:66px; z-index:4; transform-origin:top; clip-path:polygon(0 0,100% 0,50% 100%);
  background:linear-gradient(180deg,#ff6b80,#d01834); filter:drop-shadow(0 2px 0 var(--gold)); animation:flap .7s .55s ease-in forwards}
.envart .seal{position:absolute; left:50%; top:42px; width:44px; height:44px; margin-left:-22px; border-radius:50%; z-index:5; display:grid; place-items:center;
  font:700 24px/1 "Noto Serif SC",serif; color:var(--red-deep); background:radial-gradient(circle at 35% 30%,#fff3c2,var(--gold) 55%,var(--gold-deep));
  box-shadow:0 2px 6px rgba(0,0,0,.4); animation:sealoff .45s .25s ease-in forwards}
.envart .slip{position:absolute; left:12px; right:12px; top:8px; height:94px; z-index:1; border-radius:6px; display:grid; place-items:start center;
  padding-top:6px; background:linear-gradient(180deg,#fffaf0,#f3d98e); box-shadow:inset 0 0 0 2px var(--gold-deep);
  font:400 44px/1 "Bebas Neue",sans-serif; color:var(--red-deep); letter-spacing:.03em; animation:slip .8s 1.15s cubic-bezier(.3,1.5,.5,1) forwards}
@keyframes flap{0%{transform:rotateX(0)}49%{z-index:4}50%{z-index:0}100%{transform:rotateX(180deg); z-index:0; filter:brightness(.7)}}
@keyframes sealoff{to{transform:scale(1.6) rotate(40deg); opacity:0}}
@keyframes slip{to{transform:translateY(-50px)}}
/* Lucky Eight: a big gold 八 medallion spins in, rays behind it */
.eightart{position:relative; width:150px; height:150px; margin:14px auto 0; display:grid; place-items:center}
.eightart .rays{position:absolute; inset:-30px; border-radius:50%; opacity:.55;
  background:repeating-conic-gradient(from 0deg, rgba(255,230,150,.55) 0 7deg, transparent 7deg 22.5deg);
  -webkit-mask:radial-gradient(circle, #000 30%, transparent 70%); mask:radial-gradient(circle, #000 30%, transparent 70%)}
@media (prefers-reduced-motion:no-preference){ .eightart .rays{animation:spinrays 9s linear infinite} }
@keyframes spinrays{to{transform:rotate(360deg)}}
.medal.big{width:116px; height:116px; margin:0; animation:coin 1s cubic-bezier(.3,1.4,.5,1)}
.medal.big::before{inset:13px}
.medal.big span{font-size:58px}
@keyframes coin{0%{transform:scale(.2) rotateY(540deg); opacity:0}100%{transform:none; opacity:1}}
.rcard.r8 .cash{margin-top:2px}
@keyframes pop{0%{transform:scale(.2) rotate(-30deg); opacity:0}100%{transform:none; opacity:1}}
@media (prefers-reduced-motion:reduce){ .rcard,.rcard *{animation-duration:.01s!important; animation-delay:0s!important} }

/* ---------- online ---------- */
[hidden]{display:none!important}
.tabs{display:flex; gap:6px; margin:0 0 4px}
.tabs button{flex:1; border:1px solid var(--line); background:rgba(20,3,8,.55); color:#ead2bd; border-radius:12px; padding:11px 6px;
  font:600 14px Inter,sans-serif; letter-spacing:.04em; cursor:pointer}
.tabs button.on{color:#1b0a04; background:linear-gradient(180deg,#ffe08a,var(--gold)); border-color:var(--gold)}
.tabs button:disabled:not(.on){opacity:.45; cursor:not-allowed}
.netinfo{color:#ead2bd; font-size:13px; text-align:center; margin-bottom:12px}
.netcode{font-family:"Bebas Neue",sans-serif; font-size:52px; line-height:1; letter-spacing:.2em; margin-top:6px; color:#fff6d8;
  text-shadow:0 0 4px #fff, 0 0 14px var(--gold), 0 0 28px var(--gold-deep)}
.codein{text-transform:uppercase; letter-spacing:.3em; text-align:center}
.nettag{font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--gold); align-self:center; flex:none}
.nettag.off,.pn .cpu.net.off{opacity:.55}
.qr{background:var(--ivory); border-radius:12px; padding:10px; width:168px; height:168px; margin:4px auto 14px}
.qr svg{display:block; width:100%; height:100%}
.waitmsg{text-align:center; font-weight:600; margin:6px 0 4px; text-shadow:0 1px 3px rgba(0,0,0,.7)}
.netstatus{position:fixed; top:0; left:0; right:0; z-index:20; background:var(--red-deep); color:#fff6d8; text-align:center;
  font-size:13px; font-weight:600; padding:calc(6px + env(safe-area-inset-top)) 12px 6px}
.langsw{display:flex; justify-content:center; margin:0 0 10px; position:relative}
.langcur,.langlist button{display:flex; align-items:center; gap:8px; background:rgba(20,3,8,.6); color:#ead2bd; border:1px solid var(--line);
  border-radius:10px; padding:7px 12px; font:600 13px Inter,sans-serif; cursor:pointer}
.langcur .globe{width:18px; height:18px; color:var(--gold); flex:none}
.langcur .caret{color:var(--gold); font-size:11px}
.flag{width:22px; height:15px; border-radius:2px; flex:none; box-shadow:0 0 0 1px rgba(0,0,0,.35)}
.langlist{position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%); z-index:8; min-width:180px; padding:6px;
  background:linear-gradient(180deg,#2a0812,#14040a); border:1px solid var(--gold-deep); border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,.6)}
.langlist button{width:100%; border-color:transparent; background:transparent; padding:9px 10px}
.langlist button.on{border-color:var(--gold-deep); color:#fff6d8}
.langlist button:hover,.langlist button:focus-visible{background:rgba(245,196,81,.12); outline:none}
