:root{                                   /* Sunpop palette */
  --bg1:#eef7f4; --bg2:#f4eefb;
  --surface:#ffffff; --surface-2:#f1f3fb;
  --line:#e5e2f0;
  --ink:#1f2440; --muted:#656a8a;
  --primary:#7a3ff0; --primary-2:#6a2fe0;
  --daily:#ef6c00; --battle:#f5356b; --goal:#18a558; --friends:#0898b0;
  --tile:#26224e; --tile-ink:#f5f3ff; --gold:#ffb020;
  /* Takeover ownership colours (match HUE[] in app.js) */
  --o0:#3b82f6; --o1:#f97316; --o2:#22c55e; --o3:#eab308; --o4:#a855f7; --o5:#14b8a6; --o6:#ec4899; --o7:#94a3b8;
  --radius:18px; --shadow:0 10px 30px rgba(31,37,72,.14); --shadow-sm:0 3px 12px rgba(31,37,72,.09);
}
*{ box-sizing:border-box; margin:0; padding:0; }
[hidden]{ display:none !important; }
body{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif; color:var(--ink); min-height:100vh;
  background:linear-gradient(165deg,var(--bg1),var(--bg2)); background-attachment:fixed;
}

/* header */
.topbar{ display:flex; align-items:center; justify-content:space-between; padding:12px 20px; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ width:30px; height:30px; border-radius:9px; background:linear-gradient(var(--primary),var(--primary-2)); color:#fff; font-weight:800; font-size:18px; display:flex; align-items:center; justify-content:center; box-shadow:0 3px 8px rgba(122,63,240,.4); }
.brand-name{ font-size:20px; font-weight:800; letter-spacing:-.3px; color:var(--ink); }
.topbtns{ display:flex; gap:8px; }
.chip{ font:inherit; font-size:14px; cursor:pointer; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:8px 14px; color:var(--muted); box-shadow:var(--shadow-sm); }
.chip:hover{ color:var(--ink); }

.page{ max-width:1060px; margin:0 auto; padding:14px 14px 40px; }

/* home */
.home{ position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center; padding:20px 18px 40px; overflow-y:auto;
  background:linear-gradient(165deg,var(--bg1),var(--bg2)); }
.home-inner{ width:100%; max-width:440px; }
.hero{ text-align:center; margin:6px 0 20px; }
.hero-title{ font-size:46px; font-weight:800; letter-spacing:-1.5px; color:var(--ink); line-height:1; }
.hero-sub{ margin:11px auto 0; max-width:360px; color:var(--muted); font-size:16px; line-height:1.5; }
.play-cta{ width:100%; font:inherit; font-size:22px; font-weight:800; color:#fff; cursor:pointer; border:none; border-radius:var(--radius);
  padding:20px; background:linear-gradient(var(--primary),var(--primary-2)); box-shadow:0 10px 24px rgba(122,63,240,.42); transition:transform .08s ease; }
.play-cta:hover{ filter:brightness(1.05); }
.play-cta:active{ transform:translateY(2px); }
.mode-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px; }
.mode-card{ font:inherit; text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:5px;
  background:var(--surface); border:1px solid var(--line); border-radius:15px; padding:14px; box-shadow:var(--shadow-sm);
  transition:transform .1s ease, box-shadow .1s ease; }
.mode-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow); }
.mode-card:active{ transform:translateY(0); }
.mc-title{ font-weight:800; font-size:15.5px; color:var(--ink); display:flex; align-items:center; gap:8px; }
.mc-dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.mc-dot.daily{ background:var(--daily); } .mc-dot.battle{ background:var(--battle); } .mc-dot.goal{ background:var(--goal); } .mc-dot.friends{ background:var(--friends); }
.mc-desc{ font-size:12.5px; color:var(--muted); line-height:1.4; }
.home-status{ text-align:center; margin-top:22px; font-size:13px; color:var(--muted); }
.account-row{ display:flex; justify-content:center; flex-wrap:wrap; gap:8px 18px; margin-top:9px; }
.account-row button{ font:inherit; font-size:14px; background:none; border:none; color:var(--muted); cursor:pointer; padding:2px; }
.account-row button:hover{ color:var(--primary); text-decoration:underline; }
.home-tag{ margin:14px 2px 0; color:var(--muted); font-size:15px; line-height:1.45; }
.howto-steps{ margin:6px 0 18px; padding-left:20px; line-height:1.5; }
.howto-steps li{ margin:12px 0; color:var(--muted); }
.howto-steps b{ color:var(--ink); }

