/* ========================================================================
   FIVE & THREE — The Card Game
   Refined clubhouse identity: deep pine felt, championship gold, cream linen
   cards, glass panels. Serif display for brand character.
   ======================================================================== */
:root {
  --bg: #0c110e;
  --bg-2: #101713;
  --felt-hi: #2a7a4d;
  --felt: #1d5c3a;
  --felt-lo: #113523;
  --gold: #e6b33d;
  --gold-hi: #f6d581;
  --gold-lo: #9a6f14;
  --cream: #faf5e6;
  --cream-lo: #ece2c8;
  --ink: #221d14;
  --red: #b3382c;
  --sky: #7fb2d9;
  --panel: rgba(22, 30, 25, .88);
  --panel-line: rgba(230, 179, 61, .14);
  --line: rgba(255, 255, 255, .08);
  --text: #efe9da;
  --muted: #aab6ad;
  --shadow: 0 10px 34px rgba(0, 0, 0, .5);
  --serif: "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --card-w: 88px;
  --card-h: 126px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1100px 480px at 78% -12%, rgba(230, 179, 61, .10), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(29, 92, 58, .25), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
  overflow: hidden;
}
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; overflow: auto; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold-hi); outline-offset: 3px;
}
input, textarea {
  font: inherit; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.35); color: var(--text);
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; }
h2 { margin: 20px 0 12px; font-size: 1.05rem; color: var(--gold-hi); letter-spacing: .04em; }

.btn {
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: var(--text);
  padding: 10px 18px; border-radius: 12px; font-weight: 600;
  transition: transform .12s ease, box-shadow .18s ease, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.4); border-color: rgba(230,179,61,.5); }
