*{margin:0;padding:0;box-sizing:border-box;font-family:'Cairo',sans-serif;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{background:radial-gradient(120% 90% at 50% 0%,#1b1f3d 0%,#0d1024 55%,#090b1a 100%);color:#fff;min-height:100vh;display:flex;flex-direction:column;overflow-x:hidden;user-select:none;-webkit-user-select:none}
button{font-family:inherit;border:none;cursor:pointer;touch-action:manipulation}

/* top bar */
.topbar{display:flex;align-items:center;gap:12px;padding:14px 16px 6px}
.backbtn{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;flex:none}
.backbtn svg{width:20px;height:20px}
.gtitle{font-size:22px;font-weight:900;flex:1}
.gtitle small{display:block;font-size:11px;color:#9aa3c7;font-weight:400}
.sndbtn{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;flex:none;font-size:18px}
.sndbtn.off{opacity:.4}

/* generic screens */
.screen{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;gap:14px}
.statusbar{min-height:30px;font-size:16px;font-weight:800;color:#e8eaf6;text-align:center;padding:2px 10px}
.statusbar .accent{background:linear-gradient(90deg,#a78bff,#4ef0c0);-webkit-background-clip:text;background-clip:text;color:transparent}

/* buttons */
.btn{border-radius:16px;padding:13px 26px;font-size:16px;font-weight:800;color:#0d1024;background:linear-gradient(135deg,#7C5CFF,#00E5A0);box-shadow:0 8px 22px rgba(124,92,255,.35)}
.btn.ghost{background:rgba(255,255,255,.09);color:#fff;box-shadow:none}
.btn:active{transform:scale(.96)}

/* mode picker overlay */
.overlay{position:fixed;inset:0;background:rgba(9,11,26,.92);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;z-index:50;backdrop-filter:blur(4px)}
.overlay h2{font-size:22px;font-weight:900;margin-bottom:6px;text-align:center}
.overlay .sub{color:#9aa3c7;font-size:13px;margin-bottom:10px;text-align:center}
.modecard{width:min(320px,86vw);border-radius:22px;padding:20px;display:flex;align-items:center;gap:14px;color:#fff;text-align:right;box-shadow:0 10px 26px rgba(0,0,0,.35)}
.modecard:active{transform:scale(.97)}
.modecard .mi{width:52px;height:52px;flex:none}
.modecard .mt{font-size:18px;font-weight:800}
.modecard .ms{font-size:12px;color:rgba(255,255,255,.85)}
.mc-ai{background:linear-gradient(150deg,#6D5DF6,#4636c9)}
.mc-friend{background:linear-gradient(150deg,#00C48C,#01966c)}
.mc-easy{background:linear-gradient(150deg,#3BA7FF,#1d7fd6)}
.mc-hard{background:linear-gradient(150deg,#FF5C8A,#e83e6e)}

/* win overlay */
.winbox{background:#151935;border:1.5px solid rgba(124,92,255,.5);border-radius:24px;padding:28px 30px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:0 20px 50px rgba(0,0,0,.5);text-align:center}
.winbox .cup{font-size:52px;animation:pop .5s ease}
.winbox .wt{font-size:24px;font-weight:900}
.winbox .ws{font-size:14px;color:#9aa3c7;margin-bottom:10px}
@keyframes pop{0%{transform:scale(.2);opacity:0}70%{transform:scale(1.2)}100%{transform:scale(1)}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.shake{animation:shake .25s ease}

/* dice */
.die{width:64px;height:64px;border-radius:16px;background:#fff;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:10px;gap:2px;box-shadow:0 6px 16px rgba(0,0,0,.4);flex:none}
.die i{border-radius:50%;background:transparent}
.die i.on{background:#2b2f4a}
.die.rolling{animation:dieroll .12s linear infinite}
@keyframes dieroll{0%{transform:rotate(0) scale(1)}50%{transform:rotate(8deg) scale(1.08)}100%{transform:rotate(-8deg) scale(1)}}

/* score chips */
.chips{display:flex;gap:8px}
.chip{background:rgba(255,255,255,.08);border-radius:12px;padding:6px 12px;font-size:13px;font-weight:700;display:flex;align-items:center;gap:6px}
.chip .dot{width:10px;height:10px;border-radius:50%}
.chip.active{outline:2px solid #00E5A0;background:rgba(0,229,160,.12)}

.hint{font-size:12px;color:#9aa3c7;text-align:center;max-width:320px}