/* tutorial coach */
.coach{ display:flex; align-items:center; gap:14px; margin-bottom:14px;
  background:linear-gradient(#f4f6fd,#eceefb); border:2px solid #7a3ff0; border-left:8px solid #7a3ff0; border-radius:16px;
  padding:14px 18px; box-shadow:0 6px 16px rgba(0,0,0,.18); }
.coach-badge{ flex:0 0 auto; width:40px; height:40px; border-radius:50%; background:linear-gradient(#7a3ff0,#6a2fe0);
  display:flex; align-items:center; justify-content:center; box-shadow:0 2px 5px rgba(0,0,0,.25); }
.coach-text{ flex:1; font-size:16px; line-height:1.45; color:#20264a; }
.coach-text b{ color:#6a2fe0; }
.coach-btns{ flex:0 0 auto; display:flex; gap:8px; }
.chip.ghost{ background:transparent; border-color:#c9b98f; color:#6b7192; }
.tut-link{ display:block; margin:10px auto 0; font:inherit; font-size:14px; cursor:pointer; background:none; border:none; color:#6a2fe0; text-decoration:underline; }
.tut-link:hover{ color:#6a2fe0; }

/* spotlight the element the tutorial wants you to use */
.tut-point{ animation:tutglow 1.15s ease-in-out infinite; }
@keyframes tutglow{
  0%,100%{ box-shadow:0 0 0 0 rgba(255,226,122,0); }
  50%{ box-shadow:0 0 0 5px rgba(255,226,122,.9), 0 0 20px rgba(255,226,122,.55); }
}

/* wooden table + felt */
.table{
  border-radius:26px; padding:16px; border:2px solid #4e3520;
  background:repeating-linear-gradient(96deg, rgba(0,0,0,.05) 0 2px, transparent 2px 8px), linear-gradient(#8a5f38,#6f4a29);
  box-shadow:0 18px 44px rgba(0,0,0,.35), inset 0 2px 4px rgba(255,255,255,.25), inset 0 -4px 8px rgba(0,0,0,.4);
}
.felt{
  position:relative; border-radius:16px; padding:18px; display:flex; flex-direction:column;
  background:radial-gradient(130% 120% at 50% 0%, #45986c, #2f7d55 55%, #276b48 100%);
  box-shadow:inset 0 3px 12px rgba(0,0,0,.4);
}

/* top row holds the top CPU (centered) with the draw pile pinned right */
.toprow{ position:relative; display:flex; justify-content:center; align-items:center; min-height:120px; margin-bottom:8px; }
.opprow{ display:flex; justify-content:center; gap:12px; }
.opprow:empty{ display:none; }
.opp{ display:inline-flex; align-items:center; gap:14px;
  background:linear-gradient(#3a6cbd,#2f579c); border:1px solid #23457a; border-radius:16px; padding:10px 14px;
  box-shadow:0 4px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.2); }
.opp.turn{ box-shadow:0 0 0 3px var(--gold), 0 4px 10px rgba(0,0,0,.25); }
.pinfo{ display:flex; align-items:center; gap:11px; }
.opp .pname{ color:#fff; font-weight:700; font-size:17px; line-height:1.1; }
.opp .pscore{ color:#ffe08a; font-size:13px; font-weight:700; }
.backs{ display:flex; gap:3px; flex-wrap:wrap; max-width:340px; }

/* side racks */
.arena{ display:flex; align-items:center; gap:10px; flex:1; }
.oppside{ flex:0 0 auto; display:flex; align-items:center; }
.oppside:empty{ display:none; }
.opp.side{ flex-direction:column; gap:8px; padding:12px 10px; text-align:center; width:106px; }
.opp.side .pinfo{ flex-direction:column; gap:6px; }
.opp.side .backs{ justify-content:center; max-width:88px; }
.opp.side .backtile{ width:24px; height:30px; }
.opp.side .backtile::after{ font-size:11px; }

.avatar{ width:50px; height:50px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:20px; color:#fff; border:3px solid rgba(255,255,255,.85); box-shadow:0 2px 5px rgba(0,0,0,.3); }
.avatar.you{ background:linear-gradient(#e6b03f,#c98a2a); }
.avatar.cpu{ background:linear-gradient(#5a86d0,#345f9f); }

.backtile{ width:34px; height:42px; border-radius:5px; flex:0 0 auto; position:relative;
  background:radial-gradient(circle at 50% 38%, #43966a, #2c6b48); border:1.5px solid #eee3c8; box-shadow:0 2px 3px rgba(0,0,0,.3); }
.backtile::after{ content:"W"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,.45); font-weight:800; font-size:15px; }

/* center word zone (dashed) — board scales to always stay inside */
.zone{ flex:1; min-height:150px; display:flex; align-items:center; justify-content:center; overflow:hidden;
  padding:12px 16px; border:2px dashed rgba(255,255,255,.28); border-radius:16px; }
.board{ position:relative; display:flex; align-items:center; justify-content:center; transform-origin:center center; }

.drawpile{ position:absolute; top:0; right:6px; text-align:center; z-index:4; }
.pile{ width:72px; height:90px; border-radius:10px; position:relative; margin:0 auto;
  background:radial-gradient(circle at 50% 38%, #45986c, #2c6b48); border:2px solid #eee3c8;
  box-shadow:3px 3px 0 #256040, 6px 6px 0 #1f5537, 0 8px 14px rgba(0,0,0,.4); }
.pile::after{ content:"W"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,.5); font-weight:800; font-size:30px; }
.pile-label{ margin-top:12px; background:#255d3f; color:#eafce9; font-size:12px; padding:4px 10px; border-radius:12px; display:inline-block; }
.pile-label span{ background:#7a3ff0; padding:1px 8px; border-radius:10px; margin-left:5px; font-weight:700; }

/* tiles */
.tile{ position:relative; width:58px; height:66px; flex:0 0 auto; color:var(--tile-ink);
  background:linear-gradient(#f8eed3,#efe1bd); border:1px solid var(--tile-edge); border-radius:9px;
  box-shadow:0 3px 0 #cbb387, 0 5px 8px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.6); }
.tile .pip{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:31px; font-weight:800; }
.tile .val{ position:absolute; bottom:5px; right:7px; font-size:12px; font-weight:700; color:#6e5f3d; }
.board .tile{ width:100px; height:118px; margin:0; }
.board .tile .pip{ font-size:58px; }
.board .tile .val{ font-size:19px; bottom:9px; right:12px; }

/* board interactions */
.stack{ position:relative; margin:0 4px; }
.stack{ transition:transform .14s ease; }
.stack.pick{ cursor:pointer; }
.stack.pick .tile{ outline:3px solid var(--gold); outline-offset:2px; box-shadow:0 0 16px rgba(244,196,48,.7), 0 5px 8px rgba(0,0,0,.28); }
.stack.pick:hover{ transform:translateY(-6px); }
.stack.rem{ cursor:pointer; }
.stack.rem .tile{ outline:3px solid #ff7a55; outline-offset:2px; }
/* dragging a card onto a tile to COVER it — the tile lifts and glows */
.stack.over{ transform:translateY(-10px); }
.stack.over .tile{ outline:3px solid var(--gold); outline-offset:2px; box-shadow:0 0 22px rgba(244,196,48,.85), 0 8px 12px rgba(0,0,0,.3); }
.stack.buried::before{ content:""; position:absolute; inset:0; transform:translate(6px,6px) rotate(2deg);
  background:#e6d4aa; border-radius:9px; z-index:-1; box-shadow:0 3px 5px rgba(0,0,0,.3); }
.stack .depth{ position:absolute; top:-8px; left:-8px; z-index:3; background:#255d3f; color:#fff;
  border:2px solid var(--gold); border-radius:50%; width:22px; height:22px; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:bold; }
.gap{ width:8px; height:118px; flex:0 0 auto; border-radius:8px; display:flex; align-items:center; justify-content:center;
  transition:width .14s ease, background .14s ease; }
.gap.ins{ width:34px; cursor:pointer; border:2px dashed var(--gold); background:rgba(244,196,48,.12); }
.gap.ins::after{ content:"+"; color:var(--gold); font-size:22px; font-weight:800; }
/* clean insertion: a wide invisible hit-zone with a faint hint bar; opens a solid slot on hover */
.gap.drop{ width:34px; cursor:pointer; background:none; border:none; }
.gap.drop::after{ content:""; width:4px; height:56px; border-radius:3px; background:rgba(255,255,255,.16); transition:all .16s cubic-bezier(.2,.8,.3,1); }
.gap.drop.over{ width:64px !important; }
.gap.drop.over::after{ width:54px; height:104px; border-radius:12px; animation:none;
  background:linear-gradient(rgba(255,248,228,.5), rgba(244,196,48,.34)); border:2px solid rgba(244,196,48,.9);
  box-shadow:0 0 20px rgba(244,196,48,.5), inset 0 1px 2px rgba(255,255,255,.5); }
.stack.slidable .tile{ cursor:grab; }

/* legal-spot hints: only the places a picked-up card can actually go glow gold */
.gap.drop.legal::after{ background:linear-gradient(rgba(255,240,190,.85), rgba(244,196,48,.7)); width:6px;
  box-shadow:0 0 10px rgba(244,196,48,.7); animation:legalbar 1.1s ease-in-out infinite; }
@keyframes legalbar{ 0%,100%{ opacity:.6; } 50%{ opacity:1; } }
.stack.drop.legal .tile{ outline:2px solid rgba(244,196,48,.85); outline-offset:2px;
  box-shadow:0 0 14px rgba(244,196,48,.55), 0 4px 8px rgba(0,0,0,.24); animation:legalpulse 1.1s ease-in-out infinite; }
@keyframes legalpulse{ 0%,100%{ box-shadow:0 0 10px rgba(244,196,48,.4), 0 4px 8px rgba(0,0,0,.24); }
  50%{ box-shadow:0 0 20px rgba(244,196,48,.7), 0 4px 8px rgba(0,0,0,.24); } }

/* a card that can't be played on the current word is dimmed and inert */
.hand .tile.dead{ opacity:.32; filter:grayscale(.6); cursor:default; pointer-events:none; }
/* when stuck, dim tiles become tappable to swap (keeps your turn) — pulse them so it reads as an action */
.hand .tile.swap-me{ opacity:.6; cursor:pointer; outline:2px dashed rgba(47,111,191,.8); outline-offset:2px; animation:swapme 1.2s ease-in-out infinite; }
.hand .tile.swap-me::after{ content:"⇄"; position:absolute; top:-8px; right:-8px; width:20px; height:20px; border-radius:50%;
  background:#2f6fbf; color:#fff; font-size:13px; font-weight:800; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 5px rgba(0,0,0,.3); }
@keyframes swapme{ 0%,100%{ opacity:.55; } 50%{ opacity:.85; } }

.stack.drop{ cursor:pointer; }
.tile.bad, .stack.bad{ animation:badshake .38s ease-in-out; }
@keyframes badshake{ 0%,100%{ transform:translateX(0); } 20%,60%{ transform:translateX(-6px); } 40%,80%{ transform:translateX(6px); } }

/* turn badge */
.turn-badge{ align-self:center; display:flex; align-items:center; gap:8px; margin:10px 0 12px;
  background:linear-gradient(#7a3ff0,#6a2fe0); color:#fff; font-weight:700; font-size:18px; padding:9px 24px;
  border-radius:22px; border:1px solid #2f6b45; box-shadow:0 4px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25); }
.turn-badge .star{ width:20px; height:20px; }
.turn-badge.wait{ background:linear-gradient(#5b6472,#474d59); border-color:#3a3f49; }
.turn-badge.low{ background:linear-gradient(#d9534a,#bf3d35); border-color:#9c2f28; }

/* your rack */
.myrack{ display:flex; align-items:center; gap:16px;
  background:linear-gradient(#7a3ff0,#6a2fe0); border:2px solid #c7c5f7; border-radius:18px; padding:12px 16px;
  box-shadow:0 0 0 3px rgba(116,197,135,.35), 0 6px 14px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25); }
.myrack .pname{ color:#fff; font-weight:700; font-size:18px; line-height:1.1; }
.myrack .pscore{ color:#fbe9a6; font-size:14px; font-weight:700; }
.hand{ display:flex; gap:8px; flex:1; justify-content:space-around; flex-wrap:wrap; min-height:66px; }
.hand .tile{ cursor:pointer; transition:transform .14s ease; touch-action:none; }
.hand .tile:hover{ transform:translateY(-5px); }
/* selecting a card makes the rest spread aside so it stands out */
.hand .tile.shift-l{ transform:translateX(-11px); }
.hand .tile.shift-r{ transform:translateX(11px); }
.hand .tile.sel{ transform:translateY(-11px) scale(1.05); outline:3px solid var(--gold); outline-offset:2px; position:relative; z-index:2; }
.myrack.dim .hand .tile{ cursor:default; opacity:.7; }
.myrack.dim .hand .tile:hover{ transform:none; }

/* flying + drag */
.tile.fly{ position:fixed; left:0; top:0; z-index:200; pointer-events:none; transition:transform .5s cubic-bezier(.2,.75,.3,1); }
.tile.back{ background:radial-gradient(circle at 50% 38%, #43966a, #2c6b48) !important; border-color:#eee3c8; }
.tile.back .pip, .tile.back .val{ opacity:0; }
.drag-clone{ position:fixed; left:0; top:0; z-index:200; pointer-events:none; opacity:.96; transform:translate(-300px,-300px); box-shadow:0 12px 22px rgba(0,0,0,.45); }

/* actions */
.actions{ display:flex; gap:14px; justify-content:center; margin:20px 0 8px; }
.act{ font:inherit; font-size:18px; font-weight:700; cursor:pointer; border:none; border-radius:14px; padding:13px 30px; color:#fff;
  box-shadow:var(--shadow-sm); }
.act:not(:disabled):active{ transform:translateY(2px); }
.act.cream{ background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.act.blue{ background:linear-gradient(var(--primary),var(--primary-2)); box-shadow:0 5px 14px rgba(122,63,240,.35); }
.act.orange{ background:var(--daily); }
.act.on{ outline:3px solid var(--primary); }
.act:disabled{ opacity:.45; cursor:default; }
.act.hint{ animation:hintpulse 1.1s ease-in-out infinite; }
@keyframes hintpulse{
  0%,100%{ box-shadow:0 5px 0 rgba(0,0,0,.22), 0 6px 12px rgba(0,0,0,.2), 0 0 0 0 rgba(255,226,122,0); }
  50%{ box-shadow:0 5px 0 rgba(0,0,0,.22), 0 6px 16px rgba(0,0,0,.22), 0 0 0 5px rgba(255,226,122,.85); transform:translateY(-2px); }
}

/* valid-play feedback: tile bounce + floating points */
.tile.pop{ animation:tilepop .42s ease; }
@keyframes tilepop{ 0%{ transform:scale(1); } 30%{ transform:scale(1.16); box-shadow:0 0 22px rgba(124,201,143,.9), 0 5px 8px rgba(0,0,0,.28); } 100%{ transform:scale(1); } }
.scorepop{ position:fixed; z-index:270; pointer-events:none; transform:translate(-50%,0);
  font-size:32px; font-weight:800; color:#2f8a4e; text-shadow:0 2px 0 #fff, 0 4px 8px rgba(0,0,0,.28);
  animation:scorefloat .95s cubic-bezier(.2,.8,.3,1) forwards; }
.scorepop.big{ color:#e08a2e; text-shadow:0 2px 0 #fff, 0 6px 14px rgba(0,0,0,.35); }
@keyframes scorefloat{
  0%{ opacity:0; transform:translate(-50%,8px) scale(.5); }
  22%{ opacity:1; transform:translate(-50%,-8px) scale(1.15); }
  40%{ transform:translate(-50%,-16px) scale(1); }
  100%{ opacity:0; transform:translate(-50%,-58px) scale(1); }
}

/* "not a word" toast (expert mode) */
.toast{ position:fixed; left:50%; top:38%; z-index:260; pointer-events:none;
  background:#2a2f52; color:#fff; font-weight:700; font-size:16px; padding:10px 20px; border-radius:12px;
  box-shadow:0 8px 22px rgba(20,24,50,.4); animation:toastfade 1s ease-out forwards; }
@keyframes toastfade{
  0%{ opacity:0; transform:translate(-50%,8px); }
  15%{ opacity:1; transform:translate(-50%,0); }
  80%{ opacity:1; transform:translate(-50%,0); }
  100%{ opacity:0; transform:translate(-50%,-10px); }
}

/* achievement / level-up pop */
.ach-pop{ position:fixed; top:16px; left:50%; z-index:300; display:flex; align-items:center; gap:14px;
  min-width:300px; max-width:92vw; padding:12px 20px; border-radius:16px; pointer-events:none;
  background:linear-gradient(#fff7e0,#f6e3b0); border:2px solid #e0b84e;
  box-shadow:0 12px 28px rgba(0,0,0,.3); animation:achin .5s cubic-bezier(.2,.9,.3,1) forwards; }
.ach-pop.out{ animation:achout .42s ease-in forwards; }
@keyframes achin{ from{ transform:translate(-50%,-130%); } to{ transform:translate(-50%,0); } }
@keyframes achout{ from{ transform:translate(-50%,0); opacity:1; } to{ transform:translate(-50%,-130%); opacity:0; } }
.ach-ic{ flex:0 0 auto; width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:#fff; background:linear-gradient(#f4c430,#e0a02a); box-shadow:0 2px 6px rgba(0,0,0,.25); }
.ach-ic.level{ font-weight:800; font-size:20px; background:linear-gradient(#7a3ff0,#6a2fe0); }
.ach-title{ font-weight:800; color:#7a5a10; font-size:15px; }
.ach-sub{ color:#6b7192; font-size:14px; }

/* bingo celebration */
.bingo{ position:fixed; left:50%; top:44%; z-index:250; pointer-events:none; text-align:center;
  transform:translate(-50%,-50%); animation:bingopop 1.5s cubic-bezier(.2,.9,.3,1) forwards; }
.bingo-word{ display:block; font-size:60px; font-weight:800; letter-spacing:-1px; color:var(--ink);
  text-shadow:0 6px 20px rgba(31,37,72,.25); }
.bingo-plus{ display:block; margin-top:2px; font-size:32px; font-weight:800; color:var(--primary); }
@keyframes bingopop{
  0%{ transform:translate(-50%,-50%) scale(.4) rotate(-6deg); opacity:0; }
  18%{ transform:translate(-50%,-50%) scale(1.18) rotate(3deg); opacity:1; }
  32%{ transform:translate(-50%,-50%) scale(1) rotate(0); }
  70%{ transform:translate(-50%,-52%) scale(1); opacity:1; }
  100%{ transform:translate(-50%,-64%) scale(1); opacity:0; }
}

/* combo pill — grows as you chain plays in one turn */
.combo-pill{ position:fixed; left:50%; top:30%; z-index:265; pointer-events:none; transform:translate(-50%,0);
  font-weight:800; letter-spacing:1px; color:#fff; padding:6px 16px; border-radius:16px; white-space:nowrap;
  background:linear-gradient(var(--primary),var(--primary-2)); text-shadow:0 1px 2px rgba(0,0,0,.3);
  box-shadow:0 6px 16px rgba(122,63,240,.4); animation:combopop 1s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes combopop{
  0%{ opacity:0; transform:translate(-50%,10px) scale(.5) rotate(-4deg); }
  20%{ opacity:1; transform:translate(-50%,0) scale(1.15) rotate(2deg); }
  35%{ transform:translate(-50%,0) scale(1) rotate(0); }
  75%{ opacity:1; transform:translate(-50%,-6px) scale(1); }
  100%{ opacity:0; transform:translate(-50%,-30px) scale(1); }
}

/* live combo meter — sits under the turn badge while a chain is open */
.combo-meter{ position:fixed; left:50%; top:64px; transform:translateX(-50%); z-index:180; pointer-events:none;
  display:flex; align-items:center; gap:10px; padding:6px 16px; border-radius:20px; font-weight:800; white-space:nowrap;
  border:2px solid #fff; box-shadow:0 6px 16px rgba(0,0,0,.3); animation:cmpop .25s cubic-bezier(.2,.9,.3,1); }
.combo-meter.live{ background:linear-gradient(var(--primary),var(--primary-2)); color:#fff; }
.combo-meter.done{ background:#2a2f52; color:#fff; }
.combo-meter .cm-count{ letter-spacing:1px; }
.combo-meter .cm-next{ font-weight:700; opacity:.95; font-size:.92em; }
.combo-meter.live .cm-next b{ font-size:1.15em; }
@keyframes cmpop{ from{ transform:translateX(-50%) scale(.7); opacity:0; } to{ transform:translateX(-50%) scale(1); opacity:1; } }

/* a still-playable tile while a chain is open — gently invites another word */
.hand .tile.chainable{ animation:chainpulse 1.2s ease-in-out infinite; }
@keyframes chainpulse{ 0%,100%{ box-shadow:0 4px 8px rgba(0,0,0,.24); } 50%{ box-shadow:0 0 16px rgba(224,138,46,.75), 0 4px 8px rgba(0,0,0,.24); } }

/* End Turn is de-emphasised while a chain is still open (ending early leaves points behind) */
.act.secondary{ opacity:.62; }
.act.secondary:not(:disabled):hover{ opacity:.85; }

/* one-time chain coach */
.coach{ position:fixed; left:50%; top:96px; transform:translateX(-50%); z-index:320; max-width:340px; width:88vw;
  background:linear-gradient(#fff7e6,#fbeecb); border:2px solid #e0b84e; border-radius:16px; padding:16px 18px;
  box-shadow:0 16px 36px rgba(0,0,0,.34); text-align:center; animation:achin .45s cubic-bezier(.2,.9,.3,1); }
.coach-h{ font-weight:800; font-size:18px; color:#8a5a10; margin-bottom:6px; }
.coach-b{ font-size:14px; color:#6b7192; line-height:1.45; margin-bottom:12px; }
.coach-x{ font:inherit; font-weight:700; cursor:pointer; border:none; border-radius:20px; padding:9px 22px;
  background:#e08a2e; color:#fff; box-shadow:0 4px 0 rgba(0,0,0,.18); }
.coach-x:active{ transform:translateY(2px); box-shadow:0 2px 0 rgba(0,0,0,.18); }

/* confetti burst (long-word / milestone celebration) */
.confetti-piece{ position:fixed; z-index:255; pointer-events:none; width:9px; height:14px; border-radius:2px;
  transform:translate(-50%,-50%); animation:confetti 1.3s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes confetti{
  0%{ opacity:1; transform:translate(-50%,-50%) rotate(0); }
  100%{ opacity:0; transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); }
}

.assist-warn{ display:block; width:max-content; max-width:92%; margin:12px auto 0; text-align:center;
  background:#fbe7c9; color:#8a5a12; border:1px solid #f6e0bd; border-radius:12px; padding:7px 16px; font-size:14px; font-weight:700; }
.msg{ text-align:center; margin:8px 0 2px; font-size:15px; color:#6a5c46; min-height:20px; }
.msg b{ color:#6a2fe0; }
.log{ max-width:660px; margin:8px auto 0; font-size:13px; color:#6b7192; max-height:92px; overflow-y:auto; text-align:center; }
.log div{ padding:1px 0; }
.log div:first-child{ color:#4f7d3f; }

/* modals */
.modal{ position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; background:rgba(20,24,50,.5); backdrop-filter:blur(3px); padding:16px; }
.modal-box{ position:relative; background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:26px 30px; max-width:470px; text-align:center; color:var(--ink); max-height:calc(100dvh - 24px); overflow-y:auto; box-shadow:var(--shadow); }
.modal-box.left{ text-align:left; max-width:540px; }
.modal-box h2{ color:var(--ink); letter-spacing:-.3px; font-size:24px; font-weight:800; margin-bottom:12px; }
.modal-box p{ margin:9px 0; line-height:1.45; color:var(--muted); }
.modal-box ul{ margin:8px 0 8px 22px; line-height:1.6; color:var(--muted); }
.modal-box .lead{ margin-top:16px; font-weight:bold; color:var(--ink); }
.setup-box{ max-width:460px; }
.cfg{ display:flex; flex-direction:column; gap:15px; margin:20px 0 22px; text-align:left; }
.cfg-row{ display:flex; flex-direction:column; gap:7px; }
.cfg-label{ font-size:12px; font-weight:800; letter-spacing:1.2px; text-transform:uppercase; color:var(--muted); }
.cfg-hint{ display:block; font-size:11px; font-weight:600; letter-spacing:0; text-transform:none; color:var(--muted); margin-top:2px; }
.seg{ display:flex; gap:4px; background:var(--surface-2); border:1px solid var(--line); border-radius:13px; padding:4px; }
.seg .opt{ flex:1; font:inherit; font-size:15px; font-weight:600; cursor:pointer; border:none; background:transparent;
  color:var(--muted); padding:10px 6px; border-radius:9px; transition:background .12s; }
.seg .opt:hover:not(.on){ background:#fff; }
.seg .opt.on{ background:var(--primary); color:#fff; font-weight:800; box-shadow:0 2px 6px rgba(122,63,240,.35); }

.opts{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin:6px 0; }
.opt{ font:inherit; font-size:15px; cursor:pointer; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:9px 16px; color:var(--ink); font-weight:600; }
.opt.on{ background:var(--primary); color:#fff; border-color:var(--primary); font-weight:700; }
.big{ font:inherit; font-size:19px; font-weight:800; cursor:pointer; background:linear-gradient(var(--primary),var(--primary-2)); color:#fff; border:none; border-radius:14px; padding:14px 36px; margin-top:14px; box-shadow:0 6px 16px rgba(122,63,240,.35); }
.big:hover{ filter:brightness(1.05); }
.big:active{ transform:translateY(1px); }
/* close/leave/back sits on its own line, pinned to the top-right of the box — never over the title */
.modal-x{ display:block; width:fit-content; margin:-6px -6px 10px auto; font:inherit; cursor:pointer; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:6px 12px; color:var(--muted); }
.set-row{ display:flex; align-items:center; justify-content:center; gap:12px; margin:14px 0; font-size:18px; }
/* level */
.level-box{ margin:6px 0 14px; }
.level-num{ font-size:22px; font-weight:800; color:#6a2fe0; }
.level-bar{ height:14px; border-radius:8px; background:#e3d6b6; overflow:hidden; margin:8px 0 5px; border:1px solid #d3c39a; }
.level-fill{ height:100%; width:0; border-radius:8px; background:linear-gradient(90deg,#7a3ff0,#a5a2f2); transition:width .5s ease; }
.level-xp{ font-size:13px; color:#7a6f57; }

/* achievements page (full-screen, sidebar + content) */
.ach-page{ position:fixed; inset:0; z-index:95; display:flex; background:linear-gradient(135deg,var(--bg1),var(--bg2)); overflow:hidden; }
.ach-side{ width:250px; flex:0 0 auto; background:var(--surface); border-right:1px solid var(--line); padding:22px 18px; display:flex; flex-direction:column; gap:18px; overflow-y:auto; }
.ach-side-logo{ display:flex; align-items:center; gap:9px; }
.ach-side-name{ font-size:20px; font-weight:800; letter-spacing:2px; color:var(--primary); line-height:1; }
.ach-side-name span{ display:block; font-size:10px; letter-spacing:5px; color:var(--muted); margin-top:2px; }
.ach-trophy{ background:linear-gradient(160deg,var(--primary),var(--primary-2)); border-radius:18px; padding:20px 16px; text-align:center; color:#fff; box-shadow:0 8px 22px rgba(122,63,240,.32); }
.ach-trophy-ic{ width:64px; height:64px; margin:0 auto 8px; color:var(--gold); }
.ach-trophy-ic svg{ width:100%; height:100%; }
.ach-trophy-num{ font-size:30px; font-weight:800; }
.ach-trophy-lab{ font-size:11px; letter-spacing:2px; opacity:.85; margin-bottom:12px; }
.ach-trophy-bar{ height:8px; background:rgba(255,255,255,.25); border-radius:6px; overflow:hidden; }
.ach-trophy-bar>div{ height:100%; background:linear-gradient(90deg,var(--gold),#ffd873); border-radius:6px; transition:width .4s; }
.ach-trophy-pct{ font-size:11px; margin-top:8px; opacity:.9; }
.ach-filters{ display:flex; flex-direction:column; gap:7px; }
.ach-filter{ display:flex; align-items:center; justify-content:space-between; font:inherit; font-size:15px; font-weight:600; cursor:pointer; background:transparent; border:none; border-radius:12px; padding:11px 14px; color:var(--muted); }
.ach-filter b{ font-size:12px; font-weight:700; color:var(--muted); background:var(--surface-2); border-radius:8px; padding:1px 9px; }
.ach-filter:hover{ background:var(--surface-2); color:var(--ink); }
.ach-filter.on{ background:var(--primary); color:#fff; }
.ach-filter.on b{ background:rgba(255,255,255,.25); color:#fff; }

.ach-main{ flex:1; overflow-y:auto; padding:26px 30px 40px; }
.ach-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:20px; }
.ach-head h2{ color:var(--primary); letter-spacing:2px; font-size:30px; }
.ach-subtitle{ color:var(--muted); font-size:15px; margin-top:4px; }
.ach-head .chip{ flex:0 0 auto; }

.ach-summary{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:26px; }
.ach-sum{ display:flex; align-items:center; gap:14px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px; box-shadow:var(--shadow-sm); }
.ach-sum-ic{ width:46px; height:46px; border-radius:50%; background:color-mix(in srgb,var(--gold) 20%,var(--surface)); color:var(--gold); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.ach-sum-ic.green{ background:color-mix(in srgb,var(--goal) 16%,var(--surface)); color:var(--goal); }
.ach-sum-ic svg{ width:24px; height:24px; }
.ach-sum-lab{ font-size:13px; color:var(--muted); }
.ach-sum-num{ font-size:22px; font-weight:800; color:var(--ink); }
.ach-sum-sub{ font-size:12px; color:var(--muted); }
.ach-ring{ width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:0 0 auto; background:var(--line); }
.ach-ring span{ background:var(--surface); width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:var(--primary); }

.ach-section{ margin-bottom:24px; }
.ach-sec-head{ display:flex; align-items:center; gap:9px; font-size:14px; font-weight:800; letter-spacing:1.5px; color:var(--primary); margin-bottom:12px; }
.ach-sec-ic{ width:22px; height:22px; color:var(--primary); }
.ach-sec-ic svg{ width:100%; height:100%; }
.ach-sec-count{ margin-left:auto; font-size:12px; font-weight:600; letter-spacing:0; color:var(--muted); }
.ach-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.acard{ display:flex; gap:14px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:15px; box-shadow:var(--shadow-sm); }
.acard-ic{ width:48px; height:48px; border-radius:50%; flex:0 0 auto; display:flex; align-items:center; justify-content:center; background:var(--surface-2); color:var(--muted); }
.acard-ic.on{ background:color-mix(in srgb,var(--primary) 14%,var(--surface)); color:var(--primary); }
.acard-ic svg{ width:26px; height:26px; }
.acard-num{ font-size:19px; font-weight:800; letter-spacing:-.5px; }
.acard-body{ flex:1; min-width:0; }
.acard-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.acard-name{ font-weight:700; color:var(--ink); font-size:15px; }
.acard-count{ font-size:13px; font-weight:800; color:var(--muted); }
.acard-desc{ font-size:13px; color:var(--muted); margin:2px 0 9px; }
.acard-bar{ height:7px; background:var(--surface-2); border-radius:5px; overflow:hidden; margin-bottom:10px; }
.acard-bar>div{ height:100%; background:linear-gradient(90deg,var(--primary),#a78bfa); border-radius:5px; }
.acard-tiers{ display:flex; gap:6px; flex-wrap:wrap; }
.tchip{ width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--muted); background:var(--surface-2); border:1.5px solid var(--line); }
.tchip.done{ color:#fff; background:linear-gradient(160deg,var(--primary),var(--primary-2)); border-color:var(--primary-2); box-shadow:0 1px 4px rgba(122,63,240,.35); }
.ach-foot{ text-align:center; color:var(--muted); font-size:14px; background:var(--surface); border:1px dashed var(--line); border-radius:12px; padding:12px; margin-top:8px; }
@media (max-width:720px){ .ach-side{ display:none; } .ach-summary{ grid-template-columns:1fr; } }

.prof-note{ font-size:13px; color:#6b7192; margin-bottom:6px; }
.prof-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0; }
.prof-stat{ background:#fff; border:1px solid #e5e8f2; border-radius:14px; padding:16px 10px; }
.prof-num{ font-size:34px; font-weight:800; color:#6a2fe0; line-height:1.1; }
.prof-lab{ font-size:13px; color:#7a6f57; margin-top:4px; }

.over-box{ max-width:400px; }
.over-title{ font-size:40px !important; letter-spacing:-1px; font-weight:800; animation:overpop .5s cubic-bezier(.2,.9,.3,1); }
.over-title.win{ color:var(--primary) !important; }
.over-title.lose{ color:var(--muted) !important; }
@keyframes overpop{ 0%{ transform:scale(.5); opacity:0; } 55%{ transform:scale(1.12); } 100%{ transform:scale(1); opacity:1; } }
.over-scores{ margin:14px 0; }
.over-scores .row{ display:flex; align-items:center; gap:8px; font-size:18px; padding:8px 4px; border-bottom:1px solid var(--line); }
.over-scores .row .rn{ flex:1; text-align:left; color:var(--ink); }
.over-scores .row .rv{ color:var(--muted); font-weight:700; }
.over-scores .row.win{ font-weight:bold; }
.over-scores .row.win .rn, .over-scores .row.win .rv{ color:var(--primary); }
.over-recap{ margin:6px 0 4px; }
.recap-line{ font-size:15px; color:var(--muted); }
.recap-line b{ color:var(--ink); }
.over-btns{ display:flex; gap:10px; justify-content:center; margin-top:16px; }
.over-btns .big{ margin-top:0; padding:13px 26px; }
.share-btn{ background:var(--surface) !important; color:var(--ink) !important; border:1px solid var(--line) !important; box-shadow:var(--shadow-sm) !important; }
.over-menu{ display:block; margin:14px auto 0; font-size:15px; color:var(--muted); }

/* ---- online client: auth / profile / leaderboard ---- */
.field{ font:inherit; font-size:16px; padding:11px 14px; border-radius:12px; border:1px solid var(--line); background:var(--surface-2); color:var(--ink); }
.field:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(122,63,240,.2); }
.field-err{ color:#c0392b; font-size:13px; min-height:16px; font-weight:600; }
.field-hint{ color:var(--muted); font-size:12px; margin-top:-4px; }
.prof-name-row{ display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; }
.mini-btn{ font:inherit; font-size:12px; font-weight:700; cursor:pointer; background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:4px 10px; color:var(--muted); }
.mini-btn:hover{ color:var(--ink); }
.edit-name{ display:flex; flex-direction:column; gap:8px; max-width:280px; margin:10px auto 0; text-align:left; }
.edit-name-row{ display:flex; align-items:center; gap:12px; }
.edit-name-row .big{ flex:1; }
.leader-list{ max-height:60vh; overflow-y:auto; margin-top:8px; text-align:left; }
.leader-row{ display:flex; align-items:center; gap:12px; padding:9px 6px; border-bottom:1px solid #e3d6b6; }
.leader-rank{ width:26px; height:26px; border-radius:50%; background:#f4f6fd; color:#7a6f57; font-weight:800; font-size:13px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.leader-row:nth-child(1) .leader-rank{ background:linear-gradient(#ffe9a8,#f4c430); color:#7a5a10; }
.leader-name{ flex:1; font-weight:700; color:#20264a; }
.leader-xp{ color:#6b7192; font-weight:700; font-size:14px; }
.pro-tag{ display:inline-block; background:linear-gradient(#e0a02a,#c98a1e); color:#fff; font-weight:800; letter-spacing:2px; font-size:13px; padding:4px 14px; border-radius:10px; margin:8px 0; }

/* ---- hardening + pro perks ---- */
.verify-bar{ text-align:center; background:#fff4e0; color:#a15c12; font-weight:600; font-size:14px; padding:8px 14px; border-bottom:1px solid #f6e0bd; }
.linkbtn{ font:inherit; font-weight:800; background:none; border:none; color:var(--primary); text-decoration:underline; cursor:pointer; }
.adbar{ position:fixed; left:0; right:0; bottom:0; z-index:80; text-align:center; padding:10px; cursor:pointer;
  padding-bottom:calc(10px + env(safe-area-inset-bottom)); /* clear the home-bar notch */
  background:var(--surface); color:var(--muted); font-size:13px; border-top:1px solid var(--line); }
.adbar b{ color:#6a2fe0; }

/* ---------- phone layout (portrait) ---------- */
@media (max-width:560px){
  .felt{ padding:10px 8px; }
  /* opponents stack above/below so the board gets the full width */
  .arena{ flex-direction:column; gap:6px; }
  .oppside{ display:flex; flex-direction:row; gap:6px; justify-content:center; flex-wrap:wrap; }
  .zone{ width:100%; min-height:120px; }
  /* smaller BASE tiles so long words fit near scale 1 (fitBoard then barely shrinks) */
  .board .tile{ width:62px; height:74px; }
  .tile{ width:46px; height:54px; }
  .tile .pip{ font-size:24px; } .tile .val{ font-size:10px; }
  .hand{ gap:6px; min-height:56px; }
  /* keep insertion + drop hit-zones finger-sized */
  .gap{ height:74px; } .gap.ins,.gap.drop{ width:30px; }
  .gap.drop.over{ width:52px !important; }
  /* the fixed adbar must not sit over the actions row / rack */
  .table{ padding-bottom:72px; }
  .actions{ margin:14px 0 6px; gap:10px; }
  .act{ font-size:17px; padding:12px 22px; }
  .myrack{ gap:10px; padding:10px 12px; }
  .turn-badge{ font-size:16px; padding:7px 18px; }
  .combo-meter{ top:56px; font-size:.95rem; }
  .modal-box{ padding:22px 18px; }
}
.tos-row{ font-size:13px; color:#6a5c46; display:flex; align-items:center; gap:7px; }
.tos-row a{ color:#6a2fe0; }

/* theme picker (profile) */
.theme-head{ font-size:12px; font-weight:800; letter-spacing:1.4px; text-transform:uppercase; color:#6b7192; margin:14px 0 6px; }
.theme-pick{ display:flex; gap:10px; justify-content:center; margin-bottom:14px; }
.swatch{ width:38px; height:38px; border-radius:10px; cursor:pointer; border:2px solid #e5e8f2; position:relative; }
.swatch.on{ box-shadow:0 0 0 3px #7a3ff0; }
.swatch.locked{ opacity:.55; }
.sw-default{ background:linear-gradient(#f8eed3,#efe1bd); }
.sw-dark{ background:linear-gradient(#3a3f4a,#2b2f38); }
.sw-wood{ background:linear-gradient(#c8935a,#b07d45); }
.sw-neon{ background:linear-gradient(#1b1030,#120a22); box-shadow:inset 0 0 8px rgba(57,255,208,.6); }

/* tile themes (Pro cosmetic) — applied via <body data-theme> */
body[data-theme="dark"] .tile{ background:linear-gradient(#3a3f4a,#2b2f38); color:#e8ecf3; border-color:#232833; box-shadow:0 3px 0 #1c2027,0 5px 8px rgba(0,0,0,.4); }
body[data-theme="dark"] .tile .val{ color:#9aa4b2; }
body[data-theme="wood"] .tile{ background:linear-gradient(#c8935a,#b07d45); color:#3a2412; border-color:#8f6330; box-shadow:0 3px 0 #7c5528,0 5px 8px rgba(0,0,0,.35); }
body[data-theme="wood"] .tile .val{ color:#6b4a22; }
body[data-theme="neon"] .tile{ background:linear-gradient(#1b1030,#120a22); color:#39ffd0; border-color:#5a2b9e; box-shadow:0 0 10px rgba(57,255,208,.5),0 3px 0 #0a0616; }
body[data-theme="neon"] .tile .val{ color:#c98bff; }

/* account settings */
.set-email{ text-align:center; color:#6b7192; font-size:14px; margin-bottom:14px; }
.set-section{ display:flex; flex-direction:column; gap:9px; padding:14px 0; border-top:1px solid #e3d6b6; }
.set-title{ font-weight:800; color:#20264a; font-size:15px; }
.set-note{ font-size:13px; color:#9a8d70; margin:0; }
.set-section.danger .set-title{ color:#b0392b; }
.danger-btn{ background:#fdecec !important; color:#b0392b !important; border-color:#e8b4b0 !important; }

/* google sign-in */
.or-div{ text-align:center; color:#8a90b0; font-size:13px; margin:12px 0 8px; }
.gbtn{ display:flex; align-items:center; justify-content:center; gap:10px; width:100%; font:inherit; font-size:16px; font-weight:700;
  cursor:pointer; background:#fff; border:1px solid #dcd0ab; border-radius:12px; padding:11px 16px; color:#20264a; }
.gbtn:hover{ background:#f4f6fd; }

/* play-online menu + private room lobby */
.home-btn.big-cta{ font-size:26px; padding:22px; box-shadow:0 5px 0 rgba(0,0,0,.24); }
.join-row{ display:flex; gap:8px; }
.join-row .field{ flex:1; text-transform:uppercase; letter-spacing:2px; font-weight:700; text-align:center; }
.join-row .home-btn{ flex:0 0 auto; width:auto; padding:11px 20px; }
.online-note{ font-size:13px; color:var(--muted); max-width:320px; margin:14px auto 0; line-height:1.45; }
.lobby-sub{ color:var(--muted); font-size:14px; margin-top:6px; }
.lobby-code{ font-size:52px; font-weight:800; letter-spacing:10px; color:var(--primary); margin:6px 0 12px; padding-left:10px; }
.lobby-players{ display:flex; flex-direction:column; gap:8px; max-width:280px; margin:16px auto; }
.lobby-player{ background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:10px 14px; font-weight:700; color:var(--ink); }
.host-tag{ font-size:11px; font-weight:800; letter-spacing:1px; color:#fff; background:var(--primary); border-radius:8px; padding:1px 8px; margin-left:6px; }
.lobby-wait{ color:var(--muted); font-size:14px; }

/* stop accidental text/callout selection while playing */
.felt, .tile, .backtile, .myrack, .opp, .turn-badge, .drawpile, .actions, .home-card, .home-btn, .ach-page, .lobby-code, .brand {
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
.board .tile{ touch-action:none; }
/* a board tile picked up to slide (rearrange) — clearly lifted */
.stack.sliding{ transform:translateY(-12px); z-index:3; }
.stack.sliding .tile{ outline:3px solid var(--gold); outline-offset:2px; box-shadow:0 0 20px rgba(244,196,48,.8), 0 8px 12px rgba(0,0,0,.3); }

/* --- polished pickup: hole left behind + smoother insert --- */
.tile.empty-slot{ background:rgba(0,0,0,.14); border:none; box-shadow:inset 0 2px 10px rgba(0,0,0,.32); }
.tile.empty-slot .pip, .tile.empty-slot .val{ display:none; }
.stack{ transition:transform .16s cubic-bezier(.2,.8,.3,1); }        /* tiles slide apart smoothly on insert */
.drag-clone{ transition:transform .04s linear; opacity:1; box-shadow:0 16px 28px rgba(0,0,0,.4); }

/* ======================= WORD HUNT ======================= */
#huntWrap{ display:flex; flex-direction:column; align-items:center; gap:12px; padding:8px 4px 90px; }
.hunt-top{ width:100%; max-width:420px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.hunt-timer{ font-size:30px; font-weight:800; color:var(--ink); min-width:74px; font-variant-numeric:tabular-nums; }
.hunt-timer.low{ color:var(--battle); animation:pulselow 1s ease-in-out infinite; }
@keyframes pulselow{ 50%{ opacity:.45; } }
.hunt-scores{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.hs{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:5px 12px; text-align:center; min-width:56px; box-shadow:var(--shadow-sm); }
.hs b{ display:block; font-size:18px; color:var(--ink); line-height:1.1; }
.hs span{ font-size:11px; color:var(--muted); }
.hs.me{ background:var(--primary); border-color:var(--primary); } .hs.me b{ color:#fff; } .hs.me span{ color:#dfe0fb; }
.hunt-word{ min-height:34px; font-size:26px; font-weight:800; letter-spacing:4px; color:var(--muted); text-transform:uppercase; }
.hunt-word.valid{ color:#16a34a; } .hunt-word.invalid{ color:var(--battle); } .hunt-word.dupe{ color:var(--daily); }
.hunt-word.scored{ animation:tilepop .3s ease; }
.hunt-grid{ position:relative; display:grid; grid-template-columns:repeat(var(--n,4), 1fr); gap:9px; width:min(92vw, 380px); touch-action:none; user-select:none; -webkit-user-select:none; }
.hunt-line{ position:absolute; inset:0; pointer-events:none; z-index:3; overflow:visible; }
.hcell{ position:relative; aspect-ratio:1; display:flex; align-items:center; justify-content:center; cursor:pointer;
  background:var(--tile); border-radius:14px; box-shadow:0 4px 12px rgba(31,37,72,.2), inset 0 1px 0 rgba(255,255,255,.1);
  font-size:min(8.5vw,34px); font-weight:800; color:var(--tile-ink); transition:transform .1s ease, background .1s ease; }
.hcell .pip{ pointer-events:none; }
.hcell.sel{ background:linear-gradient(var(--primary),var(--primary-2)); color:#fff; box-shadow:0 0 0 3px rgba(122,63,240,.3), 0 5px 12px rgba(122,63,240,.4); transform:scale(1.05); z-index:2; }
.hcell.flash-good{ background:linear-gradient(#34d399,#10b981) !important; color:#fff !important; }
.hcell.flash-bad{ background:linear-gradient(#fb7185,#f43f5e) !important; color:#fff !important; }
.hcell.flash-dupe{ background:linear-gradient(#fbbf24,#f59e0b) !important; color:#fff !important; }
.hunt-actions{ display:flex; gap:12px; }
.hunt-hint{ font-size:13px; color:var(--muted); }
.hunt-result-score .big-score{ font-size:56px; font-weight:800; color:var(--ink); line-height:1; letter-spacing:-1.5px; }
.hunt-found-line{ font-size:16px; color:var(--muted); margin:8px 0; }
.hunt-found-line b{ color:var(--ink); }
.hunt-missed{ margin-top:6px; }
.missed-h{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:1px; }
.missed-words{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin-top:6px; }
.missed-words span{ background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:3px 9px; font-weight:700; color:var(--muted); }
@media (max-width:560px){ .hunt-grid{ width:96vw; gap:7px; } .hunt-timer{ font-size:26px; } }

/* ===== Battle + Goal (Word Hunt formats) ===== */
.home-btn.battle{ background:linear-gradient(#e4572e,#c8431f); color:#fff; border:none; }
.home-btn.goal{ background:linear-gradient(#8e5bd0,#7444bb); color:#fff; border:none; }
#huntWrap[data-format="battle"] .hunt-word,
#huntWrap[data-format="goal"] .hunt-word{ min-height:30px; font-size:22px; }
/* Takeover: a claimed tile is FILLED with its owner's colour (bright letters), so the board reads as territory.
   :not(.sel) lets the purple trace-highlight still win while you're tracing over an owned tile. */
.hcell[data-owner]{ color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.45); }
.hcell[data-owner="0"]:not(.sel){ background:var(--o0); } .hcell[data-owner="1"]:not(.sel){ background:var(--o1); }
.hcell[data-owner="2"]:not(.sel){ background:var(--o2); } .hcell[data-owner="3"]:not(.sel){ background:var(--o3); }
.hcell[data-owner="4"]:not(.sel){ background:var(--o4); } .hcell[data-owner="5"]:not(.sel){ background:var(--o5); }
.hcell[data-owner="6"]:not(.sel){ background:var(--o6); } .hcell[data-owner="7"]:not(.sel){ background:var(--o7); }
.hcell.mine{ box-shadow:0 0 0 3px #fff, 0 0 0 5px rgba(0,0,0,.12), 0 5px 12px rgba(31,37,72,.3); transform:scale(1.05); z-index:1; }
.hcell.claimpop{ animation:claimpop .36s cubic-bezier(.2,.9,.3,1); }
@keyframes claimpop{ 0%{ transform:scale(.8); } 55%{ transform:scale(1.14); } 100%{ transform:scale(1); } }
/* battle tile bar */
.tilebar{ display:flex; width:100%; height:16px; border-radius:9px; overflow:hidden; background:var(--surface-2); border:1px solid var(--line); }
.tilebar .seg{ height:100%; transition:width .25s ease; } .tilebar .seg.neutral{ background:#dfe3f0; }
.tilechips{ display:flex; flex-wrap:wrap; gap:6px 10px; justify-content:center; margin-top:6px; font-size:13px; }
.tilechips .tchip{ display:inline-flex; align-items:center; gap:4px; color:var(--muted); background:none; border:none; width:auto; height:auto; }
.tilechips .tchip.me{ font-weight:800; color:var(--ink); }
.tilechips .tchip i.dot{ width:11px; height:11px; border-radius:3px; display:inline-block; flex:0 0 auto; }
.tilechips .tchip b{ color:var(--ink); }
.tilechips .tchip{ align-items:flex-start; }
.tc-body{ display:flex; flex-direction:column; line-height:1.2; }
/* goal banner + progress rail */
.hunt-goal{ background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--goal); border-radius:14px; padding:9px 15px; text-align:center; max-width:420px; width:100%; box-shadow:var(--shadow-sm); }
.goal-label{ font-weight:800; color:var(--ink); font-size:16px; }
.goal-prog{ font-size:15px; color:var(--muted); } .goal-prog b{ color:var(--goal); font-size:20px; }
.goal-letters{ display:flex; flex-wrap:wrap; gap:4px; justify-content:center; margin-top:5px; }
.goal-letters span{ background:var(--goal); color:#fff; font-weight:800; width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:13px; }
.hunt-scores .grail{ display:flex; align-items:center; gap:8px; width:100%; max-width:280px; font-size:13px; margin:2px 0; }
.hunt-scores .grail.me{ font-weight:800; }
.grail .gn{ display:flex; flex-direction:column; width:auto; min-width:88px; max-width:130px; text-align:left; color:var(--muted); line-height:1.2; }
.grail .gn .gn-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.grail .gbar{ flex:1; height:10px; background:var(--surface-2); border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.grail .gbar i{ display:block; height:100%; border-radius:6px; transition:width .3s ease; }
.grail .gc{ width:52px; text-align:right; color:var(--muted); }
#huntWrap[data-format="goal"] .hunt-scores,
#huntWrap[data-format="battle"] .hunt-scores{ flex-direction:column; align-items:flex-end; }
/* huntRoom join row */
.join-row{ display:flex; gap:8px; justify-content:center; margin-top:12px; }
.join-input{ font:inherit; font-size:18px; font-weight:800; letter-spacing:3px; text-transform:uppercase; text-align:center; width:110px; padding:9px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--ink); }
.goal-done{ font-size:12px; font-weight:800; color:var(--goal); text-transform:uppercase; letter-spacing:.5px; }
.grail .gdone{ font-weight:800; color:var(--goal); width:34px; text-align:right; }

/* XP bar on the results screen */
.xp-wrap{ margin:14px auto 4px; max-width:300px; }
.xp-head{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); font-weight:700; margin-bottom:5px; }
.xp-head b{ color:var(--ink); }
.xp-head .xp-gain{ margin-left:auto; color:var(--primary); font-weight:800; }
.xp-track{ height:12px; border-radius:8px; background:var(--surface-2); border:1px solid var(--line); overflow:hidden; }
.xp-fill{ height:100%; width:0; border-radius:8px; background:linear-gradient(90deg,var(--primary),var(--primary-2)); transition:width .12s linear; }
.xp-guest{ font-size:13px; color:var(--muted); }

/* home v2 — big main modes + secondary + nav */
.mode-big{ font:inherit; text-align:left; cursor:pointer; width:100%; display:flex; flex-direction:column; gap:5px;
  border:none; border-radius:18px; padding:18px 20px; color:#fff; margin-bottom:12px; box-shadow:var(--shadow-sm);
  transition:transform .1s ease, box-shadow .1s ease; }
.mode-big:hover{ transform:translateY(-2px); box-shadow:var(--shadow); }
.mode-big:active{ transform:translateY(0); }
.mode-big.takeover{ background:linear-gradient(135deg,#ff5a86,#f5356b); box-shadow:0 8px 20px rgba(245,53,107,.32); }
.mode-big.gauntlet{ background:linear-gradient(135deg,#28c56e,#18a558); box-shadow:0 8px 20px rgba(24,165,88,.3); }
.mb-name{ font-size:26px; font-weight:800; letter-spacing:-.5px; }
.mb-desc{ font-size:13px; opacity:.94; line-height:1.35; }
.mode-row{ display:flex; gap:10px; margin-bottom:16px; }
.mode-mini{ font:inherit; flex:1; cursor:pointer; text-align:center; background:var(--surface); border:1px solid var(--line);
  border-radius:14px; padding:12px 8px; box-shadow:var(--shadow-sm); transition:transform .1s ease; display:flex; flex-direction:column; gap:2px; }
.mode-mini:hover{ transform:translateY(-2px); }
.mode-mini b{ color:var(--ink); font-size:15px; }
.mode-mini span{ color:var(--muted); font-size:11px; }
.nav-row{ display:flex; gap:10px; }
.nav-btn{ font:inherit; flex:1; cursor:pointer; font-weight:700; font-size:15px; color:var(--ink); background:var(--surface);
  border:1px solid var(--line); border-radius:14px; padding:13px 8px; box-shadow:var(--shadow-sm); transition:transform .1s ease; }
.nav-btn:hover{ transform:translateY(-2px); color:var(--primary); }
.mode-start-desc{ color:var(--muted); font-size:15px; margin:4px 0 16px; line-height:1.4; }

/* end-of-game word breakdown */
.word-recap{ margin:12px 0 6px; text-align:left; max-height:230px; overflow-y:auto; }
.wr-player{ margin-bottom:12px; }
.wr-name{ font-size:13px; font-weight:800; color:var(--ink); margin-bottom:6px; display:flex; align-items:baseline; gap:8px; }
.wr-count{ font-size:11px; font-weight:600; color:var(--muted); }
.wr-words{ display:flex; flex-wrap:wrap; gap:6px; }
.wr-word{ display:inline-flex; align-items:center; gap:5px; background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:4px 9px;
  font-weight:700; font-size:13px; color:var(--ink); text-transform:uppercase; letter-spacing:.5px;
  opacity:0; transform:translateY(6px) scale(.9); animation:wrpop .34s cubic-bezier(.2,.9,.3,1) forwards; }
.wr-word .wr-p{ font-size:11px; font-weight:800; color:var(--primary); letter-spacing:0; text-transform:none; }
@keyframes wrpop{ to{ opacity:1; transform:translateY(0) scale(1); } }

/* Gauntlet: the whole goal card blows up front-and-centre, counts 3-2-1, then flies into the banner */
.goal-intro{ position:fixed; inset:0; z-index:240; display:none; align-items:center; justify-content:center;
  background:rgba(20,24,50,.6); backdrop-filter:blur(3px); padding:24px; pointer-events:none;
  opacity:1; transition:opacity .5s ease; }
.goal-intro.show{ display:flex; }
.goal-intro.show .gi-card{ animation:giin .36s cubic-bezier(.2,.9,.3,1.25); }
.goal-intro.shrink{ opacity:0; } /* backdrop fades as the card lands on the real banner underneath */
.gi-card{ background:var(--surface); border:1px solid var(--line); border-left:6px solid var(--goal); border-radius:20px;
  padding:26px 34px; box-shadow:0 24px 70px rgba(0,0,0,.4); text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:10px; min-width:min(82vw,340px);
  transition:transform .52s cubic-bezier(.5,0,.35,1); will-change:transform; }
.gi-kicker{ font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:1.2px; color:var(--goal); }
.gi-card .gi-label{ font-size:26px; font-weight:800; color:var(--ink); max-width:300px; line-height:1.15; }
.gi-card .gi-prog{ font-size:16px; color:var(--muted); } .gi-card .gi-prog b{ color:var(--goal); font-size:22px; }
.gi-count{ font-size:64px; font-weight:800; color:var(--goal); line-height:1; margin-top:2px; }
.gi-count.tick{ animation:gitick .5s ease; }
@keyframes giin{ from{ opacity:0; transform:scale(.8) translateY(12px);} to{ opacity:1; transform:scale(1) translateY(0);} }
@keyframes gitick{ 0%{ transform:scale(1.55); opacity:.25;} 55%{ transform:scale(1); opacity:1;} }

/* ---- prominent guest sign-in CTA (home) ---- */
.signin-cta{ display:flex; flex-direction:column; align-items:center; gap:2px; width:100%; cursor:pointer;
  border:none; border-radius:16px; padding:13px 18px; margin-bottom:4px; text-align:center;
  background:linear-gradient(120deg,var(--primary),#a24ff0); color:#fff; box-shadow:0 8px 22px rgba(122,63,240,.35);
  transition:transform .12s ease, box-shadow .12s ease; }
.signin-cta:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(122,63,240,.45); }
.signin-cta .sc-main{ font-size:16px; font-weight:800; letter-spacing:.2px; }
.signin-cta .sc-sub{ font-size:12.5px; opacity:.92; }

/* ---- in-game level + rank tag ---- */
.pmeta{ font-size:10.5px; font-weight:700; color:var(--muted); letter-spacing:.2px; white-space:nowrap; }
.pmeta .rk{ font-style:normal; font-weight:800; }
.hs .pmeta{ display:block; margin-top:2px; }
.hs.me .pmeta{ color:#dfe0fb; } .hs.me .pmeta .rk{ color:#fff !important; }
.tc-name{ white-space:nowrap; }

/* ---- Ranks info modal ---- */
.ranks-intro{ font-size:13px; color:var(--muted); margin:2px 0 10px; line-height:1.45; }
.ranks-list{ text-align:left; }
.rank-row{ display:flex; align-items:center; gap:11px; padding:9px 8px; border-bottom:1px solid var(--line); font-size:15px; }
.rank-row:last-child{ border-bottom:none; }
.rank-dot{ width:13px; height:13px; border-radius:50%; flex:0 0 auto; box-shadow:0 0 0 3px rgba(0,0,0,.05); }
.rank-name{ font-weight:800; color:var(--ink); flex:1; }
.rank-range{ font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }
.rank-row.here{ background:color-mix(in srgb, var(--primary) 12%, transparent); border-radius:10px; }
.rank-you{ font-size:11px; font-weight:800; color:#fff; background:var(--primary); border-radius:20px; padding:2px 9px; margin-left:8px; }

/* ---- rank badge in profile ---- */
.prof-rank{ display:inline-flex; align-items:center; gap:9px; cursor:pointer; margin:2px auto 12px; padding:7px 16px;
  border-radius:22px; border:1.5px solid var(--rk,var(--line)); background:color-mix(in srgb, var(--rk,#888) 10%, var(--surface)); font:inherit; }
.prof-rank .pr-dot{ width:12px; height:12px; border-radius:50%; }
.prof-rank .pr-name{ font-weight:800; color:var(--ink); font-size:16px; }
.prof-rank .pr-rating{ font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }

/* ===== Pro tile themes: recolor the Word Hunt board via --tile / --tile-ink ===== */
body[data-theme="dark"]{ --tile:linear-gradient(#3a3f4a,#2b2f38); --tile-ink:#e8ecf3; }
body[data-theme="wood"]{ --tile:linear-gradient(#c8935a,#b07d45); --tile-ink:#3a2412; }
body[data-theme="neon"]{ --tile:linear-gradient(#1b1030,#120a22); --tile-ink:#39ffd0; }
body[data-theme="sunset"]{ --tile:linear-gradient(160deg,#ff7e5f,#feb47b); --tile-ink:#4a1e12; }
body[data-theme="ocean"]{ --tile:linear-gradient(160deg,#2b5876,#4e4376); --tile-ink:#e0f2fe; }
body[data-theme="candy"]{ --tile:linear-gradient(160deg,#ff9a9e,#fecfef); --tile-ink:#7a2247; }
body[data-theme="gold"]{ --tile:linear-gradient(160deg,#f6d365,#fda085); --tile-ink:#5a3b0a; }
.sw-sunset{ background:linear-gradient(160deg,#ff7e5f,#feb47b); }
.sw-ocean{ background:linear-gradient(160deg,#2b5876,#4e4376); }
.sw-candy{ background:linear-gradient(160deg,#ff9a9e,#fecfef); }
.sw-gold{ background:linear-gradient(160deg,#f6d365,#fda085); }
.theme-pick{ flex-wrap:wrap; }

/* ===== visible Pro flair ===== */
.pro-chip{ font-size:8.5px; font-weight:800; letter-spacing:.5px; color:#3a2b00; background:linear-gradient(#ffd873,#ffb020); border-radius:5px; padding:1px 4px; margin-left:4px; vertical-align:middle; box-shadow:0 1px 2px rgba(0,0,0,.15); }
.leader-row.pro .leader-name{ font-weight:800; background:linear-gradient(90deg,#ffb020,#ff7ac2,#7a3ff0,#ffb020); background-size:300% 100%; -webkit-background-clip:text; background-clip:text; color:transparent; animation:proshine 4s linear infinite; }
@keyframes proshine{ to{ background-position:300% 0; } }

/* ===== Word Coach ===== */
.coach-btn{ background:linear-gradient(120deg,#ffb020,#ff7a3f) !important; }
.coach-panel{ background:var(--surface-2); border:1px solid var(--line); border-radius:16px; padding:14px; margin:10px 0; text-align:left; }
.coach-head{ font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--primary); margin-bottom:10px; }
.coach-eff{ display:flex; align-items:center; gap:16px; }
.ce-ring{ --p:0; width:66px; height:66px; border-radius:50%; flex:0 0 auto; display:flex; align-items:center; justify-content:center; background:conic-gradient(var(--primary) calc(var(--p)*3.6deg), var(--line) 0); }
.ce-ring span{ width:50px; height:50px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:14px; color:var(--ink); }
.ce-body b{ display:block; font-size:20px; color:var(--ink); } .ce-body>span{ font-size:12px; color:var(--muted); } .ce-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.coach-sub{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin:12px 0 6px; }
.coach-missed{ display:flex; flex-wrap:wrap; gap:6px; }
.coach-missed .cw{ background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:3px 8px; font-size:13px; font-weight:700; color:var(--ink); }
.coach-missed .cw i{ font-style:normal; font-size:10px; font-weight:800; color:var(--goal); margin-left:5px; }
.coach-foot{ font-size:12px; color:var(--muted); margin-top:10px; text-align:center; }
.coach-stats{ display:flex; gap:10px; } .cstat{ flex:1; text-align:center; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px; }
.cstat b{ display:block; font-size:19px; color:var(--ink); } .cstat span{ font-size:11px; color:var(--muted); }
.coach-lock{ text-align:center; padding:8px; } .cl-title{ font-weight:800; color:var(--ink); font-size:16px; } .cl-sub{ font-size:13px; color:var(--muted); margin:6px 0 12px; line-height:1.4; }

/* ===== Pro Stats dashboard ===== */
.stats-body{ text-align:left; }
.stat-hero{ display:flex; justify-content:space-between; align-items:center; background:var(--surface-2); border:1px solid var(--line); border-radius:16px; padding:16px; margin-bottom:14px; }
.sh-rank{ font-size:22px; font-weight:800; } .sh-rating{ font-size:14px; color:var(--muted); }
.sh-pct{ text-align:right; } .sh-pct b{ font-size:22px; color:var(--primary); display:block; } .sh-pct span{ font-size:12px; color:var(--muted); }
.stat-block{ margin-bottom:16px; } .sb-h{ font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.8px; color:var(--muted); margin-bottom:8px; }
.spark{ width:100%; height:48px; display:block; }
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:16px; }
.sg{ background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:10px; text-align:center; }
.sg b{ display:block; font-size:18px; color:var(--ink); } .sg span{ font-size:11px; color:var(--muted); }
.mode-wins{ display:flex; gap:8px; } .mode-wins span{ flex:1; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:8px; text-align:center; font-size:12px; color:var(--muted); }
.mode-wins b{ display:block; font-size:18px; color:var(--ink); }
.wl-bars{ display:flex; gap:8px; align-items:flex-end; height:96px; }
.wlb{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; }
.wlb i{ display:block; width:72%; min-height:3px; background:linear-gradient(var(--primary),var(--primary-2)); border-radius:4px 4px 0 0; }
.wlb span{ font-size:11px; color:var(--muted); margin-top:4px; } .wlb em{ font-size:11px; font-style:normal; font-weight:800; color:var(--ink); margin-bottom:3px; }
.stats-loading{ text-align:center; color:var(--muted); padding:30px; }

/* ===== Daily Archive ===== */
.archive-body{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.archive-day{ font:inherit; cursor:pointer; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:12px; font-weight:700; color:var(--ink); }
.archive-day:hover{ border-color:var(--primary); color:var(--primary); }

/* ===== Pro perks page ===== */
.go-pro-btn{ background:linear-gradient(120deg,#ffd873,#ffb020) !important; color:#3a2b00 !important; font-weight:800; }
.pro-box{ max-width:440px; }
.pro-hero{ text-align:center; margin-bottom:14px; }
.pro-crown{ font-size:40px; line-height:1; filter:drop-shadow(0 3px 8px rgba(255,176,32,.4)); }
.pro-title{ font-size:26px; font-weight:800; color:var(--ink); letter-spacing:.5px; margin:6px 0 2px; }
.pro-title span{ background:linear-gradient(120deg,#ffb020,#ff8a3f); -webkit-background-clip:text; background-clip:text; color:transparent; }
.pro-price{ font-size:20px; font-weight:800; color:var(--primary); }
.pro-tagline{ font-size:14px; color:var(--muted); margin-top:4px; }
.pro-perks{ display:flex; flex-direction:column; gap:13px; text-align:left; margin:18px 0; }
.perk{ display:flex; gap:12px; align-items:flex-start; }
.perk-ic{ font-size:21px; line-height:1.2; flex:0 0 auto; width:30px; text-align:center; }
.perk-t b{ display:block; color:var(--ink); font-size:15px; }
.perk-t span{ font-size:13px; color:var(--muted); line-height:1.4; }
.pro-upgrade{ width:100%; background:linear-gradient(120deg,#ffd873,#ffb020) !important; color:#3a2b00 !important; font-weight:800; font-size:17px; }
.pro-upgrade:disabled{ opacity:.6; cursor:default; }
.pro-foot{ font-size:12px; color:var(--muted); margin-top:12px; line-height:1.45; text-align:center; }