.btn:active { transform: translateY(0); }
.btn.gold {
  background: linear-gradient(165deg, var(--gold-hi), var(--gold) 55%, #cf9a26);
  color: #35270a; border-color: var(--gold-lo);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn.gold:hover { box-shadow: 0 6px 22px rgba(230,179,61,.35); }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px 12px; border-radius: 10px; }
.btn.slim { padding: 7px 14px; border-radius: 10px; font-size: .88rem; }
.btn.xl { font-size: 1.2rem; padding: 18px 30px; border-radius: 16px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.error { color: #ff9a8a; min-height: 1.2em; margin-top: 8px; font-size: .9rem; }
.muted { color: var(--muted); font-size: .9rem; }
.fine { color: #6d7a70; font-size: .78rem; margin-top: 18px; }
.row { display: flex; gap: 10px; justify-content: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

.logo {
  font-family: var(--serif); font-weight: 700; color: var(--gold);
  letter-spacing: .16em; text-indent: .16em; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(122, 86, 12, .9), 0 12px 34px rgba(0,0,0,.55);
}
.logo .amp { color: var(--cream); font-size: .72em; vertical-align: 6%; margin: 0 .06em; }
.logo.small { font-size: 1.15rem; }
.logo.tiny { font-size: .95rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand-mini { position: relative; display: inline-block; width: 43px; height: 36px; flex: 0 0 43px; }
.brand-card {
  position: absolute; top: 1px; width: 24px; height: 33px; border-radius: 5px;
  background: linear-gradient(165deg, var(--cream), var(--cream-lo)); border: 1px solid rgba(230,179,61,.85);
  box-shadow: 0 3px 8px rgba(0,0,0,.45); color: var(--ink); font-family: var(--serif);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: .8;
}
.brand-card b { font-size: .72rem; }
.brand-card i { font-size: .75rem; font-style: normal; }
.brand-card.five { left: 1px; color: var(--red); transform: rotate(-8deg) translateY(2px); }
.brand-card.three { left: 18px; transform: rotate(8deg); }
.brand-lockup.compact { gap: 7px; }
.brand-lockup.compact .brand-mini { transform: scale(.82); transform-origin: left center; width: 36px; flex-basis: 36px; }

/* ============ LANDING ============ */
#screen-auth { background: #0a100d; scroll-behavior: smooth; }
.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;
}
/* ============ PUBLIC HOMEPAGE — warm paper, game-first, quiet ============ */
.public-home {
  --paper: #f6f1e3;
  --paper-2: #fffdf6;
  --ink-1: #292420;
  --ink-2: #6b645a;
  --pine: #1d5c3a;
  --pine-deep: #14432a;
  --hairline: rgba(41, 36, 32, .14);
  min-height: 100%;
  background: linear-gradient(180deg, var(--paper) 0%, #f1ead8 100%);
  color: var(--ink-1);
  font-family: var(--sans);
}
.public-home .logo { color: #8a6414; text-shadow: none; }
.public-home .logo .amp { color: var(--ink-2); }

.public-header {
  min-height: 64px; display: flex; align-items: center; gap: 28px;
  padding: 10px max(24px, calc((100vw - 1080px) / 2));
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 241, 227, .92); border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(14px);
}
.public-brand { color: inherit; text-decoration: none; }
.public-nav { display: flex; align-items: center; justify-content: center; gap: 26px; flex: 1; }
.public-nav a, .public-footer a { color: var(--ink-2); text-decoration: none; font-size: .85rem; font-weight: 600; }
.public-nav a:hover, .public-footer a:hover { color: var(--pine); }
.public-header-actions { display: flex; gap: 8px; }

/* buttons & inputs on paper */
.public-home .btn {
  border-radius: 9px; background: var(--paper-2); color: var(--ink-1); border: 1px solid rgba(67,56,43,.2);
  box-shadow: 0 1px 2px rgba(41,36,32,.07);
}
.public-home .btn:hover { border-color: #9b7937; box-shadow: 0 0 0 3px rgba(155,121,55,.09), 0 4px 10px rgba(41,36,32,.09); }
.public-home .btn.primary {
  background: linear-gradient(180deg, #f4d876 0%, #dfb43e 48%, #c9911a 100%); color: #3b2805; border-color: #aa7613;
  text-shadow: 0 1px 0 rgba(255,250,220,.65); font-weight: 750;
  box-shadow: 0 2px 4px rgba(117,78,13,.16), inset 0 1px 0 rgba(255,255,255,.48);
}
.public-home .btn.primary:hover {
  background: linear-gradient(180deg, #ffe89b 0%, #edc653 48%, #d8a128 100%); border-color: #bf871a;
  box-shadow: 0 0 0 3px rgba(246,213,129,.25), 0 0 22px rgba(230,179,61,.56), 0 6px 14px rgba(111,73,18,.16), inset 0 1px 0 rgba(255,255,255,.62); transform: translateY(-1px);
}
.public-home .btn.primary:active { transform: translateY(0); box-shadow: 0 0 0 2px rgba(230,179,61,.14), 0 1px 3px rgba(111,73,18,.18); }
.public-home .btn.ghost { background: transparent; box-shadow: none; }
.public-home input {
  background: var(--paper-2); color: var(--ink-1); border: 1px solid var(--hairline);
}
.public-home input::placeholder { color: #a49b8d; }
.public-home input:focus { border-color: var(--pine); }
.public-home .divider { color: #a49b8d; }
.public-home .divider::before, .public-home .divider::after { background: var(--hairline); }
.public-home .error { color: #a52f22; }
.public-home .fine { color: var(--ink-2); }

.public-home main { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }

/* hero */
.public-hero {
  display: grid; grid-template-columns: minmax(0, 720px);
  justify-content: center; text-align: center;
  gap: 56px; align-items: center; padding: 84px 0 40px;
}
.public-hero .public-hero-actions { justify-content: center; }

/* The one door in: a calm overlay holding the whole sign-in card */
.auth-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 22px; overflow-y: auto;
  background: rgba(41, 36, 32, .48); backdrop-filter: blur(7px);
}
.auth-overlay.hidden { display: none; }
.auth-overlay .public-auth-card {
  position: relative; width: min(432px, 100%);
  max-height: min(92vh, 720px); overflow-y: auto; margin: auto;
  animation: pop .22s ease;
}
.auth-overlay-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(41,36,32,.2); background: transparent;
  color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.auth-overlay-close:hover { background: rgba(41,36,32,.08); }
body.ui-dark .auth-overlay { background: rgba(4, 8, 5, .62); }
.public-hero-copy h1 {
  color: var(--ink-1); font: 700 clamp(2.8rem, 5vw, 4.2rem)/1.04 var(--serif);
  letter-spacing: -.02em; text-wrap: balance;
}
.public-hero-copy > p {
  max-width: 540px; margin: 20px auto 0; color: var(--ink-2);
  font-size: 1.12rem; line-height: 1.65;
}
.public-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; justify-content: center; }

/* auth card — a warm linen "card on the table", not a stark white box */
.public-auth-card {
  position: relative; border-radius: 18px; padding: 34px 28px 26px;
  background:
    repeating-linear-gradient(0deg, rgba(41,36,32,.015) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, #fbf6e6 0%, #f4edda 100%);
  border: 1px solid rgba(41,36,32,.1);
  box-shadow: 0 18px 46px rgba(41,36,32,.14), inset 0 1px 0 rgba(255,255,255,.55);
}
/* Official lockup at the top of the sign-in card: the 5♥/3♠ mark beside the
   FIVE & THREE wordmark, centered and fully inside the card. */
.auth-card-lockup {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  margin-bottom: 16px;
}
.auth-card-lockup .brand-mini { transform: scale(1.05); }
.auth-card-lockup .logo {
  font: 800 1.2rem var(--serif); letter-spacing: .04em; color: var(--ink-1);
}
.auth-card-lockup .logo .amp { color: var(--pine); font-style: italic; padding: 0 1px; }
.public-auth-card h2 { font: 700 1.55rem var(--serif); color: var(--ink-1); margin-bottom: 4px; text-align: center; }
.auth-card-sub { color: var(--ink-2); font-size: .9rem; line-height: 1.45; margin-bottom: 18px; text-align: center; }
.auth-paused { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 22px 14px 6px; }
.auth-paused-badge { font-size: 2rem; line-height: 1; }
.auth-paused h3 { font: 700 1.2rem var(--serif); color: var(--ink-1); margin: 0; }
.auth-paused p { color: var(--ink-2); font-size: .92rem; line-height: 1.5; margin: 0; max-width: 30ch; }
.auth-paused .btn.block { width: 100%; margin-top: 6px; }
.public-auth-card .auth-box { display: flex; flex-direction: column; background: transparent; border: 0; box-shadow: none; padding: 0; backdrop-filter: none; gap: 11px; }
.public-auth-card .auth-box input { width: 100%; }
.public-auth-card .btn.block { width: 100%; justify-content: center; padding: 11px 18px; }
.public-auth-card .divider { margin: 3px 0; }
.public-auth-card input { background: #fffdf7; }
.auth-mode {
  display:grid; grid-template-columns:1fr 1fr; gap:3px; padding:3px; margin-bottom:2px;
  border:1px solid var(--hairline); border-radius:11px; background:rgba(31,45,37,.055);
}
.auth-mode button {
  appearance:none; border:0; border-radius:8px; padding:8px 10px; color:var(--ink-2);
  background:transparent; font:800 .72rem var(--sans); cursor:pointer; transition:.15s ease;
}
.auth-mode button.active { color:var(--ink-1); background:#fffdf7; box-shadow:0 1px 4px rgba(25,32,27,.12); }
.auth-provider { position:relative; min-height:43px; font-weight:800; }
.auth-provider svg { width:18px; height:18px; flex:0 0 18px; }
.auth-provider span {
  position:absolute; left:14px; width:22px; height:22px; display:grid; place-items:center;
  border-radius:50%; font:900 .78rem var(--sans);
}
.auth-provider.google { color:#202124; background:#fff !important; border-color:#d7d9dd !important; }
.auth-provider.google span { color:#4285f4; border:1px solid #e1e4e8; }
.auth-provider.apple { color:#fff !important; background:#080808 !important; border-color:#080808 !important; }
.auth-provider.apple span { color:#fff; font-size:.63rem; }
.auth-provider.provider-pending { opacity:.64; }
.auth-text-action {
  appearance:none; align-self:center; border:0; padding:1px 4px; color:var(--pine-deep);
  background:none; font:750 .71rem var(--sans); cursor:pointer;
}
.auth-text-action:hover { text-decoration:underline; }
.auth-protection { margin:-1px 3px 1px; color:var(--ink-2); font-size:.66rem; line-height:1.45; text-align:center; }
.auth-honeypot { position:absolute !important; left:-10000px !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; }
.auth-captcha { min-height:65px; display:grid; place-items:center; }
.auth-captcha.hidden { display:none; }
.auth-box.busy { pointer-events:none; opacity:.68; }
.auth-box .error { min-height:16px; margin:0; }

/* the game itself */
.public-section { padding: 56px 0 0; }
.public-showcase-section { padding-top: 40px; }
.table-shot { margin: 0; }
.table-shot img {
  width: 100%; display: block; border-radius: 16px;
  border: 1px solid var(--hairline); box-shadow: 0 18px 50px rgba(41,36,32,.16);
}
.table-shot figcaption { margin-top: 10px; color: var(--ink-2); font-size: .85rem; }
.table-shot-main { display: block; }
.table-shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.table-shot-row figcaption { font-weight: 600; color: var(--ink-1); }
.showcase-note { margin-top: 18px; color: var(--ink-2); font-size: .95rem; }

/* feature sections — online play & tournaments */
.public-feature-section { padding-top: 64px; }
.feature-head { max-width: 620px; margin-bottom: 26px; }
.feature-head h2 { font: 700 clamp(1.7rem, 3vw, 2.3rem)/1.1 var(--serif); color: var(--ink-1); letter-spacing: -.01em; }
.feature-head p { margin-top: 12px; color: var(--ink-2); font-size: 1.05rem; line-height: 1.6; }

/* how it works */
.public-how-section { padding-bottom: 26px; }
.public-how-section h2 { font: 700 1.9rem var(--serif); color: var(--ink-1); margin: 0 0 22px; }
.public-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; counter-reset: step; }
.public-steps li {
  counter-increment: step; color: var(--ink-2); line-height: 1.6; font-size: .95rem;
  padding-top: 46px; position: relative;
}
.public-steps li b { display: block; color: var(--ink-1); font: 700 1.12rem var(--serif); margin-bottom: 6px; }
.public-steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pine); color: #f6f1e3; font: 700 .85rem var(--sans);
}

/* footer */
.public-footer {
  width: min(1080px, calc(100% - 48px)); margin: 56px auto 0; padding: 26px 0 44px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  border-top: 1px solid var(--hairline); color: var(--ink-2); font-size: .82rem;
}
.public-footer > div { display: flex; align-items: center; gap: 18px; }
.public-footer button { padding: 0; border: 0; color: var(--pine); background: transparent; font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  .public-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 44px; }
  .public-nav { display: none; }
  .public-steps { grid-template-columns: 1fr; gap: 24px; }
  .table-shot-row { grid-template-columns: 1fr; }
  .public-footer { flex-direction: column; }
}

/* ============ LOBBY ============ */
/* Warm "clubhouse" theme — matches the homepage so signing in feels seamless.
   Only the green felt table (#screen-game) stays dark. */
#screen-lobby {
  --bg: #efe7d4; --bg-2: #f6f1e3;
  --panel: #fffdf6;
  --panel-line: rgba(41, 36, 32, .1);
  --line: rgba(41, 36, 32, .1);
  --text: #29241f; --muted: #6f685c;
  --gold-hi: #8a6414;
  --shadow: 0 12px 34px rgba(41, 36, 32, .12);
  background: linear-gradient(180deg, #f6f1e3 0%, #efe7d4 100%);
  color: var(--text);
}
#screen-lobby .logo { color: #8a6414; text-shadow: none; }
#screen-lobby .logo .amp { color: #6f685c; }
#screen-lobby .lobby-header { background: rgba(246, 241, 227, .92); }
#screen-lobby h2 { color: #1d5c3a; }
#screen-lobby .eyebrow { color: #1d5c3a; }
#screen-lobby .tab { color: #6f685c; }
#screen-lobby .tab:hover { color: #29241f; }
#screen-lobby .tab.active { background: rgba(29, 92, 58, .12); color: #1d5c3a; }
#screen-lobby .btn { background: #fffdf6; color: #29241f; border-color: rgba(41, 36, 32, .14); box-shadow: 0 1px 2px rgba(41, 36, 32, .06); }
#screen-lobby .btn:hover { border-color: #1d5c3a; box-shadow: 0 3px 10px rgba(41, 36, 32, .1); }
#screen-lobby .btn.ghost { background: transparent; box-shadow: none; }
#screen-lobby .btn.gold, #screen-lobby .btn.action-primary {
  position: relative; overflow: hidden; border-radius: 9px;
  background: linear-gradient(180deg, #f4d876 0%, #dfb43e 48%, #c9911a 100%); color: #3b2805;
  border-color: #aa7613; text-shadow: 0 1px 0 rgba(255,250,220,.65);
  box-shadow: 0 2px 4px rgba(117,78,13,.16), inset 0 1px 0 rgba(255,255,255,.48);
}
#screen-lobby .btn.gold::after, #screen-lobby .btn.action-primary::after {
  content: none;
}
#screen-lobby .btn.gold:hover, #screen-lobby .btn.action-primary:hover {
  color: #3b2805; background: linear-gradient(180deg, #ffe89b 0%, #edc653 48%, #d8a128 100%); border-color: #bf871a; transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(246,213,129,.25), 0 0 22px rgba(230,179,61,.56), 0 6px 14px rgba(111,73,18,.16), inset 0 1px 0 rgba(255,255,255,.62);
}
#screen-lobby .btn.gold:active, #screen-lobby .btn.action-primary:active { transform: translateY(0); box-shadow: 0 0 0 2px rgba(230,179,61,.14), 0 1px 3px rgba(111,73,18,.18); }
#screen-lobby .btn.ranked {
  position: relative; overflow: hidden;
  color: #fff3d0;
  background: linear-gradient(180deg, #8b4a43 0%, #713833 52%, #572925 100%);
  border-color: rgba(171, 111, 42, .82);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  box-shadow:
    0 0 0 1px rgba(255, 235, 180, .1),
    0 5px 16px rgba(80, 35, 28, .2),
    0 0 18px rgba(171, 111, 42, .12),
    inset 0 1px 0 rgba(255, 255, 255, .18);
}
#screen-lobby .btn.ranked::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.14) 48%, transparent 72%);
  transform: translateX(-115%);
  transition: transform .42s ease;
}
#screen-lobby .btn.ranked:hover {
  color: #fff7df;
  background: linear-gradient(180deg, #9d574e 0%, #80423b 52%, #642f2b 100%);
  border-color: #c8903d;
  box-shadow:
    0 0 0 3px rgba(193, 132, 54, .14),
    0 8px 22px rgba(80, 35, 28, .25),
    0 0 24px rgba(193, 132, 54, .2),
    inset 0 1px 0 rgba(255, 255, 255, .2);
}
#screen-lobby .btn.ranked:hover::after { transform: translateX(115%); }
#screen-lobby .btn.ranked:active {
  transform: translateY(0);
  box-shadow: 0 0 0 2px rgba(193, 132, 54, .14), 0 2px 7px rgba(80, 35, 28, .24);
}
#screen-lobby .btn.action-watch {
  border-radius: 9px; color: #493d2a; background: #fffaf0;
  border-color: #9f8a63; box-shadow: 0 1px 3px rgba(41,36,32,.09);
}
#screen-lobby .btn.action-watch:hover {
  color: #352d23; background: #fff4d9; border-color: #9b7937; transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(155,121,55,.1), 0 4px 10px rgba(41,36,32,.1);
}
#screen-lobby input { background: #fffdf6; color: #29241f; border-color: rgba(41, 36, 32, .14); }
#screen-lobby input::placeholder { color: #a49b8d; }
#screen-lobby .hero { background: linear-gradient(168deg, #fffdf6, #f6efdc); }
#screen-lobby .hero h1 { color: #29241f; }
#screen-lobby .hero p, #screen-lobby .hero-text p { color: #6f685c; }
#screen-lobby .hero-card, #screen-lobby .points-explainer { background: rgba(41, 36, 32, .04); border-color: rgba(41, 36, 32, .1); }
#screen-lobby .live-stat b { color: #1d5c3a; }
#screen-lobby .elo { color: #8a6414; }
#screen-lobby .me-identity:hover { background: rgba(41, 36, 32, .05); border-color: rgba(41, 36, 32, .14); }
#screen-lobby .me-avatar { background: radial-gradient(circle at 32% 28%, #ece0c6, #d8caa8 70%); border-color: rgba(41, 36, 32, .2); }
#screen-lobby .room-item:hover { border-color: #1d5c3a; }
#screen-lobby .btn.icon { background: #fffdf6; }

/* Day / Night appearance applies to the public website and clubhouse only.
   The actual game table keeps its focused dark felt treatment in both modes. */
.public-home, #screen-lobby, .public-header, .lobby-header { transition: background-color .22s ease, color .22s ease, border-color .22s ease; }
.theme-toggle { min-width: 38px; }

body.ui-dark .public-home {
  --paper: #0d1511;
  --paper-2: #151f19;
  --ink-1: #f2ead8;
  --ink-2: #aeb9b0;
  --pine: #e6b33d;
  --pine-deep: #f6d581;
  --hairline: rgba(239,233,218,.13);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(230,179,61,.1), transparent 64%),
    radial-gradient(700px 420px at 5% 105%, rgba(29,92,58,.22), transparent 65%),
    linear-gradient(180deg, #101813 0%, #0b110e 100%);
}
body.ui-dark .public-header { background: rgba(13,21,17,.92); }
body.ui-dark .public-home .btn:not(.primary) { background: #151f19; color: #f2ead8; border-color: rgba(239,233,218,.17); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
body.ui-dark .public-home .btn:not(.primary):hover { border-color: rgba(230,179,61,.5); box-shadow: 0 0 0 3px rgba(230,179,61,.09), 0 5px 14px rgba(0,0,0,.28); }
body.ui-dark .public-home .btn.ghost { background: transparent; }
body.ui-dark .public-auth-card {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, #18231c 0%, #111a15 100%);
  border-color: rgba(239,233,218,.12);
  box-shadow: 0 20px 52px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.035);
}
body.ui-dark .public-auth-card input, body.ui-dark .public-home input { background: #0d1511; color: #f2ead8; border-color: rgba(239,233,218,.16); }
body.ui-dark .auth-mode { background:rgba(255,255,255,.04); }
body.ui-dark .auth-mode button.active { color:#f2ead8; background:#223027; box-shadow:0 1px 5px rgba(0,0,0,.35); }
body.ui-dark .public-home input::placeholder { color: #7f8c83; }
body.ui-dark .public-home .divider::before, body.ui-dark .public-home .divider::after { background: rgba(239,233,218,.12); }
body.ui-dark .public-steps li::before { color: #35270a; }
body.ui-dark .table-shot img { box-shadow: 0 18px 52px rgba(0,0,0,.46); }

body.ui-dark #screen-lobby {
  --bg: #0b110e; --bg-2: #101813;
  --panel: rgba(21,31,25,.94);
  --panel-line: rgba(230,179,61,.16);
  --line: rgba(239,233,218,.09);
  --text: #efe9da; --muted: #aab6ad;
  --gold-hi: #f6d581;
  --shadow: 0 14px 38px rgba(0,0,0,.42);
  background:
    radial-gradient(900px 520px at 82% -8%, rgba(230,179,61,.09), transparent 64%),
    radial-gradient(800px 480px at 2% 110%, rgba(29,92,58,.25), transparent 62%),
    linear-gradient(180deg, #101813 0%, #0b110e 100%);
}
body.ui-dark #screen-lobby .logo { color: #e6b33d; text-shadow: 0 2px 12px rgba(230,179,61,.12); }
body.ui-dark #screen-lobby .logo .amp { color: #aab6ad; }
body.ui-dark #screen-lobby .lobby-header { background: rgba(13,21,17,.92); }
body.ui-dark #screen-lobby h2, body.ui-dark #screen-lobby .eyebrow { color: #f6d581; }
body.ui-dark #screen-lobby .tab { color: #aab6ad; }
body.ui-dark #screen-lobby .tab:hover { color: #efe9da; }
body.ui-dark #screen-lobby .tab.active { background: rgba(230,179,61,.12); color: #f6d581; }
body.ui-dark #screen-lobby .btn:not(.gold):not(.action-primary):not(.ranked) { background: rgba(255,255,255,.055); color: #efe9da; border-color: rgba(239,233,218,.14); box-shadow: 0 2px 5px rgba(0,0,0,.22); }
body.ui-dark #screen-lobby .btn:not(.gold):not(.action-primary):not(.ranked):hover { border-color: rgba(230,179,61,.48); box-shadow: 0 5px 14px rgba(0,0,0,.3); }
body.ui-dark #screen-lobby .btn.ghost { background: transparent; }
body.ui-dark #screen-lobby .btn.gold, body.ui-dark #screen-lobby .btn.action-primary { color: #3b2805; }
body.ui-dark #screen-lobby .btn.ranked {
  color: #f7e8b5;
  background: linear-gradient(180deg, #405675 0%, #2d405d 52%, #202f47 100%);
  border-color: rgba(222, 180, 76, .72);
  box-shadow:
    0 0 0 1px rgba(255, 226, 143, .08),
    0 6px 18px rgba(7, 18, 35, .34),
    0 0 20px rgba(222, 180, 76, .13),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
body.ui-dark #screen-lobby .btn.ranked:hover {
  color: #fff2c5;
  background: linear-gradient(180deg, #4b668b 0%, #354d70 52%, #263955 100%);
  border-color: #e4bd5b;
  box-shadow:
    0 0 0 3px rgba(228, 189, 91, .13),
    0 9px 24px rgba(7, 18, 35, .4),
    0 0 26px rgba(228, 189, 91, .22),
    inset 0 1px 0 rgba(255, 255, 255, .2);
}
body.ui-dark #screen-lobby .btn.action-watch { color: #f6d581; background: rgba(230,179,61,.08); border-color: rgba(230,179,61,.32); }
body.ui-dark #screen-lobby input, body.ui-dark #screen-lobby textarea { background: #0d1511; color: #efe9da; border-color: rgba(239,233,218,.16); }
body.ui-dark #screen-lobby input::placeholder, body.ui-dark #screen-lobby textarea::placeholder { color: #748279; }
body.ui-dark #screen-lobby .hero { background: linear-gradient(155deg, rgba(24,35,28,.98), rgba(15,23,18,.98)); }
body.ui-dark #screen-lobby .hero h1 { color: #f4eddf; }
body.ui-dark #screen-lobby .hero p, body.ui-dark #screen-lobby .hero-text p { color: #aab6ad; }
body.ui-dark #screen-lobby .hero-card, body.ui-dark #screen-lobby .points-explainer { background: rgba(255,255,255,.035); border-color: rgba(230,179,61,.14); }
body.ui-dark #screen-lobby .live-stat b, body.ui-dark #screen-lobby .elo { color: #e6b33d; }
body.ui-dark #screen-lobby .me-identity:hover { background: rgba(255,255,255,.045); border-color: rgba(230,179,61,.18); }
body.ui-dark #screen-lobby .me-avatar { background: radial-gradient(circle at 32% 28%, #48594f, #202b24 70%); border-color: rgba(230,179,61,.34); }
body.ui-dark #screen-lobby .btn.icon { background: rgba(255,255,255,.055); }
body.ui-dark #screen-lobby .room-item:hover { border-color: rgba(230,179,61,.38); }
body.ui-dark #screen-lobby .room-item.private-room { background: linear-gradient(145deg, rgba(27,38,31,.98), rgba(17,26,21,.98)); border-color: rgba(230,179,61,.22); }
body.ui-dark #screen-lobby .room-score { background: rgba(230,179,61,.07); color: #aab6ad; }
body.ui-dark #screen-lobby .room-progress-copy b { color: #efe9da; }
body.ui-dark #screen-lobby .private-access { color: #f6d581; background: rgba(230,179,61,.08); border-color: rgba(230,179,61,.2); }
body.ui-dark #screen-lobby .hero-private { color: #d6bd78 !important; }

body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) .modal-card {
  background: linear-gradient(180deg, #18231c, #101813); color: #efe9da; border-color: rgba(230,179,61,.18);
}
body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) h2 { color: #efe9da; }
body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) .muted,
body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) .tc-field-label { color: #aab6ad; }
body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) input { background: #0d1511; color: #efe9da; border-color: rgba(239,233,218,.16); }
body.ui-dark :is(#tournament-create-modal, #name-picker, #table-create-modal, #table-invite-modal, #confirm-modal) .btn:not(.gold) { background: rgba(255,255,255,.055); color: #efe9da; border-color: rgba(239,233,218,.14); }
body.ui-dark #table-invite-modal .social-person { background: rgba(255,255,255,.035); color: #efe9da; border-color: rgba(230,179,61,.12); }
body.ui-dark #table-invite-modal .social-person-info small, body.ui-dark #table-invite-modal .social-empty { color: #aab6ad; }
body.ui-dark #table-invite-modal .social-avatar { background: radial-gradient(circle at 32% 28%, #48594f, #202b24 70%); border-color: rgba(230,179,61,.3); }
body:not(.ui-dark) #settings-modal:not(.game-context) .modal-card { background: linear-gradient(180deg, #fffdf6, #f7f0de); color: #29241f; border-color: rgba(41,36,32,.12); }
body:not(.ui-dark) #settings-modal:not(.game-context) h2 { color: #29241f; }
body:not(.ui-dark) #settings-modal:not(.game-context) .muted { color: #6f685c; }
body:not(.ui-dark) #settings-modal:not(.game-context) .btn:not(.gold) { background: #fffdf6; color: #29241f; border-color: rgba(41,36,32,.18); box-shadow: 0 1px 2px rgba(41,36,32,.06); }
@media (max-width: 900px) {
  .public-header-actions .theme-toggle { display: inline-flex !important; align-items: center; justify-content: center; }
}

.lobby-header {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--panel-line);
  backdrop-filter: blur(10px); flex-wrap: wrap; position: sticky; top: 0; z-index: 10;
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { background: none; border: none; color: var(--muted); padding: 8px 16px; border-radius: 10px; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(230,179,61,.12); color: var(--gold-hi); }
.nav-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  margin-left: 4px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #35270a;
  font-size: .66rem; font-weight: 900; vertical-align: 1px;
}
.nav-count.red { background: #e5484d; color: #fff; }
.nav-count.hidden { display: none; }

/* iPhone-style notification dot on the account avatar in the toolbar */
.me-avatar-wrap { position: relative; display: inline-flex; }
.notif-dot {
  position: absolute; top: -5px; right: -6px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e5484d; color: #fff; font-size: .64rem; font-weight: 900; line-height: 1;
  border: 2px solid var(--panel, #fbf6e6);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  animation: notifPop .25s ease;
}
.notif-dot.hidden { display: none; }
@keyframes notifPop { from { transform: scale(0); } to { transform: scale(1); } }
.me-box { display: flex; align-items: center; gap: 10px; }
.account-menu-wrap { position: relative; }
.me-identity {
  display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 4px; border: 1px solid transparent; border-radius: 13px;
  background: transparent; color: var(--text); text-align: left;
}
.me-identity:hover { background: rgba(255,255,255,.045); border-color: rgba(230,179,61,.18); }
.account-chevron { color: var(--muted); font-size: .9rem; line-height: 1; transition: transform .16s ease; }
.me-identity[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 30; width: 292px;
  padding: 8px; border-radius: 15px; color: var(--text); background: var(--panel);
  border: 1px solid var(--panel-line); box-shadow: 0 18px 46px rgba(20,16,9,.24);
  backdrop-filter: blur(18px);
}
.account-menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 9px 10px; color: var(--muted); font-size: .69rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.account-menu-head .badge { font-size: .58rem; padding: 3px 6px; }
.account-menu-item {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; gap: 2px;
  padding: 10px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left;
}
.account-menu-item:hover, .account-menu-item:focus-visible { background: rgba(230,179,61,.1); }
.account-menu-item span { font-size: .82rem; font-weight: 800; }
.account-menu-item small { color: var(--muted); font-size: .69rem; line-height: 1.35; }
.account-menu-separator { height: 1px; margin: 6px 8px; background: var(--panel-line); }
.account-signout { color: #b5402f; }
body.ui-dark #screen-lobby .account-signout { color: #ff9a8a; }
.settings-trigger { min-height: 38px; padding: 8px 13px; border-radius: 10px; font-size: .76rem; }
.me-avatar {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #48594f, #202b24 70%); border: 1px solid rgba(230,179,61,.34); font-size: 1.1rem;
}
.me-copy { display: flex; flex-direction: column; min-width: 0; }
.me-copy strong { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; line-height: 1.2; }
.elo { color: var(--gold); font-size: .66rem; font-weight: 750; line-height: 1.2; }
.badge {
  background: linear-gradient(165deg, var(--gold-hi), var(--gold));
  color: #35270a; font-size: .68rem; font-weight: 800; padding: 3px 8px; border-radius: 20px;
}
.lobby-main { padding: 28px; max-width: 980px; margin: 0 auto; width: 100%; }

/* Heroes */
.hero {
  display: flex; gap: 30px; align-items: center; margin: 6px 0 30px;
  background:
    radial-gradient(700px 260px at 18% 0%, rgba(230,179,61,.09), transparent 70%),
    radial-gradient(500px 300px at 90% 100%, rgba(29,92,58,.35), transparent 70%),
    var(--panel);
  border: 1px solid var(--panel-line); border-radius: 24px; padding: 40px 38px;
}
.hero.slim { padding: 30px 34px; }
.hero.center { justify-content: center; text-align: center; }
.hero-text { flex: 1; min-width: 0; }
.access-status {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; width: fit-content;
  margin: 14px 0 2px; padding: 7px 11px; border-radius: 10px;
  background: rgba(230,179,61,.08); border: 1px solid rgba(230,179,61,.2);
  font-size: .76rem;
}
.access-status b { color: var(--gold-hi); }
.access-status span { color: var(--muted); }
.eyebrow {
  display: block; font-size: .68rem; font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--serif); font-size: 2.5rem; line-height: 1.08; font-weight: 700;
  letter-spacing: .01em; margin-bottom: 12px;
}
.hero p { color: var(--muted); max-width: 52ch; line-height: 1.55; }
.hero.center p { margin: 0 auto; }
.hero-cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-card {
  min-width: 210px; background: rgba(0,0,0,.28); border: 1px solid var(--panel-line);
  border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
}
.points-explainer {
  min-width: 290px; display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; gap: 10px;
  padding: 18px; border: 1px solid var(--panel-line); border-radius: 18px; background: rgba(0,0,0,.24);
}
.point-card {
  position: relative; height: 104px; border-radius: 11px; background: linear-gradient(165deg, var(--cream), var(--cream-lo));
  color: var(--ink); box-shadow: 0 7px 18px rgba(0,0,0,.42); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-family: var(--serif); transform: rotate(4deg);
}
.point-card.five { color: var(--red); transform: rotate(-5deg); }
.point-card b { position: absolute; top: 7px; left: 9px; font-size: 1rem; }
.point-card span { font-size: 2.45rem; }
.point-card em { position: absolute; bottom: 7px; right: 8px; font: 800 .72rem var(--sans); }
.point-math { color: var(--muted); text-align: center; font-size: .8rem; line-height: 1.6; }
.point-math strong { display: inline-block; color: var(--gold-hi); margin: 0 2px; }
.live-stat { display: flex; align-items: baseline; gap: 10px; }
.live-stat b { font-family: var(--serif); font-size: 2rem; color: var(--gold); }
.live-stat span { color: var(--muted); font-size: .85rem; }
.live-dot { color: #7edb92; font-size: .74rem; margin-top: 4px; }

/* Play columns / join by code */
.play-columns { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.join-card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 20px;
  padding: 22px; display: flex; flex-direction: column; gap: 8px; margin-top: 46px;
}
.join-card h3 { font-family: var(--serif); font-size: 1.25rem; }
.join-row { display: flex; gap: 8px; margin-top: 8px; }
.join-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; letter-spacing: .15em; text-transform: lowercase; }
.rule-list { list-style: none; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: .9rem; }
.rule-list li::before { content: "✓ "; color: var(--gold); }

/* Learn / rules accordion */
.learn-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.learn-main details {
  border-bottom: 1px solid var(--line); padding: 4px 6px;
}
.learn-main summary {
  cursor: pointer; font-family: var(--serif); font-size: 1.3rem; padding: 14px 4px;
  list-style: none; display: flex; align-items: baseline; gap: 14px;
}
.learn-main summary::-webkit-details-marker { display: none; }
.learn-main summary i { font-style: normal; font-size: .8rem; color: var(--gold); font-family: var(--sans); }
.learn-main summary::after { content: "+"; margin-left: auto; color: var(--muted); font-family: var(--sans); }
.learn-main details[open] summary::after { content: "–"; }
.learn-main details p { color: var(--muted); line-height: 1.6; padding: 0 4px 16px 34px; max-width: 62ch; }
.learn-grid .join-card { margin-top: 0; }

.footnote-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; color: var(--muted); font-size: .86rem; line-height: 1.5; margin-top: 14px;
}
.footnote-card b { color: var(--gold-hi); }
.ranking-explainer > b { display: block; font-size: 1rem; margin-bottom: 8px; }
.ranking-explainer ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ranking-explainer li { position: relative; padding-left: 18px; }
.ranking-explainer li::before { content: "•"; position: absolute; left: 4px; color: var(--gold); }
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px;
  min-height: 142px; background: var(--panel); padding: 17px 18px; border-radius: 16px; border: 1px solid var(--line);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.room-item:hover { border-color: var(--panel-line); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(41,36,32,.08); }
.room-item.live-game { border-left: 4px solid #c89527; }
.room-item.private-room { background: linear-gradient(145deg, #fffdf6, #fbf3df); border-color: rgba(157,111,23,.22); }
#screen-lobby .room-item.private-room:hover { border-color: #b7892f; }
.room-copy { min-width: 0; }
.room-title-row { display: flex; align-items: center; gap: 10px; }
.room-title-row > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-status { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; font-size: .62rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.room-status.live { color: #1e603a; background: rgba(59,148,91,.12); }
.room-status.waiting { color: #80611e; background: rgba(200,149,39,.12); }
.room-privacy { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; color: #6e5116; background: rgba(230,179,61,.16); border: 1px solid rgba(166,119,25,.16); font-size: .62rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.room-status i { width: 6px; height: 6px; border-radius: 50%; background: #3e9c5d; box-shadow: 0 0 0 4px rgba(62,156,93,.12); animation: roomLivePulse 1.7s ease-in-out infinite; }
.room-item .seats { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.room-game-summary { display: flex; align-items: center; gap: 16px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.room-score { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; padding: 6px 10px; border-radius: 10px; background: #f5ecd8; color: #756b5b; font-size: .7rem; }
.room-score span:first-child b { color: #9b6a12; }
.room-score span:last-child b { color: #3d6f96; }
.room-score b { margin-left: 3px; font: 800 1.12rem var(--serif); }
.room-score em { color: #a9a092; font-style: normal; }
.room-progress-copy { display: flex; flex-direction: column; min-width: 0; }
.room-progress-copy b { color: #3b342d; font-size: .77rem; }
.room-progress-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.room-waiting-note { margin-top: 9px; color: var(--muted); font-size: .72rem; }
.room-actions { display: flex; flex-direction: column; align-items: stretch; gap: 9px; min-width: 132px; }
.room-actions .btn { white-space: nowrap; padding: 9px 14px; }
.private-access { max-width: 132px; padding: 9px 11px; border-radius: 10px; color: #74571b; background: rgba(230,179,61,.1); border: 1px solid rgba(166,119,25,.18); font-size: .7rem; font-weight: 750; line-height: 1.35; text-align: center; }
.hero-private { margin-top: 10px; padding-left: 3px; padding-right: 3px; color: #725a28 !important; border-color: transparent !important; }
.hero-private:hover { color: #4e3a13 !important; background: rgba(230,179,61,.09) !important; border-color: rgba(166,119,25,.15) !important; box-shadow: none !important; }
.waiting-invite-actions { margin-top: 10px; flex-wrap: wrap; }
.waiting-invite-actions .btn { padding: 8px 12px; font-size: .78rem; }
@keyframes roomLivePulse { 50% { transform: scale(.72); opacity: .62; } }

/* Friends, requests, blocks, and direct messages */
.social-hero { overflow: hidden; }
.social-hero-mark {
  position: relative; width: 145px; height: 95px; flex: 0 0 145px;
  font: 700 4.8rem/1 var(--serif); filter: drop-shadow(0 14px 20px rgba(0,0,0,.45));
}
.social-hero-mark span, .social-hero-mark b { position: absolute; display: block; }
.social-hero-mark span { left: 15px; top: 10px; color: var(--red); transform: rotate(-10deg); }
.social-hero-mark b { right: 8px; top: 0; color: var(--cream); transform: rotate(9deg); }
.social-signin {
  text-align: center; padding: 50px 24px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 20px;
}
.social-signin .empty-mark { font-size: 2.5rem; color: var(--gold); }
.social-signin h2 { font: 700 1.5rem var(--serif); color: var(--text); }
.official-notices { display: flex; flex-direction: column; gap: 8px; margin: -14px 0 18px; }
.official-notice {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 13px 16px; border-radius: 15px; background: linear-gradient(135deg, rgba(230,179,61,.12), rgba(29,92,58,.18));
  border: 1px solid rgba(230,179,61,.34); box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.official-notice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font-size: 1.25rem; background: rgba(230,179,61,.12); }
.official-notice b { display: block; color: var(--gold-hi); margin-bottom: 3px; }
.official-notice p { color: var(--muted); font-size: .78rem; line-height: 1.42; }
.official-seal { color: #35270a; background: var(--gold); border-radius: 99px; padding: 4px 8px; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.social-layout { display: grid; grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); gap: 18px; align-items: start; }
.social-sidebar { display: flex; flex-direction: column; gap: 12px; }
.social-card, .dm-card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; box-shadow: 0 8px 25px rgba(0,0,0,.18);
}
.social-card { padding: 16px; }
.social-card h2, .dm-card h2 { margin: 0; color: var(--text); font: 700 1.25rem var(--serif); }
.social-card .eyebrow, .dm-card .eyebrow { margin-bottom: 4px; }
.social-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.social-number {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 99px; color: var(--gold-hi); background: rgba(230,179,61,.1); border: 1px solid rgba(230,179,61,.2);
  font-size: .75rem; font-weight: 800;
}
.social-list { display: flex; flex-direction: column; gap: 7px; }
.social-empty { color: var(--muted); font-size: .82rem; padding: 9px 2px; }
.social-person {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid transparent;
}
.social-person:hover { border-color: rgba(230,179,61,.16); }
.social-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #47584f, #202b24 70%); border: 1px solid rgba(230,179,61,.3); font-size: 1.2rem;
}
.social-person-info { min-width: 0; }
.social-person-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.social-person-info small { color: var(--muted); font-size: .68rem; }
.social-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.social-actions .btn { padding: 6px 9px; font-size: .72rem; }
.social-details { padding: 0; overflow: hidden; }
.social-details summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700;
}
.social-details summary::-webkit-details-marker { display: none; }
.social-details[open] summary { border-bottom: 1px solid var(--line); }
.social-details .social-list { padding: 10px; }
.social-detail-note { color: var(--muted); font-size: .72rem; line-height: 1.45; padding: 12px 14px 0; }
.dm-card { min-height: 540px; overflow: hidden; }
.dm-empty { min-height: 540px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.dm-empty-mark { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px; font-size: 2rem; color: var(--gold); background: rgba(230,179,61,.08); border: 1px solid rgba(230,179,61,.2); }
.dm-empty p { color: var(--muted); max-width: 38ch; line-height: 1.5; margin-top: 8px; }
.dm-conversation { display: grid; grid-template-rows: auto auto minmax(260px, 1fr) auto auto auto; min-height: 540px; }
.dm-head { display: flex; gap: 11px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.dm-head .social-avatar { flex: 0 0 40px; }
.dm-head > div:nth-child(3) { min-width: 0; flex: 1; }
.dm-back { display: none; }
.dm-scam-warning { display: flex; align-items: center; gap: 9px; padding: 9px 16px; background: rgba(230,179,61,.07); border-bottom: 1px solid rgba(230,179,61,.16); }
.dm-scam-warning > span { font-size: 1.15rem; }
.dm-scam-warning b { display: block; color: var(--gold-hi); font-size: .73rem; }
.dm-scam-warning small { display: block; color: var(--muted); font-size: .64rem; line-height: 1.35; }
.dm-log { height: 350px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dm-day { align-self: center; color: var(--muted); font-size: .68rem; margin: 3px 0; }
.dm-bubble { max-width: min(76%, 520px); padding: 9px 12px; border-radius: 15px 15px 15px 4px; background: rgba(255,255,255,.07); line-height: 1.42; font-size: .9rem; overflow-wrap: anywhere; }
.dm-bubble.mine { align-self: flex-end; border-radius: 15px 15px 4px 15px; color: #35270a; background: linear-gradient(165deg, var(--gold-hi), var(--gold)); }
.dm-bubble time { display: block; opacity: .64; font-size: .61rem; margin-top: 4px; text-align: right; }
.dm-report { display: block; margin-top: 6px; padding: 2px 0; border: 0; background: transparent; color: #ffad9f; font-size: .61rem; opacity: .75; }
.dm-report:hover { opacity: 1; text-decoration: underline; }
.dm-compose-alert { margin: 0 16px 2px; padding: 9px 11px; border-radius: 10px; color: #ffd1c8; background: rgba(179,56,44,.16); border: 1px solid rgba(255,120,100,.34); font-size: .74rem; line-height: 1.4; }
.dm-compose { display: flex; align-items: end; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--line); }
.dm-compose textarea { min-height: 46px; max-height: 130px; flex: 1; }
.dm-safety { color: var(--muted); font-size: .66rem; text-align: center; padding: 0 16px 12px; }
.public-profile-actions { display: flex; gap: 9px; flex-wrap: wrap; margin: 4px 0 18px; }
.lb-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 16px; overflow: hidden; }
.lb-table th, .lb-table td { padding: 11px 14px; text-align: left; }
.lb-table thead { background: rgba(230,179,61,.08); color: var(--gold-hi); font-size: .85rem; }
.lb-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.025); }
.lvl-cell { color: var(--gold-hi); font-weight: 700; }
.stats-card {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; padding: 16px; margin-bottom: 18px;
}
.stat-tile { text-align: center; padding: 9px 4px; background: rgba(255,255,255,.045); border-radius: 12px; }
.stat-val { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; color: var(--gold); }
.stat-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 10px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.plan.featured { border-color: rgba(230,179,61,.55); box-shadow: 0 0 40px rgba(230,179,61,.12); }
.plan .price { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--gold); }
.plan .price span { font-size: 1rem; color: var(--muted); font-weight: 500; font-family: var(--sans); }
.plan .price s { color: var(--muted); font-size: 1.05rem; font-weight: 500; margin-right: 5px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .92rem; flex: 1; }
.plan li::before { content: "✓ "; color: var(--gold); }
.theme-preview {
  min-height: 76px; position: relative; overflow: hidden; border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(150deg, #163f2c, #0c271b); display: flex; align-items: flex-end; padding: 9px 12px;
}
.theme-preview small { position: relative; z-index: 2; color: rgba(255,255,255,.76); font-size: .7rem; }
.felt-preview { position: absolute; inset: 0; opacity: .85; }
.felt-preview.pine { background: radial-gradient(circle at 30% 20%, #2a7a4d, #113523 65%); }
.felt-preview.royal { background: radial-gradient(circle at 30% 20%, #68498a, #24162f 68%); }
.back-preview {
  position: absolute; right: 16px; top: 8px; width: 42px; height: 58px; border-radius: 7px; z-index: 1;
  border: 2px solid rgba(246,213,129,.7); box-shadow: 0 5px 12px rgba(0,0,0,.45); transform: rotate(8deg);
}
.back-preview.gold { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 3px, transparent 3px 7px), linear-gradient(150deg, #c99b34, #7c5916); }
.back-preview.onyx { background: repeating-linear-gradient(45deg, rgba(246,213,129,.14) 0 3px, transparent 3px 7px), linear-gradient(150deg, #202522, #090b0a); }
.tourney-item { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 10px; }

/* Tournament card — the real Tournaments-tab card */
.tournament-card {
  display: flex; gap: 0; margin-bottom: 14px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px;
  box-shadow: 0 6px 22px rgba(0,0,0,.06);
}
.tournament-card .tc-accent {
  flex: 0 0 76px; display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(160deg, #2a7a4d, #14432a);
}
.tournament-card.official .tc-accent { background: linear-gradient(160deg, var(--gold), var(--gold-lo)); }
.tournament-card .tc-body { flex: 1; min-width: 0; padding: 15px 18px; display: flex; flex-direction: column; gap: 10px; }
.tc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tc-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tc-title h3 { font: 700 1.2rem var(--serif); color: var(--text); }
.tc-status { font-size: .74rem; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.tc-status.open { color: #2e7d4f; background: rgba(46,125,79,.14); }
.tc-status.live { color: #d1533f; background: rgba(209,83,63,.14); display: inline-flex; align-items: center; gap: 6px; }
.tc-status.live i { width: 7px; height: 7px; border-radius: 50%; background: #d1533f; animation: livePulse 1.5s infinite; }
.tc-status.done { color: var(--gold-hi); background: rgba(230,179,61,.15); }
.tc-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .86rem; }
.tc-fill { display: flex; align-items: center; gap: 11px; }
.tc-fill-bar { flex: 1; max-width: 220px; height: 7px; border-radius: 4px; background: rgba(41,36,32,.1); overflow: hidden; }
.tc-fill-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2a7a4d, #38a468); transition: width .5s; }
.tc-fill span { color: var(--muted); font-size: .82rem; }
.tc-players { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip { font-size: .78rem; padding: 3px 10px; border-radius: 20px; background: rgba(41,36,32,.06); border: 1px solid var(--line); color: var(--text); }
.tc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.tc-actions .btn { padding: 8px 16px; }
.btn.danger { color: #b5402f; border-color: rgba(181,64,47,.4); }
.btn.danger:hover { border-color: #b5402f; background: rgba(181,64,47,.06); }

/* Create-tournament modal fields */
.tc-field-label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 12px 0 5px; letter-spacing: .02em; }
#tourney-create-modal input { width: 100%; }
.seg-toggle { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg-toggle button { background: transparent; border: 0; padding: 9px 16px; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg-toggle button + button { border-left: 1px solid var(--line); }
.seg-toggle button.active { background: var(--gold); color: #35270a; }

/* Light modals shown over the warm lobby (not over the dark game table) */
#tournament-create-modal .modal-card, #name-picker .modal-card {
  background: linear-gradient(180deg, #fffdf6, #f7f0de);
  color: #29241f; border-color: rgba(41, 36, 32, .12);
}
#tournament-create-modal h2, #name-picker h2 { color: #29241f; }
#tournament-create-modal .muted, #name-picker .muted, #tournament-create-modal .tc-field-label { color: #6f685c; }
#tournament-create-modal input, #name-picker input {
  background: #fffdf6; color: #29241f; border-color: rgba(41, 36, 32, .18);
}
#tournament-create-modal input::placeholder, #name-picker input::placeholder { color: #a49b8d; }
#tournament-create-modal input:focus, #name-picker input:focus { border-color: #1d5c3a; }
#tournament-create-modal .btn, #name-picker .btn {
  background: #fffdf6; color: #29241f; border-color: rgba(41, 36, 32, .18); box-shadow: 0 1px 2px rgba(41,36,32,.06);
}
#tournament-create-modal .btn.ghost, #name-picker .btn.ghost { background: transparent; box-shadow: none; }
#tournament-create-modal .btn.gold, #name-picker .btn.gold {
  background: linear-gradient(180deg, #f4d876 0%, #dfb43e 48%, #c9911a 100%); color: #3b2805; border-color: #aa7613;
  text-shadow: 0 1px 0 rgba(255,250,220,.65); box-shadow: 0 2px 4px rgba(117,78,13,.16), inset 0 1px 0 rgba(255,255,255,.48);
}
#tournament-create-modal .btn.gold:hover, #name-picker .btn.gold:hover {
  background: linear-gradient(180deg, #ffe89b 0%, #edc653 48%, #d8a128 100%); border-color: #bf871a;
  box-shadow: 0 0 0 3px rgba(246,213,129,.25), 0 0 22px rgba(230,179,61,.56), 0 6px 14px rgba(111,73,18,.16), inset 0 1px 0 rgba(255,255,255,.62);
}
#tournament-create-modal .seg-toggle { border-color: rgba(41, 36, 32, .18); }
#tournament-create-modal .seg-toggle button { color: #6f685c; }
#tournament-create-modal .seg-toggle button + button { border-left-color: rgba(41, 36, 32, .14); }
#tc-size { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
#tc-size button { padding: 9px 6px; white-space: nowrap; }
#tournament-create-modal .seg-toggle button.active { background: #e7b94d; color: #35270a; }
#table-create-modal .modal-card {
  background: linear-gradient(180deg, #fffdf6, #f7f0de); color: #29241f;
  border-color: rgba(41,36,32,.12);
}
#table-create-modal h2 { color: #29241f; }
#table-create-modal .muted, #table-create-modal .tc-field-label { color: #6f685c; }
#table-create-modal input {
  width: 100%; background: #fffdf6; color: #29241f; border-color: rgba(41,36,32,.18);
}
#table-create-modal input::placeholder { color: #a49b8d; }
#table-create-modal input:focus { border-color: #1d5c3a; }
#table-create-modal .btn { background: #fffdf6; color: #29241f; border-color: rgba(41,36,32,.18); box-shadow: 0 1px 2px rgba(41,36,32,.06); }
#table-create-modal .btn.ghost { background: transparent; box-shadow: none; }
#table-create-modal .btn.gold {
  background: linear-gradient(180deg, #f4d876 0%, #dfb43e 48%, #c9911a 100%); color: #3b2805; border-color: #aa7613;
  text-shadow: 0 1px 0 rgba(255,250,220,.65); box-shadow: 0 2px 4px rgba(117,78,13,.16), inset 0 1px 0 rgba(255,255,255,.48);
}
#table-create-modal .btn.gold:hover {
  background: linear-gradient(180deg, #ffe89b 0%, #edc653 48%, #d8a128 100%); border-color: #bf871a;
  box-shadow: 0 0 0 3px rgba(246,213,129,.25), 0 0 22px rgba(230,179,61,.56), 0 6px 14px rgba(111,73,18,.16), inset 0 1px 0 rgba(255,255,255,.62);
}
#confirm-modal .modal-card {
  background: linear-gradient(180deg, #fffdf6, #f7f0de); color: #29241f;
  border-color: rgba(41,36,32,.12);
}
#confirm-modal h2 { color: #29241f; }
#confirm-modal .muted { color: #6f685c; }
#confirm-modal .btn.ghost { background: transparent; color: #29241f; border-color: rgba(41,36,32,.18); }
#confirm-modal .btn.danger { color: #b5402f; border-color: rgba(181,64,47,.45); background: rgba(181,64,47,.05); }
body.ui-dark #confirm-modal .btn.danger { color: #ff9a8a; border-color: rgba(255,120,100,.4); background: rgba(255,120,100,.07); }
#table-invite-modal .modal-card {
  background: linear-gradient(180deg, #fffdf6, #f7f0de); color: #29241f;
  border-color: rgba(41,36,32,.12);
}
#table-invite-modal h2 { color: #29241f; }
#table-invite-modal .muted { color: #6f685c; }
#table-invite-modal .invite-friend-list { display: flex; flex-direction: column; gap: 7px; max-height: 320px; overflow: auto; margin-top: 16px; }
#table-invite-modal .social-person { background: rgba(41,36,32,.035); border-color: rgba(41,36,32,.08); color: #29241f; }
#table-invite-modal .social-person-info small, #table-invite-modal .social-empty { color: #6f685c; }
#table-invite-modal .social-avatar { background: radial-gradient(circle at 32% 28%, #ece0c6, #d8caa8 70%); border-color: rgba(41,36,32,.18); }
#table-invite-modal .btn { background: #fffdf6; color: #29241f; border-color: rgba(41,36,32,.18); box-shadow: 0 1px 2px rgba(41,36,32,.06); }
#table-invite-modal .btn.gold {
  background: linear-gradient(180deg, #f4d876 0%, #dfb43e 48%, #c9911a 100%); color: #3b2805; border-color: #aa7613;
  text-shadow: 0 1px 0 rgba(255,250,220,.65); box-shadow: 0 2px 4px rgba(117,78,13,.16), inset 0 1px 0 rgba(255,255,255,.48);
}
#table-invite-modal .btn.gold:hover {
  background: linear-gradient(180deg, #ffe89b 0%, #edc653 48%, #d8a128 100%); border-color: #bf871a;
  box-shadow: 0 0 0 3px rgba(246,213,129,.25), 0 0 22px rgba(230,179,61,.56), 0 6px 14px rgba(111,73,18,.16), inset 0 1px 0 rgba(255,255,255,.62);
}
.table-invite-row .social-avatar { cursor: default; }
.bracket { display: flex; gap: 30px; margin-top: 14px; overflow-x: auto; padding-bottom: 8px; }
.bracket-round { display: flex; flex-direction: column; gap: 14px; justify-content: space-around; }
.bracket-match { background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 12px; min-width: 170px; border: 1px solid var(--line); }
.bracket-match .p { padding: 3px 0; }
.bracket-match .p.win { color: var(--gold); font-weight: 700; }

/* ============ GAME ============ */
#screen-game { display: flex; }
.table-wrap { display: flex; flex-direction: column; width: 100%; height: 100%; }

.game-header {
  display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--panel-line); backdrop-filter: blur(10px);
}
.gh-brand { display: flex; align-items: baseline; gap: 10px; min-width: 200px; }
.gh-sub { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; }
.gh-table { flex: 1; text-align: center; }
.gh-table b { font-size: 1rem; }
#btn-invite .invite-code {
  color: var(--gold-hi); font-family: ui-monospace, monospace;
  letter-spacing: .08em; margin-left: 5px; font-weight: 700;
}
.spectator-banner {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  color: #dcecff; background: rgba(61,111,150,.2); border: 1px solid rgba(127,178,217,.38);
  font-size: .72rem; font-weight: 800; white-space: nowrap;
}
.spectator-banner span { color: #a9c9e2; font-weight: 600; }
.gh-actions { display: flex; gap: 8px; min-width: 200px; justify-content: flex-end; }

.game-main {
  flex: 1; display: grid; grid-template-columns: 1fr 330px; gap: 16px;
  padding: 16px 18px 10px; min-height: 0;
}
.felt-zone { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#screen-game.spectator-mode .my-hand-wrap { display: none; }
#screen-game.spectator-mode .felt-zone { padding-bottom: 4px; }
#screen-game.spectator-mode .quick-chat,
#screen-game.spectator-mode .chat-compose,
#screen-game.spectator-mode .emoji-tray { display: none; }

.felt {
  position: relative; flex: 1; min-height: 300px;
  background:
    radial-gradient(ellipse 62% 55% at 50% 42%, rgba(255, 236, 170, .10), transparent 70%),
    radial-gradient(ellipse at 50% 42%, var(--felt-hi) 0%, var(--felt) 48%, var(--felt-lo) 100%);
  border-radius: 34px;
  border: 1px solid rgba(230,179,61,.28);
  box-shadow:
    inset 0 0 90px rgba(0, 20, 8, .65),
    inset 0 0 0 6px rgba(0, 0, 0, .22),
    var(--shadow);
}
.felt-ring {
  position: absolute; inset: 12%; border-radius: 50%;
  border: 1.5px dashed rgba(255, 245, 214, .10); pointer-events: none;
}

.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 3; }
/* Empty chair while seated: tap it to invite a friend */
.seat.invite-chair { cursor: pointer; }
.seat.invite-chair .avatar {
  border-style: dashed; border-color: rgba(230,179,61,.55);
  background: radial-gradient(circle at 35% 28%, #3c3a24, #23200f 72%);
  font-size: 1.1rem;
}
.seat.invite-chair:hover .avatar { border-color: #f6d581; box-shadow: 0 0 18px rgba(230,179,61,.5); }
.seat.invite-chair .prole { color: #f6d581; }
.seat.open-chair { cursor: pointer; z-index: 5; }
.seat.open-chair .avatar {
  border-color: #f6d581; background: radial-gradient(circle at 35% 28%, #6c5926, #2d260f 72%);
  box-shadow: 0 0 0 4px rgba(230,179,61,.14), 0 0 22px rgba(230,179,61,.58);
  animation: openChairPulse 1.8s ease-in-out infinite;
}
.seat.open-chair .pname { color: #fff1b5; border-color: rgba(230,179,61,.62); }
.seat.open-chair .prole { color: #f6d581; font-weight: 800; }
.seat.open-chair:hover .avatar { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 5px rgba(230,179,61,.18), 0 0 30px rgba(246,213,129,.78); }
@keyframes openChairPulse { 50% { box-shadow: 0 0 0 6px rgba(230,179,61,.1), 0 0 30px rgba(230,179,61,.72); } }
.seat-top { top: 14px; left: 50%; transform: translateX(-50%); }
.seat-left { left: 18px; top: 50%; transform: translateY(-72%); }
.seat-right { right: 18px; top: 50%; transform: translateY(-72%); }
.seat-bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }
.avatar {
  width: 54px; height: 54px; border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 32% 28%, #47584f, #202b24 70%);
  border: 2.5px solid rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.55rem; transition: box-shadow .3s, border-color .3s;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.avatar-face { position: relative; z-index: 1; line-height: 1; }
.avatar-timer {
  position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px);
  overflow: visible; pointer-events: none; z-index: 4; transform: rotate(-90deg);
  filter: drop-shadow(0 0 5px rgba(230,179,61,.42));
}
.avatar-timer.hidden { display: none; }
.avatar-timer-track,
.avatar-timer-fill { fill: none; stroke-width: 6; }
.avatar-timer-track { stroke: rgba(255,255,255,.16); }
.avatar-timer-fill {
  stroke: var(--gold-hi); stroke-linecap: round;
  transition: stroke-dashoffset .25s linear, stroke .3s, filter .3s;
}
.avatar-timer.urgent .avatar-timer-fill {
  stroke: #ff6652; filter: drop-shadow(0 0 4px rgba(255,90,68,.85));
}
.seat.team-us .avatar { border-color: rgba(230,179,61,.55); }
.seat.team-them .avatar { border-color: rgba(127,178,217,.55); }
.seat.active .avatar {
  border-color: var(--gold-hi);
  box-shadow: 0 0 0 4px rgba(230,179,61,.22), 0 0 26px rgba(230,179,61,.65);
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 4px rgba(230,179,61,.20), 0 0 22px rgba(230,179,61,.5); }
  50% { box-shadow: 0 0 0 6px rgba(230,179,61,.30), 0 0 34px rgba(230,179,61,.8); }
}
.pname {
  font-size: .82rem; font-weight: 700; background: rgba(0,0,0,.45);
  padding: 3px 12px; border-radius: 14px; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.08);
}
.prole { font-size: .68rem; color: rgba(239,233,218,.62); letter-spacing: .04em; }
.seat.dealer .prole::after { content: " · dealer 🎴"; color: var(--gold-hi); }
.opp-hand { display: flex; margin-top: 3px; }
.opp-hand .mini-back {
  width: 27px; height: 39px; border-radius: 5px; margin-left: -14px;
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.16) 0 3px, transparent 3px 7px),
    linear-gradient(150deg, #17472e, #0d2e1c);
  border: 1px solid rgba(230,179,61,.5);
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
}
.turn-pill {
  background: linear-gradient(165deg, var(--gold-hi), var(--gold));
  color: #35270a; font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  padding: 4px 12px; border-radius: 20px; animation: pop .25s ease;
  box-shadow: 0 3px 14px rgba(230,179,61,.45);
}

.bid-bubble {
  position: absolute; z-index: 6; background: var(--cream); color: var(--ink);
  font-weight: 800; padding: 5px 13px; border-radius: 14px; font-size: .9rem;
  box-shadow: var(--shadow); white-space: nowrap; animation: pop .25s ease;
}
.seat-top .bid-bubble { top: 100%; margin-top: 6px; }
.seat-left .bid-bubble { left: 100%; margin-left: 8px; top: 30%; }
.seat-right .bid-bubble { right: 100%; margin-right: 8px; top: 30%; }
.seat-bottom .bid-bubble { bottom: 100%; margin-bottom: 6px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Trump badge — always know the contract at a glance */
.trump-badge {
  position: absolute; top: 16px; left: 18px; z-index: 4;
  display: flex; align-items: center; gap: 12px;
  background: rgba(10, 16, 12, .82); border: 1.5px solid var(--gold);
  border-radius: 16px; padding: 10px 16px; backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(0,0,0,.5), 0 0 18px rgba(230,179,61,.25);
  animation: pop .3s ease;
}
.trump-badge .tb-suit {
  width: 46px; height: 62px; border-radius: 8px;
  background: linear-gradient(170deg, var(--cream), var(--cream-lo));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--ink); box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.trump-badge .tb-suit.red { color: var(--red); }
.trump-badge .tb-suit.nt { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.trump-badge .tb-info { display: flex; flex-direction: column; }
.trump-badge .tb-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.trump-badge .tb-main { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--gold-hi); line-height: 1.15; }
.trump-badge .tb-who { font-size: .78rem; color: var(--text); }

.table-msg {
  position: absolute; top: 23%; left: 50%; transform: translateX(-50%);
  color: rgba(250, 245, 230, .9); font-weight: 700; font-size: 1.02rem; text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.7); pointer-events: none; z-index: 2;
  letter-spacing: .02em;
}

/* Trick area */
.trick-area { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
/* A completed trick must clear the player's fanned hand on its way to the
   winner. Raising the parent stacking context is what lets the flying cards'
   own z-index escape above .my-hand (z-index: 5). */
.trick-area.capturing { z-index: 6; }
.trick-card { position: absolute; left: 50%; top: 50%; transition: transform .32s cubic-bezier(.2,.8,.3,1), opacity .3s; filter: drop-shadow(0 10px 16px rgba(0,0,0,.45)); }
.trick-card[data-pos="0"] { transform: translate(-50%, -4%) rotate(2deg); }
.trick-card[data-pos="1"] { transform: translate(-138%, -58%) rotate(-9deg); }
.trick-card[data-pos="2"] { transform: translate(-50%, -112%) rotate(-3deg); }
.trick-card[data-pos="3"] { transform: translate(38%, -58%) rotate(9deg); }
.trick-card.swept { opacity: 0; transform: translate(-50%, -50%) scale(.25) rotate(20deg); }
/* Trick capture: the four cards gather and fly to the winner's trick pile.
   --fly-x/--fly-y are set in JS to the pile's real position, so the cards
   visibly travel to the person — like a hand pulling the trick in. */
.trick-card.flying {
  transition: transform .8s cubic-bezier(.35, .1, .3, 1), opacity .18s ease .66s;
  transform: translate(calc(-50% + var(--fly-x, 0px)), calc(-50% + var(--fly-y, 0px))) scale(.34) rotate(6deg);
  opacity: 0;
  z-index: 9;
}
.trick-card.winner-glow .card { box-shadow: 0 0 30px rgba(246,213,129,.95), 0 0 0 2px var(--gold-hi); }

/* Trick piles — captured tricks stack face-down beside each player */
.trick-pile {
  position: absolute; display: flex; pointer-events: none; z-index: 2;
}
.seat-top .trick-pile { left: calc(100% + 10px); top: 8px; }
.seat-bottom .trick-pile { left: calc(100% + 12px); bottom: 56px; }
/* Side piles sit below the Opponent label. The 13px offset centers the first
   26px card; subsequent cards fan inward (right from the left seat, left from
   the right seat) without covering either player's name. */
.seat-left .trick-pile,
.seat-right .trick-pile {
  left: calc(50% - 13px); right: auto; top: calc(100% + 8px);
}
.pile-card {
  width: 26px; height: 37px; border-radius: 4px; position: absolute; left: 0; top: 0;
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.16) 0 3px, transparent 3px 7px),
    linear-gradient(150deg, #17472e, #0d2e1c);
  border: 1px solid rgba(230,179,61,.5);
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.pile-card.newest { animation: pileLand .3s cubic-bezier(.2,.8,.3,1); }
@keyframes pileLand { from { transform: scale(1.7); opacity: .4; } }

/* "takes it" flag on the winner's seat */
.trick-flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 7;
  background: linear-gradient(165deg, var(--gold-hi), var(--gold)); color: #35270a;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; white-space: nowrap;
  padding: 4px 12px; border-radius: 20px; box-shadow: 0 4px 14px rgba(230,179,61,.5);
  animation: pop .25s ease; pointer-events: none;
}

/* Cards */
.card {
  width: var(--card-w); height: var(--card-h); border-radius: 10px; position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.014) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, var(--cream) 0%, #f2ecd9 70%, var(--cream-lo) 100%);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,.42), inset 0 0 0 1px rgba(0,0,0,.05);
  user-select: none; display: block;
}
.card.red { color: var(--red); }
.card .corner {
  position: absolute; top: 6px; left: 8px; font-weight: 700; font-size: 1.02rem;
  line-height: .95; text-align: center; font-family: var(--serif);
}
.card .corner.br { top: auto; left: auto; bottom: 6px; right: 8px; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.card .pip .face {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 700;
  width: 58%; height: 62%; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid currentColor; border-radius: 8px;
  background: linear-gradient(165deg, rgba(230,179,61,.14), rgba(230,179,61,.03));
}
.card.special-5 {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, #fff8e0, #ffe9ab);
  box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 16px rgba(230,179,61,.55), inset 0 0 0 1.5px var(--gold);
}
.card.special-3 {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, #e9e2d4, #cfc4b0);
  box-shadow: 0 4px 12px rgba(0,0,0,.42), inset 0 0 0 1.5px #6f6250;
}
.card-back {
  width: var(--card-w); height: var(--card-h); border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.14) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(246,213,129,.10) 0 4px, transparent 4px 9px),
    linear-gradient(150deg, #17472e, #0d2e1c);
  border: 2px solid rgba(230,179,61,.55); box-shadow: 0 4px 12px rgba(0,0,0,.45);
}

/* My hand */
.my-hand-wrap {
  position: relative; z-index: 5; min-height: calc(var(--card-h) + 26px); margin-top: -30px;
}
.my-hand {
  display: flex; justify-content: center; padding: 6px 10px 14px;
  min-height: calc(var(--card-h) + 26px); align-items: flex-end;
  position: relative; z-index: 5;
}
.my-hand .card {
  margin: 0 -16px; transition: transform .16s ease, box-shadow .16s ease, opacity .3s, filter .2s;
  transform-origin: bottom center;
}
.my-hand .card.playable { outline: 2px solid rgba(246,213,129,.85); outline-offset: -2px; cursor: pointer; }
.my-hand .card.playable:hover {
  transform: translateY(-26px) scale(1.04);
  box-shadow: 0 18px 34px rgba(0,0,0,.55), 0 0 22px rgba(230,179,61,.35); z-index: 10;
}
.my-hand .card.disabled { filter: brightness(.5) saturate(.6); }
.my-hand .card.dealing { animation: dealIn .45s cubic-bezier(.2,.8,.3,1) backwards; }
.my-hand .own-card-back { margin: 0 -16px; transform-origin: bottom center; }
.my-hand .own-card-back:nth-child(odd) { transform: translateY(2px) rotate(-1.5deg); }
.my-hand .own-card-back:nth-child(even) { transform: rotate(1.5deg); }
.pickup-hand-btn {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); z-index: 18;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  border: 1px solid var(--gold-lo); border-radius: 999px; padding: 9px 11px 9px 14px;
  color: #35270a; background: linear-gradient(155deg, var(--gold-hi), var(--gold));
  font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.52), 0 0 22px rgba(230,179,61,.42);
  animation: pickupPulse 1.8s ease-in-out infinite;
}
.pickup-hand-btn:hover { transform: translate(-50%, -54%); box-shadow: 0 12px 28px rgba(0,0,0,.55), 0 0 28px rgba(246,213,129,.58); }
.pickup-hand-btn:disabled { cursor: wait; filter: saturate(.65); }
.pickup-hand-icon { font-size: 1.15rem; line-height: 1; }
.pickup-countdown {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px;
  border-radius: 999px; padding: 0 6px; color: var(--gold-hi); background: rgba(28,21,5,.82);
  font-size: .72rem; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
@keyframes pickupPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.52), 0 0 16px rgba(230,179,61,.32); }
  50% { box-shadow: 0 8px 24px rgba(0,0,0,.52), 0 0 27px rgba(246,213,129,.58); }
}
@keyframes dealIn { from { transform: translateY(-340px) rotate(18deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Center panels */
.center-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(12, 18, 14, .95); border: 1px solid var(--panel-line); border-radius: 20px;
  padding: 22px 28px; text-align: center; box-shadow: var(--shadow); z-index: 20;
  display: flex; flex-direction: column; gap: 12px; min-width: 300px; backdrop-filter: blur(8px);
}
.center-panel h3 { color: var(--gold-hi); font-family: var(--serif); letter-spacing: .04em; }
.bid-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.bid-grid .btn { padding: 11px 0; font-size: 1.08rem; font-family: var(--serif); font-weight: 700; }
.nt-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.nt-toggle .x2 { color: var(--gold); }
.trump-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.suit-btn { font-size: 2.1rem; padding: 14px 0; background: linear-gradient(170deg, var(--cream), var(--cream-lo)); color: var(--ink); }
.suit-btn.red { color: var(--red); }
#waiting-seats { display: flex; flex-direction: column; gap: 6px; text-align: left; }

/* Side panel */
.side-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px;
  padding: 14px 16px; backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 10px;
}
.panel.grow { flex: 1; min-height: 0; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.panel-tag { font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--text); text-transform: none; }
.panel-tag.gold { color: var(--gold-hi); border: 1px solid rgba(230,179,61,.4); padding: 3px 10px; border-radius: 12px; }
.panel-tag.live { color: #7edb92; }
.team-row { display: flex; justify-content: space-between; align-items: center; }
.team-meta b { font-family: var(--serif); font-size: 1.02rem; letter-spacing: .03em; }
.team-names { display: block; color: var(--muted); font-size: .74rem; margin-top: 1px; }
.team-pts { font-family: var(--serif); font-size: 1.9rem; }
.team-row.us .team-pts { color: var(--gold); }
.team-row.them .team-pts { color: var(--sky); }
.progress { height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.2,.8,.3,1); width: 0; }
.progress-fill.us { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.progress-fill.them { background: linear-gradient(90deg, #3d6f96, var(--sky)); }
.hand-split { display: flex; justify-content: space-between; }
.hand-side { display: flex; flex-direction: column; }
.hand-side:last-child { text-align: right; }
.hs-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.hand-side b { font-family: var(--serif); font-size: 1.5rem; }
.hand-side:first-child b { color: var(--gold); }
.hand-side:last-child b { color: var(--sky); }
.seg-track { display: flex; gap: 4px; }
.seg { flex: 1; height: 7px; border-radius: 3px; background: rgba(255,255,255,.09); transition: background .3s; }
.seg.us { background: var(--gold); }
.seg.them { background: var(--sky); }
.special-row { display: flex; gap: 8px; }
.special-badge {
  flex: 1; text-align: center; font-size: .76rem; font-weight: 700; padding: 5px 0;
  border-radius: 10px; border: 1px solid var(--line); color: var(--muted); transition: all .3s;
}
.special-badge.five.claimed-us, .special-badge.three.claimed-us { border-color: var(--gold); color: var(--gold-hi); background: rgba(230,179,61,.1); }
.special-badge.five.claimed-them, .special-badge.three.claimed-them { border-color: var(--sky); color: var(--sky); background: rgba(127,178,217,.1); }

/* Chat / event feed */
.chat-log { flex: 1; overflow-y: auto; font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 7px; min-height: 90px; }
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.chat-line { display: flex; gap: 8px; align-items: baseline; }
.chat-time { color: #5d6b60; font-size: .68rem; min-width: 28px; }
.chat-line b { color: var(--text); }
.chat-line.sys .chat-text { color: #c8b98a; }
#panel-talk.talk-locked { border-color: rgba(230,179,61,.28); }
.panel-tag.locked { color: var(--gold-hi); }
.chat-view-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.talk-lock {
  color: var(--gold-hi); background: rgba(230,179,61,.08); border: 1px solid rgba(230,179,61,.22);
  border-radius: 10px; padding: 7px 9px; font-size: .75rem; line-height: 1.35;
}
.talk-ready {
  color: #a8e7b5; background: rgba(90,190,115,.08); border: 1px solid rgba(110,210,135,.22);
  border-radius: 10px; padding: 7px 9px; font-size: .75rem; line-height: 1.35;
}
.chat-compose { display: flex; align-items: stretch; gap: 7px; }
#chat-input { flex: 1; min-width: 0; padding: 8px 12px; font-size: .85rem; }
#chat-input:disabled { opacity: .58; cursor: not-allowed; }
.emoji-toggle {
  width: 38px; flex: 0 0 38px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--text); font-size: 1.05rem;
}
.emoji-tray {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 7px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.2);
}
.emoji-tray button {
  border: 0; border-radius: 8px; background: rgba(255,255,255,.05); padding: 5px 3px;
  font-size: 1.05rem; transition: background .15s, transform .15s;
}
.emoji-tray button:hover { background: rgba(230,179,61,.14); transform: translateY(-1px); }
.quick-chat .chip:disabled, .emoji-toggle:disabled { opacity: .38; cursor: not-allowed; }

/* Quick chat + achievements + profile */
.quick-chat { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--muted);
  font-size: .74rem; padding: 4px 10px; border-radius: 20px; transition: all .15s;
}
.chip:hover { color: var(--gold-hi); border-color: rgba(230,179,61,.5); }
.ach { display: inline-grid; place-items: center; filter: grayscale(1) brightness(.45); cursor: help; transition: filter .2s; }
.ach.got { filter: none; }
.ach-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ach-tile { grid-column: span 3; }
.ach-earned {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 14px; border-radius: 12px;
  background: rgba(230,179,61,.1); border: 1px solid rgba(230,179,61,.45);
  animation: pop .3s ease; font-size: .92rem;
}

/* Achievement badge language: one coherent medallion system instead of a
   cabinet of unrelated emoji. Family controls the centre mark; tier controls
   the metal, ring, and prestige. */
.achievement-medallion {
  --badge-accent: #d8b35f; --badge-dark: #352b1a; --badge-metal-1: #b97943; --badge-metal-2: #e2ad72;
  position: relative; isolation: isolate; display: inline-grid; place-items: center;
  width: 58px; height: 58px; flex: 0 0 58px; border-radius: 50%;
  color: #fff4d5; border: 3px solid var(--badge-metal-2);
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.22), transparent 24%),
    repeating-conic-gradient(from 8deg, rgba(255,255,255,.065) 0 7deg, transparent 7deg 15deg),
    radial-gradient(circle, color-mix(in srgb, var(--badge-accent), #172019 56%), var(--badge-dark) 72%);
  box-shadow: inset 0 0 0 3px rgba(7,11,8,.56), 0 2px 8px rgba(0,0,0,.38), 0 0 0 1px var(--badge-metal-1);
}
.achievement-medallion::before { content: ""; position: absolute; inset: 6px; border: 1px solid color-mix(in srgb, var(--badge-metal-2), transparent 35%); border-radius: 50%; }
.achievement-medallion i { position: relative; z-index: 1; color: #fff5d7; font: 900 .88rem/1 var(--serif); letter-spacing: -.03em; text-shadow: 0 2px 5px rgba(0,0,0,.7); }
.achievement-medallion i.badge-art { font:normal 1.42rem/1 system-ui,"Apple Color Emoji","Segoe UI Emoji"; filter:drop-shadow(0 2px 4px rgba(0,0,0,.56)); }
.achievement-medallion > b {
  position:absolute; z-index:2; left:-3px; top:-2px; min-width:20px; height:17px; display:grid; place-items:center;
  border-radius:9px; color:#fff; background:rgba(10,12,16,.78); border:1px solid color-mix(in srgb,var(--badge-metal-2),transparent 28%);
  font:900 .48rem/1 var(--sans); box-shadow:0 2px 5px rgba(0,0,0,.32);
}
.achievement-medallion em {
  position: absolute; z-index: 2; right: -3px; bottom: -2px; min-width: 21px; height: 18px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 9px; color: #21190b; background: linear-gradient(180deg, var(--badge-metal-2), var(--badge-metal-1));
  border: 1px solid rgba(255,255,255,.35); box-shadow: 0 2px 6px rgba(0,0,0,.38); font: 950 .53rem/1 var(--sans);
}
.achievement-medallion.tier-1 { --badge-metal-1: #9b5f35; --badge-metal-2: #d59a65; }
.achievement-medallion.tier-2 { --badge-metal-1: #8893a0; --badge-metal-2: #dbe1e8; }
.achievement-medallion.tier-3 { --badge-metal-1: #b27a13; --badge-metal-2: #f4d876; box-shadow: inset 0 0 0 3px rgba(7,11,8,.56), 0 2px 9px rgba(0,0,0,.4), 0 0 16px rgba(230,179,61,.28); }
.achievement-medallion.tier-4 { --badge-metal-1: #d29b22; --badge-metal-2: #fff2ad; border-width: 4px; box-shadow: inset 0 0 0 3px rgba(7,11,8,.56), 0 3px 10px rgba(0,0,0,.46), 0 0 0 2px rgba(246,213,129,.17), 0 0 24px rgba(246,213,129,.46); }
.achievement-medallion.family-five { --badge-accent: #b83e35; --badge-dark: #3b1717; }
.achievement-medallion.family-three { --badge-accent: #52667f; --badge-dark: #101a27; }
.achievement-medallion.family-bid, .achievement-medallion.family-notrump, .achievement-medallion.family-perfect { --badge-accent: #6c4e8e; --badge-dark: #21152f; }
.achievement-medallion.family-victory, .achievement-medallion.family-rating, .achievement-medallion.family-streak, .achievement-medallion.family-comeback { --badge-accent: #a64835; --badge-dark: #341813; }
.achievement-medallion.family-trophy { --badge-accent: #d19b25; --badge-dark: #3c2b0f; }
.achievement-medallion.family-visits, .achievement-medallion.family-member, .achievement-medallion.family-fairplay { --badge-accent: #3e805b; --badge-dark: #14291d; }
/* Tier is the dominant material. The centre mark still tells the achievement
   family, but the whole medal now reads bronze, silver, gold, or platinum at
   a glance instead of inheriting clubhouse green. */
.achievement-medallion.tier-1 {
  --badge-accent: #b96f43; --badge-dark: #3b1b10; --badge-metal-1: #854525; --badge-metal-2: #e2a273;
  background: radial-gradient(circle at 31% 24%, #f1bf91, transparent 18%), repeating-conic-gradient(from 8deg, rgba(255,255,255,.07) 0 7deg, transparent 7deg 15deg), radial-gradient(circle, #a85f37, #35170d 74%);
}
.achievement-medallion.tier-2 {
  --badge-accent: #aeb9c8; --badge-dark: #26303c; --badge-metal-1: #737f8f; --badge-metal-2: #f2f6fb;
  background: radial-gradient(circle at 31% 24%, #fff, transparent 18%), repeating-conic-gradient(from 8deg, rgba(255,255,255,.1) 0 7deg, transparent 7deg 15deg), radial-gradient(circle, #9ca8b8, #222b36 74%);
}
.achievement-medallion.tier-3 {
  --badge-accent: #e9b52e; --badge-dark: #3e2908; --badge-metal-1: #9f6508; --badge-metal-2: #ffe58b;
  background: radial-gradient(circle at 31% 24%, #fff6bf, transparent 18%), repeating-conic-gradient(from 8deg, rgba(255,255,255,.11) 0 7deg, transparent 7deg 15deg), radial-gradient(circle, #d69a13, #352104 74%);
}
.achievement-medallion.tier-4 {
  --badge-accent: #dff8ff; --badge-dark: #1b1931; --badge-metal-1: #8d98ae; --badge-metal-2: #f4fdff;
  background: radial-gradient(circle at 31% 24%, #fff, transparent 17%), conic-gradient(from 35deg, #dff8ff, #b9b5f4, #fff1b8, #b8edff, #ead3ff, #dff8ff);
  color: #151426; border-color: #effcff;
  box-shadow: inset 0 0 0 4px rgba(29,27,52,.72), 0 3px 10px rgba(0,0,0,.46), 0 0 0 2px rgba(223,248,255,.24), 0 0 28px rgba(192,220,255,.62);
}
.achievement-medallion.tier-4::before { border-color: rgba(35,31,63,.42); }
.achievement-medallion.tier-4 i { color: #fff; text-shadow: 0 1px 5px #343054, 0 0 12px rgba(255,255,255,.85); }
.achievement-medallion.small { width: 42px; height: 42px; flex-basis: 42px; border-width: 2px; }
.achievement-medallion.small::before { inset: 4px; }
.achievement-medallion.small i { font-size: .67rem; }
.achievement-medallion.small i.badge-art { font-size:1.05rem; }
.achievement-medallion.small > b { min-width:15px; height:13px; font-size:.38rem; }
.achievement-medallion.small em { min-width: 17px; height: 14px; font-size: .44rem; }
.achievement-medallion.tiny { width: 30px; height: 30px; flex-basis: 30px; border-width: 2px; }
.achievement-medallion.tiny::before { inset: 3px; }
.achievement-medallion.tiny i { font-size: .52rem; }
.achievement-medallion.tiny i.badge-art { font-size:.78rem; }
.achievement-medallion.tiny > b { min-width:13px; height:11px; font-size:.32rem; }
.achievement-medallion.tiny em { min-width: 14px; height: 12px; right: -4px; font-size: .38rem; }
.achievement-medallion.hero-medallion { width: 94px; height: 94px; flex-basis: 94px; }
.achievement-medallion.hero-medallion i { font-size: 1.3rem; }
.achievement-medallion.hero-medallion i.badge-art { font-size:2.5rem; }
.achievement-medallion.hero-medallion > b { min-width:28px; height:22px; font-size:.62rem; }
.achievement-medallion.hero-medallion em { min-width: 29px; height: 23px; font-size: .63rem; }

/* Achievement unlock celebration */
.achievement-celebration {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; overflow: hidden; padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(230,179,61,.2), transparent 32%),
    rgba(4, 9, 6, .86);
  backdrop-filter: blur(9px);
  animation: unlockBackdropIn .28s ease both;
  perspective: 1400px;
}
.achievement-celebration::before, .achievement-celebration::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 150px; height: 150px;
  border: 3px solid rgba(246,213,129,.6); border-radius: 50%; opacity: 0; pointer-events: none;
  animation: unlockShockwave 1.25s .55s ease-out both;
}
.achievement-celebration::after { animation-delay: .72s; border-width: 1px; }
.achievement-celebration.leaving { animation: unlockBackdropOut .24s ease both; }
.unlock-card {
  position: relative; isolation: isolate; width: min(500px, 94vw); overflow: hidden;
  padding: 44px 44px 36px; text-align: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(246,213,129,.14), transparent 38%),
    linear-gradient(155deg, rgba(27,43,33,.98), rgba(11,20,14,.99));
  border: 1px solid rgba(246,213,129,.72); border-radius: 28px;
  box-shadow: 0 28px 90px rgba(0,0,0,.72), 0 0 0 5px rgba(230,179,61,.08), 0 0 54px rgba(230,179,61,.24);
  transform-style: preserve-3d;
  animation: unlockCardIn 1.05s cubic-bezier(.16,.92,.24,1.14) both;
}
.unlock-card::after {
  content: "5\2665   3\2660"; position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center; border-radius: inherit;
  color: var(--gold-hi); font-family: var(--serif); font-size: 3.2rem; font-weight: 800; letter-spacing: .13em;
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.11) 0 5px, transparent 5px 12px),
    linear-gradient(145deg, #1d5135, #0a2014);
  border: 5px double rgba(246,213,129,.72); box-shadow: inset 0 0 45px rgba(0,0,0,.55);
  backface-visibility: hidden; transform: rotateY(180deg);
  text-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.unlock-card > * { backface-visibility: hidden; }
.achievement-celebration.leaving .unlock-card { animation: unlockCardOut .22s ease both; }
.unlock-glow {
  position: absolute; z-index: -1; width: 310px; height: 310px; left: 50%; top: -116px;
  transform: translateX(-50%); border-radius: 50%; opacity: .42;
  background: repeating-conic-gradient(from 0deg, rgba(246,213,129,.28) 0deg 5deg, transparent 5deg 18deg);
  animation: unlockRays 14s linear infinite;
}
.unlock-sparkles span { position: absolute; color: var(--gold-hi); text-shadow: 0 0 12px var(--gold); animation: unlockTwinkle 1.15s ease-in-out infinite alternate; }
.unlock-sparkles span:nth-child(1) { left: 18%; top: 22%; font-size: 1.2rem; }
.unlock-sparkles span:nth-child(2) { right: 16%; top: 34%; font-size: .72rem; animation-delay: .3s; }
.unlock-sparkles span:nth-child(3) { right: 24%; top: 15%; font-size: 1rem; animation-delay: .6s; }
.unlock-card .eyebrow { display: block; margin-bottom: 15px; color: var(--gold-hi); }
.unlock-icon {
  display: grid; place-items: center; width: 116px; height: 116px; margin: 0 auto 18px;
  border-radius: 50%; padding: 8px;
  background: radial-gradient(circle at 35% 28%, #405b49, #18271d 68%);
  border: 3px solid var(--gold-hi);
  box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 7px rgba(230,179,61,.14), 0 12px 34px rgba(0,0,0,.52), 0 0 28px rgba(230,179,61,.34);
  animation: unlockMedalIn .72s .66s cubic-bezier(.18,1.5,.3,1) both;
}
.unlock-card h2 { margin: 0; color: var(--cream); font-family: var(--serif); font-size: 2.2rem; line-height: 1.08; animation: unlockCopyIn .45s .82s ease both; }
.unlock-card p { max-width: 34ch; margin: 9px auto 13px; color: var(--text); font-size: 1rem; }
.unlock-category {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  color: var(--gold-hi); background: rgba(230,179,61,.1); border: 1px solid rgba(230,179,61,.3);
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.unlock-more { min-height: 20px; margin: 12px 0 4px; color: var(--muted); font-size: .75rem; }

/* ---- Achievement tiers: the medal ring tells you what class of badge this is ---- */
#achievement-celebration[data-tier="1"] .unlock-icon { border-color: #c98d4e; box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 7px rgba(201,141,78,.16), 0 12px 34px rgba(0,0,0,.52), 0 0 22px rgba(201,141,78,.3); }
#achievement-celebration[data-tier="2"] .unlock-icon { border-color: #ccd3dd; box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 7px rgba(204,211,221,.15), 0 12px 34px rgba(0,0,0,.52), 0 0 24px rgba(204,211,221,.32); }
#achievement-celebration[data-tier="4"] .unlock-icon {
  border-color: #fff3c4;
  box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 8px rgba(246,213,129,.22), 0 12px 34px rgba(0,0,0,.52), 0 0 46px rgba(246,213,129,.65);
}

/* The complete unlock scene changes material with the tier. */
#achievement-celebration[data-tier="1"] {
  background: radial-gradient(circle at 50% 43%, rgba(193,111,65,.34), transparent 35%), rgba(18,7,3,.91);
}
#achievement-celebration[data-tier="1"] .unlock-card {
  background: radial-gradient(circle at 50% 8%, rgba(226,162,115,.25), transparent 40%), linear-gradient(155deg, #4a2517, #1b0c07 78%);
  border-color: #d88f5e; box-shadow: 0 28px 90px rgba(0,0,0,.76), 0 0 0 5px rgba(185,111,67,.1), 0 0 62px rgba(185,111,67,.35);
}
#achievement-celebration[data-tier="2"] {
  background: radial-gradient(circle at 50% 43%, rgba(192,210,234,.3), transparent 36%), rgba(5,9,15,.92);
}
#achievement-celebration[data-tier="2"] .unlock-card {
  background: radial-gradient(circle at 50% 8%, rgba(238,247,255,.24), transparent 40%), linear-gradient(155deg, #303b49, #111820 78%);
  border-color: #dce6f2; box-shadow: 0 28px 90px rgba(0,0,0,.76), 0 0 0 5px rgba(205,220,238,.1), 0 0 68px rgba(190,214,242,.36);
}
#achievement-celebration[data-tier="3"] {
  background: radial-gradient(circle at 50% 43%, rgba(255,197,55,.38), transparent 35%), rgba(13,8,1,.93);
}
#achievement-celebration[data-tier="3"] .unlock-card {
  background: radial-gradient(circle at 50% 5%, rgba(255,226,119,.3), transparent 42%), linear-gradient(155deg, #49330b, #171003 80%);
  border: 2px solid #f2c34d; box-shadow: 0 28px 90px rgba(0,0,0,.78), 0 0 0 6px rgba(242,195,77,.11), 0 0 88px rgba(242,177,42,.48);
}
#achievement-celebration[data-tier="4"] {
  background: radial-gradient(circle at 50% 43%, rgba(207,228,255,.38), transparent 32%), radial-gradient(circle at 34% 24%, rgba(205,174,255,.18), transparent 28%), rgba(4,4,12,.94);
}
#achievement-celebration[data-tier="4"] .unlock-card {
  background: radial-gradient(circle at 50% 2%, rgba(244,253,255,.28), transparent 38%), linear-gradient(155deg, #27263f, #0b0b17 80%);
  border: 2px solid #e8f8ff; box-shadow: 0 28px 100px rgba(0,0,0,.82), 0 0 0 6px rgba(205,226,255,.13), 0 0 110px rgba(192,218,255,.58), 0 0 55px rgba(211,174,255,.28);
}
#achievement-celebration[data-tier="1"] :is(.unlock-card .eyebrow,.unlock-category,.unlock-sparkles span) { color:#efb080; }
#achievement-celebration[data-tier="2"] :is(.unlock-card .eyebrow,.unlock-category,.unlock-sparkles span) { color:#edf5ff; }
#achievement-celebration[data-tier="3"] :is(.unlock-card .eyebrow,.unlock-category,.unlock-sparkles span) { color:#ffe17b; }
#achievement-celebration[data-tier="4"] :is(.unlock-card .eyebrow,.unlock-category,.unlock-sparkles span) { color:#eafaff; text-shadow:0 0 14px rgba(194,221,255,.78); }
#achievement-celebration[data-tier="1"] .unlock-category { background:rgba(185,111,67,.14); border-color:rgba(226,162,115,.46); }
#achievement-celebration[data-tier="2"] .unlock-category { background:rgba(207,224,243,.12); border-color:rgba(224,238,255,.44); }
#achievement-celebration[data-tier="3"] .unlock-category { background:rgba(236,176,35,.14); border-color:rgba(255,218,105,.5); }
#achievement-celebration[data-tier="4"] .unlock-category { background:linear-gradient(90deg,rgba(190,224,255,.15),rgba(217,186,255,.15)); border-color:rgba(228,244,255,.62); }
#achievement-celebration[data-tier="1"] .unlock-card .btn.gold { background:linear-gradient(#d99463,#9a512d); border-color:#efb080; color:#211008; }
#achievement-celebration[data-tier="2"] .unlock-card .btn.gold { background:linear-gradient(#f3f7fb,#aab6c5); border-color:#fff; color:#17202a; }
#achievement-celebration[data-tier="3"] .unlock-card .btn.gold { background:linear-gradient(#ffe787,#d4930d); border-color:#fff1ae; color:#281a02; }
#achievement-celebration[data-tier="4"] .unlock-card .btn.gold { background:linear-gradient(110deg,#f5fdff,#bcd7ff 38%,#e0c7ff 70%,#fff0b7); border-color:#fff; color:#171427; box-shadow:0 0 24px rgba(207,229,255,.5); }

/* The treasure-chest sequence: dim rattling medal winding up… then the burst */
#achievement-celebration.charging .unlock-icon {
  filter: brightness(.5) saturate(.55);
  animation: chargeRattle .16s linear infinite, chargeGlow 1.6s ease-in forwards;
}
#achievement-celebration.charging .unlock-card h2,
#achievement-celebration.charging .unlock-card p,
#achievement-celebration.charging .unlock-category,
#achievement-celebration.charging .unlock-more,
#achievement-celebration.charging .unlock-card .btn { animation: none; opacity: 0; }
#achievement-celebration.boom .unlock-card h2,
#achievement-celebration.boom .unlock-card p,
#achievement-celebration.boom .unlock-category,
#achievement-celebration.boom .unlock-more,
#achievement-celebration.boom .unlock-card .btn { animation: none; opacity: 1; }
.unlock-card h2, .unlock-card p, .unlock-category, .unlock-more, .unlock-card .btn { transition: opacity .35s ease .12s; }
#achievement-celebration.boom .unlock-icon {
  filter: none;
  animation: boomPop .55s cubic-bezier(.2, 1.6, .35, 1) both;
}
@keyframes chargeRattle {
  0% { transform: scale(.72) rotate(-2.2deg) translateX(-1px); }
  50% { transform: scale(.74) rotate(2.2deg) translateX(1px); }
  100% { transform: scale(.72) rotate(-2.2deg) translateX(-1px); }
}
@keyframes chargeGlow {
  from { box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 4px rgba(230,179,61,.08), 0 0 8px rgba(230,179,61,.15); }
  to { box-shadow: inset 0 0 0 5px rgba(5,10,7,.72), 0 0 0 10px rgba(246,213,129,.3), 0 0 62px rgba(246,213,129,.85); }
}
@keyframes boomPop {
  0% { transform: scale(.72); filter: brightness(2.4); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); filter: none; }
}
.unlock-card .btn { min-width: 150px; }
.achievement-confetti { position: absolute; inset: 0; pointer-events: none; }
.achievement-confetti i {
  position: absolute; left: 50%; top: 48%; width: 9px; height: 17px; border-radius: 2px;
  background: var(--confetti-color); opacity: 0;
  box-shadow: 0 0 6px color-mix(in srgb, var(--confetti-color), transparent 45%);
  animation: confettiBurst 1.55s var(--confetti-delay) cubic-bezier(.18,.78,.28,1) forwards;
}
.achievement-confetti i[data-shape="1"] { width: 10px; height: 10px; border-radius: 50%; }
.achievement-confetti i[data-shape="2"] { width: 15px; height: 6px; border-radius: 5px; }
@keyframes unlockBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes unlockBackdropOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes unlockCardIn {
  0% { opacity: 0; transform: translateY(46px) scale(.5) rotateY(180deg) rotateZ(-4deg); }
  12% { opacity: 1; }
  56% { transform: translateY(-8px) scale(1.08) rotateY(-14deg) rotateZ(1deg); }
  76% { transform: translateY(2px) scale(.97) rotateY(5deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes unlockCardOut { to { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes unlockMedalIn { 0% { opacity: 0; transform: scale(.15) rotate(-35deg); } 68% { transform: scale(1.18) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes unlockCopyIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes unlockRays { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes unlockTwinkle { from { opacity: .25; transform: scale(.72) rotate(-8deg); } to { opacity: 1; transform: scale(1.18) rotate(8deg); } }
@keyframes unlockShockwave { 0% { opacity: .85; transform: translate(-50%,-50%) scale(.25); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(5.2); } }
@keyframes confettiBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
  9% { opacity: 1; }
  76% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--confetti-x)), calc(-50% + var(--confetti-y))) scale(1) rotate(var(--confetti-rotation)); }
}
.avatar-grid { flex-wrap: wrap; max-width: 100%; }
.avatar-grid .swatch { width: 44px; height: 44px; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); flex: 0 0 auto; }
.prov { color: var(--muted); font-size: .8rem; margin-left: 2px; cursor: help; }

/* Profile page */
.profile-head { display: flex; align-items: center; gap: 20px; margin: 10px 0 6px; }
.profile-avatar {
  width: 86px; height: 86px; border-radius: 50%; font-size: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #47584f, #202b24 70%);
  border: 3px solid rgba(230,179,61,.55); box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.profile-id h1 { font-family: var(--serif); font-size: 2rem; }
.profile-customize { margin: 18px 0 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.profile-customize summary {
  list-style: none; cursor: pointer; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center;
}
.profile-customize summary::-webkit-details-marker { display: none; }
.profile-customize summary span:first-child { display: flex; flex-direction: column; gap: 2px; }
.profile-customize summary small { color: var(--muted); font-size: .75rem; font-weight: 400; }
.profile-customize .edit-label { color: var(--gold-hi); font-size: .78rem; font-weight: 700; }
.profile-customize[open] .edit-label::after { content: " · close"; color: var(--muted); }
.profile-customize-body { border-top: 1px solid var(--line); padding: 0 18px 20px; }
.achievement-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
.achievement-heading h2 { margin: 0; }
.achievement-heading .eyebrow { margin-bottom: 4px; }
.achievement-overview { color: var(--muted); font-size: .82rem; text-align: right; }
.ach-gallery { display: flex; flex-direction: column; gap: 22px; }
.ach-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.ach-group-head h3 { font-family: var(--serif); color: var(--cream); }
.ach-group-head span { color: var(--muted); font-size: .76rem; }
.ach-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ach-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-height: 82px;
  opacity:.34; filter:grayscale(.96) saturate(.15); transition:opacity .2s ease,filter .2s ease,border-color .2s ease;
}
.ach-card.got { opacity: 1; filter: none; }
.ach-card:not(.got) .achievement-medallion { filter:brightness(.62) grayscale(1); box-shadow:inset 0 0 0 3px rgba(7,11,8,.42),0 2px 7px rgba(0,0,0,.24); }
.ach-card:not(.got):hover { opacity:.5; filter:grayscale(.75) saturate(.4); }
.ach-card.got .achievement-medallion { transform:translateZ(0); }
.ach-card.got.tier-1 { border-color:rgba(207,132,81,.48); background:linear-gradient(105deg,rgba(185,111,67,.12),var(--panel) 48%); }
.ach-card.got.tier-2 { border-color:rgba(205,220,238,.5); background:linear-gradient(105deg,rgba(190,208,230,.13),var(--panel) 48%); }
.ach-card.got.tier-3 { border-color:rgba(242,195,77,.58); background:linear-gradient(105deg,rgba(230,179,61,.15),var(--panel) 48%); box-shadow:0 0 18px rgba(230,179,61,.08); }
.ach-card.got.tier-4 { border-color:rgba(223,244,255,.64); background:linear-gradient(105deg,rgba(195,222,255,.16),rgba(222,196,255,.09) 40%,var(--panel) 70%); box-shadow:0 0 22px rgba(195,222,255,.12); }
.ach-card .ach-icon { display: grid; place-items: center; flex: 0 0 auto; }
.ach-card .ach-copy { min-width: 0; flex: 1; }
.ach-card p { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.ach-card .ach-tier {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: .56rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; vertical-align: 2px;
}
.ach-card.tier-1 .ach-tier { color: #d8a06a; background: rgba(201,141,78,.1); border: 1px solid rgba(201,141,78,.4); }
.ach-card.tier-2 .ach-tier { color: #ccd3dd; background: rgba(204,211,221,.09); border: 1px solid rgba(204,211,221,.38); }
.ach-card.tier-3 .ach-tier { color: var(--gold-hi); background: rgba(230,179,61,.1); border: 1px solid rgba(230,179,61,.45); }
.ach-card.tier-4 .ach-tier { color: #effcff; background: linear-gradient(90deg,rgba(184,218,255,.18),rgba(218,190,255,.18)); border: 1px solid #dcefff; box-shadow: 0 0 12px rgba(195,222,255,.42); }
.ach-card .ach-state { margin-left: auto; color: var(--gold); }
.ach-progress { height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin-top: 7px; }
.ach-progress span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.ach-progress-label { color: var(--muted); font-size: .66rem; margin-top: 3px; }

/* Short-cycle achievements: honest weekly progress with no punitive streak. */
.weekly-panel {
  margin:22px 0 0; border:1px solid rgba(188,145,48,.34); border-radius:18px;
  background:radial-gradient(circle at 8% 0%,rgba(230,179,61,.13),transparent 32%),var(--panel);
  box-shadow:0 12px 36px rgba(35,29,15,.06);
}
.weekly-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; padding:16px 18px; cursor:pointer; list-style:none; }
.weekly-panel-head::-webkit-details-marker { display:none; }
.weekly-panel-head::after { content:'+'; align-self:center; color:var(--gold); font-size:1.25rem; font-weight:800; }
.weekly-panel[open] .weekly-panel-head::after { content:'−'; }
.weekly-panel-head h2 { margin:3px 0 2px; }
.weekly-panel-head p { color:var(--muted); font-size:.8rem; }
.weekly-panel-body { padding:0 18px 18px; }
.weekly-summary { min-width:105px; margin-left:auto; text-align:right; }
.weekly-summary strong { display:block; font-family:var(--serif); font-size:1.65rem; color:var(--gold-lo); }
.weekly-summary span { color:var(--muted); font-size:.65rem; }
.weekly-summary small { display:block; margin-top:3px; color:var(--gold); font-size:.62rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.weekly-challenge-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.weekly-challenge {
  position:relative; overflow:hidden; min-height:112px; padding:13px; border:1px solid var(--line); border-radius:13px;
  background:color-mix(in srgb,var(--panel) 82%,var(--bg));
}
.weekly-challenge.complete { border-color:rgba(214,167,55,.58); background:linear-gradient(145deg,rgba(245,207,108,.18),rgba(197,220,242,.08)),var(--panel); box-shadow:0 0 20px rgba(230,179,61,.1); }
.weekly-challenge-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.weekly-challenge-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; font-size:1.15rem; background:rgba(120,126,125,.1); filter:grayscale(.75); opacity:.65; }
.weekly-challenge.complete .weekly-challenge-icon { background:linear-gradient(145deg,#fff0aa,#c78d1d); filter:none; opacity:1; box-shadow:0 0 14px rgba(230,179,61,.3); }
.weekly-check { color:var(--muted); font-size:.68rem; font-weight:900; }
.weekly-challenge.complete .weekly-check { color:#9a6709; }
.weekly-challenge b { display:block; margin:9px 0 2px; font-size:.82rem; }
.weekly-challenge p { color:var(--muted); font-size:.68rem; min-height:31px; }
.weekly-progress { height:5px; margin-top:9px; overflow:hidden; border-radius:99px; background:rgba(110,115,112,.13); }
.weekly-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#ad7410,#efc75c); }
.weekly-progress-label { display:block; margin-top:4px; color:var(--muted); font-size:.61rem; text-align:right; }
.weekly-finale { display:flex; align-items:center; gap:11px; margin-top:12px; padding:11px 13px; border:1px dashed rgba(183,143,50,.4); border-radius:12px; }
.weekly-finale-medal { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:rgba(135,135,130,.1); filter:grayscale(1); opacity:.45; }
.weekly-finale > div { flex:1; display:flex; flex-direction:column; }
.weekly-finale small { color:var(--muted); font-size:.67rem; }
.weekly-finale > span:last-child { color:var(--muted); font-size:.72rem; font-weight:900; }
.weekly-finale.complete { border-style:solid; border-color:rgba(219,187,99,.62); background:linear-gradient(100deg,rgba(230,179,61,.14),rgba(195,220,246,.09)); }
.weekly-finale.complete .weekly-finale-medal { background:linear-gradient(145deg,#fff2a9,#c88e1f); filter:none; opacity:1; box-shadow:0 0 17px rgba(230,179,61,.34); }

@media (max-width:900px) { .weekly-challenge-list { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px) { .weekly-panel-head { flex-direction:column; } .weekly-summary { text-align:left; } .weekly-challenge-list { grid-template-columns:1fr; } }

/* Public player cards */
.player-link {
  appearance: none; border: 0; background: none; color: var(--text); padding: 4px 6px;
  border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.player-link:hover { color: var(--gold-hi); background: rgba(230,179,61,.1); }
.avatar.clickable { cursor: pointer; }
.avatar.clickable:hover { filter: brightness(1.12); }
.public-profile-card { position: relative; max-width: 820px; max-height: min(760px, 90vh); overflow-y: auto; text-align: left; }
.public-profile-close { position: absolute; right: 16px; top: 16px; z-index: 2; font-size: 1.25rem; }
.public-profile-loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); }
.public-profile-head { display: flex; align-items: center; gap: 18px; padding-right: 48px; margin-bottom: 18px; }
.public-profile-head h2 { margin: 2px 0 3px; font-size: 2rem; }
.public-profile-head .profile-avatar { flex: 0 0 auto; }
.stats-card.public-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.public-achievement-heading { margin-top: 4px; }
.public-achievement-heading h3 { font-family: var(--serif); font-size: 1.35rem; }
.public-achievements { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.public-achievement-badge {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 11px 13px;
  border: 1px solid rgba(230,179,61,.3); border-radius: 13px; background: rgba(230,179,61,.07);
}
.public-achievement-badge > span { flex: 0 0 auto; display: grid; place-items: center; }
.public-achievement-badge div { min-width: 0; }
.public-achievement-badge b, .public-achievement-badge small { display: block; }
.public-achievement-badge small { color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-profile-empty {
  grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 28px; color: var(--muted); background: rgba(255,255,255,.025); border: 1px dashed var(--line); border-radius: 14px;
}
.public-profile-empty:first-letter { font-size: 1.7rem; }

.table-empty { padding: 26px 16px; text-align: center; }
.table-empty .empty-mark { font-size: 1.8rem; margin-bottom: 6px; }
.table-empty b { display: block; color: var(--text); font-family: var(--serif); font-size: 1.1rem; }
.table-empty p { color: var(--muted); margin: 5px auto 12px; max-width: 46ch; }

/* 5♥ / 3♠ motif */
.card-duo { display: flex; justify-content: center; margin-bottom: 6px; }
.duo-card {
  width: 44px; height: 62px; border-radius: 7px;
  background: linear-gradient(170deg, var(--cream), var(--cream-lo));
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.05;
  color: var(--ink);
}
.duo-card.red { color: var(--red); }
.duo-card:first-child { transform: rotate(-8deg) translateX(4px); z-index: 1; }
.duo-card:last-child { transform: rotate(8deg); }

/* Hand recap — anchored to the table's top-right corner (mirrors the contract
   badge on the top-left), non-blocking so the final trick stays visible. */
.hand-toast {
  position: absolute; top: 12px; right: 14px; z-index: 6;
  width: 236px; max-width: 60%;
  background: rgba(10, 16, 12, .9); border: 1.5px solid var(--gold);
  border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(8px);
  box-shadow: 0 8px 26px rgba(0,0,0,.55), 0 0 18px rgba(230,179,61,.22);
  animation: slideInRight .4s cubic-bezier(.2,.85,.3,1);
}
.hand-toast.hidden { display: none; }
@keyframes slideInRight { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.hand-toast .ht-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.hand-toast .ht-heading { display: flex; flex-direction: column; gap: 1px; }
.hand-toast .ht-title { font-family: var(--serif); font-size: 1rem; }
.hand-toast .ht-hand-number { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.hand-toast .ht-verdict { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hand-toast .ht-verdict.made { color: #7edb92; }
.hand-toast .ht-verdict.failed { color: #ff9a8a; }
.hand-toast .ht-contract { color: var(--muted); font-size: .78rem; margin-bottom: 8px; }
.hand-toast .ht-contract b { color: var(--text); }
.hand-toast .ht-teams { display: flex; gap: 8px; }
.hand-toast .ht-team { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 6px; background: rgba(255,255,255,.04); border-radius: 10px; padding: 5px 4px; }
.hand-toast .ht-team.us { border: 1px solid rgba(230,179,61,.35); }
.hand-toast .ht-team .ht-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hand-toast .ht-team .ht-delta { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; }
.hand-toast .ht-team .ht-total { font-size: .68rem; color: var(--muted); }
.hand-toast .ht-note { margin-top: 6px; }
.hand-toast .ht-taker { color: var(--text); font-size: .74rem; padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hand-toast .ht-taker b { color: var(--gold-hi); }
.hand-toast .ht-taker.them b { color: #9fc3e2; }
.hand-toast .ht-review {
  margin-top: 7px; width: 100%; font-size: .72rem; padding: 5px 8px;
  background: rgba(230,179,61,.1); border-color: rgba(230,179,61,.4); color: var(--gold-hi);
}
.hand-toast .ht-review:hover { background: rgba(230,179,61,.2); }

/* ---- Support & administration ---- */
.support-page-head, .admin-topbar { display:flex; align-items:flex-end; justify-content:space-between; gap:28px; margin:20px 0 26px; }
.support-page-head > div, .admin-topbar > div:first-child { max-width:720px; }
.support-page-head h1, .admin-topbar h1 { margin:4px 0 7px; }
.support-page-head p, .admin-topbar p { color:var(--muted); }
.support-workspace { min-height:590px; display:grid; grid-template-columns:300px minmax(0,1fr); overflow:hidden; background:var(--panel); border:1px solid var(--line); border-radius:18px; box-shadow:0 14px 50px rgba(28,31,27,.06); }
.support-list-panel { border-right:1px solid var(--line); background:color-mix(in srgb,var(--panel) 80%,var(--bg)); }
.support-list-head { display:flex; justify-content:space-between; padding:18px 18px 13px; border-bottom:1px solid var(--line); }
.queue-count { color:var(--muted); font-size:.72rem; }
.support-list-item { width:100%; padding:15px 17px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.support-list-item:hover, .support-list-item.active { background:rgba(40,104,83,.08); }
.support-list-item strong, .support-list-item small { display:block; }
.support-list-item small { color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.support-detail { padding:26px; min-width:0; }
.support-empty, .admin-empty { height:100%; display:grid; place-content:center; text-align:center; color:var(--muted); }
.support-empty span, .admin-empty span { font-size:2rem; opacity:.5; }
.support-thread-head { display:flex; justify-content:space-between; gap:20px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.support-thread-head p { color:var(--muted); font-size:.78rem; margin-top:5px; }
.status-pill { display:inline-flex; align-items:center; height:25px; padding:0 9px; border-radius:999px; background:rgba(40,104,83,.1); color:var(--green); font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.status-pill.resolved { color:var(--muted); background:rgba(120,120,120,.1); }
.support-messages { display:flex; flex-direction:column; gap:12px; padding:20px 0; max-height:390px; overflow:auto; }
.support-message { max-width:78%; padding:12px 14px; border-radius:14px; background:var(--bg); border:1px solid var(--line); }
.support-message.mine, .support-message.staff { align-self:flex-end; background:rgba(40,104,83,.1); border-color:rgba(40,104,83,.18); }
.support-message.internal { align-self:stretch; max-width:none; border-style:dashed; background:rgba(230,179,61,.08); }
.support-message header { display:flex; justify-content:space-between; gap:18px; font-size:.68rem; color:var(--muted); margin-bottom:5px; }
.support-message p { white-space:pre-wrap; line-height:1.48; }
.support-reply { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:end; padding-top:15px; border-top:1px solid var(--line); }
.support-reply textarea { min-height:74px; resize:vertical; }
.form-modal-card { text-align:left; max-width:520px; }
.form-modal-card label { display:block; margin:14px 0 5px; font-size:.72rem; font-weight:800; color:var(--muted); }
.form-modal-card input, .form-modal-card select, .form-modal-card textarea { width:100%; }
.form-note { color:var(--muted); font-size:.72rem; line-height:1.45; margin-top:10px; }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:18px; }

.admin-console { max-width:1500px; margin-left:auto; margin-right:auto; }
.admin-live { display:flex; gap:15px; align-items:center; color:var(--muted); font-size:.78rem; }
.admin-live i { width:8px; height:8px; border-radius:50%; background:#2ba66a; box-shadow:0 0 0 5px rgba(43,166,106,.12); }
.admin-shell { min-height:720px; display:grid; grid-template-columns:210px minmax(0,1fr); background:var(--panel); border:1px solid var(--line); border-radius:20px; overflow:hidden; box-shadow:0 18px 65px rgba(25,32,27,.08); }
.admin-rail { padding:16px 10px; background:color-mix(in srgb,var(--panel) 75%,var(--bg)); border-right:1px solid var(--line); }
.admin-nav { width:100%; display:flex; align-items:center; justify-content:space-between; padding:10px 12px; margin-bottom:3px; border:0; border-radius:9px; background:transparent; color:var(--muted); font:inherit; font-size:.82rem; font-weight:700; text-align:left; cursor:pointer; }
.admin-nav:hover { background:rgba(40,104,83,.06); color:var(--text); }
.admin-nav.active { color:var(--green); background:rgba(40,104,83,.11); box-shadow:inset 3px 0 var(--green); }
.admin-nav-count { min-width:21px; padding:2px 6px; border-radius:999px; background:#b64a3a; color:#fff; font-size:.62rem; text-align:center; }
.admin-main { min-width:0; padding:30px; }
.admin-view-head { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:24px; }
.admin-view-head h2 { font-size:1.65rem; margin-bottom:3px; }
.admin-view-head p { color:var(--muted); }
.admin-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:24px; }
.admin-metric { min-height:128px; padding:17px; border:1px solid var(--line); border-radius:14px; background:var(--bg); color:var(--text); text-align:left; }
button.admin-metric { cursor:pointer; font:inherit; }
button.admin-metric:hover { border-color:rgba(40,104,83,.45); transform:translateY(-1px); }
.admin-metric span, .admin-metric small { display:block; color:var(--muted); font-size:.69rem; font-weight:700; }
.admin-metric strong { display:block; font-family:var(--serif); font-size:2.3rem; margin:7px 0 4px; }
.admin-metric.urgent strong { color:#a23c30; }
.admin-overview-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(250px,.75fr); gap:16px; }
.admin-card { padding:20px; border:1px solid var(--line); border-radius:14px; background:var(--bg); }
.admin-card-head { display:flex; justify-content:space-between; gap:20px; align-items:start; margin-bottom:13px; }
.kicker { display:block; color:var(--muted); font-size:.62rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; margin-bottom:4px; }
.text-button { border:0; background:transparent; color:var(--green); font-weight:800; cursor:pointer; }
.admin-priority-row { display:grid; grid-template-columns:9px 1fr auto; gap:11px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.admin-priority-row:last-child { border-bottom:0; }
.admin-priority-row i { width:8px; height:8px; border-radius:50%; background:#d59637; }
.admin-priority-row small { display:block; color:var(--muted); margin-top:2px; }
.admin-principles ul { margin:14px 0 0 18px; color:var(--muted); line-height:1.7; font-size:.8rem; }
.admin-toolbar { display:flex; gap:9px; margin-bottom:17px; }
.admin-toolbar input { flex:1; min-width:0; }
.admin-toolbar select { width:auto; min-width:130px; }
.admin-search-status { min-height:18px; margin:-9px 0 13px; color:var(--muted); font-size:.74rem; }
.admin-inbox-layout { min-height:540px; display:grid; grid-template-columns:310px minmax(0,1fr); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.admin-inbox-list { border-right:1px solid var(--line); overflow:auto; max-height:620px; }
.admin-inbox-item { width:100%; padding:14px 15px; text-align:left; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); cursor:pointer; }
.admin-inbox-item:hover,.admin-inbox-item.active { background:rgba(40,104,83,.08); }
.admin-inbox-item.unread strong::before { content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:#d59637; margin-right:7px; }
.admin-inbox-item small { display:block; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-inbox-detail { min-width:0; padding:22px; }
.admin-ticket-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.admin-ticket-tools select { width:auto; }
.admin-player-list,.admin-case-list,.admin-staff-list,.admin-activity-list { display:flex; flex-direction:column; gap:9px; }
.admin-player { display:grid; grid-template-columns:auto minmax(190px,1fr) auto; gap:13px; align-items:center; padding:14px 15px; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.admin-player-avatar { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:rgba(40,104,83,.09); font-size:1.35rem; }
.admin-player-copy { min-width:0; }
.admin-player-copy p { color:var(--muted); font-size:.74rem; margin-top:4px; }
.admin-role-badge { display:inline-flex; margin-left:7px; padding:2px 7px; border-radius:999px; font-size:.56rem; font-weight:900; letter-spacing:.08em; color:var(--green); background:rgba(40,104,83,.1); vertical-align:2px; }
.admin-player-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.admin-player-actions .btn { min-width:116px; }
.admin-case { padding:17px; border:1px solid var(--line); border-radius:13px; background:var(--bg); }
.admin-case-head { display:flex; justify-content:space-between; gap:20px; }
.admin-case-meta { color:var(--muted); font-size:.72rem; margin-top:5px; }
.admin-case-evidence { margin:12px 0; padding:12px; border-left:3px solid #d59637; background:rgba(213,150,55,.08); border-radius:0 8px 8px 0; }
.admin-case-actions { display:flex; gap:7px; flex-wrap:wrap; }
.admin-staff-row,.admin-log-row { display:flex; align-items:center; gap:12px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; background:var(--bg); }
.admin-staff-row .copy,.admin-log-row .copy { flex:1; }
.admin-staff-row small,.admin-log-row small { display:block; color:var(--muted); margin-top:2px; }
.admin-team-search { margin-bottom:24px; padding:18px; border:1px solid var(--line); border-radius:13px; background:var(--bg); }
.admin-team-search > div:first-child p { color:var(--muted); font-size:.78rem; margin:3px 0 13px; }
.admin-team-search .admin-staff-row { margin-top:8px; background:var(--panel); }
.admin-celebrations { position:relative; display:grid; grid-template-columns:repeat(3,minmax(180px,1fr)); gap:20px; padding:20px; border:1px solid var(--line); border-radius:14px; background:var(--bg); }
.admin-celebration-group { display:flex; flex-direction:column; gap:8px; }
.admin-celebration-group h4 { color:var(--muted); font-size:.65rem; letter-spacing:.1em; text-transform:uppercase; }
.admin-celebration-group .btn { width:100%; height:43px; padding:9px 10px; background:var(--panel); border-color:var(--line); color:var(--text); box-shadow:none; white-space:nowrap; font-size:.82rem; }
.admin-celebration-group .btn:hover { background:rgba(40,104,83,.08); border-color:rgba(40,104,83,.35); }
.admin-moment-stage { position:absolute; inset:0; pointer-events:none; overflow:hidden; border-radius:inherit; }
.admin-moment-stage .felt-moment { top:50%; }

.modal .admin-player-modal-card { width:min(760px,calc(100vw - 32px)); max-width:760px; max-height:88vh; overflow:auto; padding:0; text-align:left; }
.admin-player-modal-head { position:sticky; top:0; z-index:2; display:grid; grid-template-columns:auto 1fr auto; gap:13px; align-items:center; padding:20px 22px; border-bottom:1px solid rgba(255,255,255,.12); background:#101c17; }
.admin-player-modal-head .admin-player-avatar { background:rgba(255,255,255,.08); }
.admin-player-modal-head h2 { margin:2px 0; }
.admin-player-modal-head .btn.icon { min-width:38px; color:#fff; border-color:rgba(255,255,255,.18); }
.admin-player-status { display:flex; flex-wrap:wrap; gap:7px; padding:14px 22px; background:rgba(255,255,255,.035); border-bottom:1px solid rgba(255,255,255,.1); }
.admin-player-status span { padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.07); color:#cbd5cf; font-size:.68rem; }
.admin-player-sections { padding:5px 22px 22px; }
.admin-player-sections section { display:grid; grid-template-columns:minmax(190px,1fr) auto; gap:22px; align-items:center; padding:17px 0; border-bottom:1px solid rgba(255,255,255,.1); }
.admin-player-sections section:last-child { border-bottom:0; }
.admin-player-sections h3 { color:#fff; font-size:1rem; margin-bottom:3px; }
.admin-player-sections p { color:#9caaa3; font-size:.72rem; max-width:390px; }
.admin-section-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.admin-section-actions .btn { min-height:39px; white-space:nowrap; background:rgba(255,255,255,.06); color:#fff; border-color:rgba(255,255,255,.18); box-shadow:none; }
.admin-section-actions .btn:hover { background:rgba(255,255,255,.12); }
.admin-section-actions .btn:disabled { opacity:.35; cursor:not-allowed; }

@media (max-width: 980px) {
  .admin-shell { grid-template-columns:1fr; }
  .admin-rail { display:flex; overflow:auto; border-right:0; border-bottom:1px solid var(--line); }
  .admin-nav { width:auto; white-space:nowrap; }
  .admin-metrics { grid-template-columns:repeat(2,1fr); }
  .admin-overview-grid { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .support-page-head,.admin-topbar,.admin-view-head { align-items:flex-start; flex-direction:column; }
  .support-workspace,.admin-inbox-layout { grid-template-columns:1fr; }
  .support-list-panel,.admin-inbox-list { border-right:0; border-bottom:1px solid var(--line); max-height:230px; }
  .admin-main { padding:18px; }
  .admin-metrics { grid-template-columns:1fr 1fr; }
  .admin-player { grid-template-columns:auto 1fr; }
  .admin-player-actions { grid-column:1/-1; justify-content:flex-start; }
  .admin-celebrations { grid-template-columns:1fr; }
  .admin-player-sections section { grid-template-columns:1fr; gap:10px; }
  .admin-section-actions { justify-content:flex-start; }
  .admin-team-search .admin-staff-row { flex-wrap:wrap; }
}

/* Felt moments: on-felt celebration pops (card moments, made the bid) */
.felt-moment {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  z-index: 7; text-align: center; pointer-events: none;
  animation: momentIn .45s cubic-bezier(.2, 1.5, .4, 1);
}
.felt-moment.hidden { display: none; }
.felt-moment .fm-title {
  font-family: var(--serif); font-size: 1.85rem; font-weight: 700; color: #fff3c4;
  text-shadow: 0 2px 16px rgba(0,0,0,.65), 0 0 34px rgba(230,179,61,.55);
  white-space: nowrap;
}
.felt-moment .fm-sub {
  margin-top: 3px; font-size: .88rem; font-weight: 700; color: var(--gold-hi);
  text-shadow: 0 1px 8px rgba(0,0,0,.75);
}
.felt-moment.cheer .fm-title { font-size: 2.5rem; }
.felt-moment.cheer .fm-sub { font-size: 1rem; }
.fm-burst { position: absolute; inset: -20px; pointer-events: none; }
.fm-burst i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 2px;
  background: var(--gold-hi); opacity: 0;
  animation: fmBurst .95s ease-out var(--t) forwards;
}
.fm-burst i:nth-child(3n) { background: #fff7df; }
.fm-burst i:nth-child(4n) { background: #b3382c; border-radius: 50%; }
@keyframes fmBurst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(-10px); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-10px - var(--d))); }
}
@keyframes momentIn {
  from { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Trick review: the finished hand, trick by trick */
.trick-review-card { max-width: 560px; text-align: left; max-height: 86vh; display: flex; flex-direction: column; }
.trick-review-card h2 { margin-bottom: 14px; }
#trick-review-list { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 6px; }
.tr-trick { background: rgba(255,255,255,.035); border: 1px solid var(--panel-line); border-radius: 14px; padding: 10px 12px; }
.tr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: .78rem; }
.tr-head > span:first-child { color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }
.tr-winner { color: var(--gold-hi); font-weight: 600; }
.tr-cards { display: flex; gap: 10px; justify-content: space-between; }
.tr-play { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; border-radius: 10px; padding: 6px 2px 4px; }
.tr-play.tr-win { background: rgba(230,179,61,.12); box-shadow: inset 0 0 0 1.5px rgba(230,179,61,.55); }
.tr-play .card { position: relative; width: 46px; height: 66px; border-radius: 7px; flex: none; }
.tr-play .card .corner { font-size: .62rem; line-height: 1.05; top: 3px; left: 4px; }
.tr-play .card .corner.br { bottom: 3px; right: 4px; }
.tr-play .card .pip { font-size: 1.15rem; }
.tr-play .card .pip .face { font-size: 1.15rem; }
.tr-name { font-size: .62rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-play.tr-win .tr-name { color: var(--gold-hi); }

/* Name picker input: real letter case, not code styling */
#np-input { text-transform: none; letter-spacing: normal; font-family: var(--sans); }

/* Locked screen name (profile) */
.name-locked { display: flex; align-items: baseline; gap: 12px; margin: 4px 0; }
.name-locked b { font-family: var(--serif); font-size: 1.35rem; color: var(--gold-hi); }
.name-locked .lock { font-size: .8rem; color: var(--muted); }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(4,8,5,.68); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal-card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 22px;
  padding: 32px 38px; text-align: center; box-shadow: var(--shadow); max-width: 460px; width: 92%;
  animation: pop .25s ease; backdrop-filter: blur(12px);
}
.modal-card h2 { font-family: var(--serif); font-size: 1.7rem; margin-bottom: 10px; color: var(--text); }
.modal-card .made { color: #7edb92; }
.modal-card .failed { color: #ff9a8a; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 14px 0; text-align: center; }
.summary-grid .head { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.summary-grid .val { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.delta-pos { color: #7edb92; }
.delta-neg { color: #ff9a8a; }
.trophy { font-size: 3.6rem; }

/* Game results: a satisfying win, with a much larger championship moment. */
.game-result-modal { overflow: hidden; background: rgba(3,8,5,.82); backdrop-filter: blur(9px); }
.game-result-modal .modal-card {
  position: relative; isolation: isolate; overflow: visible; width: min(520px, 92vw); max-width: 520px;
  padding: 38px 40px 34px; border-color: rgba(230,179,61,.22);
}
.game-result-modal.victory .modal-card {
  border-color: rgba(230,179,61,.66);
  background: radial-gradient(circle at 50% 8%, rgba(230,179,61,.18), transparent 42%), var(--panel);
  box-shadow: 0 0 0 1px rgba(246,213,129,.15), 0 0 70px rgba(230,179,61,.24), var(--shadow);
  animation: resultCardIn .52s cubic-bezier(.18,.88,.28,1.18) both;
}
.game-result-modal.champion {
  background:
    radial-gradient(circle at 50% 42%, rgba(255,210,72,.3), transparent 25%),
    radial-gradient(circle at 30% 24%, rgba(187,218,255,.18), transparent 27%),
    radial-gradient(circle at 72% 72%, rgba(218,190,255,.14), transparent 30%),
    rgba(3,3,10,.94);
}
.game-result-modal.champion .modal-card {
  width: min(650px, 94vw); max-width: 650px; padding: 52px 54px 42px;
  border: 2px solid #f5e39a;
  background:
    radial-gradient(circle at 50% -4%, rgba(255,226,116,.3), transparent 40%),
    radial-gradient(circle at 18% 25%, rgba(190,221,255,.12), transparent 27%),
    linear-gradient(160deg, #191925, #080910 78%);
  box-shadow: 0 0 0 5px rgba(239,248,255,.11), 0 0 80px rgba(195,221,255,.24), 0 0 150px rgba(230,179,61,.42), 0 30px 100px rgba(0,0,0,.82);
  animation: championCardIn .78s cubic-bezier(.16,.9,.24,1.2) both;
}
.game-result-modal.champion .modal-card::before {
  content:""; position:absolute; inset:-10px; z-index:-1; border-radius:30px; padding:2px;
  background:conic-gradient(from var(--champion-spin,0deg),#fff5bd,#c9e7ff,#e5cbff,#ffe27a,#fff5bd);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  filter:blur(4px); opacity:.9; animation:championHalo 5s linear infinite;
}
.game-result-modal .result-kicker { display: block; margin-bottom: 6px; color: var(--gold-hi); font-size: .68rem; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
.result-reveal { position: relative; z-index: 2; }
.game-result-modal.revealed .result-reveal { animation: resultReveal .58s cubic-bezier(.16,.9,.24,1.16) both; }
.result-charge {
  display: none; position: relative; z-index: 4; min-height: 330px;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--gold-hi); cursor: pointer; user-select: none;
}
.game-result-modal.charging .result-charge { display: flex; }
.game-result-modal.charging .result-reveal { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.result-charge > span { font-size: .68rem; font-weight: 950; letter-spacing: .24em; text-transform: uppercase; }
.result-charge > b { font-family: var(--serif); font-size: 1.35rem; color: #fff3c4; }
.result-charge > small { color: var(--muted); font-size: .7rem; }
.result-charge-trophy {
  position: relative; display: grid; place-items: center; width: 118px; height: 118px;
  margin: 8px 0; border-radius: 50%; font-size: 4.4rem;
  filter: saturate(.3) brightness(.62) drop-shadow(0 12px 22px rgba(0,0,0,.55));
  animation: resultChargeLift var(--result-charge-ms) cubic-bezier(.18,.68,.2,1) both;
}
.result-charge-trophy::before, .result-charge-trophy::after {
  content: ""; position: absolute; inset: -8px; border: 2px solid rgba(246,213,129,.26); border-radius: 50%;
  animation: resultChargeRing .6s ease-in-out infinite alternate;
}
.result-charge-trophy::after { inset: -24px; border-width: 1px; animation-delay: -.2s; }
.game-result-modal.champion .result-charge { color:#fff0a8; }
.game-result-modal.champion .result-charge > b { color:#f3fbff; text-shadow:0 0 18px rgba(198,224,255,.55); }
.game-result-modal.champion .result-charge-trophy { font-size: 5.3rem; filter:saturate(.45) brightness(.66) drop-shadow(0 12px 22px rgba(0,0,0,.65)); }
.game-result-modal.champion .result-charge-trophy::before { border-color:rgba(255,224,112,.48); }
.game-result-modal.champion .result-charge-trophy::after { border-color:rgba(207,234,255,.42); }
.result-charge-track { width: min(280px, 75vw); height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); box-shadow: inset 0 1px 4px rgba(0,0,0,.4); }
.result-charge-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8c6515, #e6b33d, #fff3b2); box-shadow: 0 0 16px rgba(246,213,129,.7); animation: resultChargeFill var(--result-charge-ms) cubic-bezier(.22,.54,.24,1) both; }
.game-result-modal.charging .game-result-confetti i,
.game-result-modal.charging .game-result-firework i { visibility: hidden; animation-play-state: paused; }
.game-result-modal.boom::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,248,210,.92), rgba(246,213,129,.26) 22%, transparent 58%);
  animation: resultScreenFlash .72s ease-out both;
}
.game-result-modal .trophy { position: relative; z-index: 2; filter: drop-shadow(0 12px 20px rgba(0,0,0,.5)); animation: resultTrophy 1s .18s cubic-bezier(.2,.85,.25,1.2) both; }
.game-result-modal.champion .trophy { font-size: 6.4rem; filter:drop-shadow(0 14px 20px rgba(0,0,0,.65)) drop-shadow(0 0 30px rgba(255,210,64,.78)); }
.game-result-modal h2 { position: relative; z-index: 2; margin: 2px 0 9px; font-size: 2.3rem; color: var(--cream); }
.game-result-modal.champion .result-kicker { color:#effaff; text-shadow:0 0 14px rgba(195,222,255,.72); }
.game-result-modal.champion h2 {
  font-size:clamp(2.5rem,7vw,4.25rem); color:#fff0a6;
  background:linear-gradient(100deg,#fff7c7 8%,#e7b934 34%,#f5fbff 55%,#d8c6ff 75%,#fff0a0 94%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  text-shadow:0 8px 34px rgba(230,179,61,.22); filter:drop-shadow(0 0 16px rgba(213,231,255,.2));
}
.game-result-modal .result-sub { position: relative; z-index: 2; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.game-result-modal.champion .result-sub { color:#eef4fa; font-size:1.12rem; }
.game-result-modal.champion .result-next-milestone { border-color:rgba(219,235,255,.28); background:linear-gradient(100deg,rgba(229,191,60,.09),rgba(190,218,255,.08)); }
.game-result-modal.champion .result-actions .btn { border-color:rgba(224,239,255,.35); }
.result-rating { position: relative; z-index: 2; margin-top: 12px; }
.result-actions { position: relative; z-index: 2; margin-top: 22px; }
.result-next-milestone {
  position: relative; z-index: 2; margin: 16px auto 0; padding: 12px 14px 10px; max-width: 390px;
  border: 1px solid rgba(230,179,61,.22); border-radius: 14px; background: rgba(230,179,61,.06); text-align: left;
}
.result-milestone-copy { display: flex; align-items: center; gap: 11px; }
.result-milestone-copy > span { font-size: 1.65rem; }
.result-milestone-copy div { display: flex; flex-direction: column; min-width: 0; }
.result-milestone-copy small { color: var(--muted); font-size: .58rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.result-milestone-copy b { color: var(--gold-hi); font-size: .86rem; }
.result-milestone-copy p { color: var(--muted); font-size: .7rem; }
.result-milestone-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.result-milestone-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); box-shadow: 0 0 10px rgba(230,179,61,.35); }
.result-milestone-count { display: block; margin-top: 4px; color: var(--muted); font-size: .62rem; text-align: right; }
.result-rings { position: absolute; left: 50%; top: 35%; width: 20px; height: 20px; z-index: 0; pointer-events: none; }
.result-rings i { position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; border: 2px solid rgba(246,213,129,.35); border-radius: 50%; opacity: 0; animation: resultShockwave 1.6s .25s ease-out both; }
.result-rings i:nth-child(2) { animation-delay: .48s; }
.result-rings i:nth-child(3) { animation-delay: .72s; }
.game-result-confetti { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.game-result-confetti i {
  position: absolute; left: var(--x); top: -22px; width: var(--size); height: calc(var(--size) * 1.8); border-radius: 2px;
  background: var(--colour); opacity: 0; animation: resultConfettiFall 3.1s var(--delay) cubic-bezier(.2,.62,.35,1) both;
}
.game-result-modal.champion .game-result-confetti i { animation-duration: 4.2s; }
.game-result-firework { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.game-result-firework i {
  position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-radius: 50%; background: var(--colour);
  box-shadow: 0 0 12px var(--colour); opacity: 0; animation: resultFirework 1.75s var(--delay) cubic-bezier(.16,.72,.2,1) both;
}
.game-result-modal.champion .game-result-firework i { width: 9px; height: 9px; box-shadow: 0 0 18px var(--colour); animation-duration: 2.15s; }
@keyframes resultCardIn { from { opacity: 0; transform: scale(.72) translateY(24px) rotateX(10deg); } to { opacity: 1; transform: none; } }
@keyframes championCardIn { 0% { opacity: 0; transform: scale(.48) rotate(-4deg); } 68% { opacity: 1; transform: scale(1.045) rotate(1deg); } 100% { transform: none; } }
@property --champion-spin { syntax:"<angle>"; initial-value:0deg; inherits:false; }
@keyframes championHalo { to { --champion-spin:360deg; } }
@keyframes resultReveal { from { opacity: 0; transform: scale(.72) translateY(18px); } 72% { opacity: 1; transform: scale(1.025); } to { transform: none; } }
@keyframes resultChargeFill { from { width: 0; } to { width: 100%; } }
@keyframes resultChargeLift { 0% { transform: scale(.72); filter: saturate(.2) brightness(.45) drop-shadow(0 8px 18px rgba(0,0,0,.55)); } 72% { transform: scale(.9); filter: saturate(.75) brightness(.85) drop-shadow(0 10px 25px rgba(230,179,61,.28)); } 100% { transform: scale(1.08); filter: saturate(1.15) brightness(1.18) drop-shadow(0 0 34px rgba(246,213,129,.7)); } }
@keyframes resultChargeRing { from { opacity: .24; transform: scale(.94); } to { opacity: .72; transform: scale(1.05); } }
@keyframes resultScreenFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes resultTrophy { from { opacity: 0; transform: translateY(30px) scale(.35) rotate(-18deg); } 72% { opacity: 1; transform: translateY(-5px) scale(1.13) rotate(5deg); } to { transform: none; } }
@keyframes resultShockwave { 0% { opacity: .75; transform: translate(-50%,-50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(4.2); } }
@keyframes resultConfettiFall { 0% { opacity: 0; transform: translate3d(0,-30px,0) rotate(0deg); } 10% { opacity: 1; } 100% { opacity: .95; transform: translate3d(var(--drift),105vh,0) rotate(760deg); } }
@keyframes resultFirework { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.15); } 12% { opacity: 1; } 72% { opacity: 1; transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.25); } }

/* Settings */
.settings-card { text-align: left; max-width: 420px; }
.settings-card h2 { text-align: center; margin-bottom: 18px; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.setting-row label { font-weight: 600; font-size: .95rem; }
.setting-row input[type="range"] { width: 150px; accent-color: var(--gold); }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }
.swatch-row { display: flex; gap: 10px; }
.swatch {
  width: 40px; height: 28px; border-radius: 8px; border: 2px solid rgba(255,255,255,.2);
  transition: border-color .15s, transform .12s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.selected { border-color: var(--gold-hi); box-shadow: 0 0 10px rgba(230,179,61,.5); }
.swatch.membership-locked { opacity: .28; filter: grayscale(.75); cursor: not-allowed; }
.swatch.membership-locked:hover { transform: none; }
.swatch.felt-pine { background: radial-gradient(circle at 40% 35%, #2a7a4d, #113523); }
.swatch.felt-midnight { background: radial-gradient(circle at 40% 35%, #2b4e75, #101f33); }
.swatch.felt-oxblood { background: radial-gradient(circle at 40% 35%, #7e2f34, #381114); }
.swatch.felt-walnut { background: radial-gradient(circle at 40% 35%, #7a5230, #33200e); }
.swatch.felt-slate { background: radial-gradient(circle at 40% 35%, #4e6470, #223138); }
.swatch.felt-royal { background: radial-gradient(circle at 40% 35%, #6b4a9e, #2c1d47); }
.swatch.back-classic { background: repeating-linear-gradient(45deg, rgba(246,213,129,.3) 0 3px, transparent 3px 7px), linear-gradient(150deg, #17472e, #0d2e1c); }
.swatch.back-gold { background: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 3px, transparent 3px 7px), linear-gradient(150deg, #b8860b, #6f5410); }
.swatch.back-crimson { background: repeating-linear-gradient(45deg, rgba(246,213,129,.25) 0 3px, transparent 3px 7px), linear-gradient(150deg, #7a1f28, #4e1218); }
.swatch.back-navy { background: repeating-linear-gradient(45deg, rgba(200,211,224,.25) 0 3px, transparent 3px 7px), linear-gradient(150deg, #1d3a5f, #0e2036); }
.swatch.back-onyx { background: repeating-linear-gradient(45deg, rgba(246,213,129,.2) 0 3px, transparent 3px 7px), linear-gradient(150deg, #2a2a2e, #101014); }

/* Felt themes (body class) */
body.felt-midnight { --felt-hi: #35608f; --felt: #24466b; --felt-lo: #142c47; }
body.felt-oxblood { --felt-hi: #8f3a40; --felt: #6b262c; --felt-lo: #3a1114; }
body.felt-walnut { --felt-hi: #8a6038; --felt: #5b3a1e; --felt-lo: #2e1c0c; }
body.felt-slate { --felt-hi: #5b7480; --felt: #3d545e; --felt-lo: #1e2c33; }
body.felt-royal { --felt-hi: #7a55b5; --felt: #503678; --felt-lo: #291b42; }

/* Tournament felts — richer colours, one per tournament series */
body.felt-championship { --felt-hi: #2f965d; --felt: #1a6f41; --felt-lo: #0d3f24; }
body.felt-sapphire     { --felt-hi: #3070bd; --felt: #1c4e91; --felt-lo: #102a52; }
body.felt-crimson-cup  { --felt-hi: #b0454b; --felt: #841f2b; --felt-lo: #48111a; }
body.felt-amethyst     { --felt-hi: #8f52c0; --felt: #602f92; --felt-lo: #33184c; }

/* Tournament table dressing — gold championship trim + faint centre crest */
body.tournament-table .felt {
  border: 2px solid rgba(230,179,61,.6);
  box-shadow:
    inset 0 0 90px rgba(0, 16, 8, .6),
    inset 0 0 0 5px rgba(0, 0, 0, .2),
    inset 0 0 0 7px rgba(230,179,61,.22),
    0 0 44px rgba(230,179,61,.12), var(--shadow);
}
.felt-crest { display: none; }
body.tournament-table .felt-crest {
  display: flex; position: absolute; inset: 0; z-index: 0;
  flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center;
}
.felt-crest .crest-ring {
  width: 232px; height: 232px; border-radius: 50%; position: relative;
  border: 2px solid rgba(246,213,129,.55); display: grid; place-items: center;
  background: radial-gradient(circle, rgba(230,179,61,.2) 0%, rgba(230,179,61,.05) 55%, transparent 72%);
  box-shadow: inset 0 0 60px rgba(246,213,129,.22), 0 0 46px rgba(230,179,61,.28);
  animation: crestGlow 3.4s ease-in-out infinite;
}
.felt-crest .crest-ring::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid rgba(246,213,129,.22);
}
@keyframes crestGlow {
  0%, 100% { box-shadow: inset 0 0 60px rgba(246,213,129,.2), 0 0 40px rgba(230,179,61,.24); }
  50% { box-shadow: inset 0 0 70px rgba(246,213,129,.3), 0 0 60px rgba(230,179,61,.4); }
}
.felt-crest .crest-badge {
  font-size: 4.4rem; opacity: 1;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.4)) drop-shadow(0 0 18px rgba(246,213,129,.7));
}
.felt-crest .crest-label {
  margin-top: 14px; color: var(--gold-hi);
  font: 800 .78rem var(--sans); letter-spacing: .34em; text-transform: uppercase;
  text-shadow: 0 0 14px rgba(230,179,61,.6), 0 2px 4px rgba(0,0,0,.4);
}
.tournament-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: none; align-items: center; gap: 8px;
  background: linear-gradient(165deg, rgba(20,16,10,.9), rgba(12,10,6,.9));
  border: 1px solid rgba(230,179,61,.55); border-radius: 20px; padding: 6px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4), 0 0 18px rgba(230,179,61,.14);
  color: var(--gold-hi); font-size: .78rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
body.tournament-table .tournament-banner { display: flex; }
.tournament-banner .tb-round { color: var(--muted); font-weight: 600; }

/* ============ TOURNAMENT BRACKET (standings) ============ */
.bracket-board {
  display: flex; align-items: stretch; justify-content: center; gap: 6px;
  padding: 44px 30px; background:
    radial-gradient(760px 360px at 50% 0%, rgba(230,179,61,.09), transparent 70%),
    var(--panel);
  border: 1px solid var(--panel-line); border-radius: 20px; overflow-x: auto;
}
.bracket-col { display: flex; flex-direction: column; justify-content: space-around; gap: 22px; min-width: 168px; }
.bracket-col.center { min-width: 200px; justify-content: center; }
body.showcase-shot .lobby-main { max-width: 1200px; }
body.showcase-shot #tab-tournaments { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; }

/* tournament overview: live header, in-progress + pending on one screen */
.tourney-live-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 14px; flex-wrap: wrap; }
.tourney-live-head b { font: 700 1.35rem var(--serif); }
.live-tag { display: inline-flex; align-items: center; gap: 7px; color: #ff8a7a; font-size: .82rem; font-weight: 700; }
.live-tag i { width: 8px; height: 8px; border-radius: 50%; background: #ff5a44; animation: livePulse 1.5s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,68,.55); } 70% { box-shadow: 0 0 0 7px rgba(255,90,68,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,68,0); } }
.bracket-match { padding-top: 4px; }
.bracket-match.live { border-color: rgba(255,90,68,.5); box-shadow: 0 0 16px rgba(255,90,68,.15); margin-top: 8px; }
.bracket-match.pending-final { border-color: rgba(230,179,61,.45); background: rgba(230,179,61,.06); margin-top: 8px; }
.match-tag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-size: .56rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 10px; white-space: nowrap;
}
.match-tag.live { background: #ff5a44; color: #2a0f0b; }
.match-tag.final { background: linear-gradient(165deg, var(--gold-hi), var(--gold)); color: #35270a; }
.bracket-team.tbd { color: #5d6b60; font-style: italic; }
.tourney-upcoming { margin-top: 26px; }
.tourney-upcoming h2 { margin-bottom: 12px; }
.upcoming-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 18px; margin-bottom: 9px;
}
.upcoming-row .u-when { color: var(--muted); font-size: .85rem; }
.upcoming-row .u-fill { color: var(--muted); font-size: .82rem; }
.bracket-match {
  background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 11px;
  padding: 4px; display: flex; flex-direction: column; gap: 3px; position: relative;
}
.bracket-team {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 11px; border-radius: 8px; font-size: .88rem; color: var(--muted);
}
.bracket-team .bt-seed { color: #5d6b60; font-size: .68rem; width: 14px; flex: 0 0 14px; }
.bracket-team .bt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-team .bt-score { font-family: var(--serif); font-weight: 700; color: var(--text); }
.bracket-team.win { color: var(--text); background: rgba(230,179,61,.1); }
.bracket-team.win .bt-name { color: var(--gold-hi); }
.bracket-team.win .bt-score { color: var(--gold-hi); }
.bracket-round-label {
  text-align: center; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.bracket-champion {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: linear-gradient(165deg, rgba(42,55,44,.9), rgba(17,26,21,.9));
  border: 1.5px solid rgba(230,179,61,.5); border-radius: 16px; padding: 18px 16px;
  box-shadow: 0 0 34px rgba(230,179,61,.14);
}
.bracket-champion .champ-trophy { font-size: 2.4rem; }
.bracket-champion .champ-label { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.bracket-champion .champ-name { font: 700 1.15rem var(--serif); color: var(--gold-hi); }
.bracket-champion .champ-avatar { font-size: 1.6rem; }

/* Card back themes */
body.back-gold .card-back, body.back-gold .opp-hand .mini-back, body.back-gold .pile-card {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 4px, transparent 4px 9px),
    linear-gradient(150deg, #a97c14, #6f5410);
  border-color: rgba(255, 240, 200, .65);
}
body.back-crimson .card-back, body.back-crimson .opp-hand .mini-back, body.back-crimson .pile-card {
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.15) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(246,213,129,.1) 0 4px, transparent 4px 9px),
    linear-gradient(150deg, #7a1f28, #4e1218);
  border-color: rgba(230, 179, 61, .6);
}
body.back-navy .card-back, body.back-navy .opp-hand .mini-back, body.back-navy .pile-card {
  background:
    repeating-linear-gradient(45deg, rgba(200,211,224,.16) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(200,211,224,.1) 0 4px, transparent 4px 9px),
    linear-gradient(150deg, #1d3a5f, #0e2036);
  border-color: rgba(200, 211, 224, .55);
}
body.back-onyx .card-back, body.back-onyx .opp-hand .mini-back, body.back-onyx .pile-card {
  background:
    repeating-linear-gradient(45deg, rgba(246,213,129,.14) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(246,213,129,.08) 0 4px, transparent 4px 9px),
    linear-gradient(150deg, #2a2a2e, #101014);
  border-color: rgba(230, 179, 61, .5);
}

/* Leave flow / player menu */
.leave-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn.danger { color: #ff9a8a; border-color: rgba(255,120,100,.4); }
.btn.danger:hover { border-color: #ff9a8a; }
.return-chip {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  background: linear-gradient(165deg, var(--gold-hi), var(--gold)); color: #35270a;
  border: 1px solid var(--gold-lo); font-weight: 700; padding: 12px 18px; border-radius: 30px;
  box-shadow: 0 8px 26px rgba(230,179,61,.4); animation: pop .3s ease; cursor: pointer;
}
.player-menu {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 8px; min-width: 220px; text-align: center;
}
.chat-name { cursor: pointer; }
.chat-name:hover { color: var(--gold-hi); }
.pname.clickable { cursor: pointer; }
.pname.clickable:hover { border-color: rgba(230,179,61,.6); color: var(--gold-hi); }
.chat-toggle {
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--gold-hi); font-size: .72rem;
  cursor: pointer; padding: 4px 8px; border-radius: 9px;
}
.chat-toggle:hover { border-color: rgba(230,179,61,.45); }
.chat-toggle.off { color: var(--muted); opacity: .7; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid rgba(230,179,61,.5); color: var(--text);
  padding: 12px 22px; border-radius: 14px; z-index: 99; box-shadow: var(--shadow);
  animation: pop .2s ease; backdrop-filter: blur(10px);
}

@media (max-height: 840px) {
  :root { --card-w: 72px; --card-h: 104px; }
  .avatar { width: 46px; height: 46px; font-size: 1.3rem; }
  .my-hand-wrap { margin-top: -22px; }
}
@media (max-width: 1000px) {
  .public-header { gap: 16px; }
  .public-nav { display: none; }
  .public-hero { min-height: 0; grid-template-columns: 1fr; gap: 46px; padding: 68px 0 78px; }
  .public-auth-card { width: min(560px, 100%); }
  .public-live-grid { grid-template-columns: 1fr 1fr; }
  .public-tables-card { grid-column: 1 / -1; }
  .table-showcase { grid-template-columns: 1fr; }
  .table-shot-main { min-height: 500px; }
  .table-shot-stack { grid-template-columns: 1fr 1fr; grid-template-rows: 300px; }
  .public-plans { grid-template-columns: 1fr 1fr; }
  .public-plan.featured { grid-column: 1 / -1; grid-row: 1; }
  .game-main { grid-template-columns: 1fr; overflow-y: auto; }
  .side-panel { flex-direction: row; flex-wrap: wrap; }
  .panel { flex: 1; min-width: 240px; }
  body { overflow: auto; }
  .play-columns, .learn-grid { grid-template-columns: 1fr; }
  .join-card { margin-top: 0; }
  .hero { flex-direction: column; align-items: stretch; text-align: left; padding: 28px 24px; }
  .hero h1 { font-size: 2rem; }
  .social-layout { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  :root { --card-w: 58px; --card-h: 84px; }
  .public-header { min-height: 62px; padding: 9px 13px; }
  .public-header .logo { font-size: .83rem; }
  .public-header .brand-mini { transform: scale(.85); transform-origin: left center; width: 37px; flex-basis: 37px; }
  .public-header-actions .ghost { display: none; }
  .public-header-actions .btn { padding: 8px 10px; font-size: .74rem; }
  .public-home main, .public-footer { width: min(100% - 28px, 1180px); }
  .public-hero { padding: 48px 0 64px; gap: 36px; }
  .public-hero-copy h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .public-hero-copy > p { font-size: 1rem; }
  .public-hero-actions { flex-direction: column; align-items: stretch; }
  .public-hero-actions .btn { justify-content: center; text-align: center; }
  .public-proof { display: grid; grid-template-columns: 1fr 1fr; }
  .public-auth-card { padding: 27px 20px 22px; }
  .auth-buttons { flex-direction: column; }
  .public-section { padding: 66px 0; }
  .public-section-head { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 24px; }
  .public-section-head h2, .membership-banner h2 { font-size: 2.15rem; }
  .public-stat-row, .public-live-grid, .public-steps, .public-plans { grid-template-columns: 1fr; }
  .public-stat-row > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .public-stat-row > div:last-child { border-bottom: 0; }
  .public-tables-card, .public-plan.featured { grid-column: auto; grid-row: auto; }
  .table-shot-main { min-height: 310px; }
  .table-shot-stack { grid-template-columns: 1fr; grid-template-rows: repeat(2, 260px); }
  .table-shot figcaption { align-items: start; flex-direction: column; gap: 3px; }
  .membership-banner { grid-template-columns: 1fr; padding: 30px 23px; }
  .membership-price { min-width: 0; text-align: left; }
  .membership-price b { font-size: 3rem; }
  .public-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .public-footer > div { flex-wrap: wrap; justify-content: center; }
  .lobby-header { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px 12px; }
  .lobby-header > .brand-lockup { grid-column: 1; grid-row: 1; min-width: 0; }
  .lobby-header .brand-lockup .logo { font-size: .88rem; }
  .lobby-header .me-box { grid-column: 2; grid-row: 1; }
  .lobby-header .me-box .me-copy { display: none; }
  .lobby-header .me-identity { padding: 2px; }
  .lobby-header .tabs {
    grid-column: 1 / -1; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
  }
  .lobby-header .tabs::-webkit-scrollbar { display: none; }
  .lobby-header .tab { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; }
  .lobby-main { padding: 18px 14px; }
  .room-item { grid-template-columns: 1fr; gap: 13px; padding: 15px; }
  .room-actions { min-width: 0; flex-direction: row; }
  .room-actions .btn { flex: 1; }
  .room-game-summary { align-items: flex-start; flex-direction: column; gap: 8px; }
  .room-progress-copy span { white-space: normal; }
  .points-explainer { min-width: 0; width: 100%; }
  .achievement-heading { align-items: start; }
  .achievement-overview { max-width: 130px; }
  .achievement-celebration { padding: 14px; }
  .unlock-card { padding: 28px 22px 24px; border-radius: 22px; }
  .unlock-icon { width: 88px; height: 88px; font-size: 2.85rem; }
  .unlock-card h2 { font-size: 1.65rem; }
  .public-profile-card { padding: 24px 18px; max-height: 92vh; }
  .public-profile-head { align-items: flex-start; }
  .public-profile-head .profile-avatar { width: 66px; height: 66px; font-size: 2rem; }
  .public-profile-head h2 { font-size: 1.55rem; }
  .stats-card.public-stats { grid-template-columns: repeat(2, 1fr); }
  .public-achievements { grid-template-columns: 1fr; }
  .social-hero-mark { display: none; }
  .official-notice { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
  .official-notice-icon { width: 38px; height: 38px; }
  .official-seal { grid-column: 2; width: fit-content; }
  .social-layout { grid-template-columns: 1fr; }
  .dm-card { min-height: 0; }
  .dm-empty { min-height: 260px; }
  .dm-conversation { min-height: 65vh; }
  .dm-back { display: inline-flex; }
  .dm-head #dm-view-profile { display: none; }
  .social-layout.dm-open .social-sidebar { display: none; }
  .social-layout:not(.dm-open) .dm-card { display: none; }
  .my-hand .card { margin: 0 -11px; }
  .seat-left { left: 8px; } .seat-right { right: 8px; }
  .bid-grid { grid-template-columns: repeat(3, 1fr); }
  .gh-brand, .gh-actions { min-width: 0; }
  .game-header { flex-wrap: wrap; }
  .gh-sub { display: none; }
  .spectator-banner { order: 4; width: 100%; justify-content: center; }
  #screen-game.spectator-mode .table-msg { display: none; }
  .game-result-modal .modal-card, .game-result-modal.champion .modal-card { padding: 34px 22px 28px; }
  .game-result-modal.champion .trophy { font-size: 4.7rem; }
}
@media (max-width: 440px) {
  .lobby-header { grid-template-columns: 46px minmax(0, 1fr); }
  .lobby-header .brand-lockup .logo { display: none; }
  .lobby-header .brand-mini { transform: scale(.9); transform-origin: left center; }
  .lobby-header .me-box { justify-content: flex-end; gap: 5px; min-width: 0; }
  .lobby-header .btn.icon { padding: 7px 9px; min-width: 34px; }
  .lobby-header .settings-trigger { min-height: 34px; padding: 7px 9px; font-size: .7rem; }
  .lobby-header .me-avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .account-menu { position: fixed; top: 66px; right: 10px; width: min(292px, calc(100vw - 20px)); }
}
/* ---- Phones, portrait: a tall felt that fills the screen, one-row header,
       score and table talk stacked below. ---- */
@media (max-width: 520px) {
  :root { --card-w: 50px; --card-h: 72px; }
  .game-header { gap: 8px 10px; padding: 7px 10px; }
  .gh-brand { min-width: 0; }
  .gh-brand .logo, .gh-sub { display: none; }
  .gh-table { text-align: left; min-width: 0; }
  .gh-table b { font-size: .82rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #btn-invite .invite-code { margin-left: 3px; }
  .gh-actions { gap: 5px; }
  .gh-actions .btn { padding: 6px 8px; font-size: .68rem; }
  .game-main { padding: 8px 8px 6px; gap: 10px; }
  /* min-height lives on the zone: the felt is flex-basis 0, so its own
     min-height overflows the zone instead of growing it */
  .felt-zone { min-height: min(56vh, 470px); }
  #screen-game:not(.spectator-mode) .felt-zone { min-height: calc(min(50vh, 430px) + var(--card-h) + 12px); }
  .felt { min-height: 240px; border-radius: 20px; }
  .felt-ring { inset: 15%; }
  .avatar { width: 40px; height: 40px; font-size: 1.1rem; border-width: 2px; }
  .avatar-timer { inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); }
  .pname { font-size: .66rem; padding: 2px 8px; max-width: 96px; }
  .prole { font-size: .58rem; }
  .seat-top { top: 6px; } .seat-bottom { bottom: 6px; }
  .seat-left { left: 4px; } .seat-right { right: 4px; }
  .table-msg { top: 26%; font-size: .8rem; max-width: 82%; }
  .trump-badge { top: 8px; left: 8px; gap: 7px; padding: 6px 9px; border-radius: 12px; }
  .trump-badge .tb-suit { width: 26px; height: 36px; font-size: 1rem; border-radius: 5px; }
  .trump-badge .tb-label { font-size: .52rem; }
  .trump-badge .tb-main { font-size: .8rem; }
  .trump-badge .tb-who { font-size: .6rem; }
  .hand-toast { top: 8px; right: 8px; width: 186px; max-width: 58%; padding: 8px 9px; }
  .hand-toast .ht-title { font-size: .86rem; }
  .hand-toast .ht-taker { font-size: .68rem; }
  .my-hand-wrap { margin-top: -16px; }
  .my-hand .card { margin: 0 -14px; }
  .felt-moment .fm-title { font-size: 1.25rem; }
  .felt-moment.cheer .fm-title { font-size: 1.6rem; }
  .felt-moment .fm-sub, .felt-moment.cheer .fm-sub { font-size: .74rem; }
  .bid-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .trick-review-card { padding: 22px 14px; }
  .tr-cards { gap: 5px; }
  .tr-play .card { width: 40px; height: 58px; }
}

/* ---- Phones, landscape: short screen — table and side panel share the width,
       everything sized to keep a full table visible. ---- */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --card-w: 46px; --card-h: 66px; }
  .game-header { padding: 4px 10px; gap: 8px; }
  .gh-brand .logo, .gh-sub { display: none; }
  .gh-brand { min-width: 0; }
  .gh-table { text-align: left; min-width: 0; }
  .gh-table b { font-size: .8rem; }
  .gh-actions { min-width: 0; gap: 5px; }
  .gh-actions .btn { padding: 5px 8px; font-size: .66rem; }
  .game-main { grid-template-columns: minmax(0, 1fr) 230px; padding: 6px 8px 4px; gap: 8px; }
  .side-panel { flex-direction: column; flex-wrap: nowrap; overflow-y: auto; min-height: 0; }
  .panel { min-width: 0; flex: none; }
  .felt-zone { min-height: calc(100vh - 128px); }
  .felt { min-height: 200px; border-radius: 18px; }
  .avatar { width: 36px; height: 36px; font-size: .95rem; border-width: 2px; }
  .avatar-timer { inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); }
  .pname { font-size: .62rem; padding: 2px 8px; max-width: 90px; }
  .prole { display: none; }
  .seat-top { top: 4px; } .seat-bottom { bottom: 4px; }
  .seat-left { left: 4px; } .seat-right { right: 4px; }
  .table-msg { top: 25%; font-size: .78rem; }
  .trump-badge { top: 6px; left: 6px; gap: 6px; padding: 5px 8px; border-radius: 10px; }
  .trump-badge .tb-suit { width: 24px; height: 33px; font-size: .9rem; border-radius: 4px; }
  .trump-badge .tb-label { font-size: .5rem; }
  .trump-badge .tb-main { font-size: .74rem; }
  .trump-badge .tb-who { font-size: .56rem; }
  .hand-toast { top: 6px; right: 6px; width: 180px; padding: 7px 8px; }
  .hand-toast .ht-title { font-size: .82rem; }
  .my-hand-wrap { margin-top: -34px; min-height: calc(var(--card-h) + 14px); }
  .my-hand { padding-bottom: 6px; min-height: calc(var(--card-h) + 14px); }
  .my-hand .card { margin: 0 -13px; }
  .trick-review-card { max-height: 94vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Limited Beta ---------------------------------------------------- */
.limited-beta-section {
  display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:34px;
  align-items:center;margin-top:34px;padding:44px;color:var(--text);
  border:1px solid rgba(230,179,61,.28);border-radius:28px;
  background:radial-gradient(700px 320px at 4% 0%,rgba(230,179,61,.14),transparent 58%),radial-gradient(540px 300px at 100% 100%,rgba(29,92,58,.34),transparent 64%),linear-gradient(145deg,#111a15,#0c110e 72%);
  box-shadow:0 24px 70px rgba(10,17,13,.32),inset 0 1px 0 rgba(255,255,255,.04);
}
.limited-beta-section .eyebrow{color:var(--gold-hi)}
.limited-beta-copy h2{color:var(--cream);font:700 clamp(2rem,4vw,3.6rem)/1.02 var(--serif);margin:10px 0 16px;letter-spacing:-.035em}
.limited-beta-copy>p{font-size:1.04rem;line-height:1.65;max-width:670px;color:#b9c3bb}
.beta-progress{height:10px;background:rgba(255,255,255,.1);border:1px solid rgba(230,179,61,.1);border-radius:999px;overflow:hidden;margin:28px 0 10px}
.beta-progress span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--felt-hi),var(--gold),var(--gold-hi));transition:width .5s ease}
.beta-capacity-line{display:flex;justify-content:space-between;gap:18px;margin-bottom:22px;font-size:.86rem}.beta-capacity-line span{color:#aab6ad}
.beta-event-stack{display:grid;gap:12px}.beta-event-stack article{display:grid;grid-template-columns:58px 1fr;gap:14px;align-items:center;padding:17px;border:1px solid rgba(230,179,61,.14);border-radius:18px;background:rgba(255,255,255,.04)}
.beta-event-stack article>span{display:grid;place-items:center;width:58px;height:58px;border:1px solid rgba(230,179,61,.22);border-radius:16px;background:linear-gradient(145deg,var(--felt-hi),var(--felt-lo));color:var(--cream);font-size:.8rem;font-weight:900;letter-spacing:.06em}
.beta-event-stack b{display:block;margin-bottom:4px;color:var(--cream)}.beta-event-stack p{margin:0;color:#aab6ad;font-size:.84rem;line-height:1.45}
.auth-consent{display:flex;gap:10px;text-align:left;align-items:flex-start;margin:7px 0 2px;color:var(--muted);font-size:.76rem;line-height:1.45}.public-auth-card .auth-consent input{width:17px;height:17px;flex:0 0 17px;margin-top:2px}
.beta-bug-trigger{border-color:rgba(154,111,20,.5)!important;background:linear-gradient(145deg,rgba(29,92,58,.13),rgba(230,179,61,.1))!important;color:var(--text)!important}
body.ui-dark .beta-bug-trigger{border-color:rgba(230,179,61,.38)!important;background:linear-gradient(145deg,rgba(42,122,77,.22),rgba(230,179,61,.08))!important;color:var(--cream)!important}
.beta-idea-trigger{border-color:rgba(29,92,58,.38)!important;background:rgba(29,92,58,.08)!important;color:var(--text)!important}body.ui-dark .beta-idea-trigger{border-color:rgba(42,122,77,.42)!important;background:rgba(42,122,77,.14)!important;color:var(--cream)!important}
.beta-feedback-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:12px}.beta-feedback-actions>span{margin-right:2px;color:var(--muted);font-size:.7rem;font-weight:850;letter-spacing:.12em;text-transform:uppercase}.beta-feedback-actions .btn{padding:8px 13px;font-size:.78rem;border-radius:10px}
.beta-feedback-dock{position:fixed;right:18px;bottom:18px;z-index:760;margin:0;padding:10px 11px;border:1px solid rgba(230,179,61,.28);border-radius:16px;background:color-mix(in srgb,var(--panel) 94%,transparent);box-shadow:0 14px 38px rgba(10,17,13,.22);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.beta-feedback-dock.hidden{display:none}.beta-feedback-dock>span{padding:0 5px}.beta-feedback-dock .btn{box-shadow:none}
.beta-bug-card{max-width:590px;text-align:left}.beta-bug-card>label{display:block;margin-top:14px;font-weight:750;color:var(--text)}.beta-bug-card textarea{width:100%;margin-top:7px}.beta-bug-technical{margin-top:16px;border:1px solid var(--line);border-radius:13px;background:color-mix(in srgb,var(--panel) 74%,var(--bg));overflow:hidden}.beta-bug-technical summary{padding:13px 15px;cursor:pointer;font-size:.82rem;font-weight:750;color:var(--muted)}.beta-bug-technical>div{padding:0 15px 14px}.beta-bug-technical dl{display:grid;gap:7px}.beta-bug-technical dl div{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px;font-size:.74rem}.beta-bug-technical dt{color:var(--muted);font-weight:750}.beta-bug-technical dd{overflow-wrap:anywhere;color:var(--text)}
.beta-idea-card{max-width:590px;text-align:left}.beta-idea-card>label{display:block;margin-top:14px;font-weight:750;color:var(--text)}.beta-idea-card textarea{width:100%;margin-top:7px}
.beta-welcome-card{max-width:570px;text-align:left;padding:36px}.beta-welcome-card h2{font-size:2.25rem;margin:8px 0 14px}.beta-welcome-card>p,.beta-welcome-card li{color:var(--muted);line-height:1.6}.beta-welcome-card ul{padding-left:20px;margin:18px 0}
.beta-acknowledge{display:flex;gap:12px;align-items:flex-start;padding:16px;border:1px solid rgba(73,139,205,.3);border-radius:15px;background:rgba(41,110,180,.07);font-size:.88rem;line-height:1.48}.beta-acknowledge input{width:19px;height:19px;flex:0 0 auto;margin-top:2px}
@media(max-width:780px){.limited-beta-section{grid-template-columns:1fr;padding:26px 20px}.limited-beta-copy h2{font-size:2.35rem}.beta-capacity-line{align-items:flex-start;flex-direction:column;gap:4px}.beta-welcome-card{padding:25px 20px}.beta-feedback-dock{left:10px;right:10px;bottom:10px;justify-content:center}.beta-feedback-dock>span{width:100%;text-align:center}}
