:root {
  --felt-1: #153228;
  --felt-2: #071510;
  --ink: #f0fdf4;
  --muted: #86efac;
  --gold: #fbbf24;
  --gold-ink: #1e1100;
  --first: #34d399;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-line: rgba(255, 255, 255, 0.09);
  --danger: #f87171;
  --good: #34d399;
  --radius: 16px;
  --serif: 'Inter', system-ui, -apple-system, sans-serif;
  --sans: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--felt-2); }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(16, 185, 129, .22), transparent 60%),
    radial-gradient(900px 600px at 95% 15%, rgba(59, 130, 246, .18), transparent 60%),
    linear-gradient(180deg, #0d231b, var(--felt-2) 85%) fixed;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 800; letter-spacing: -.02em; }
[hidden] { display: none !important; }

/* ---------- shared controls */
.btn {
  border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700;
  background: linear-gradient(135deg, #ffd978, #ffb13d); color: var(--gold-ink); min-height: 44px;
  box-shadow: 0 6px 18px rgba(255, 177, 61, .28);
  transition: transform .08s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(255, 177, 61, .4); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
.btn.ghost { box-shadow: none; background: rgba(255, 255, 255, .05); color: var(--ink); border: 1px solid var(--panel-line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
input[type=text], input[type=email], input[type=password] {
  font: inherit; color: var(--ink); background: rgba(8,9,30,.5); border: 1px solid var(--panel-line);
  border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 201, 77, .2); }
input[type=text]:focus-visible, input[type=email]:focus-visible, input[type=password]:focus-visible, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.public-tables-panel { margin: 16px 0 12px; }
.social-panel { display: grid; gap: 10px; }
.social-panel h3 { margin-top: 8px; font-size: 16px; }
.fs-chip { cursor: pointer; user-select: none; white-space: nowrap; }
.friend-name { cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; transition: color .15s; }
.friend-name:hover { color: var(--ink); }
.social-search label { flex-basis: 100%; text-align: left; font-size: 14px; color: var(--muted); }
#tableInviteForm { margin-top: 12px; }
.social-search { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.social-search input, .social-search select { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--ink); background: rgba(8,9,30,.5); border: 1px solid var(--panel-line); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
.social-list { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.social-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px; border: 1px solid var(--panel-line); border-radius: 12px; background: rgba(255,255,255,.035); }
.social-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.social-info small { color: var(--muted); overflow-wrap: anywhere; }
.social-avatar { font-size: 22px; }
.social-error { color: #fecaca; }
.social-notice { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* a row with one button keeps it beside the name; only rows with two or more buttons (Accept / Decline) wrap on phones */
.social-row .btn { flex: 0 0 auto; }
@media (max-width: 560px) { .social-row:has(.btn ~ .btn) { flex-wrap: wrap; } .social-row:has(.btn ~ .btn) .social-info { flex-basis: calc(100% - 42px); } .social-row:has(.btn ~ .btn) .btn { flex: 1; } .social-search .btn { flex: 0 0 auto; } }
.session-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 11px; letter-spacing: 0; }
.public-tables { display: grid; gap: 8px; margin-top: 10px; }
.public-table { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--panel-line); border-radius: 13px; background: rgba(255,255,255,.035); }
.public-game-icon { font-size: 25px; width: 34px; text-align: center; }
.public-table-info { display: grid; gap: 3px; flex: 1; min-width: 0; }
.public-table-info b { font-size: 15px; }
.public-table-info span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-tables { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.recent-table { display: flex; align-items: center; gap: 8px; border: 1px solid var(--panel-line); border-radius: 12px; background: rgba(255,255,255,.04); color: var(--ink); padding: 9px 12px; text-align: left; }
.recent-table:hover { background: rgba(255,255,255,.1); }
.recent-table span { color: var(--gold); font-size: 18px; }
.recent-table code { color: var(--muted); font-size: 11px; margin-left: 4px; }
.recent-table small { display: block; color: var(--muted); font-size: 11px; }
.create-sheet { width: min(500px, calc(100vw - 28px)); }
.visibility-options { display: grid; gap: 10px; margin-top: 14px; }
.visibility-option { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--panel-line); border-radius: 13px; background: rgba(255,255,255,.035); cursor: pointer; text-align: left; }
.visibility-option:has(input:checked) { border-color: var(--gold); background: rgba(255,201,77,.1); }
.visibility-option input { margin-top: 3px; accent-color: var(--gold); }
.visibility-option span { display: grid; gap: 4px; }
.visibility-option small { color: var(--muted); line-height: 1.4; }
.visibility-control { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--panel-line); }
.visibility-control small { flex-basis: 100%; color: var(--muted); line-height: 1.35; }
.visibility-status { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid var(--panel-line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.visibility-status.private { color: var(--muted); }
.visibility-status.public { color: var(--good); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); }
.spectator-list { margin: 8px 0; border: 1px solid var(--panel-line); border-radius: 12px; background: rgba(255,255,255,.03); }
.spectator-list summary { padding: 10px 14px; cursor: pointer; color: var(--ink); font-weight: 700; }
.spectator-list summary:hover { color: var(--gold); }
.spectator-names { padding: 0 14px 10px; color: var(--muted); font-size: 13px; }
.activity-sheet { width: min(560px, calc(100vw - 28px)); max-height: min(75vh, 680px); overflow: auto; }
.activity-list { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; }
.activity-list li { display: flex; gap: 8px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--panel-line); font-size: 14px; }
.activity-list li b { color: var(--gold); white-space: nowrap; }
.activity-list li span { color: var(--ink); }
.game-log-inline { width: min(900px, calc(100% - 24px)); margin: 12px auto 0; border: 1px solid var(--panel-line); border-radius: 14px; background: rgba(0,0,0,.14); text-align: left; overflow: hidden; }
.game-log-inline summary { padding: 11px 14px; cursor: pointer; color: var(--ink); font-weight: 700; }
.game-log-inline summary span { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.game-log-inline ol { list-style: none; padding: 0 14px 10px; margin: 0; max-height: 210px; overflow: auto; }
.game-log-inline li { display: flex; gap: 8px; padding: 6px 0; font-size: 13px; border-top: 1px solid rgba(255,255,255,.05); }
.game-log-inline li b { color: var(--gold); font-weight: 700; }
.game-log-inline li span { color: var(--ink); }
@media (max-width: 600px) { .upcoming-games { grid-template-columns: 1fr; } .upcoming-game { grid-template-columns: auto 1fr; align-items: center; } .upcoming-game > span { grid-row: span 2; } .upcoming-game small, .upcoming-game em { grid-column: 2; } }
.panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  border: 1px solid var(--panel-line); border-radius: 20px; padding: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

#banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 6px; text-align: center; background: var(--danger); color: #2a0600; font-weight: 700; font-size: 14px; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 90px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: rgba(10,10,10,.88); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: 90vw; animation: toast 3s forwards; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
@keyframes toast { 0%{opacity:0;transform:translateY(8px)} 8%,85%{opacity:1;transform:none} 100%{opacity:0} }

/* ---------- home + lobby */
.page { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.brand { text-align: center; padding: 12px 0 4px; position: relative; }
.brand .mark { font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(124, 92, 255, .5)); }
.brand h1 { font-size: 46px; background: linear-gradient(90deg, #fff, #c9b8ff 60%, #7ff0da); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.01em; margin-top: 6px; }
.brand p { color: var(--muted); margin: 8px auto 0; max-width: 38ch; line-height: 1.45; }

.panel-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 8px;
}
.join-form input {
  text-transform: uppercase;
  letter-spacing: .3em;
  text-align: center;
  font-weight: 700;
  font-size: 22px;
}

/* Profile Personas */
.profile { display: grid; gap: 8px; }
.profile-header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-line);
  margin-bottom: 4px;
}
.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar.big {
  width: 52px;
  height: 52px;
  font-size: 28px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(255, 255, 255, .3);
}
.profile-meta { display: grid; gap: 2px; }
.profile-welcome { font-size: 14px; color: var(--ink); }
.profile-welcome b { color: var(--gold); }
.profile-hint { font-size: 12px; color: var(--muted); }
.av-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.av-pick {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent;
  background: rgba(0, 0, 0, .25); font-size: 22px; line-height: 1;
  display: grid; place-items: center; padding: 0;
  transition: transform .1s, border-color .15s;
}
.av-pick:hover { background: var(--panel); transform: scale(1.08); }
.av-pick.on {
  border-color: var(--gold);
  background: rgba(255, 201, 77, .2);
  box-shadow: 0 0 0 2px rgba(255, 201, 77, .25);
  transform: scale(1.06);
}
.section { margin-top: 0; }
.section-sub { font-size: 13px; color: var(--muted); }

/* Game Grid Tiles */
@media (min-width: 700px) { .game-grid { grid-template-columns: 1fr 1fr; } }
.game-art {
  display: grid; place-items: center; font-size: 52px;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #000));
  text-shadow: 0 4px 12px rgba(0, 0, 0, .55);
}
.game-body { padding: 18px; display: grid; gap: 10px; align-content: start; }
.game-body p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 14px; }
.game-actions { margin-top: 4px; }
@media (max-width: 440px) {
  .game-tile { grid-template-columns: 80px 1fr; }
  .game-art { font-size: 38px; }
  .game-body { padding: 14px; }
}

.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.code-card { text-align: center; }
.code { font-family: var(--serif); font-size: clamp(34px, 15vw, 56px); letter-spacing: .18em; padding-left: .18em; color: var(--gold); line-height: 1.1; margin: 4px 0 12px; }
.seats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; }
.seat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(0,0,0,.2); border-radius: 10px; }
.seat .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.seat .dot.off { background: #777; }
.seat-actions { display: inline-flex; gap: 6px; flex: none; }
.seat-actions .btn { padding: 6px 10px; min-width: 38px; }
.spectator-people { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.spectator-people li { display: flex; align-items: center; gap: 8px; }
.spectator-people .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--panel-line); }
.tag.host { background: var(--gold); color: var(--gold-ink); }
.opt { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; }
.opt input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--gold); flex: none; }

