:root {
  --felt-1: #16714a;
  --felt-2: #0b3d27;
  --felt-3: #072a1b;
  --ink: #8c1d2c;
  --ink-2: #6b1220;
  --cream: #fbf4e6;
  --cream-2: #efe3c9;
  --gold: #f6b93b;
  --gold-2: #e09b14;
  --text: #f2f7f3;
  --muted: #a9c7b6;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(4, 30, 19, 0.55);
  --danger: #ff6b6b;
  --cw: clamp(56px, 16vw, 92px);
  --radius: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: radial-gradient(120% 90% at 50% 35%, var(--felt-1) 0%, var(--felt-2) 60%, var(--felt-3) 100%) fixed;
  background-color: var(--felt-2);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 7px);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#app { position: relative; min-height: 100dvh; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line);
  transition: transform 0.08s, background 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--gold); color: #3a2400; border-color: var(--gold-2); box-shadow: 0 4px 0 var(--gold-2); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-2); transform: translateY(3px); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; }
.btn.block { width: 100%; }

.field {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); font-size: 17px;
}
.field::placeholder { color: var(--muted); opacity: 0.7; }

/* ---------- Home ---------- */
.site { max-width: 1040px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 40px; }
.sitebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.01em; }
.logo img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 3px 10px rgba(0,0,0,0.3); }
.rejoinchip { background: rgba(246,185,59,0.16); border-color: rgba(246,185,59,0.5); color: var(--gold); }
.hero { padding: 26px 0 22px; position: relative; }
.collage { display: none; position: relative; }
.collage .cl { position: absolute; }
@media (min-width: 860px) {
  .hero > .collage { display: block; position: absolute; right: 0; top: 10px; width: 440px; height: 300px; }
  .hero > .collage .cl-whot { left: 0; top: 20px; transform: scale(1.35) rotate(-6deg); }
  .hero > .collage .cl-ludo { right: 10px; top: 0; transform: scale(1.3) rotate(6deg); }
  .hero > .collage .cl-words { left: 140px; top: 140px; transform: scale(1.05); }
}
.collage.small { display: block; height: 150px; margin-top: auto; }
.collage.small .cl { transform: scale(0.85); }
.collage.small .cl-whot { left: calc(50% - 190px); top: 10px; }
.collage.small .cl-ludo { left: calc(50% - 85px); top: -8px; z-index: 1; }
.collage.small .cl-words { left: calc(50% + 10px); top: 22px; }
.steps { display: grid; gap: 10px; margin-top: 30px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps > div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.steps b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #3a2400; font-family: var(--display); font-weight: 800; }
.steps span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.steps strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 8.5vw, 60px); line-height: 1.02; letter-spacing: -0.025em; margin: 0 0 14px; max-width: 15ch; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 50ch; }
.joincard { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.joincard > div:first-child { display: grid; gap: 2px; }
.joincard > div:first-child span { color: var(--muted); font-size: 14px; }
.joincard .joinrow { flex: 1 1 260px; max-width: 340px; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: block; }
.joinrow { display: flex; gap: 10px; }
.joinrow .field { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; text-align: center; font-size: 20px; }
.joinrow .btn { flex: 0 0 auto; }
.sect { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 30px 0 12px; }
.gamegrid { display: grid; gap: 14px; }
@media (min-width: 640px) { .gamegrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) and (max-width: 979px) { .gamegrid > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 980px) { .gamegrid { grid-template-columns: repeat(6, 1fr); } .gamegrid > * { grid-column: span 2; } .gamegrid > :nth-child(4):nth-last-child(2), .gamegrid > :nth-child(5):nth-last-child(1) { grid-column: span 3; } }
.gtile { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; color: var(--text); text-decoration: none; background: var(--gbg); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 12px 30px rgba(0,0,0,0.3); transition: transform 0.15s, box-shadow 0.15s; }
.gtile:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,0.4); }
.gtile:active { transform: scale(0.985); }
.gtile-art { height: 150px; display: grid; place-items: center; background: radial-gradient(80% 90% at 50% 100%, rgba(255,255,255,0.14), transparent 70%); }
.gtile-body { padding: 4px 18px 18px; display: grid; gap: 6px; }
.gtile h3 { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.gtile p { margin: 0; color: rgba(255,255,255,0.8); line-height: 1.45; font-size: 15px; }
.gtile .meta { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); margin-top: 4px; }
.kind { justify-self: start; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.85); }
.g-whot { --gbg: linear-gradient(165deg, #a3283a, #5a1220 75%); }
.g-ludo { --gbg: linear-gradient(165deg, #2a62b0, #142f5e 75%); }
.g-words { --gbg: linear-gradient(165deg, #b07a14, #5c3d06 75%); }
.g-ayo { --gbg: linear-gradient(165deg, #6e7d2a, #33400d 75%); }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
.foot a { color: var(--gold); }

.art { position: relative; display: grid; place-items: center; }
.art-whot { width: 170px; height: 120px; }
.art-whot .card { position: absolute; --cw: 66px; top: 8px; left: calc(50% - 33px); transform-origin: 50% 130%; box-shadow: 0 10px 20px rgba(0,0,0,0.35); }
.art-whot .card:nth-child(1) { transform: rotate(-20deg); }
.art-whot .card:nth-child(2) { transform: rotate(20deg); }
.art-whot .card:nth-child(3) { transform: rotate(-2deg); }
.art-ludo { width: 170px; height: 124px; }
.art-ludo .mb { width: 112px; aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #fffdf6; transform: rotate(-8deg); box-shadow: 0 10px 22px rgba(0,0,0,0.35); position: relative; }
.art-ludo .q { border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.art-ludo .q.c0 { background: var(--l0); } .art-ludo .q.c1 { background: var(--l1); } .art-ludo .q.c2 { background: var(--l2); } .art-ludo .q.c3 { background: var(--l3); }
.art-ludo .q b { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15); }
.art-ludo .mc { position: absolute; inset: 38%; border-radius: 4px; background: conic-gradient(var(--l1) 0 25%, var(--l2) 0 50%, var(--l3) 0 75%, var(--l0) 0); box-shadow: 0 0 0 3px #fffdf6; }
.art-ludo .artdie { position: absolute; right: 8px; bottom: 2px; width: 44px; padding: 7px; border-radius: 11px; transform: rotate(14deg); }
.art-words { width: 190px; height: 120px; display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-content: center; gap: 6px; transform: rotate(-6deg); }
.art-words .tile { width: 44px; }
.art-words .tile .lt { font-family: var(--display); font-weight: 800; font-size: 22px; }
.art-words .tile:nth-child(even) { transform: translateY(6px); }

.ghero { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 8px 18px 22px; margin: 4px 0 14px; border-radius: 24px; background: var(--gbg); border: 1px solid rgba(255,255,255,0.14); }
.ghero-art { height: 150px; display: grid; place-items: center; transform: scale(1.15); }
.ghero .kind { justify-self: center; }
.ghero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9vw, 48px); line-height: 1; margin: 0; letter-spacing: -0.02em; }
.ghero p { margin: 0; color: rgba(255,255,255,0.85); line-height: 1.5; max-width: 42ch; }
.ghero .chips span { font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: rgba(0,0,0,0.25); }
.ghero .chips { gap: 8px; }
.createbox { display: grid; gap: 10px; }
.createbox .label { margin: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 8px 0 2px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: center; }
.howto { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.howto li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; line-height: 1.45; }
.howto li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(246,185,59,0.18); color: var(--gold); font-weight: 800; font-family: var(--display); }
.rulechips { display: flex; flex-wrap: wrap; gap: 6px; }
.rulechips span { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 99px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); color: var(--muted); }

.invite { display: flex; flex-direction: column; }
.invitebox { display: grid; gap: 10px; margin: 0 0 auto; padding: 22px 18px; }
.invitebox h1 { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 2px 0 8px; }
.invitebox .code { color: var(--gold); letter-spacing: 0.08em; }
.invitebox .label { margin: 0; }
.invite .foot { margin: 16px 0 8px; }

/* ---------- Lobby ---------- */
.lobby { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 120px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; }
.topbar .title { font-family: var(--display); font-weight: 800; font-size: 20px; }
.topbar .title span { color: var(--gold); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; backdrop-filter: blur(6px); }
.panel h2 { font-family: var(--display); font-size: 18px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }
.panel h2 small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 500; }
.codebox { text-align: center; }
.codebox .code { font-family: var(--display); font-weight: 800; font-size: 56px; letter-spacing: 0.18em; color: var(--gold); margin: 2px 0 10px; padding-left: 0.18em; }
.codebox .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.players .name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,0.12); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tag.host { background: var(--gold); color: #3a2400; }
.tag.off { background: rgba(255,107,107,0.2); color: #ffb3b3; }
.players .mkhost { min-height: 32px; padding: 0 10px; font-size: 12px; flex: 0 0 auto; }
.kick { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.kick:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: 0 0 auto; font-family: var(--display); font-size: 16px; }

.rules { display: grid; gap: 12px; }
.rules-sub { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-family: var(--display); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); }
.rules-sub::before, .rules-sub::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(246,185,59,0.5)); }
.rules-sub::after { transform: scaleX(-1); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rtile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 12px 12px 14px; min-height: 128px; border-radius: 16px; color: var(--muted);
  background: linear-gradient(170deg, rgba(255,255,255,0.07), rgba(0,0,0,0.2));
  border: 2px solid rgba(255,255,255,0.08); box-shadow: 0 5px 0 rgba(0,0,0,0.35);
  transition: transform 0.1s, box-shadow 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
}
.rtile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.rtile.on {
  color: var(--text); border-color: var(--gold);
  background: radial-gradient(120% 90% at 20% 0%, rgba(246,185,59,0.35), rgba(246,185,59,0.08) 70%), rgba(0,0,0,0.15);
  box-shadow: 0 5px 0 var(--gold-2), 0 0 22px rgba(246,185,59,0.22);
}
.rtile.on:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-2), 0 0 22px rgba(246,185,59,0.22); }
.rtile.unavail { opacity: 0.4; }
.ricon { height: 44px; min-width: 44px; display: grid; place-items: center; font-size: 28px; line-height: 1; margin-bottom: 4px; transition: transform 0.25s cubic-bezier(.3,1.6,.5,1), filter 0.2s; }
.rtile:not(.on) .ricon { filter: grayscale(1) brightness(0.8); opacity: 0.7; }
.rtile.on .ricon { transform: rotate(-8deg) scale(1.08); }
.ricon .num { width: 40px; height: 40px; border-radius: 11px; background: var(--cream); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 var(--cream-2); }
.ricon svg { width: 26px; height: 26px; fill: currentColor; }
.rname { font-weight: 800; font-size: 14px; line-height: 1.2; padding-right: 30px; }
.rdesc { font-size: 12px; line-height: 1.35; color: var(--muted); }
.rstate { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,0.1); color: var(--muted); }
.rtile.on .rstate { background: var(--gold); color: #3a2400; }
.minicard { position: relative; width: 32px; height: 44px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(160deg, #fffaf0, var(--cream)); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 17px; box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 3px 6px rgba(0,0,0,0.3); }
.minicard.w { font-size: 13px; }
.minicard small { position: absolute; top: 3px; font-size: 6px; letter-spacing: 0.04em; }

.rblock { padding: 14px; border-radius: 18px; background: linear-gradient(170deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18)); border: 1px solid var(--line); }
.rhead { display: flex; align-items: center; gap: 12px; }
.rhead .ricon { margin: 0; font-size: 26px; }
.rhead .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rhead .txt b { font-weight: 800; font-size: 15px; }
.rhead .txt span { color: var(--muted); font-size: 13px; line-height: 1.35; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg button {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 6px 10px; border-radius: 12px;
  font-weight: 800; font-size: 14px; color: var(--text); line-height: 1.2;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 4px 0 rgba(0,0,0,0.35);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.seg button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0.35); }
.seg button.on { background: var(--gold); color: #3a2400; border-color: var(--gold-2); box-shadow: 0 2px 0 var(--gold-2), 0 0 16px rgba(246,185,59,0.35); transform: translateY(2px); }
.seg button.unavail { opacity: 0.35; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; font-size: 26px; font-weight: 800; line-height: 1; background: var(--gold); color: #3a2400; box-shadow: 0 4px 0 var(--gold-2); transition: transform 0.1s, box-shadow 0.1s; }
.stepper button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-2); }
.stepper button:disabled { background: rgba(255,255,255,0.1); color: var(--muted); box-shadow: 0 4px 0 rgba(0,0,0,0.3); }
.rules.ro .stepper button { visibility: hidden; }
.handfan { position: relative; width: 110px; height: 64px; }
.handfan i { position: absolute; left: calc(50% - 17px); bottom: 0; width: 34px; height: 48px; border-radius: 5px; transform-origin: 50% 140%; transform: rotate(calc(var(--i) * 9deg)); background: repeating-linear-gradient(45deg, var(--ink) 0 4px, var(--ink-2) 4px 8px); box-shadow: 0 0 0 2px var(--cream), 0 3px 6px rgba(0,0,0,0.35); transition: transform 0.25s; }
.stepval { font-family: var(--display); font-weight: 800; font-size: 34px; min-width: 30px; text-align: center; color: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; justify-content: center; }
.cardchip { width: 46px; height: 64px; padding: 0; border-radius: 8px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; transition: transform 0.25s cubic-bezier(.3,1.6,.5,1), background 0.2s; background: repeating-linear-gradient(45deg, var(--ink) 0 5px, var(--ink-2) 5px 10px); color: transparent; box-shadow: 0 0 0 2px var(--cream), 0 4px 0 rgba(0,0,0,0.35); }
.cardchip.on { background: linear-gradient(160deg, #fffaf0, var(--cream)); color: var(--ink); transform: translateY(-4px) rotate(-3deg); box-shadow: 0 0 0 2px var(--gold), 0 6px 12px rgba(0,0,0,0.35); }
.cardchip.unavail { opacity: 0.3; }

.rules.ro .rtile, .rules.ro .seg button, .rules.ro .cardchip { cursor: default; }
.bump { animation: bump 0.5s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 0% { transform: scale(0.92); } 60% { transform: scale(1.04); } 100% { transform: none; } }


.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--felt-3) 35%); z-index: 5; }
.dock .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn.primary { flex: 1; }
.waiting { text-align: center; color: var(--muted); padding: 12px; flex: 1; }

/* ---------- Cards ---------- */
.card {
  --ch: calc(var(--cw) * 1.42);
  position: relative; width: var(--cw); height: var(--ch); flex: 0 0 auto;
  border-radius: calc(var(--cw) * 0.1);
  background: var(--cream);
  box-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.28);
  color: var(--ink); user-select: none; padding: 0;
}
.card.face { background: linear-gradient(160deg, #fffaf0, var(--cream) 45%, var(--cream-2)); }
.card .big { position: absolute; left: 50%; top: 50%; width: 52%; height: 52%; transform: translate(-50%, -50%); fill: var(--ink); }
.card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * 0.22); }
.card .corner .mini { width: calc(var(--cw) * 0.13); height: calc(var(--cw) * 0.13); fill: var(--ink); margin-top: 2px; }
.card .tl { top: 6%; left: 8%; }
.card .br { bottom: 6%; right: 8%; transform: rotate(180deg); }
.card.whot .whot-word {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-28deg);
  font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * 0.3); letter-spacing: 0.02em;
  color: var(--ink); white-space: nowrap;
}
.card.whot::after {
  content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 2px dashed rgba(140,29,44,0.35);
}
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 4px, transparent 4px 9px),
    radial-gradient(circle at 50% 50%, #a52a3b, var(--ink-2));
  box-shadow: 0 0 0 calc(var(--cw) * 0.05) var(--cream) inset, 0 0 0 1px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.3);
}
.card.back::after {
  content: 'WHOT'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-60deg);
  font-family: var(--display); font-weight: 800; color: var(--cream); font-size: calc(var(--cw) * 0.26); letter-spacing: 0.04em;
}

