* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
  font-family:'Cairo',system-ui,sans-serif; background:#05070d; color:#eaf0ff;
  background-image:radial-gradient(1200px 600px at 80% -10%, rgba(0,120,255,.18), transparent),
                   radial-gradient(900px 500px at 10% 110%, rgba(0,80,220,.12), transparent);
  overflow-x:hidden;
}
#app { max-width:520px; margin:0 auto; padding:12px; min-height:100%; display:flex; flex-direction:column; }
header { padding:10px 4px; }
.brand { display:flex; align-items:center; gap:10px; }
.logo { width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,#0a84ff,#003e8f);
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:24px; color:#fff;
  box-shadow:0 0 18px rgba(0,132,255,.45); border:1px solid #2f6fd0; }
h1 { font-size:20px; font-weight:900; }
h1 span { color:#4da3ff; }
.brand p { font-size:11px; color:#8fa3c8; }
.screen { flex:1; display:flex; flex-direction:column; justify-content:center; gap:14px; }
.hidden { display:none !important; }
.card { background:rgba(13,20,36,.92); border:1px solid #1c2b4d; border-radius:18px; padding:22px;
  display:flex; flex-direction:column; gap:12px; box-shadow:0 10px 40px rgba(0,0,0,.5); }
h2 { font-size:22px; }
.muted { color:#8fa3c8; font-size:13px; }
.small { font-size:11px; }
input,select { background:#0a1120; border:1px solid #22345c; color:#eaf0ff; border-radius:12px;
  padding:12px 14px; font-size:16px; font-family:inherit; width:100%; }
input:focus,select:focus { outline:none; border-color:#0a84ff; }
.btn { background:#13203a; border:1px solid #2a3f6b; color:#eaf0ff; border-radius:12px;
  padding:13px 16px; font-size:16px; font-weight:700; font-family:inherit; cursor:pointer; }
.btn:active { transform:scale(.97); }
.btn.primary { background:linear-gradient(135deg,#0a84ff,#0062d6); border-color:#3d8dff;
  box-shadow:0 4px 20px rgba(0,132,255,.35); }
.btn.ghost { background:transparent; border-color:#22345c; color:#9fb4dd; }
.btn.small { padding:7px 12px; font-size:13px; align-self:flex-end; }
.row { display:flex; gap:8px; }
.row .btn { flex:0 0 auto; }
.divider { text-align:center; color:#5a6f99; font-size:12px; }
.code-box { font-size:38px; font-weight:900; letter-spacing:12px; text-align:center; color:#4da3ff;
  background:#0a1120; border:1px dashed #2a3f6b; border-radius:12px; padding:10px; }
.players { display:flex; flex-direction:column; gap:8px; }
.pill { display:flex; align-items:center; gap:10px; background:#0a1120; border:1px solid #1c2b4d;
  border-radius:12px; padding:10px 14px; font-weight:700; }
.dot { width:14px; height:14px; border-radius:50%; box-shadow:0 0 8px currentColor; }
.foot { text-align:center; color:#5a6f99; font-size:12px; }
/* board */
#boardWrap { display:flex; justify-content:center; }
#board { display:grid; grid-template-columns:repeat(15,1fr); width:min(94vw,440px); aspect-ratio:1;
  background:#0a1120; border:2px solid #22345c; border-radius:14px; overflow:hidden; box-shadow:0 8px 40px rgba(0,0,0,.6); }
.cell { border:1px solid rgba(40,60,100,.35); position:relative; display:flex; align-items:center; justify-content:center; }
.cell.red { background:#e0393e; } .cell.green { background:#2ea44f; } .cell.yellow { background:#f5c518; } .cell.blue { background:#2273e8; }
.cell.red.dim,.cell.green.dim,.cell.yellow.dim,.cell.blue.dim { opacity:.35; }
.cell.safe::after { content:'★'; position:absolute; font-size:10px; color:#fff; opacity:.85; top:0; right:1px; }
.token { width:72%; height:72%; border-radius:50%; border:2px solid #fff; z-index:2; cursor:pointer;
  box-shadow:0 1px 4px rgba(0,0,0,.6); display:flex;align-items:center;justify-content:center; }
.token.t-red { background:#e0393e; } .token.t-green { background:#2ea44f; } .token.t-yellow { background:#f5c518; } .token.t-blue { background:#2273e8; }
.token.mini { width:34%; height:34%; border-width:1px; margin:1px; }
.token.hl { outline:3px solid #fff; animation:pulse .7s infinite alternate; }
@keyframes pulse { from{box-shadow:0 0 4px #fff} to{box-shadow:0 0 14px #fff} }
.cell.stack { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; }
.turn-bar { text-align:center; padding:8px; border-radius:12px; background:#0d1424; border:1px solid #1c2b4d;
  font-weight:700; margin-bottom:10px; }
.controls { display:flex; align-items:center; justify-content:center; gap:16px; padding:14px 0; }
.dice { font-size:18px; padding:14px 26px; }
#diceFace { width:52px; height:52px; border-radius:12px; background:#fff; color:#111;
  display:flex; align-items:center; justify-content:center; font-size:30px; font-weight:900; }
.chat { background:#0d1424; border:1px solid #1c2b4d; border-radius:12px; padding:10px; margin-top:8px; }
#chatLog { max-height:120px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; margin-bottom:8px; font-size:13px; }
#chatLog .me { color:#4da3ff; }
.emojis { display:flex; gap:6px; margin-top:8px; }
.emojis button { font-size:22px; background:none; border:none; cursor:pointer; }
.modal { position:fixed; inset:0; background:rgba(2,4,10,.8); display:flex; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal .card { width:100%; max-width:340px; text-align:center; }