/* ---------- overlays */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: linear-gradient(160deg, #1d1c55, #11123a); border: 1px solid var(--panel-line); border-radius: 22px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.sheet h2 { font-size: 26px; margin-bottom: 12px; }

/* the sign-in dialog: small, plain, and built from the same pieces as every other panel */
.auth-sheet { max-width: 400px; padding: 20px; }
.auth-sheet h2 { font-size: 22px; margin-bottom: 0; }
.auth-tabs { margin: 14px 0 4px; }
.auth-tabs .btn { flex: 1; }
.auth-form { display: grid; gap: 10px; margin-top: 8px; }
.auth-links { margin-top: 10px; justify-content: space-between; }
.auth-links .btn { font-size: 12.5px; }
.auth-policy-hint { margin: -1px 0 2px; padding: 8px 10px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, .2); color: var(--muted); font-size: 12px; line-height: 1.4; }
.auth-policy-hint.optional { border-color: rgba(127, 240, 218, .45); color: #aef7ea; background: rgba(127, 240, 218, .08); }
.auth-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 201, 77, .1); border: 1px solid rgba(255, 201, 77, .35); color: var(--gold); font-size: 13.5px; line-height: 1.45; }
table.score { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
table.score th, table.score td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--panel-line); white-space: nowrap; }
table.score th:first-child, table.score td:first-child { text-align: left; }
table.score th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.score td small { display: block; color: var(--muted); font-size: 11px; }
.pos { color: var(--good); } .neg { color: var(--danger); }
.score-wrap { overflow-x: auto; }
.me-col { background: rgba(255,201,77,.1); }
.podium { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.podium li { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.2); font-weight: 700; }
.podium li:first-child { background: var(--gold); color: var(--gold-ink); font-size: 18px; }
.podium .pts { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- v2: home + lobby polish */
.page.wide { max-width: 980px; }
@media (min-width: 700px) { .home-grid { grid-template-columns: 1fr 1fr; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; flex: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.avatar.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--panel-line); border: 0; }
.seat.empty { background: transparent; border: 1px dashed var(--panel-line); color: var(--muted); }
.seat .nm em { font-style: normal; color: var(--muted); font-weight: 400; }
.tag.team.t0 { background: #2b6cb0; color: #fff; }
.tag.team.t1 { background: #b0452b; color: #fff; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper .btn { min-width: 38px; }
.opts { display: grid; gap: 10px; }
.opt-card { padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); display: grid; gap: 6px; }
.opt-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.opt-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
select {
  font: inherit; font-weight: 600; color: var(--ink); width: 100%; min-height: 44px; padding: 10px 40px 10px 12px; border-radius: 10px;
  border: 1px solid var(--panel-line); background: rgba(0, 0, 0, .3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23ffc94d' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none; appearance: none;
}
select option { background: #171947; color: #fff; }
select:disabled { opacity: .75; }
select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.big { width: 100%; font-size: 18px; min-height: 52px; }
.btn.big small { font-weight: 500; opacity: .75; }
.btn.wa { background: #25d366; color: #05301a; }
.rule { line-height: 1.5; margin: 0 0 10px; color: #e6e3d6; }
.variants dt { font-weight: 700; margin-top: 8px; }
.variants dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.code-inline { font-family: var(--serif); letter-spacing: .12em; color: var(--gold); }
.sound-btn { min-width: 38px; }
.wn-close { background: transparent; border: 0; color: var(--muted); font-size: 16px; padding: 4px; cursor: pointer; border-radius: 6px; }
.wn-close:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }
.tool-ico { font-size: 30px; }

/* ---- v0.3.2: rejoin banner/badge, sticky start bar */
.rejoin-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 201, 77, .22), rgba(255, 138, 76, .16)); border: 1px solid rgba(255, 201, 77, .6); box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 0 rgba(255, 201, 77, .5); animation: rjglow 2.2s ease-in-out infinite; }
.rj-ico { font-size: 30px; flex: none; }
.rj-text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13px; line-height: 1.35; }
.rj-text b { font-size: 15px; color: var(--gold); }
.rj-text span { color: var(--ink); opacity: .9; }
.rj-text code { background: rgba(0, 0, 0, .3); padding: 0 5px; border-radius: 5px; letter-spacing: .08em; }
.rejoin-banner .btn { flex: none; }
@keyframes rjglow { 50% { box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 6px rgba(255, 201, 77, 0); } }
.recent-table.mine { border-color: var(--gold); background: rgba(255, 201, 77, .12); }
.rj-badge { font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #3b2c00; }
.start-bar { position: sticky; bottom: 0; z-index: 5; margin: 4px -16px 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 12px); background: linear-gradient(to top, #0b0d1f 60%, rgba(11, 13, 31, 0)); }
.start-bar.wait { background: linear-gradient(to top, #0b0d1f 70%, rgba(11, 13, 31, 0)); }
@media (max-width: 520px) { .rejoin-banner { flex-wrap: wrap; } .rejoin-banner .btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .rejoin-banner { animation: none; } }

/* player stats */
.stats-open { margin-top: 12px; width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--panel-line); min-width: 0; }
.stat-tile.wide { grid-column: span 2; }
.stat-tile.good .stat-v { color: var(--gold); }
.stat-v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-l { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat-h { margin: 16px 0 8px; font-size: 14px; letter-spacing: .04em; }
.stat-h small { color: var(--muted); font-weight: 400; }
.stat-games { display: grid; gap: 8px; }
.stat-game { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.stat-game-rec { color: var(--muted); font-size: 12px; text-align: right; }
.stat-bar { grid-column: 1 / 2; height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.stat-game-pct { font-weight: 700; font-size: 13px; text-align: right; }
.stat-game-best { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.stat-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 10px; font-size: 14px; background: rgba(255,255,255,.06); }
.stat-chip b { font-size: 12px; }
.stat-chip.w { box-shadow: inset 0 0 0 1px rgba(120,220,150,.6); } .stat-chip.w b { color: #7fe3a0; }
.stat-chip.l { box-shadow: inset 0 0 0 1px rgba(240,120,120,.45); } .stat-chip.l b { color: #f2908f; }

.stat-kind { font-weight: 600; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-left: 4px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--panel-line); }

/* ---------- top bar + account menu */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) max(16px, calc((100% - 980px) / 2)) 8px; background: rgba(7, 21, 16, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--panel-line); }
.tb-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.tb-mark { font-size: 26px; line-height: 1; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.menu-wrap { position: relative; }
.tb-avatar-btn { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(255, 255, 255, .05); color: var(--ink); cursor: pointer; }
.tb-avatar-btn:hover, .tb-avatar-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
.tb-av { width: 36px; height: 36px; }
.tb-caret { font-size: 12px; color: var(--muted); }
.tb-dot { position: absolute; top: 4px; left: 32px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #0b1f17; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; width: min(280px, calc(100vw - 24px)); padding: 6px; border-radius: 16px; border: 1px solid var(--panel-line); background: #11261e; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 10px; }
.menu-who { display: grid; min-width: 0; }
.menu-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who small { color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .09); }
.menu-item.dim { color: var(--muted); }
.mi-ico { width: 22px; text-align: center; }
.mi-label { flex: 1; }
.mi-new { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--panel-line); }

/* ---------- dialogs opened from the menu */
.modal-sheet { max-width: 460px; }
.modal-head { justify-content: space-between; align-items: center; }
.modal-head h2 { margin-bottom: 0; font-size: 22px; }
.modal-body { display: grid; gap: 10px; margin-top: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--panel-line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; }
.verify-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--panel-line); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.verify-pill.required { background: rgba(255, 201, 77, .12); border-color: rgba(255, 201, 77, .5); color: var(--gold); }
.verify-pill.optional { background: rgba(127, 240, 218, .12); border-color: rgba(127, 240, 218, .5); color: #7ff0da; }
.verify-pill.verified { background: rgba(120, 220, 150, .14); border-color: rgba(120, 220, 150, .5); color: #7fe3a0; }
.verify-status { align-items: flex-start; }
.verify-status .btn[disabled], .verify-status .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.verify-status small { max-width: 34ch; }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.wn-list li { display: flex; gap: 12px; align-items: flex-start; }
.wn-list .wn-ico { font-size: 22px; line-height: 1.2; }
.wn-list p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
html { scroll-behavior: auto; }
.topbar + .page { padding-top: 16px; }

/* ---------- home */
.home { gap: 26px; }
.home-hero { display: grid; align-items: end; padding-top: 6px; }
@media (min-width: 760px) { .home-hero { grid-template-columns: 1fr minmax(280px, 360px); gap: 32px; } }
.home-intro { display: grid; gap: 8px; justify-items: start; }
.home-intro h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.1; background: linear-gradient(90deg, #fff, #c9b8ff 60%, #7ff0da); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.45; }
.join-form { display: grid; gap: 6px; }
.join-row { display: flex; gap: 8px; }
.join-row .btn { min-width: 84px; }
.home-section { display: grid; gap: 12px; }
.section { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.game-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .game-grid { grid-template-columns: 1fr 1fr; } }
.game-card { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--panel-line); border-radius: 18px; background: var(--panel); border-left: 4px solid var(--accent, #7b4bd0); transition: border-color .15s, background .15s; }
.game-card:hover { background: rgba(255, 255, 255, .07); }
.game-card .game-art { font-size: 34px; line-height: 1; width: 48px; flex: none; text-align: center; padding-top: 2px; }
.game-card .game-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.game-card h3 { font-size: 19px; }
.game-card h3 small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 6px; letter-spacing: 0; }
.game-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.game-card .game-actions { gap: 8px; margin-top: 4px; }
.notice-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 201, 77, .35); background: rgba(255, 201, 77, .1); color: var(--gold); font-size: 14px; }
.home-foot { text-align: center; color: var(--muted); font-size: 13px; padding-top: 6px; }
.home-foot a { color: var(--muted); }
.home-foot a:hover { color: var(--ink); }

/* ---------- states shared by every screen */
.empty { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; text-align: center; border: 1px dashed var(--panel-line); border-radius: 16px; color: var(--muted); }
.empty-ico { font-size: 28px; }
.empty b { color: var(--ink); }
.empty p { margin: 0; font-size: 14px; max-width: 40ch; line-height: 1.45; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--panel-line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.error-block { display: grid; justify-items: center; gap: 8px; padding: 22px 16px; border-radius: 16px; border: 1px solid rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); color: #fecaca; text-align: center; }
.error-block p { margin: 0; }
.btn.danger { background: linear-gradient(135deg, #fca5a5, #ef4444); color: #2a0600; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.plain-list b { color: var(--ink); }

/* ---------- profile page */
.profile-page { max-width: 760px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; justify-self: start; }
.back-link:hover { color: var(--ink); }
.pp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pp-id { flex: 1; min-width: 160px; }
.pp-id h1 { font-size: 26px; overflow-wrap: anywhere; }
.pp-id p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--panel-line); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.tab small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.tab-panel { display: grid; gap: 12px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--panel-line); border-radius: 14px; background: var(--panel); }
.hist-ico { font-size: 24px; width: 32px; text-align: center; }
.hist-main { flex: 1; display: grid; min-width: 0; }
.hist-main small { color: var(--muted); }
.result { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--panel-line); color: var(--muted); }
.result.won { color: var(--good); border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .1); }
.result.lost { color: #fecaca; border-color: rgba(248, 113, 113, .4); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; }
.account-list { display: grid; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 14px; border: 1px solid rgba(248, 113, 113, .4); border-radius: 14px; }
.danger-zone small { display: block; color: var(--muted); margin-top: 3px; }
@media (max-width: 480px) { .danger-zone, .setting-row { flex-wrap: wrap; } .pp-head .btn { width: 100%; } }
.game-card .game-art { background: none; align-self: flex-start; border-radius: 0; }

/* connection quality (ping) */
.ping { font-variant-numeric: tabular-nums; font-weight: 600; padding: 1px 7px; border-radius: 999px; font-size: .92em; white-space: nowrap; background: rgba(255,255,255,.08); }
.ping::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: currentColor; }
.ping.q-great { color: #5fe0a0; } .ping.q-good { color: #a6e05f; } .ping.q-fair { color: #f2c14e; } .ping.q-poor { color: #ff7a6b; } .ping.none { color: var(--muted); }
.pp-conn { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* tap a player at the table */
.pseat[data-act="playerCard"] { cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
.pseat[data-act="playerCard"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (hover: hover) { .pseat[data-act="playerCard"]:hover .plate { border-color: rgba(255, 255, 255, .55); } }
.pcard-head { display: flex; align-items: center; gap: 14px; }
.pcard-head h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.pcard-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.pcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.pcard-stats > div { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--panel); }
.pcard-stats b { display: block; font-size: 20px; }
.pcard-stats span { font-size: 12px; color: var(--muted); }
.pcard-actions { display: grid; gap: 8px; margin-top: 12px; }
.pcard-actions .btn { width: 100%; justify-content: center; }
.pcard-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; text-align: left; }
.pcard-actions a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }

/* Stage 8: simpler home */
.friends-strip { background: var(--card, rgba(255,255,255,.04)); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 14px; padding: 12px 14px; }
.fs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fs-head .section { margin: 0; }
.fs-head .hint { margin: 2px 0 0; }
.fs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fs-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 13px; }
.friends-strip .social-list { margin-top: 8px; }
.soon-card b { display: block; }
.soon-card small { color: var(--muted); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--ink); }
.tb-bell { position: relative; min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 18px; cursor: pointer; }
.tb-bell:hover, .tb-bell[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #1a1405; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.bell-panel { position: fixed; top: 62px; right: 12px; left: auto; width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 80px); overflow-y: auto; padding: 12px; }
.bell-title { margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bell-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.bell-row { display: grid; gap: 6px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.bell-row .social-info { min-width: 0; overflow-wrap: anywhere; }
.bell-btns { display: flex; gap: 6px; }
.bell-btns .btn { flex: 1; }
.bell-empty { margin: 4px 0 10px; }
.bell-manage { width: 100%; }


/* Home and roadmap polish */
.home-hero { gap: 22px; padding: 10px 0 4px; }
.home-intro { align-content: center; }
.home-intro h1 { max-width: 16ch; letter-spacing: -.025em; }
.home-intro p { max-width: 52ch; }
.join-form { align-self: stretch; align-content: center; padding: 14px; border: 1px solid var(--panel-line); border-radius: 16px; background: var(--panel); }
.join-form .hint { line-height: 1.4; }
.game-card { min-width: 0; }
.game-card .game-actions { flex-wrap: wrap; }
.game-card .game-actions .btn { min-height: 38px; }
.coming-roadmap { padding-top: 4px; }
.soon-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.soon-heading .section { margin-bottom: 2px; }
.soon-intro { color: var(--muted); max-width: 68ch; margin: 3px 0 0; line-height: 1.5; }
.soon-count { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--panel-line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.soon-group-title { margin: 14px 0 0; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.soon-more-title { margin-top: 20px; }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 9px; margin-top: 8px; }
.soon-card { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 72px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--panel-line); background: var(--panel); opacity: 1; }
.soon-number { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); color: var(--muted); font-size: 11px; font-weight: 700; }
.soon-ico { flex: 0 0 28px; text-align: center; font-size: 23px; line-height: 1.25; }
.soon-copy { min-width: 0; flex: 1; }
.soon-copy b { display: block; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.soon-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.soon-tag { flex: 0 0 auto; margin-left: 2px; padding: 2px 7px; border: 1px solid var(--panel-line); border-radius: 999px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.soon-footnote { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
@media (max-width: 560px) {
  .home-hero { gap: 14px; }
  .join-form { padding: 12px; }
  .soon-heading { align-items: flex-start; }
  .soon-count { margin-top: 3px; }
  .soon-grid { grid-template-columns: minmax(0, 1fr); }
  .soon-card { min-height: 66px; padding: 9px 10px; gap: 8px; }
  .soon-tag { font-size: 8px; padding: 2px 5px; }
}

/* Friend names are buttons (keyboard and screen-reader reachable) that read as text. */
button.friend-name { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 700; text-align: left; }
button.fs-chip { border: 0; color: var(--ink); font: inherit; font-size: 13px; min-height: 34px; }
button.fs-chip:hover { background: rgba(255,255,255,.14); }
button.friend-name:focus-visible, button.fs-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
/* Lobby: fewer, quieter blocks. Profile and options fold into one-line summaries. */
.fold { padding: 0; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .avatar { flex: 0 0 auto; width: 32px; height: 32px; font-size: 18px; }
.fold-title { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-title small { color: var(--muted); font-weight: 400; }
.fold-hint { margin-left: auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.fold > summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.fold[open] > summary::after { transform: rotate(180deg); }
.fold > :not(summary) { margin: 0 14px 14px; }
.code-card .code { font-size: clamp(30px, 12vw, 44px); margin: 2px 0 8px; }

/* Home: quieter. The roadmap is a closed fold; game cards are compact on phones. */
.soon-fold > summary { list-style: none; cursor: pointer; min-height: 52px; padding: 10px 14px; border: 1px solid var(--panel-line); border-radius: 14px; background: var(--panel); align-items: center; }
.soon-fold > summary::-webkit-details-marker { display: none; }
.soon-fold > summary .section { display: block; margin: 0; }
.soon-fold > summary .soon-intro { display: block; margin: 2px 0 0; font-size: 13px; }
.soon-fold[open] > summary { margin-bottom: 4px; }
.soon-fold > summary::after { content: '▾'; color: var(--muted); margin-left: 4px; transition: transform .2s; }
.soon-fold[open] > summary::after { transform: rotate(180deg); }
@media (max-width: 560px) {
  .game-card { gap: 10px; padding: 12px; }
  .game-card .game-art { font-size: 28px; width: 36px; }
  .game-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .game-card h3 { font-size: 17px; }
  .game-card .game-actions .btn { min-height: 40px; }
  .game-grid { gap: 10px; }
}

.soon-card.in-dev .soon-tag { color: var(--gold, #f2c14e); border-color: currentColor; }
/* The whole friends header is tappable, not just Manage. */
.fs-title { display: block; flex: 1 1 auto; min-width: 0; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fs-title h2 { margin: 0; }
.fs-title .hint { display: block; margin: 2px 0 0; }
.fs-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* End of a game: the finished table stays visible, a winner pop-up follows, then the result with Leave / Play again / vote */
.endhold .overlay, .endhold .ludo-end, .endhold .end-bar { display: none !important; }
.end-pop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8, 10, 20, .55); animation: endFade .35s ease both; }
.end-pop-card { display: grid; justify-items: center; gap: 8px; padding: 26px 34px; border-radius: 22px; background: linear-gradient(160deg, #3b2a73, #1d1740); color: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 2px rgba(255, 215, 110, .55); animation: endPop .55s cubic-bezier(.2, 1.3, .4, 1) both; text-align: center; max-width: min(88vw, 420px); }
.end-pop-card b { font-size: clamp(1.4rem, 6vw, 2rem); overflow-wrap: anywhere; }
.end-pop-ico { font-size: 3rem; animation: endBounce 1.2s ease-in-out infinite; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.end-votes { display: block; text-align: center; margin-top: 8px; }
.end-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(20, 16, 44, .94); border-top: 1px solid rgba(255, 255, 255, .15); }
@keyframes endFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes endPop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes endBounce { 50% { transform: translateY(-6px) } }
@media (prefers-reduced-motion: reduce) { .end-pop, .end-pop-card, .end-pop-ico { animation: none; } }

/* Blocks every other tap while a slow step (joining, creating, starting) is in flight */
.busy-block { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(8, 10, 20, .6); cursor: progress; }
.busy-card { display: grid; justify-items: center; gap: 14px; padding: 24px 30px; border-radius: 18px; background: #1d1740; color: #fff; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.busy-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #ffd76e; animation: busySpin .8s linear infinite; }
@keyframes busySpin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .busy-spin { animation-duration: 2s; } }