/* ---------- Game table ---------- */
.game {
  height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  max-width: 980px; margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 0 0;
}
.game .topbar { padding: 4px 12px 6px; }
.game .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.topbar .right { display: flex; gap: 6px; align-items: center; }
.vctl { display: flex; gap: 6px; }
.vpill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 10px; border-radius: 12px; background: rgba(255,255,255,0.08); font-weight: 700; font-size: 14px; }
.vpill svg, .iconbtn svg { width: 20px; height: 20px; fill: currentColor; }
.iconbtn.live { background: #1e8449; }
.iconbtn.off { background: #b3261e; }
.iconbtn:disabled { opacity: 0.6; }
.avatar { position: relative; transition: box-shadow 0.12s; }
.avatar.speaking { box-shadow: 0 0 0 3px #3ddc84, 0 0 16px 3px rgba(61, 220, 132, 0.75) !important; }
.vbadge { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #1e8449; border: 2px solid var(--felt-2); font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; color: #fff; }
.vbadge svg { width: 10px; height: 10px; fill: #fff; }
.vbadge.muted { background: #b3261e; }
.vbadge.fail { background: var(--gold); color: #3a2400; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.08); font-size: 18px; }

.opps { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 8px; scrollbar-width: none; justify-content: safe center; }
.opps::-webkit-scrollbar { display: none; }
.opp {
  flex: 0 0 auto; min-width: 92px; max-width: 140px; padding: 8px 10px; border-radius: 14px;
  background: var(--panel); border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color 0.2s, transform 0.2s;
}
.opp.turn { border-color: var(--gold); transform: translateY(2px); box-shadow: 0 0 0 4px rgba(246,185,59,0.15); }
.opp.away { opacity: 0.55; }
.opp .avatar { width: 34px; height: 34px; font-size: 15px; }
.opp .nm { font-weight: 600; font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .cnt { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.opp .cnt .card { --cw: 12px; border-radius: 2px; box-shadow: 0 0 0 1px var(--cream) inset; }
.opp .cnt .card::after { display: none; }
.badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 99px; background: var(--danger); color: #fff; }
.badge.semi { background: var(--gold); color: #3a2400; }
.dots { display: inline-flex; gap: 3px; height: 14px; align-items: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; padding: 4px 12px; }
.piles { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 8vw, 64px); }
.piles .card { --cw: clamp(78px, 22vw, 116px); }
.marketbtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.marketbtn .stack { position: relative; }
.marketbtn .stack .card + .card { position: absolute; }
.marketbtn .stack .card:nth-child(2) { top: -3px; left: 2px; }
.marketbtn .stack .card:nth-child(3) { top: -6px; left: 4px; }
.marketbtn .cap { font-size: 12px; color: var(--muted); font-weight: 600; }
.marketbtn.live .stack { animation: nudge 1.6s ease-in-out infinite; }
.marketbtn.live .stack .card:last-child { box-shadow: 0 0 0 calc(var(--cw) * 0.05) var(--cream) inset, 0 0 0 3px var(--gold), 0 6px 18px rgba(246,185,59,0.4); }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.pile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pile .under { position: absolute; top: 0; transform: rotate(-6deg); opacity: 0.9; }
.pile .under2 { position: absolute; top: 0; transform: rotate(5deg); opacity: 0.9; }
.pile .topcard { position: relative; }
.pile .topcard.land { animation: land 0.35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes land { from { transform: translateY(-40px) scale(1.15) rotate(-8deg); opacity: 0.3; } to { transform: none; opacity: 1; } }
.pile .cap { font-size: 12px; color: var(--muted); font-weight: 600; }

.need {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px;
  background: var(--cream); color: var(--ink); font-weight: 800; font-family: var(--display); font-size: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25); animation: pop 0.3s;
}
.need svg { width: 22px; height: 22px; fill: var(--ink); }
.need.still { animation: none; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.status { text-align: center; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.status .main { font-family: var(--display); font-weight: 700; font-size: clamp(17px, 4.6vw, 22px); }
.status .main.mine { color: var(--gold); }
.status .main.alert { color: #ffd2d2; }
.status .sub { font-size: 13px; color: var(--muted); max-width: 360px; }

.me { background: linear-gradient(transparent, rgba(0,0,0,0.35) 30%); padding: 6px 0 max(10px, env(safe-area-inset-bottom)); }
.mebar { display: flex; align-items: center; gap: 10px; padding: 0 14px 6px; }
.mebar .who { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.mebar .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mebar .who .avatar { width: 30px; height: 30px; font-size: 13px; }
.mebar.turn .who .avatar { box-shadow: 0 0 0 3px var(--gold); }
.hand {
  --cw: clamp(62px, 17.5vw, 96px);
  display: flex; overflow-x: auto; overflow-y: visible; padding: 22px 14px 8px; scrollbar-width: none;
  justify-content: safe center;
}
.hand::-webkit-scrollbar { display: none; }
.hand .card { transition: transform 0.15s, filter 0.15s, opacity 0.15s; }
.hand.active .card.legal { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0,0,0,0.35); }
.hand.active .card:not(.legal) { filter: brightness(0.72) saturate(0.7); }
.hand .card.legal:active { transform: translateY(-20px) scale(1.04); }
.hand .card.enter { animation: deal 0.35s ease-out; }
@keyframes deal { from { transform: translateY(60px); opacity: 0; } }
.hand.active .card.legal.enter { animation: deal-up 0.35s ease-out; }
@keyframes deal-up { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(-14px); } }

.log { text-align: center; color: var(--muted); font-size: 12px; min-height: 16px; padding: 0 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Overlays ---------- */
.overlay.still, .overlay.still .sheet { animation: none; }
.overlay { position: fixed; inset: 0; background: rgba(2, 18, 11, 0.72); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 20; padding: 16px; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--felt-2); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: rise 0.25s; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet h3 { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0 0 4px; text-align: center; }
.sheet .lead { text-align: center; color: var(--muted); margin: 0 0 16px; }
.shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shapes button { background: var(--cream); color: var(--ink); border-radius: 16px; padding: 14px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; text-transform: capitalize; box-shadow: 0 4px 0 var(--cream-2); }
.shapes button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cream-2); }
.shapes svg { width: 44px; height: 44px; fill: var(--ink); }
.shapes .count { text-transform: none; font-size: 11px; color: var(--ink-2); opacity: 0.7; font-weight: 600; }
.results { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.results li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); }
.results li.win { background: rgba(246,185,59,0.18); box-shadow: 0 0 0 2px var(--gold) inset; }
.results .nm { font-weight: 700; }
.results .pts { font-family: var(--display); font-weight: 800; font-size: 20px; }
.results .pts small { font-family: var(--body); font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.results .minis { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; }
.mini-card { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; background: var(--cream); color: var(--ink); font-weight: 800; font-size: 12px; font-family: var(--display); }
.mini-card svg { width: 11px; height: 11px; fill: var(--ink); }
.sheet .actions { display: grid; gap: 10px; }
.trophy { font-size: 48px; text-align: center; line-height: 1; margin-bottom: 6px; }

#toasts { position: fixed; left: 0; right: 0; top: max(6px, env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 30; padding: 0 16px; }
.toast { background: rgba(10, 10, 10, 0.82); color: #fff; padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.3); animation: toast-in 0.25s; max-width: 100%; text-align: center; }
.toast.big { background: var(--gold); color: #3a2400; font-family: var(--display); font-weight: 800; font-size: 17px; }
.toast.err { background: #b3261e; }
.toast.out { animation: toast-out 0.3s forwards; }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-12px); opacity: 0; } }
#conn { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #b3261e; color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 13px; z-index: 40; }

@media (min-width: 720px) {
  .game { padding-top: 16px; }
  .center { gap: 22px; }
  .hand { padding-top: 26px; }
}
@media (max-height: 640px) {
  .piles .card { --cw: clamp(64px, 17vw, 90px); }
  .hand { --cw: clamp(54px, 15vw, 80px); padding-top: 18px; }
  .opp { padding: 5px 8px; }
  .opp .avatar { width: 26px; height: 26px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Game picker ---------- */
.gamepick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 14px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); text-align: center; }
.gcard b { font-family: var(--display); font-size: 16px; }
.gcard small { color: var(--muted); font-size: 12px; }
.gcard.on { border-color: var(--gold); background: rgba(246,185,59,0.14); }
.gcard:disabled { cursor: default; }
.gcard:disabled:not(.on) { opacity: 0.55; }
.gicon { height: 40px; display: grid; place-items: center; }
.gi-cards { position: relative; width: 44px; height: 40px; }
.gi-cards i { position: absolute; top: 2px; width: 24px; height: 34px; border-radius: 4px; background: var(--cream); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.gi-cards i:first-child { left: 4px; transform: rotate(-12deg); background: radial-gradient(circle at 50% 50%, #a52a3b, var(--ink-2)); box-shadow: 0 0 0 2px var(--cream) inset; }
.gi-cards i:last-child { left: 16px; transform: rotate(10deg); }
.gi-tiles { display: flex; gap: 3px; }
.gi-tiles i { width: 26px; height: 26px; border-radius: 5px; background: var(--cream); color: var(--ink); font-style: normal; font-family: var(--display); font-weight: 800; font-size: 15px; display: grid; place-items: center; box-shadow: 0 2px 0 var(--cream-2); }

/* ---------- Wahala Words ---------- */
.words {
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  max-width: 640px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  --bw: min(calc(100vw - 16px), 600px, calc(100dvh - 330px));
}
.words .topbar { padding: 0 4px 6px; }
.words .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
.wplayers { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; justify-content: safe center; }
.wplayers::-webkit-scrollbar { display: none; }
.wp { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border-radius: 99px; background: var(--panel); border: 2px solid transparent; }
.wp .avatar { width: 28px; height: 28px; font-size: 13px; }
.wp .nm { font-weight: 600; font-size: 13px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp .sc { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--gold); }
.wp.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,185,59,0.15); }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; background: rgba(0,0,0,0.35); padding: 2px 7px; border-radius: 99px; }
.clock.low { background: var(--danger); color: #fff; }
.wstatus { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; min-height: 34px; }
.wstatus .who { font-family: var(--display); font-weight: 700; font-size: 16px; flex: 0 0 auto; }
.wstatus .who.mine { color: var(--gold); }
.wstatus .evt { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn.small { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }

.wboard-wrap { flex: 0 0 auto; align-self: center; margin: auto 0; width: var(--bw); max-width: 100%; overflow: hidden; border-radius: 10px; }
.wboard-wrap.zoom { width: 100%; height: var(--bw); overflow: auto; }
.wboard {
  --cell: calc(var(--bw) / 13);
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; padding: 3px;
  width: var(--bw); aspect-ratio: 1; background: rgba(0,0,0,0.35); border-radius: 10px;
}
.wboard-wrap.zoom .wboard { --bw-z: max(var(--bw), 600px); --cell: calc(var(--bw-z) / 13); width: var(--bw-z); }
.sq {
  position: relative; display: grid; place-items: center; border-radius: 3px; padding: 0;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85);
  font-size: calc(var(--cell) * 0.3); font-weight: 800; letter-spacing: -0.02em; min-width: 0; min-height: 0;
}
.sq.tw { background: #8c1d2c; }
.sq.dw { background: #c8664a; }
.sq.tl { background: #1f5f8b; }
.sq.dl { background: #3f8f9a; }
.sq.st { background: var(--gold-2); color: #3a2400; font-size: calc(var(--cell) * 0.55); }
.sq.filled, .sq.pend { background: var(--cream); color: var(--ink); box-shadow: 0 1px 0 var(--cream-2); }
.sq.filled.last { background: #ffe7a3; }
.sq.pend { background: #fff6dc; box-shadow: 0 0 0 2px var(--gold) inset; }
.sq .lt, .tile .lt { font-family: var(--display); font-weight: 800; line-height: 1; }
.sq .lt { font-size: calc(var(--cell) * 0.58); }
.sq .pt { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--cell) * 0.24); font-weight: 700; line-height: 1; }

.wpreview { min-height: 30px; display: flex; align-items: center; justify-content: center; padding: 6px 4px 2px; }
.pv { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 13px; font-weight: 600; }
.pv.muted { color: var(--muted); }
.pv.bad { color: #ffb3b3; }
.pw { background: rgba(255,255,255,0.1); padding: 3px 9px; border-radius: 99px; font-family: var(--display); font-weight: 700; letter-spacing: 0.03em; }
.pw small { font-family: var(--body); color: var(--gold); margin-left: 2px; }
.pw.good { background: rgba(61,220,132,0.2); }
.pw.bad { background: rgba(255,107,107,0.25); }

.rack { display: flex; justify-content: center; gap: 6px; padding: 8px 0; min-height: 64px; flex-wrap: nowrap; }
.tile {
  position: relative; width: min(46px, calc((100vw - 64px) / 7)); aspect-ratio: 1; border-radius: 8px;
  background: linear-gradient(160deg, #fffaf0, var(--cream)); color: var(--ink); box-shadow: 0 3px 0 var(--cream-2), 0 4px 10px rgba(0,0,0,0.3);
  display: grid; place-items: center; transition: transform 0.12s;
}
.tile .lt { font-size: min(24px, calc((100vw - 64px) / 7 * 0.55)); }
.tile .pt { position: absolute; right: 5px; bottom: 3px; font-size: 10px; font-weight: 700; }
.tile.blank { background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 4px, var(--cream-2) 4px, var(--cream-2) 8px); }
.tile.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--gold), 0 10px 18px rgba(0,0,0,0.35); }
.tile.swapsel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--danger), 0 10px 18px rgba(0,0,0,0.35); opacity: 0.85; }
.wactions { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 6px; }
.wactions:has(#swapgo) { grid-template-columns: 1fr 1.4fr; }
.wactions .btn { padding: 0 6px; min-height: 44px; }
.letters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.letters button { aspect-ratio: 1; border-radius: 8px; background: var(--cream); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 20px; box-shadow: 0 3px 0 var(--cream-2); }
.valtable { display: grid; gap: 4px; font-size: 13px; background: rgba(0,0,0,0.2); padding: 10px 12px; border-radius: 12px; }
.valtable b { display: inline-block; min-width: 22px; color: var(--gold); }
@media (max-height: 700px) {
  .words { --bw: min(calc(100vw - 16px), 600px, calc(100dvh - 300px)); }
  .wplayers .avatar { display: none; }
}

/* Ludo */
:root { --l0: #e0393e; --l1: #2e9e4f; --l2: #f2b705; --l3: #2475d6; }
.c0 { --pc: var(--l0); } .c1 { --pc: var(--l1); } .c2 { --pc: var(--l2); } .c3 { --pc: var(--l3); }
.gi-ludo { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 36px; height: 36px; padding: 3px; background: var(--cream); border-radius: 6px; }
.gi-ludo i { border-radius: 3px; }
.gi-ludo i:nth-child(1) { background: var(--l0); } .gi-ludo i:nth-child(2) { background: var(--l1); }
.gi-ludo i:nth-child(3) { background: var(--l3); } .gi-ludo i:nth-child(4) { background: var(--l2); }
.ludo {
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  max-width: 640px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  --lb: min(calc(100vw - 16px), 600px, calc(100dvh - 250px));
}
.ludo .topbar { padding: 0 4px 6px; }
.ludo .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
.ludo .wstatus { min-height: 22px; padding-bottom: 4px; }
.ludo .wstatus .evt { text-align: center; }
.wp.lp.turn { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 30%, transparent); }
.wp .dots { display: flex; gap: 2px; }
.wp .dots i, .ldot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 1.5px rgba(255,255,255,0.7); display: inline-block; }
.wp.lp .sc { font-size: 14px; }
.lboard-wrap { position: relative; flex: 0 0 auto; align-self: center; margin: auto 0; width: var(--lb); width: round(down, var(--lb), 15px); aspect-ratio: 1; }
.lboard {
  display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr);
  width: 100%; height: 100%; background: #fffdf6; border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 3px var(--cream-2), 0 12px 30px rgba(0,0,0,0.45);
  transform: translateZ(0); backface-visibility: hidden;
}
.seeds { transform: translateZ(0); }
.cell { border: 0.5px solid rgba(60, 40, 20, 0.22); display: grid; place-items: center; color: rgba(60,40,20,0.45); font-size: calc(var(--lb) / 15 * 0.55); line-height: 1; min-width: 0; min-height: 0; }
.cell.lane, .cell.st { background: var(--pc); border-color: color-mix(in srgb, var(--pc), #000 15%); }
.cell.st { color: rgba(255,255,255,0.9); }
.cell.star { color: #9a8a6a; }
.yard { position: relative; background: var(--pc); min-width: 0; min-height: 0; }
.yard.empty { filter: saturate(0.35) brightness(1.05); }
.yard .yin { position: absolute; inset: 16.667%; background: #fffdf6; border-radius: 14%; box-shadow: inset 0 2px 6px rgba(0,0,0,0.15); }
.yard .yin::after { content: ''; position: absolute; inset: calc(var(--lb) / -60); border-radius: 18%; box-shadow: 0 0 0 calc(var(--lb) / 60) rgba(255,255,255,0.9); opacity: 0; pointer-events: none; will-change: opacity; }
.yard.on .yin::after { animation: yardglow 1.2s ease-in-out infinite alternate; }
@keyframes yardglow { from { opacity: 0; } to { opacity: 1; } }
.yard .spot { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: color-mix(in srgb, var(--pc) 22%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 55%, #fff); }
.yard .yname { position: absolute; width: 100%; translate: -50% -50%; text-align: center; font-weight: 800; font-size: calc(var(--lb) / 15 * 0.48); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.lcentre { background: conic-gradient(from -45deg, var(--l1) 0 25%, var(--l2) 0 50%, var(--l3) 0 75%, var(--l0) 0); }
.seeds { position: absolute; inset: 0; pointer-events: none; }
.seed {
  position: absolute; width: calc(100% / 15 * 0.82); aspect-ratio: 1; padding: 0; border-radius: 50%; pointer-events: auto;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.85) 0 11%, var(--pc) 32%, color-mix(in srgb, var(--pc), #000 38%) 100%);
  box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0,0,0,0.5);
}
.seed.stk { transform: translate(-50%, -50%) scale(0.74); }
.seed.hm { transform: translate(-50%, -50%) scale(0.6); }
.seed.can { z-index: 2; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 2px 5px rgba(0,0,0,0.5); }
.seed.can::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid var(--gold); pointer-events: none; will-change: transform, opacity; animation: seedpulse 0.9s ease-in-out infinite; }
@keyframes seedpulse { 0%, 100% { transform: scale(0.9); opacity: 0.35; } 50% { transform: scale(1.18); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .seed.can::after, .yard.on .yin::after { animation: none; opacity: 1; } }
.ldock { display: flex; align-items: center; gap: 10px; padding: 10px 4px 2px; min-height: 80px; }
.lstatus { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.lstatus .cdot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }
.lstatus b { display: block; font-family: var(--display); font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lstatus b.mine { color: var(--gold); }
.lstatus span { display: block; color: var(--muted); font-size: 13px; }
.dice { display: flex; gap: 8px; }
.die {
  width: 56px; aspect-ratio: 1; padding: 9px; border-radius: 13px; background: #fffdf6;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
  box-shadow: 0 3px 0 #d9cfb8, 0 5px 12px rgba(0,0,0,0.35); transition: opacity 0.2s, transform 0.15s;
}
.die i { border-radius: 50%; }
.die i.on { background: #2b2118; }
.die.idle { opacity: 0.55; }
.die.used { opacity: 0.3; transform: scale(0.9); }
.die.sel { box-shadow: 0 0 0 3px var(--gold), 0 3px 0 #d9cfb8, 0 5px 12px rgba(0,0,0,0.35); transform: translateY(-3px); }
.dice.inflight .die { opacity: 0; transition: none; }
.dicefly { position: fixed; z-index: 15; pointer-events: none; will-change: transform; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.45)); }
.dicefly .die, .dicegone .die { width: 100%; height: 100%; padding: 16%; border-radius: 22%; gap: 4%; }
.dicegone { position: fixed; z-index: 15; pointer-events: none; }
.dicefly.landed .die { animation: landflash 1s ease-out; }
@keyframes landflash { 0% { box-shadow: 0 0 0 0 rgba(246,185,59,0.95), 0 3px 0 #d9cfb8; } 40% { box-shadow: 0 0 0 7px rgba(246,185,59,0.75), 0 3px 0 #d9cfb8; } 100% { box-shadow: 0 0 0 3px rgba(246,185,59,0.6), 0 3px 0 #d9cfb8; } }
.die.mini { width: 30px; padding: 5px; border-radius: 8px; box-shadow: none; }
.rollbtn { min-height: 60px; padding: 0 22px; font-size: 20px; font-family: var(--display); animation: rollpulse 1.1s ease-in-out infinite; }
@keyframes rollpulse { 50% { transform: scale(1.05); } }
@media (max-height: 700px) {
  .ludo { --lb: min(calc(100vw - 16px), 600px, calc(100dvh - 220px)); }
  .ludo .wplayers .avatar { display: none; }
}
@media (max-width: 480px) {
  .wplayers.many .lp .nm { display: none; }
}

/* Win moment, confetti, leaderboard */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }
.winmoment { background: rgba(2, 18, 11, 0.82); backdrop-filter: blur(3px); cursor: pointer; }
.wm { display: grid; justify-items: center; gap: 14px; text-align: center; }
.wm-who { display: flex; align-items: center; gap: 10px; animation: rise 0.3s both; }
.wm-head { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 7vw, 34px); color: var(--gold); text-shadow: 0 3px 12px rgba(0,0,0,0.5); }
.wm-card { animation: wmcard 0.7s cubic-bezier(.2,1.4,.4,1) both 0.1s; }
.wm-card .card { --cw: clamp(110px, 34vw, 150px); box-shadow: 0 0 0 4px var(--gold), 0 18px 50px rgba(0,0,0,0.55), 0 0 60px rgba(246,185,59,0.55); }
.wm-sub { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; animation: fade 0.4s both 0.5s; }
.winmoment.still .wm-who, .winmoment.still .wm-card, .winmoment.still .wm-sub { animation: none; }
@keyframes wmcard { from { transform: translateY(-90px) scale(0.5) rotate(-20deg); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.ressheet { display: flex; flex-direction: column; overflow: hidden; }
.ressheet > * { flex: none; }
.ressheet > ul.results { flex: 0 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 12px; }
.resrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lbtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.lbtable th { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; padding: 0 4px 8px; }
.lbtable th:first-child { text-align: left; }
.lbtable td { text-align: center; padding: 7px 4px; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 17px; }
.lbtable td:first-child { text-align: left; font-family: var(--body); font-weight: 600; font-size: 14px; }
.lbtable td.zero { color: var(--muted); opacity: 0.45; }
.lbtable td.played { color: var(--muted); font-size: 14px; }
.lbtable tr.lbme td:first-child { color: var(--gold); }
.lbtable tr.gone { opacity: 0.6; }
.lbname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lbname .avatar { width: 28px; height: 28px; font-size: 13px; flex: 0 0 auto; }
.lbname small { color: var(--muted); font-weight: 500; font-size: 11px; }
.lbempty { color: var(--muted); text-align: center; margin: 0; }

.sitefoot { margin-top: 48px; border-top: 1px solid var(--line); background: rgba(3, 22, 14, 0.55); padding: 32px 16px max(20px, env(safe-area-inset-bottom)); }
.sf-top, .sf-bottom { max-width: 1008px; margin: 0 auto; }
.sf-top { display: grid; gap: 28px 24px; grid-template-columns: 1fr 1fr; }
.sf-brand { grid-column: 1 / -1; display: grid; gap: 10px; }
.sf-brand p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 36ch; }
.sf-col { display: grid; gap: 10px; align-content: start; }
.sf-col h4 { margin: 0 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sf-col a { color: var(--text); text-decoration: none; font-size: 15px; }
.sf-col a:hover { color: var(--gold); }
.sf-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
@media (min-width: 720px) {
  .sf-top { grid-template-columns: 2fr 1fr 1fr; }
  .sf-brand { grid-column: auto; }
}
.sf-legal { display: flex; gap: 18px; }
.sf-legal a { color: var(--muted); text-decoration: none; }
.sf-legal a:hover { color: var(--gold); }
.legal article { max-width: 760px; padding: 12px 0 8px; line-height: 1.65; }
.legal h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 8vw, 48px); letter-spacing: -0.02em; margin: 6px 0 4px; }
.legal .updated { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.legal .lead { font-size: 18px; margin: 0 0 8px; }
.legal section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.legal h2 { font-family: var(--display); font-size: 21px; margin: 0 0 8px; }
.legal p { margin: 0 0 10px; color: rgba(242,247,243,0.88); }
.legal ul { margin: 0 0 10px; padding-left: 20px; color: rgba(242,247,243,0.88); }
.legal li { margin-bottom: 6px; }

.ask { z-index: 25; }
.ask .sheet { width: min(360px, 100%); text-align: center; padding: 24px 20px 20px; }
.ask.closing { opacity: 0; transition: opacity 0.15s; }
.askicon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); }
.ask .lead { margin-bottom: 20px; line-height: 1.45; }
.askrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.danger { background: #c0392b; border-color: #962d22; color: #fff; box-shadow: 0 4px 0 #962d22; }
.btn.danger:active:not(:disabled) { box-shadow: 0 1px 0 #962d22; transform: translateY(3px); }

.seg.pics button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 12px 8px; min-height: 120px; }
.seg.pics button small { display: block; font-weight: 600; font-size: 11px; line-height: 1.3; opacity: 0.8; margin-top: 3px; }
.seg .pic { height: 40px; display: grid; place-items: center; font-size: 30px; line-height: 1; transition: transform 0.25s cubic-bezier(.3,1.6,.5,1); }
.seg button.on .pic { transform: scale(1.12) rotate(-6deg); }
.needpic { display: flex; gap: 3px; }
.needpic svg { width: 20px; height: 20px; fill: currentColor; }
.seg button:not(.on) .needpic svg { fill: var(--muted); }
.seg button.on .needpic svg { fill: var(--ink); }
.rulelist { display: grid; gap: 8px; margin: 0 0 16px; }
.rulelist > div { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); }
.rulelist .ricon { margin: 0; height: 44px; min-width: 40px; font-size: 24px; }
.rulelist .ricon > svg { width: 28px; height: 28px; fill: var(--gold); }
.rulelist p { margin: 0; line-height: 1.4; font-size: 14px; }

/* Watching */
.watchbar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(246,185,59,0.16), rgba(0,0,0,0.25)); border: 1px solid rgba(246,185,59,0.35); text-align: left; }
.wb-eye { font-size: 26px; line-height: 1; }
.wb-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.wb-txt b { font-weight: 800; }
.wb-txt span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.watchbar .btn { flex: 0 0 auto; }
.me.watching { padding: 8px 12px max(12px, env(safe-area-inset-bottom)); }
.words > .watchbar, .ludo > .watchbar { margin-top: 10px; }
.watchbtn { position: relative; font-size: 17px; }
.watchbtn i { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--felt-3); border: 1px solid var(--line); font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.watchbtn .dot { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 2px var(--felt-2); animation: blink 1.2s infinite; }
.vpill.asked { background: rgba(246,185,59,0.18); color: var(--gold); }
.watchers li { flex-wrap: wrap; }
.watchers li.asking { background: rgba(246,185,59,0.12); box-shadow: 0 0 0 1px rgba(246,185,59,0.45) inset; }
.watchers .name small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.reqbtns { display: flex; gap: 6px; margin-left: auto; }
.wsheet .watchers li { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); }
.wsheet .watchers { display: grid; gap: 8px; }
.vpill { white-space: nowrap; }
.reqbtns { flex: 1 0 100%; margin-left: 0; }
.reqbtns .btn { flex: 1; }

/* Accounts */
.sb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.acctchip { gap: 8px; padding: 0 12px 0 4px; text-decoration: none; color: var(--text); }
.acctchip .avatar { width: 28px; height: 28px; font-size: 13px; }
.sitebar a.btn { text-decoration: none; color: var(--text); }
.playingas { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,0.25); border: 1px solid var(--line); }
.playingas .label { margin: 0; }
.playingas b { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.playingas .avatar { width: 30px; height: 30px; font-size: 14px; }
.hint a, .formerr a { color: var(--gold); }
.hint.good { color: #6ee7a8; }
.hint.bad { color: var(--danger); }
.auth { max-width: 460px; }
.authbox { display: grid; gap: 10px; margin-top: 8px; padding: 20px 18px; }
.authbox h1 { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 6px 0 0; letter-spacing: -0.01em; }
.authbox .lead { margin: 0 0 6px; color: var(--muted); line-height: 1.45; }
.authbox .label { margin: 6px 0 0; }
.authbox .hint { text-align: left; margin: 0; }
.authtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,0.25); }
.authtabs a { text-align: center; padding: 10px; border-radius: 10px; font-weight: 800; color: var(--muted); text-decoration: none; }
.authtabs a.on { background: var(--gold); color: #3a2400; }
.unamefield { position: relative; }
.unamefield span { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); font-weight: 800; font-size: 17px; }
.unamefield .field { padding-left: 32px; }
.pinrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pinrow > div { display: grid; gap: 6px; }
.field.pin { text-align: center; font-size: 26px; letter-spacing: 0.5em; padding-left: calc(16px + 0.5em); font-weight: 800; }
.formerr { margin: 0; color: var(--danger); font-weight: 600; min-height: 0; }
.formerr:empty { display: none; }
.captchabox { min-height: 65px; display: flex; justify-content: center; }
.captchabox[hidden] { display: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); text-decoration: underline; cursor: pointer; }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.field.code6 { letter-spacing: 0.4em; padding-left: calc(16px + 0.4em); }
.ctext { min-height: 140px; resize: vertical; font: inherit; font-size: 17px; line-height: 1.45; color: var(--text); padding: 12px 16px; }
.authbox .label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.pagetitle { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 8vw, 44px); margin: 10px 0 14px; letter-spacing: -0.02em; }
.profhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; }
.profhead > .avatar, .profhead .avbtn > .avatar { width: 64px; height: 64px; font-size: 28px; }
.avatar.pic { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.22); }
.avatar.pic > b { font-size: 1.5em; line-height: 1; font-family: system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.avbtn { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.avbtn .avedit { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #3a2400; font-size: 12px; box-shadow: 0 0 0 3px var(--felt-2); }
.avgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0; }
.avpick { aspect-ratio: 1; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; font-size: clamp(26px, 8vw, 42px); line-height: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.22), 0 3px 0 rgba(0,0,0,0.35); transition: transform 0.12s; }
.avpick:active { transform: scale(0.94); }
.avpick.on { box-shadow: 0 0 0 3px var(--felt-2), 0 0 0 6px var(--gold); }
.avpick.letter { background: rgba(255,255,255,0.08); color: #fff; font: 800 13px var(--body); }
.profhead h1 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 7vw, 36px); margin: 0; letter-spacing: -0.01em; word-break: break-all; }
.profhead p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.profact { display: flex; gap: 8px; margin-left: auto; }
.profact a.btn { text-decoration: none; color: inherit; }
.presence { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; color: #6ee7a8; }
.presence.on::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }
.stattiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stattiles > div { padding: 14px 10px; border-radius: 16px; text-align: center; background: linear-gradient(170deg, rgba(255,255,255,0.07), rgba(0,0,0,0.2)); border: 1px solid var(--line); }
.stattiles b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(20px, 6vw, 28px); color: var(--gold); }
.stattiles span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.pergame { display: grid; gap: 10px; }
@media (min-width: 620px) { .pergame { grid-template-columns: repeat(3, 1fr); } }
.pg { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--gbg); border: 1px solid rgba(255,255,255,0.14); }
.pg .gicon { flex: 0 0 auto; }
.pg-body { display: grid; gap: 2px; }
.pg-body b { font-family: var(--display); font-size: 17px; }
.pg-body span { font-size: 13px; color: rgba(255,255,255,0.8); }
.pg-body .medals { font-weight: 700; color: var(--text); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); }
.h-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.h-body b small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 4px; }
.h-body span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-pts { font-family: var(--display); font-weight: 800; font-size: 18px; }
.h-pts small { font-family: var(--body); font-size: 11px; color: var(--muted); margin-left: 2px; }
.place { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: rgba(0,0,0,0.25); font-weight: 800; font-size: 13px; }
.place.p1, .place.p2, .place.p3 { font-size: 22px; }
.flist .fname { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--text); font-weight: 700; }
.flist .fname span { display: grid; }
.flist small { color: var(--muted); font-weight: 500; font-size: 12px; }
.flist small.onl { color: #6ee7a8; }
.flist a.btn { text-decoration: none; color: inherit; }
.friends .joincard { margin-bottom: 14px; }
.lbtabs { margin: 0 0 14px; }
.lbtabs a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--text); text-decoration: none; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 4px 0 rgba(0,0,0,0.35); }
.lbtabs a.on { background: var(--gold); color: #3a2400; border-color: var(--gold-2); box-shadow: 0 2px 0 var(--gold-2); transform: translateY(2px); }
.lbtable .rank { color: var(--muted); font-size: 14px; width: 28px; }
.lbtable a.lbname { color: var(--text); text-decoration: none; }
.lbtable.global td, .lbtable.global th { padding-left: 3px; padding-right: 3px; }
.saved { text-align: center; color: #6ee7a8; font-size: 13px; font-weight: 700; margin: -6px 0 10px; }
.plink { font: inherit; color: inherit; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.vtick { font-style: normal; font-size: 11px; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; background: #2e9e4f; color: #fff; font-weight: 800; }
.profsheet .profhead { margin-top: 0; }
.profsheet .stattiles b { font-size: 22px; }
.friends .joinrow .field { text-transform: none; letter-spacing: normal; text-align: left; font-size: 17px; font-weight: 600; }

#app:has(> .sitefoot) { display: flex; flex-direction: column; }
#app:has(> .sitefoot) > main { flex: 1 0 auto; width: 100%; }
.sitefoot { flex-shrink: 0; }
.sb-nav { display: none; gap: 4px; margin-left: 18px; }
.sb-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 15px; text-decoration: none; }
.sb-nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.sb-nav a.on { color: var(--text); background: rgba(255,255,255,0.1); }
@media (min-width: 720px) { .sb-nav { display: flex; } }
@media (max-width: 380px) { .logo span { font-size: 21px; } .acctchip span { max-width: 84px; overflow: hidden; text-overflow: ellipsis; } }
.sitebar { position: relative; width: calc(min(1040px, 100vw) - 32px); left: 50%; translate: -50% 0; }
.rejoinchip { white-space: nowrap; letter-spacing: 0.04em; }
.sitebar .logo { flex: 0 0 auto; }
.sb-right { min-width: 0; flex-shrink: 1; }
.acctchip { min-width: 0; flex-shrink: 1; }
.acctchip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.rejoinchip { flex: 0 0 auto; }

/* Pause */
.game .topbar, .words .topbar, .ludo .topbar, .ayo .topbar, .chess .topbar, .pool .topbar { position: relative; z-index: 19; }
.wincel { position: fixed; inset: 0; z-index: 29; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding-bottom: 12vh; background: rgba(4,26,16,0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; cursor: pointer; animation: fade 0.25s; transition: opacity 0.35s; }
.wincel.out { opacity: 0; }
.wc-core { position: relative; width: 160px; height: 160px; flex: none; }
.wc-rays { position: absolute; left: -180px; top: -180px; width: 520px; height: 520px; border-radius: 50%; background: repeating-conic-gradient(rgba(246,185,59,0.55) 0 7deg, transparent 7deg 25.7deg); -webkit-mask: radial-gradient(closest-side, #000 15%, transparent); mask: radial-gradient(closest-side, #000 15%, transparent); opacity: 0; animation: wcrays 3s 0.45s linear both; }
.wc-trophy { position: absolute; inset: 0; display: grid; place-items: center; font-size: 140px; line-height: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.5)); animation: wcdrop 0.75s 0.1s both; }
.wc-bits { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.wc-bits i { position: absolute; left: 0; top: 0; font-style: normal; transform: translate(-50%, -50%); opacity: 0; animation: wcbit 1.7s 0.62s cubic-bezier(.2,.7,.4,1) both; }
.wc-title { display: flex; font: 800 52px/1 var(--display); letter-spacing: -0.02em; color: var(--gold); text-shadow: 0 5px 0 #b8740a, 0 0 24px rgba(246,185,59,0.6); }
.wc-title span { display: inline-block; animation: wcstamp 0.35s both; }
.wc-hint { color: var(--muted); font-weight: 600; opacity: 0; animation: fade 0.3s 1.6s both; }
@keyframes wcdrop { 0% { transform: translateY(-70vh); } 60% { transform: translateY(0); } 75% { transform: translateY(-34px); } 88% { transform: translateY(0); } 94% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes wcrays { 0% { opacity: 0; transform: rotate(0); } 15% { opacity: 0.9; } 100% { opacity: 0.9; transform: rotate(110deg); } }
@keyframes wcbit { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 45% { opacity: 1; transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) rotate(calc(var(--r) / 2)); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)); } }
@keyframes wcstamp { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .wc-trophy, .wc-title span, .wc-hint { animation: fade 0.3s both; } .wc-rays, .wc-bits { display: none; } }
.cdlayer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,0.55); animation: fade 0.2s; transition: background 0.5s; }
.cdlayer.going { background: rgba(0,0,0,0); pointer-events: none; }
.cdlayer > * { grid-area: 1 / 1; }
.cdnum { font: 800 150px/1 var(--display); color: #fff; letter-spacing: -0.02em; text-shadow: 0 6px 0 #b8740a, 0 0 30px rgba(246,185,59,0.7); animation: cdpunch 1s both; }
.cdnum.go { font-size: 110px; color: var(--gold); animation-duration: 0.75s; }
.cdring { width: 120px; height: 120px; border-radius: 50%; border: 6px solid rgba(246,185,59,0.8); animation: cdring 1s ease-out both; }
.cdsub { align-self: end; margin-bottom: 22vh; font: 800 24px var(--display); color: #fff; animation: cdpunch 1s both; }
@keyframes cdpunch { 0% { transform: scale(1.9); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 70% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes cdring { from { transform: scale(1); opacity: 1; } to { transform: scale(3.2); opacity: 0; border-width: 1px; } }
@media (prefers-reduced-motion: reduce) { .cdnum, .cdsub { animation: none; } .cdring { display: none; } }
.pauselayer { position: fixed; inset: 0; z-index: 18; display: grid; place-items: center; padding: 72px 16px 16px; background: rgba(2, 18, 11, 0.78); backdrop-filter: blur(5px); animation: fade 0.25s; }
.pausecard { width: min(380px, 100%); text-align: center; background: var(--felt-2); border: 1px solid var(--line); border-radius: 24px; padding: 26px 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: rise 0.3s; }
.pausecard h3 { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 0 0 6px; }
.pausecard .lead { color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.pausecard .btn { width: 100%; }
.pausecard .hint { margin-top: 4px; }
.pausebars { display: flex; justify-content: center; gap: 10px; margin: 0 auto 14px; }
.pausebars i { width: 16px; height: 52px; border-radius: 6px; background: var(--gold); box-shadow: 0 4px 0 var(--gold-2); animation: pausebreath 1.6s ease-in-out infinite; }
.pausebars i + i { animation-delay: 0.2s; }
.pauselayer.settled, .pauselayer.settled .pausecard { animation: none; }
.pausecard.back .pausebars i { background: #2ecc71; box-shadow: 0 4px 0 #1e8449; animation: none; }
@keyframes pausebreath { 50% { transform: scaleY(0.82); opacity: 0.75; } }
.pauseclock { display: inline-block; font-size: 14px; color: var(--muted); background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; margin-bottom: 18px; }
.pauseclock b { color: var(--text); font-variant-numeric: tabular-nums; }
.awaybar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; margin: 0 0 16px; }
.awaybar i { display: block; height: 100%; background: var(--gold); transform-origin: left; animation: awaydrain linear forwards; }
@keyframes awaydrain { from { transform: scaleX(var(--from, 1)); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .pausebars i { animation: none; } }
.game .topbar .meta, .words .topbar .meta, .ludo .topbar .meta, .ayo .topbar .meta { white-space: nowrap; }
@media (max-width: 420px) {
  .topbar .right { gap: 4px; }
  .topbar .right .iconbtn { width: 38px; }
  .game .topbar .meta, .words .topbar .meta, .ludo .topbar .meta, .ayo .topbar .meta { gap: 6px; }
  .topbar .right #vjoin { padding: 0 10px; }
  .topbar .right #vjoin span { display: none; }
}

/* Ayo */
:root { --wood-1: #a8672f; --wood-2: #7a4520; --wood-3: #4e2a12; --pit: #2b170a; }
.ayo {
  height: 100dvh; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  max-width: 640px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}
.ayo .topbar { padding: 4px 2px 0; }
.ayo .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
.abar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--panel); border: 2px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }
.abar.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,185,59,0.15); }
.abar .avatar { width: 34px; height: 34px; font-size: 15px; }
.abar .nm { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abowl { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 99px; background: linear-gradient(180deg, var(--wood-2), var(--wood-3)); box-shadow: inset 0 2px 4px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.08); }
.abowl i { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #1b0e05 55%, #3a210f); box-shadow: inset 0 0 0 2px rgba(0,0,0,0.3); position: relative; }
.abowl i::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e4e0cc, #9b977d 55%, #5d5a45); }
.abowl b { font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff4dc; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.abowl small { color: #e8cfa8; font-size: 11px; font-weight: 600; }
.abowl.gain { animation: bowlpop 0.5s ease-out; }
@keyframes bowlpop { 40% { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(246,185,59,0.5); } }
.aplay { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.aboard-wrap { display: grid; place-items: center; }
.aboard {
  position: relative; width: 100%; max-width: 560px; display: grid; gap: 10px; padding: 14px 12px;
  border-radius: 26px;
  background:
    repeating-linear-gradient(92deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(88deg, rgba(0,0,0,0.08) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, var(--wood-1), var(--wood-2) 55%, var(--wood-3));
  box-shadow: 0 18px 40px rgba(0,0,0,0.5), inset 0 2px 0 rgba(255,255,255,0.18), inset 0 -4px 0 rgba(0,0,0,0.3);
}
.aboard::after { content: ''; position: absolute; left: 14px; right: 14px; top: 50%; height: 2px; background: rgba(0,0,0,0.25); box-shadow: 0 1px 0 rgba(255,255,255,0.12); }
.arow { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(5px, 1.6vw, 10px); }
.apit {
  position: relative; aspect-ratio: 0.8; border-radius: 46% / 40%; padding: 0;
  background: radial-gradient(ellipse at 50% 40%, var(--pit) 50%, #4a2a12 100%);
  box-shadow: inset 0 6px 10px rgba(0,0,0,0.7), inset 0 -2px 3px rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.15);
  transition: box-shadow 0.2s, transform 0.15s;
}
.apit .aseeds { position: absolute; inset: 10% 8%; }
.apit .aseeds i, .art-ayo .aseeds i {
  position: absolute; width: clamp(9px, 2.6vw, 13px); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #ece8d6, #a3a085 50%, #5d5a45);
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.apit .acount { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--display); font-weight: 800; font-size: 12px; color: #fff4dc; background: rgba(0,0,0,0.45); border-radius: 99px; padding: 1px 7px; line-height: 1.4; }
.arow.top .acount { top: -9px; }
.arow.bottom .acount { bottom: -9px; }
.apit.can { box-shadow: inset 0 6px 10px rgba(0,0,0,0.7), 0 0 0 3px var(--gold), 0 0 18px rgba(246,185,59,0.55); animation: pitglow 1.4s ease-in-out infinite; }
.apit.can:active { transform: scale(0.95); }
@keyframes pitglow { 50% { box-shadow: inset 0 6px 10px rgba(0,0,0,0.7), 0 0 0 3px var(--gold), 0 0 6px rgba(246,185,59,0.3); } }
.apit.picked { box-shadow: inset 0 6px 10px rgba(0,0,0,0.7), 0 0 0 3px #fff4dc, 0 0 20px rgba(255,244,220,0.5); }
.apit.hit { animation: pithit 0.3s ease-out; }
@keyframes pithit { 40% { transform: scale(1.06); } }
.apit.took { animation: pittook 0.6s ease-out; }
@keyframes pittook { 30% { box-shadow: inset 0 6px 10px rgba(0,0,0,0.7), 0 0 0 4px #2ecc71, 0 0 24px rgba(46,204,113,0.7); } }
.adir { position: absolute; right: -2px; top: 50%; transform: translate(50%, -50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--wood-3); color: #e8cfa8; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,0.4); z-index: 1; }
.ahand { position: absolute; z-index: 2; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; transform: translate(-50%, -50%) scale(0.5); opacity: 0; background: var(--gold); color: #3a2400; font-family: var(--display); font-weight: 800; font-size: 15px; box-shadow: 0 6px 16px rgba(0,0,0,0.45); pointer-events: none; transition: left 0.18s ease-out, top 0.18s ease-out, opacity 0.2s, transform 0.2s; }
.ahand.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.atake { position: fixed; z-index: 25; pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 22px; color: #2ecc71; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.astatus { text-align: center; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.astatus b { font-family: var(--display); font-size: 17px; }
.astatus.mine b { color: var(--gold); }
.astatus .evt { color: var(--muted); font-size: 13px; }
.aleft { color: var(--muted); font-size: 12px; }
.gi-ayo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 40px; padding: 4px; border-radius: 8px; background: linear-gradient(180deg, var(--wood-1), var(--wood-3)); }
.gi-ayo i { aspect-ratio: 1; border-radius: 50%; background: var(--pit); box-shadow: inset 0 2px 2px rgba(0,0,0,0.6); }
.art-ayo { width: 190px; height: 120px; }
.art-ayo .ab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 10px; width: 150px; border-radius: 18px; transform: rotate(-6deg); background: linear-gradient(180deg, var(--wood-1), var(--wood-2) 60%, var(--wood-3)); box-shadow: 0 10px 22px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.18); }
.art-ayo .ap { position: relative; aspect-ratio: 0.85; border-radius: 46% / 40%; background: radial-gradient(ellipse at 50% 40%, var(--pit) 50%, #4a2a12); box-shadow: inset 0 4px 6px rgba(0,0,0,0.7); }
.art-ayo .aseeds { position: absolute; inset: 12% 10%; }
.art-ayo .aseeds i { width: 9px; }
.collage.small .cl-ayo { display: none; }
.hero > .collage .cl-ayo { display: none; }
@media (prefers-reduced-motion: reduce) { .apit.can, .apit.hit, .apit.took, .abowl.gain { animation: none; } }
.game .topbar .meta, .words .topbar .meta, .ludo .topbar .meta, .ayo .topbar .meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar > .right { flex: 0 0 auto; }

#installbar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--cream); color: #1d2b22; border-radius: 18px; box-shadow: 0 12px 36px rgba(0,0,0,0.4); z-index: 25; animation: install-in 0.3s ease-out; }
#installbar.out { opacity: 0; transform: translateY(16px); transition: opacity 0.25s, transform 0.25s; }
#installbar img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
#installbar .it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.35; }
#installbar .it > b { font-size: 15px; font-family: var(--display); }
#installbar .it span { color: #4b5d52; }
#installbar .shareic { width: 16px; height: 16px; vertical-align: -3px; color: #2475d6; }
#installbar .btn { flex: none; padding: 10px 18px; }
#installbar .iconbtn { flex: none; color: #4b5d52; background: transparent; }
@keyframes install-in { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { #installbar { animation: none; } }

.g-chess { --gbg: linear-gradient(165deg, #44576a, #1a2530 75%); }
.pc { overflow: visible; display: block; }
.pc.w { --pf: #fbf4e6; --ps: #1d2620; --pd: #1d2620; }
.pc.b { --pf: #2a2f2c; --ps: #0d100e; --pd: #e9dcc0; }
.pc use { fill: var(--pf); stroke: var(--ps); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#chessdefs .pd { stroke: var(--pd); stroke-width: 1.3; }
#chessdefs .pe { fill: var(--pd); stroke: none; }
.chess {
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  max-width: 640px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}
.chess .topbar { padding: 4px 2px 0; }
.chess .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
.cplay { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ccol { width: min(100%, 560px, calc(100dvh - 330px)); min-width: min(100%, 280px); display: flex; flex-direction: column; gap: 8px; }
.cbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; background: var(--panel); border: 2px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }
.cbar.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,185,59,0.15); }
.cbar .avatar { width: 32px; height: 32px; font-size: 14px; }
.cwho { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cwho .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cwho .nm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; border: 1.5px solid rgba(0,0,0,0.55); vertical-align: -1px; }
.cchip.w { background: #fbf4e6; }
.cchip.b { background: #2a2f2c; border-color: rgba(255,255,255,0.55); }
.ctook { display: flex; align-items: center; height: 16px; }
.ctook .pc.mini { width: 16px; height: 16px; margin-right: -5px; }
.ctook b { margin-left: 9px; font-size: 12px; color: var(--muted); }
.cclock { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; padding: 4px 10px; border-radius: 10px; background: rgba(0,0,0,0.3); color: var(--muted); min-width: 66px; text-align: center; }
.cclock.on { background: var(--cream); color: #1d2b22; }
.cclock.on.low { background: #e0393e; color: #fff; }
.cboard { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 5px #2b1c10, 0 0 0 6px rgba(255,255,255,0.12), 0 14px 34px rgba(0,0,0,0.45); margin: 5px; }
.csq { position: relative; aspect-ratio: 1; border: 0; padding: 0; margin: 0; display: grid; place-items: center; background: var(--sq); cursor: default; border-radius: 0; }
.csq.l { --sq: #efe3c9; --co: #5b8f63; }
.csq.d { --sq: #5b8f63; --co: #efe3c9; }
.csq.last.l { --sq: #f2d985; }
.csq.last.d { --sq: #a3b552; }
.csq.own { cursor: pointer; }
.csq.sel { box-shadow: inset 0 0 0 3px var(--gold); }
.csq.sel.l { --sq: #f6cf6c; }
.csq.sel.d { --sq: #b3b347; }
.csq.check { background: radial-gradient(circle, #ff6b5f 0%, #e0393e 38%, var(--sq) 72%); }
.csq.tgt, .csq.cap { cursor: pointer; }
.csq.tgt::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(12, 32, 20, 0.3); }
.csq.cap::after { content: ''; position: absolute; inset: 5%; border-radius: 50%; border: max(3px, 0.8vmin) solid rgba(12, 32, 20, 0.32); }
.csq .pc { width: 90%; height: 90%; position: relative; z-index: 1; pointer-events: none; filter: drop-shadow(0 2px 1px rgba(0,0,0,0.25)); }
.csq .pc.moving { z-index: 3; }
.csq .co { position: absolute; font-size: clamp(8px, 2.2vmin, 11px); font-weight: 800; color: var(--co); line-height: 1; z-index: 2; pointer-events: none; }
.csq .co.rk { left: 3px; top: 3px; }
.csq .co.fl { right: 3px; bottom: 2px; }
.coffer { display: flex; align-items: center; justify-content: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: rgba(246,185,59,0.14); border: 1px solid rgba(246,185,59,0.5); font-weight: 600; font-size: 14px; text-align: center; animation: rise 0.25s; }
.coffer.out { background: rgba(255,255,255,0.05); border-color: var(--line); color: var(--muted); }
.coffer .cbtns { display: flex; gap: 8px; }
.cstatus { text-align: center; min-height: 40px; }
.cstatus b { display: block; font-size: 16px; }
.cstatus.mine b { color: var(--gold); }
.cstatus .evt { display: block; font-size: 13px; color: var(--muted); min-height: 17px; }
.cmoves { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; font-size: 13px; padding: 2px; color: var(--muted); scrollbar-width: none; font-variant-numeric: tabular-nums; }
.cmoves::-webkit-scrollbar { display: none; }
.cmoves .mn { color: rgba(255,255,255,0.35); margin-left: 4px; }
.cmoves .mn:first-child { margin-left: 0; }
.cmoves span:last-child:not(.mn) { color: var(--text); font-weight: 700; }
.cacts { display: flex; gap: 8px; justify-content: center; }
.cpromo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 14px; }
.cpromo button { aspect-ratio: 0.85; border-radius: 14px; background: #efe3c9; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #1d2b22; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.cpromo button:hover, .cpromo button:focus-visible { border-color: var(--gold); }
.cpromo .pc { width: 78%; height: auto; aspect-ratio: 1; }
.results .cres { font-weight: 800; font-size: 15px; }
.rnote { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.gi-chess { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: conic-gradient(#5b8f63 25%, #efe3c9 0 50%, #5b8f63 0 75%, #efe3c9 0) 0 0 / 50% 50%; }
.gi-chess .pc { width: 34px; height: 34px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)); }
.art-chess { width: 190px; height: 120px; position: relative; }
.art-chess .cb { position: absolute; left: 34px; top: 8px; width: 110px; height: 110px; display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 10px; overflow: hidden; transform: rotate(-6deg); box-shadow: 0 0 0 4px #2b1c10, 0 10px 22px rgba(0,0,0,0.35); }
.art-chess .cb i.l { background: #efe3c9; }
.art-chess .cb i.d { background: #5b8f63; }
.art-chess .pc { position: absolute; width: 70px; height: 70px; filter: drop-shadow(0 6px 6px rgba(0,0,0,0.35)); }
.art-chess .ak2 { left: 30px; top: 6px; transform: rotate(-8deg); }
.art-chess .ak1 { left: 92px; top: 40px; transform: rotate(6deg); }
.collage.small .cl-chess, .hero > .collage .cl-chess { display: none; }
@media (max-height: 640px) { .cstatus { min-height: 0; } .cstatus .evt { display: none; } .cbar { padding: 4px 8px; } }
.ctook .pc.b { --ps: rgba(233,220,192,0.8); }

.overlay.under { z-index: 18; padding-top: calc(max(8px, env(safe-area-inset-top)) + 64px); }
.overlay.under .sheet { max-height: calc(100dvh - 96px - env(safe-area-inset-top)); }
.players li.out { background: rgba(255,255,255,0.025); }
.players li.out > .avatar { opacity: 0.55; }
.seatbtn { display: flex; width: fit-content; margin-top: 4px; border: 0; border-radius: 99px; padding: 4px 10px; font: 700 12px var(--body); cursor: pointer; white-space: nowrap; }
.players li .seatnote { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.seatbtn.in { background: rgba(46,158,79,0.22); color: #9fe3b4; box-shadow: inset 0 0 0 1px rgba(46,158,79,0.55); }
.seatbtn.out { background: rgba(255,255,255,0.08); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.seathint { margin: -4px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.4; }

.livedot { position: relative; display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,0.7); animation: livepulse 1.8s ease-out infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,0.65); } 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.livepill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 99px; background: rgba(61,220,132,0.1); border: 1px solid rgba(61,220,132,0.4); color: #c8f5da; font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; flex: none; }
.livepill.hot { background: linear-gradient(90deg, rgba(246,185,59,0.28), rgba(61,220,132,0.18)); border-color: rgba(246,185,59,0.85); color: #fff3d6; animation: pillglow 2.4s ease-in-out infinite; }
@keyframes pillglow { 50% { box-shadow: 0 0 18px rgba(246,185,59,0.45); } }
.livepill .lp-short { display: none; }
@media (max-width: 480px) { .livepill .lp-long { display: none; } .livepill .lp-short { display: inline; } .livepill { padding: 7px 11px; } }
.livebox { scroll-margin-top: 80px; }
.lv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lv-head h2 { margin: 0; }
.lv-head small { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.lv-empty { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.lv-empty b { color: var(--text); }
.lv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 720px) { .lv-list { grid-template-columns: 1fr 1fr; } }
.lv-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--gbg); border: 1px solid rgba(255,255,255,0.14); animation: rise 0.3s; }
.lv-item.open { box-shadow: 0 0 0 1px rgba(61,220,132,0.35), 0 8px 20px rgba(0,0,0,0.25); }
.lv-item.playing, .lv-item.full { opacity: 0.85; }
.lv-item .gicon { flex: none; height: auto; }
.lv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lv-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-txt small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255,255,255,0.78); }
.lv-wait { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.quickbtn { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; border-color: rgba(61,220,132,0.55); background: rgba(61,220,132,0.12); color: #d6f8e3; }
.opentoggle { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.opentoggle .livedot { background: #6b7d73; animation: none; box-shadow: none; }
.opentoggle.on { border-color: rgba(61,220,132,0.6); background: rgba(61,220,132,0.1); }
.opentoggle.on .livedot { background: #3ddc84; animation: livepulse 1.8s ease-out infinite; }
.ot-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ot-txt b { font-size: 15px; }
.ot-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.ot-sw { flex: none; width: 42px; height: 24px; border-radius: 99px; background: rgba(255,255,255,0.18); position: relative; transition: background 0.2s; }
.ot-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.opentoggle.on .ot-sw { background: #2e9e4f; }
.opentoggle.on .ot-sw::after { transform: translateX(18px); }
.openbadge { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: #c8f5da; font-weight: 600; }
.seeking { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(90deg, rgba(61,220,132,0.14), rgba(246,185,59,0.12)); border: 1px solid rgba(61,220,132,0.45); }
.seeking b { display: block; font-size: 15px; }
.seeking span { font-size: 13px; color: var(--muted); }
.seekspin { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(61,220,132,0.25); border-top-color: #3ddc84; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fresults { margin-top: 10px; }
.fresults:empty { display: none; }
.fresults .fhint { color: var(--muted); font-size: 14px; background: transparent; }
.fresults mark { background: rgba(246,185,59,0.35); color: inherit; border-radius: 3px; padding: 0 1px; }
.fsearchbox { flex-direction: column; align-items: stretch; }
@media (prefers-reduced-motion: reduce) { .livedot, .livepill.hot, .lv-wait, .seekspin, .opentoggle.on .livedot { animation: none; } }
.fsearchbox .joinrow { max-width: none; flex: none; }
.fsearchbox .field { text-transform: none; letter-spacing: 0; text-align: left; font-size: 16px; font-weight: 600; }
.lv-item a.btn, .livepill { text-decoration: none; }
.fresults .fnm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.livebox[hidden] { display: none; }
.lobby .topbar .tbr { display: flex; align-items: center; gap: 8px; }
.sbset { width: 38px; height: 38px; font-size: 17px; flex: none; }
.setts { display: grid; gap: 8px; margin: 4px 0 16px; }
.settrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); cursor: pointer; }
.settrow.dim { opacity: 0.5; }
.st-ic { font-size: 20px; flex: none; }
.st-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-txt b { font-size: 15px; }
.st-txt small { color: var(--muted); font-size: 12.5px; }
.settrow input[type="range"] { flex: 1.2; accent-color: var(--gold); min-width: 0; }
.sw { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,0.18); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.sw:checked { background: #2e9e4f; }
.sw:checked::after { transform: translateX(20px); }
.sw:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sheet .setts { margin-top: 0; }
html, body { touch-action: pan-x pan-y; }
body * { touch-action: manipulation; }

.menubtn { position: relative; flex: none; width: 42px; height: 40px; padding: 0; border: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; background: linear-gradient(180deg, #fffaf0, #efe3c9); box-shadow: 0 3px 0 #b89c6a, 0 6px 14px rgba(0,0,0,0.3), inset 0 1px 0 #fff; transition: transform 0.08s, box-shadow 0.08s; }
.menubtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b89c6a, 0 3px 8px rgba(0,0,0,0.3); }
.mb-bars { display: grid; gap: 4px; width: 20px; }
.mb-bars i { display: block; height: 3px; border-radius: 3px; background: var(--ink); }
.mb-bars i:nth-child(2) { width: 68%; justify-self: end; background: var(--gold-2); }
.mb-dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #3ddc84; border: 2px solid var(--felt-2); animation: livepulse 1.8s ease-out infinite; }
.topbar .right .menubtn, .lobby .tbr .menubtn { width: 40px; height: 38px; }
.sb-menu { display: none; }
@media (max-width: 719px) {
  .sb-menu { display: block; }
  .sitebar .sbset, .sitebar .acctchip, .sitebar .sb-right > a.btn[href="/login"] { display: none; }
}
.mnu-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(2, 18, 11, 0.62); backdrop-filter: blur(4px); animation: fade 0.18s; }
.mnu-wrap.out { opacity: 0; transition: opacity 0.18s; }
.mnu { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; left: 10px; margin-left: auto; max-width: 420px; max-height: calc(100dvh - 20px); overflow: auto; overscroll-behavior: contain; padding: 14px; border-radius: 24px; background: radial-gradient(130% 70% at 85% 0%, #1d7a50 0%, var(--felt-2) 55%, var(--felt-3) 100%); border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.1); transform-origin: top right; animation: mnuin 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.15); }
.mnu-wrap.out .mnu { transform: translateY(-8px) scale(0.97); transition: transform 0.18s; }
@keyframes mnuin { from { opacity: 0; transform: translateY(-14px) scale(0.94); } }
.mnu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mnu-head .logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 22px; }
.mnu-head .logo img { width: 30px; height: 30px; }
.mnu-room { padding: 4px 10px; border-radius: 99px; background: rgba(246,185,59,0.18); color: var(--gold); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; }
.mnu-x { margin-left: auto; }
.mnu-live { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 14px; border-radius: 14px; background: rgba(61,220,132,0.1); border: 1px solid rgba(61,220,132,0.4); color: #d6f8e3; font-weight: 700; font-size: 14px; text-decoration: none; }
.mnu-live.hot { background: linear-gradient(90deg, rgba(246,185,59,0.25), rgba(61,220,132,0.16)); border-color: rgba(246,185,59,0.8); color: #fff3d6; }
.mnu-live.calm { background: rgba(255,255,255,0.04); border-color: var(--line); color: var(--muted); font-weight: 600; }
.mnu-live.calm .livedot { background: #6b7d73; animation: none; box-shadow: none; }
.mnu-live b { margin-left: auto; font-size: 22px; line-height: 1; }
.mnu-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mtile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 84px; padding: 13px 14px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.13); background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)); box-shadow: 0 4px 0 rgba(0,0,0,0.35); color: var(--text); text-decoration: none; font: 700 15px var(--body); text-align: left; cursor: pointer; animation: rise 0.32s both; transition: transform 0.08s, box-shadow 0.08s; }
.mtile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.mtile.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(246,185,59,0.22), rgba(246,185,59,0.08)); }
.mtile.warn { border-color: rgba(255,107,107,0.35); }
.mtile .mi { font-size: 26px; line-height: 1; }
.mtile .mi .avatar { width: 30px; height: 30px; font-size: 14px; }
.mtile:nth-child(2) { animation-delay: 0.03s; } .mtile:nth-child(3) { animation-delay: 0.06s; } .mtile:nth-child(4) { animation-delay: 0.09s; } .mtile:nth-child(5) { animation-delay: 0.12s; }
.mtile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.mnu-sec { margin: 16px 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mnu-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mgame { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 14px; background: var(--gbg); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 3px 0 rgba(0,0,0,0.35); color: var(--text); text-decoration: none; font-size: 11.5px; font-weight: 700; animation: rise 0.35s both; }
.mgame.on { box-shadow: 0 0 0 2px var(--gold), 0 3px 0 rgba(0,0,0,0.35); }
.mgame:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.mgame .gicon { height: 36px; transform: scale(0.85); }
.mnu .setts { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .mnu, .mtile, .mgame { animation: none; } }
.mtile:last-child:nth-child(odd) { justify-content: flex-start; gap: 12px; }

.topbar [hidden] { display: none !important; }
.reactbtn { font-size: 19px; }
.rtray-wrap { position: fixed; inset: 0; z-index: 41; }
.rtray-wrap.out .rtray { opacity: 0; transform: translateY(-6px) scale(0.97); transition: opacity 0.15s, transform 0.15s; }
.rtray { position: absolute; right: 10px; left: 10px; margin-left: auto; max-width: 380px; padding: 12px; border-radius: 20px; background: radial-gradient(130% 80% at 90% 0%, #1d7a50, var(--felt-2) 60%, var(--felt-3)); border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 18px 50px rgba(0,0,0,0.5); transform-origin: top right; animation: mnuin 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
.rt-phrases { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 99px; border: 1px solid rgba(255,255,255,0.16); background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)); box-shadow: 0 3px 0 rgba(0,0,0,0.35); color: var(--text); font: 700 14px var(--body); cursor: pointer; }
.rt-chip:active, .rt-emo:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.rt-emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.rt-emo { aspect-ratio: 1; border-radius: 14px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.07); box-shadow: 0 3px 0 rgba(0,0,0,0.35); font-size: 26px; cursor: pointer; display: grid; place-items: center; }
.rbub { position: fixed; z-index: 35; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 99px; background: #fbf4e6; color: #1d2b22; box-shadow: 0 10px 26px rgba(0,0,0,0.4); pointer-events: none; animation: rbubin 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4); white-space: nowrap; }
.rbub b { font-size: 26px; line-height: 1; }
.rbub span { font: 800 15px var(--body); }
.rbub small { font: 700 12px var(--body); color: #5b6b62; }
.rbub.up::after, .rbub.down::after { content: ''; position: absolute; left: 50%; width: 12px; height: 12px; background: #fbf4e6; transform: translateX(-50%) rotate(45deg); }
.rbub.up::after { bottom: -5px; }
.rbub.down::after { top: -5px; }
.rbub.out { opacity: 0; transform: translateY(-8px) scale(0.9); transition: opacity 0.3s, transform 0.3s; }
@keyframes rbubin { from { opacity: 0; transform: scale(0.4) translateY(10px); } }
.rpart { position: absolute; left: 22px; top: 8px; font-style: normal; font-size: 20px; opacity: 0; animation: rpart 1.3s ease-out forwards; }
@keyframes rpart { 0% { opacity: 0; transform: translate(0, 0) scale(0.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.15); } }
.bragbtn { margin: 6px 0 10px; background: linear-gradient(90deg, #f6b93b, #ffd36e); color: #3a2400; border-color: #e09b14; box-shadow: 0 4px 0 #c07f0c; font-weight: 800; animation: bragpulse 2.2s ease-in-out infinite; }
@keyframes bragpulse { 50% { box-shadow: 0 4px 0 #c07f0c, 0 0 22px rgba(246,185,59,0.55); } }
.bragov { z-index: 30; }
.bragimg { display: grid; place-items: center; min-height: 200px; margin: 4px 0 14px; border-radius: 16px; overflow: hidden; background: rgba(0,0,0,0.25); }
.bragimg img { display: block; width: 100%; height: auto; }
.bragov .actions a.btn { text-decoration: none; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .rbub, .rtray, .bragbtn { animation: none; } }

.rmline { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.rmline b { color: var(--gold); font-variant-numeric: tabular-nums; }
.rmchips { display: flex; }
.rmchip { position: relative; margin-left: -6px; opacity: 0.45; transition: opacity 0.2s; }
.rmchip:first-child { margin-left: 0; }
.rmchip.on { opacity: 1; }
.rmchip.away .avatar { filter: grayscale(1); }
.rmchip .avatar { width: 30px; height: 30px; font-size: 13px; box-shadow: 0 0 0 2px var(--felt-2); }
.rmchip i { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #2e9e4f; color: #fff; font: 900 10px/15px var(--body); text-align: center; font-style: normal; box-shadow: 0 0 0 2px var(--felt-2); }
.rmbtn.on { background: rgba(46,158,79,0.2); border-color: rgba(46,158,79,0.6); color: #c8f5da; }
.kobox { display: grid; gap: 4px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); font-size: 14px; text-align: left; }
.kobox b { font-size: 15px; }
.kobox span { color: var(--muted); }
.kobox .koout { color: #ffb3b3; }
.kobox small { color: var(--muted); }
.kobox.champ { background: linear-gradient(90deg, rgba(246,185,59,0.22), rgba(246,185,59,0.08)); border-color: rgba(246,185,59,0.7); text-align: center; }
.kobox.champ b { font-size: 17px; color: #fff3d6; }

.badgegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.bdg { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 16px; text-align: center; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.bdg .bi { font-size: 34px; line-height: 1.1; }
.bdg b { font-size: 14px; }
.bdg small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.bdg.on { background: linear-gradient(180deg, rgba(246,185,59,0.2), rgba(246,185,59,0.05)); border-color: rgba(246,185,59,0.55); box-shadow: 0 4px 0 rgba(0,0,0,0.3); }
.bdg.locked .bi { filter: grayscale(1); opacity: 0.35; }
.bdg.locked b { color: var(--muted); }
.sect small { font-family: var(--body); font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.badgepop { position: fixed; z-index: 46; top: max(12px, env(safe-area-inset-top)); left: 50%; translate: -50% 0; width: min(360px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 20px; background: linear-gradient(160deg, #fff6dc, #f6d98c); color: #3a2400; box-shadow: 0 18px 50px rgba(0,0,0,0.5), 0 0 0 3px rgba(246,185,59,0.6); animation: badgein 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.35); cursor: pointer; }
.badgepop.out { opacity: 0; transform: translateY(-12px); transition: opacity 0.4s, transform 0.4s; }
@keyframes badgein { from { opacity: 0; transform: translateY(-30px) scale(0.85); } }
.bp-head { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a5a00; margin-bottom: 8px; }
.bp-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bp-row .bi { font-size: 36px; line-height: 1; animation: badgespin 0.9s ease-out; }
@keyframes badgespin { from { transform: rotateY(180deg) scale(0.4); } }
.bp-row b { display: block; font-size: 17px; font-family: var(--display); }
.bp-row small { font-size: 13px; color: #6b4a10; }
.bp-more { display: inline-block; margin-top: 4px; font-weight: 800; font-size: 13px; color: #8a1d2c; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .badgepop, .bp-row .bi { animation: none; } }

.invlist .fname { pointer-events: none; }
.invcard { position: fixed; z-index: 47; left: 50%; translate: -50% 0; bottom: max(16px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 20px; background: radial-gradient(130% 90% at 0% 0%, #1d7a50, var(--felt-2) 70%); border: 2px solid var(--gold); box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 30px rgba(246,185,59,0.25); animation: invin 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.invcard.out { opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; }
@keyframes invin { from { opacity: 0; transform: translateY(60px) scale(0.9); } }
.ic-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,0.08); animation: icwiggle 1.2s ease-in-out 0.4s 2; }
@keyframes icwiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
.ic-txt { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.ic-txt b { font-size: 15px; line-height: 1.3; }
.ic-txt small { color: var(--muted); font-size: 12.5px; }
.ic-btns { display: flex; gap: 8px; flex: 1 0 100%; }
.ic-btns .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .invcard, .ic-ico { animation: none; } }

.bdgwrap { position: relative; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.3, 0.7, 0.2, 1); }
.bdgwrap.all { max-height: none !important; }
.bdgfade { display: none; }
.bdgwrap.folded { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), rgba(0,0,0,0.25) calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), rgba(0,0,0,0.25) calc(100% - 30px), transparent); }
.bdgmore { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 0; padding: 10px 18px; border-radius: 99px; border: 1px solid rgba(246,185,59,0.55); background: rgba(246,185,59,0.12); color: #fff3d6; font: 700 14px var(--body); cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.3); position: relative; z-index: 1; }
.bdgmore[hidden] { display: none; }
.bdgmore:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.bdgmore i { font-style: normal; display: inline-block; animation: bdgnudge 1.6s ease-in-out infinite; }
.bdgwrap.open + .bdgmore i { animation: none; }
@keyframes bdgnudge { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .bdgwrap { transition: none; } .bdgmore i { animation: none; } }

.g-8ball { --gbg: linear-gradient(165deg, #1f6f8b, #0e3445 75%); }
.pool {
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden; touch-action: none;
  max-width: 1100px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
}
.pool .topbar { padding: 4px 2px 0; }
.pool .topbar .meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
#pbar-top, #pbar-bottom { width: min(100%, 620px); margin: 4px auto; }
.pbar { padding: 5px 10px; }
.pbar .avatar { width: 28px; height: 28px; font-size: 13px; }
.pgrp { margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,0.1); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: capitalize; }
.pmini { display: flex; gap: 3px; align-items: center; min-height: 14px; }
.pmini i { width: 12px; height: 12px; border-radius: 50%; background: var(--bc); box-shadow: inset -2px -2px 3px rgba(0,0,0,0.35); }
.pmini i.st { background: linear-gradient(var(--bc), var(--bc)) center / 100% 46% no-repeat, #f8f4e8; }
.pmini i.gone { opacity: 0.18; }
.pmini i.eight { margin-left: 4px; opacity: 0.35; }
.pmini i.eight.live { opacity: 1; box-shadow: 0 0 0 2px var(--gold); }
.pnone { color: var(--muted); font-size: 12px; }
.pplay { flex: 1; min-height: 0; display: flex; align-items: stretch; justify-content: center; gap: 8px; }
.ptable { flex: 1; min-width: 0; min-height: 0; display: grid; place-items: center; max-width: 1000px; }
.ptable canvas { display: block; touch-action: none; border-radius: 14px; box-shadow: 0 14px 36px rgba(0,0,0,0.5); }
.pside { flex: 0 0 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; transition: opacity 0.2s; }
.pool:not(.mine) .pside { opacity: 0.3; pointer-events: none; }
.pspin { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; position: relative; cursor: pointer; background: radial-gradient(circle at 35% 30%, #fff, #e9e3d2 60%, #bdb59f); box-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 0 2px rgba(255,255,255,0.25); }
.pspin i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #d6322e; transform: translate(-50%, -50%); left: 50%; top: 50%; }
.prow { flex: 0 0 auto; flex-direction: row; gap: 10px; width: min(100%, 520px); margin: 6px auto 0; }
.pfine { flex: 1; height: 38px; border-radius: 19px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; touch-action: none; cursor: ew-resize; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 3px, rgba(255,255,255,0.14) 3px 5px), rgba(0,0,0,0.25); border: 1px solid var(--line); }
.ppower { width: 38px; height: min(62vh, 300px); display: flex; flex-direction: column; align-items: center; gap: 6px; touch-action: none; cursor: grab; }
.pp-cap { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.pp-track { position: relative; flex: 1; width: 22px; border-radius: 11px; overflow: hidden; background: rgba(0,0,0,0.35); border: 1px solid var(--line); box-shadow: inset 0 2px 6px rgba(0,0,0,0.5); }
.pp-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: linear-gradient(#3ddc84, #f6b93b 60%, #e0393e); }
.pp-num { min-height: 16px; font-size: 13px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.pool .cstatus { height: 40px; margin-top: 2px; overflow: hidden; }
#pbar-top .cbar, #pbar-bottom .cbar { min-height: 48px; }
.ptable { overflow: hidden; }
.pool .cstatus b.mine { color: var(--gold); }
.spinsheet .spinball { position: relative; width: 200px; height: 200px; margin: 6px auto 16px; border-radius: 50%; touch-action: none; cursor: crosshair; background: radial-gradient(circle at 35% 30%, #fff, #ece6d6 55%, #b8b09a); box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.spinsheet .spinball::before, .spinsheet .spinball::after { content: ''; position: absolute; background: rgba(0,0,0,0.12); }
.spinsheet .spinball::before { left: 50%; top: 8%; bottom: 8%; width: 1px; }
.spinsheet .spinball::after { top: 50%; left: 8%; right: 8%; height: 1px; }
.spindot { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #d6322e; transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.spinball .sl { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #6b6550; text-transform: uppercase; letter-spacing: 0.06em; }
.spinball .sl.t { top: 10px; } .spinball .sl.b { bottom: 10px; }
.gi-8ball { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #555, #111 60%, #000); box-shadow: inset -3px -3px 6px rgba(0,0,0,0.6); }
.gi-8ball b { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #fbf8ee; color: #111; font: 900 11px var(--body); }
.art-8ball { width: 200px; height: 120px; position: relative; }
.art-8ball .pfelt { position: absolute; inset: 8px 10px; border-radius: 16px; transform: rotate(-5deg); background: radial-gradient(circle, #1f8a55, #126b3f); box-shadow: 0 0 0 7px #7a4420, 0 12px 24px rgba(0,0,0,0.4); }
.art-8ball .pb { position: absolute; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bc); box-shadow: inset -4px -5px 7px rgba(0,0,0,0.35), 0 3px 4px rgba(0,0,0,0.3); }
.art-8ball .pb.st { background: linear-gradient(var(--bc), var(--bc)) center / 100% 48% no-repeat, #f8f4e8; }
.art-8ball .pb b { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #fbf8ee; color: #111; font: 900 9px var(--body); }
.art-8ball .b1 { left: 98px; top: 18px; } .art-8ball .b2 { left: 128px; top: 34px; } .art-8ball .b3 { left: 112px; top: 52px; } .art-8ball .b8 { left: 142px; top: 64px; } .art-8ball .b4 { left: 96px; top: 76px; }
.art-8ball .pcball { position: absolute; left: 34px; top: 44px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e6dfcc); box-shadow: 0 3px 4px rgba(0,0,0,0.3); }
.art-8ball .pcue { position: absolute; left: -46px; top: 52px; width: 76px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #1a0f08 0 30%, #b9773b 31%, #d9a463 92%, #f3ead6 93%, #4da3e8); transform: rotate(4deg); }
.collage.small .cl-8ball, .hero > .collage .cl-8ball { display: none; }

.cgrid { display: grid; gap: 16px; margin-top: 8px; }
.cintro h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 8vw, 48px); letter-spacing: -0.02em; margin: 6px 0 10px; }
.cintro .lead { margin: 0 0 14px; color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 44ch; }
.cnotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cnotes li { display: flex; gap: 10px; align-items: flex-start; color: rgba(242,247,243,0.88); line-height: 1.45; }
.cnotes li span { flex: none; }
.contactpage .authbox { margin-top: 0; }

@media (min-width: 900px) {
  .gpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .gpage > * { grid-column: 2; min-width: 0; }
  .gpage > .sitebar { grid-column: 1 / -1; }
  .gpage > .ghero { grid-column: 1; grid-row: 2 / span 6; position: sticky; top: 16px; margin-top: 0; padding: 40px 28px 36px; }
  .gpage > .ghero .ghero-art { height: 220px; transform: scale(1.6); margin-bottom: 18px; }
  .gpage > .createbox { margin-top: 0; }
  .invite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: center; }
  .invite > * { grid-column: 2; }
  .invite > .sitebar { grid-column: 1 / -1; }
  .invite > .collage { grid-column: 1; grid-row: 2 / span 2; justify-self: center; transform: scale(1.25); }
  .invite .foot { text-align: left; }
  .cgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 48px; align-items: start; margin-top: 24px; }
}
.linkbtn.dangerlink { color: #ff8a7a; }
