:root {
  --night: #0F0D1F;
  --surface: #1A1733;
  --surface-2: #242046;
  --surface-3: #2D2757;
  --line: #353061;
  --line-2: #4A4380;
  --ink: #F4EEE2;
  --ink-2: #C9C3E3;
  --muted: #A9A3C7;
  --faint: #6F68A0;
  --gold: #F2B544;
  --gold-deep: #C98A1B;
  --gold-ink: #1B1405;
  --teal: #4CC9A6;
  --teal-soft: #7FE0C3;
  --teal-ink: #072A20;
  --rose: #E8789F;
  --rose-soft: #F0A3C4;
  --rose-bg: #3A1F33;
  --verm: #F0644A;
  --verm-soft: #FF9A85;
  --verm-ink: #1F0A05;
  --paper: #F6EBD5;
  --paper-ink: #2A1E14;
  --paper-muted: #6B5A48;
  --legal-deep: #17735C;
  --legal-tint: #DDEFE7;
  --contra-deep: #A0306B;
  --contra-tint: #F5DCE8;
  --pen: #B23A24;
  --display: 'Bricolage Grotesque', 'Hind Siliguri', system-ui, sans-serif;
  --body: 'Hind Siliguri', system-ui, sans-serif;
  --cw: 112px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse 70% 55% at 60% 30%, #251F4A 0%, var(--night) 70%) fixed, var(--night);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
button { font: inherit; color: inherit; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.eyebrow.gold { color: var(--gold); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 16px;
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:focus-visible, .gcard:focus-visible, .pill:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 800; box-shadow: 0 8px 24px rgba(242,181,68,.3); }
.btn-gold:hover:not(:disabled) { box-shadow: 0 12px 30px rgba(242,181,68,.45); }
.btn-verm { background: var(--verm); border-color: var(--verm); color: var(--verm-ink); font-weight: 800; box-shadow: 0 10px 28px rgba(240,100,74,.3); }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 60px; padding: 0 30px; font-size: 19px; border-radius: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.lang-btn { width: auto; min-width: 44px; padding: 0 12px; font-family: var(--body); font-weight: 700; font-size: 15px; color: var(--gold); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* ---------- Bengali typography ---------- */
.tk { font-family: var(--body); font-weight: 600; font-size: .78em; color: var(--gold); margin-left: .12em; vertical-align: .08em; }
.brow.win .tk, .btn-gold .tk { color: inherit; opacity: .75; }
:lang(bn) h1, :lang(bn) h2, :lang(bn) h3, :lang(bn) .wordmark, :lang(bn) .stamp { letter-spacing: 0; }
:lang(bn) h1, :lang(bn) h2 { line-height: 1.3; font-weight: 700; }
:lang(bn) .wordmark { line-height: 1.15; font-size: clamp(60px, 8vw, 100px); font-weight: 700; }
:lang(bn) .eyebrow { letter-spacing: .02em; font-size: 13px; }
:lang(bn) .wordmark-bn { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
:lang(bn) .stamp { padding: 6px 22px 0; }

/* ---------- Title ---------- */
.title {
  max-width: 1240px; margin: 0 auto; padding: 56px 24px 40px; min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
}
.title-copy { display: flex; flex-direction: column; gap: 26px; }
.wordmark { font-size: clamp(64px, 9vw, 112px); font-weight: 800; line-height: .9; letter-spacing: -.035em; }
.wordmark-bn { font-size: clamp(26px, 3vw, 36px); font-weight: 600; color: var(--gold); margin-top: 6px; }
.tagline { font-size: 19px; color: var(--ink-2); max-width: 470px; margin: 0; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero { position: relative; height: 560px; }
.hero .gcard { position: absolute; --cw: 172px; }
.hero .h1 { left: 8%; top: 22%; transform: rotate(-14deg); animation: float 6s ease-in-out infinite; }
.hero .h2 { left: 30%; top: 12%; z-index: 2; --cw: 188px; animation: float 6s ease-in-out -2s infinite; }
.hero .h3 { left: 54%; top: 20%; transform: rotate(12deg); animation: float 6s ease-in-out -4s infinite; }
.hero .sack { position: absolute; left: 30%; top: 62%; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5)); }
.hero .tag { left: 56%; top: 74%; bottom: auto; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.profile-card, .panel {
  background: rgba(26,23,51,.88); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px;
}
.profile-card { display: flex; flex-direction: column; gap: 12px; max-width: 540px; }
.rank-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rank-badge { display: flex; align-items: center; gap: 12px; }
.rank-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.rank-name { font-family: var(--display); font-weight: 800; font-size: 21px; }
.xpbar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.xpbar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); width: var(--to); }
.xpbar.anim > div { animation: fill 1.6s cubic-bezier(.2,.8,.2,1) .4s both; }
@keyframes fill { from { width: var(--from); } to { width: var(--to); } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 13px; color: var(--muted); }
.stats b { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--ink); }
.feats { display: flex; flex-wrap: wrap; gap: 5px; }
.feat-dot { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); color: var(--faint); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.feat-dot.on { background: #3A2F5E; border-color: var(--gold-deep); }
.name-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type="text"], select {
  font: 16px var(--body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; min-height: 44px;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.seat { display: grid; grid-template-columns: 40px minmax(0, 1fr) 130px; gap: 8px; align-items: center; margin-bottom: 8px; }
.setup { display: flex; flex-direction: column; gap: 14px; max-width: 540px; }

/* ---------- Game shell ---------- */
.hud {
  position: sticky; top: 0; z-index: 10; height: 68px; padding: 0 24px; display: flex; align-items: center; gap: 18px;
  justify-content: space-between; border-bottom: 1px solid #2A2650; background: rgba(15,13,31,.86); backdrop-filter: blur(10px);
}
.hud-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { font-family: var(--display); font-weight: 800; font-size: 21px; white-space: nowrap; }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.done { background: var(--gold); }
.pips i.now { background: var(--ink); }
.steps { display: flex; gap: 4px; font-size: 14px; font-weight: 600; }
.steps span { padding: 7px 13px; border-radius: 99px; color: var(--muted); white-space: nowrap; }
.steps span.on { background: var(--gold); color: var(--gold-ink); }
.hud-right { display: flex; align-items: center; gap: 10px; }
.purse { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px 5px 6px; }
.coin { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.purse b { font-family: var(--display); font-size: 20px; }

.table { max-width: 1320px; margin: 0 auto; padding: 22px 24px 40px; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 24px; }
.rail { display: flex; flex-direction: column; gap: 10px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .3s, box-shadow .3s; }
.pcard.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,181,68,.15); }
.pcard.zam { background: linear-gradient(180deg, #2A2140, var(--surface)); }
.prow { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 17px; }
.pname { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pstatus { font-size: 12px; color: var(--muted); }
.pstatus.gold { color: var(--gold); font-weight: 600; }
.pmoney { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 18px; position: relative; }
.pmoney.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.3); color: var(--gold); } }
.delta { position: absolute; right: 0; top: -6px; font-size: 14px; font-weight: 800; animation: rise 1.6s ease-out forwards; pointer-events: none; }
.delta.up { color: var(--teal-soft); }
.delta.down { color: var(--verm-soft); }
@keyframes rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }
.chips { display: flex; gap: 4px; flex-wrap: wrap; font-size: 12px; }
.chip { background: var(--surface-2); border-radius: 99px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.chip.hidden { background: var(--rose-bg); color: var(--rose-soft); }
.cpu { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 5px; }
.streak { display: flex; align-items: center; gap: 10px; color: var(--verm); }
.streak.hot { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px rgba(240,100,74,.25); } }
.ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.ledger li { padding-left: 12px; position: relative; }
.ledger li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }

.stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stage-head h2 { font-size: 38px; font-weight: 800; margin-top: 4px; }
.hint { font-size: 14px; color: var(--muted); }

/* ---------- Cards ---------- */
.cards { display: flex; gap: 12px; flex-wrap: wrap; }
.gcard {
  width: var(--cw); height: calc(var(--cw) * 1.41); flex: none; border-radius: calc(var(--cw) * .125);
  background: var(--paper); color: var(--paper-ink); border: 0; padding: calc(var(--cw) * .09);
  box-shadow: 0 10px 24px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  font-family: var(--body); text-align: center; position: relative; transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
}
button.gcard { cursor: pointer; }
button.gcard:hover { transform: translateY(-6px); }
.gc-top { width: 100%; display: flex; justify-content: space-between; font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * .135); }
.gc-top .pen { color: var(--pen); }
.gc-medal { width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--legal-tint); color: var(--legal-deep); display: flex; align-items: center; justify-content: center; }
.gc-medal svg { width: 86%; height: 86%; }
.gcard.contra .gc-medal { background: var(--contra-tint); color: var(--contra-deep); }
.gc-name, .gc-sub { display: block; }
.gc-name { font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * .145); line-height: 1.1; }
.gc-sub { font-size: calc(var(--cw) * .1); color: var(--paper-muted); line-height: 1.2; }
.gcard.contra .gc-sub { color: var(--contra-deep); font-weight: 600; }
.gcard.mini { --cw: 66px; }
.gcard.mini .gc-sub { display: none; }
.gcard.picked { transform: translateY(-18px); box-shadow: 0 18px 30px rgba(0,0,0,.55), 0 0 0 3px var(--verm); }
.gcard.picked::after { content: attr(data-tag); position: absolute; bottom: -26px; left: 50%; translate: -50% 0; font-size: 12px; font-weight: 700; color: var(--verm-soft); }
.gcard.smuggle { box-shadow: 0 10px 24px rgba(0,0,0,.5), 0 0 0 3px var(--rose); }
.gcard.dim { opacity: .35; }
.gcard.taking { box-shadow: 0 10px 24px rgba(0,0,0,.5), 0 0 0 3px var(--teal); }
.gcard.back { background: repeating-linear-gradient(45deg, #3A2A12, #3A2A12 7px, #4A3618 7px, #4A3618 14px); border: 3px solid var(--gold-deep); }
.gcard.deal { animation: deal .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-8deg) scale(.9); } }
.gcard.flip { animation: flip .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.35s + var(--i, 0) * 180ms); backface-visibility: hidden; }
@keyframes flip { from { transform: rotateY(90deg) scale(.9); opacity: 0; } 60% { transform: rotateY(-8deg) scale(1.04); opacity: 1; } }
.gcard.seized { filter: grayscale(.2); }
.gcard.seized::before {
  content: attr(data-seized); position: absolute; top: 42%; left: 50%; translate: -50% 0; rotate: -14deg; z-index: 2;
  font-family: var(--display); font-weight: 800; font-size: calc(var(--cw) * .14); color: var(--pen); border: 2px solid var(--pen);
  border-radius: 6px; padding: 0 6px; background: rgba(246,235,213,.85);
}

/* ---------- Market / Pack ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
.bagzone { --cw: 96px; min-height: 200px; border-radius: 22px; border: 2px dashed var(--line-2); background: rgba(26,23,51,.6); padding: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.slot { flex: none; width: var(--cw); height: calc(var(--cw) * 1.41); border-radius: 14px; border: 2px dashed var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; text-align: center; }
.side { border-radius: 22px; background: var(--surface); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.declare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pill svg { flex: none; }
.pill {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: 600 15px var(--body); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.pill.on { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 700; }
.odds { border-radius: 14px; background: var(--surface-2); padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.odds.bluff { background: #2A1730; }
.odds .row { display: flex; justify-content: space-between; gap: 8px; }
.odds .head { font-weight: 600; color: var(--ink); font-size: 15px; }
.odds.bluff .head { color: var(--rose-soft); }
.good-t { color: var(--teal-soft); font-weight: 600; }
.bad-t { color: var(--verm-soft); font-weight: 600; }
.side .btn { margin-top: auto; }
.dock { padding-top: 8px; padding-bottom: 28px; }
.dock .cards { min-height: calc(var(--cw) * 1.41 + 20px); align-items: flex-end; }
.pile .cards { gap: 8px; }

/* ---------- Inspection ---------- */
.court { border-radius: 26px; padding: 34px 28px; background: radial-gradient(circle at 50% 45%, #3A2C1A 0%, #1A1530 45%, rgba(15,13,31,.6) 80%); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.court h2 { font-size: 40px; }
.court-row { display: grid; grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr); gap: 28px; align-items: center; width: 100%; }
.suspect { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.suspect .avatar { width: 88px; height: 88px; font-size: 36px; box-shadow: 0 0 0 4px var(--night), 0 0 0 6px var(--line-2); }
.bubble { background: var(--ink); color: #1D1830; border-radius: 18px 18px 18px 4px; padding: 12px 16px; font-weight: 500; max-width: 280px; animation: pop .4s cubic-bezier(.2,.8,.2,1.4) both .15s; }
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(10px); } }
.sackwrap { position: relative; height: 260px; display: flex; align-items: center; justify-content: center; }
.sackwrap::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(242,181,68,.28), transparent 70%); }
.sackwrap svg { position: relative; filter: drop-shadow(0 22px 34px rgba(0,0,0,.6)); }
.sackwrap.wobble svg { animation: wobble .9s ease-in-out infinite; }
@keyframes wobble { 25% { rotate: -4deg; } 75% { rotate: 4deg; } }
.sacktag { position: absolute; bottom: 36px; background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 8px 16px; font-family: var(--display); font-weight: 800; font-size: 22px; rotate: -4deg; box-shadow: 0 10px 22px rgba(0,0,0,.45); white-space: nowrap; }
.stakes { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.stake { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.stake b { display: block; font-size: 15px; }
.decide { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.thinking { font-size: 18px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.dots i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--gold); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .2; transform: translateY(-4px); } }

/* ---------- Result ---------- */
.verdict { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.stamp {
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 76px); letter-spacing: .02em; text-transform: uppercase;
  border: 6px solid currentColor; border-radius: 16px; padding: 4px 22px; rotate: -6deg; animation: stamp .45s cubic-bezier(.3,1.6,.5,1) both;
}
.stamp.caught { color: var(--verm); }
.stamp.honest { color: var(--teal); }
.stamp.passed { color: var(--gold); }
@keyframes stamp { from { transform: scale(2.4); opacity: 0; } }
.verdict.shake { animation: shake .45s .3s; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.verdict-text { font-size: 18px; color: var(--ink-2); max-width: 560px; }
.verdict-text b { color: var(--ink); }
.smuggled { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 99px; background: var(--rose-bg); color: var(--rose-soft); font-weight: 700; font-size: 18px; animation: pop .5s .4s both; }
.sparks { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.sparks i { position: absolute; left: 50%; top: 30%; width: 8px; height: 8px; border-radius: 2px; background: var(--c); animation: spark 1.2s cubic-bezier(.1,.7,.3,1) forwards; animation-delay: .35s; opacity: 0; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(540deg); } }

/* ---------- Round end / results ---------- */
.deltas { display: grid; gap: 8px; width: 100%; max-width: 520px; }
.deltas .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.results { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; max-width: 1240px; margin: 0 auto; padding: 44px 24px; }
.results h1 { font-size: clamp(40px, 5vw, 60px); font-weight: 800; margin-top: 6px; }
.board { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.brow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 62px 62px 62px 74px; gap: 10px; align-items: center; padding: 14px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: deal .5s both; animation-delay: calc(var(--i) * 90ms); }
.brow.head { background: none; border: 0; padding-top: 0; padding-bottom: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); animation: none; }
.brow.win { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.brow.win .sub { color: var(--gold-ink); }
.brow .num { text-align: right; }
.brow .tot { text-align: right; font-family: var(--display); font-weight: 800; font-size: 24px; }
.brow .pos { font-family: var(--display); font-weight: 800; font-size: 22px; }
.brow .sub { font-size: 13px; color: var(--muted); }
.xp-total { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--gold); }
.breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 14px; }
.breakdown div { display: flex; justify-content: space-between; color: var(--ink-2); }
.breakdown span:last-child { color: var(--ink); }
.featrow { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; animation: pop .5s both; animation-delay: calc(1.2s + var(--i) * 150ms); }
.featrow .ic { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.rankup { color: var(--gold); font-weight: 700; animation: pop .5s 2s both; }

/* ---------- Pass screen ---------- */
.pass { text-align: center; padding: 70px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pass .rank-icon { width: 84px; height: 84px; border-radius: 26px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--gold-deep); border-radius: 16px; padding: 12px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toast-in .5s cubic-bezier(.2,.8,.2,1.3) both; max-width: 340px; }
.toast .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); display: flex; align-items: center; justify-content: center; flex: none; }
.toast.out { animation: toast-out .4s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(60px); } }

/* ---------- Rules dialog ---------- */
dialog { max-width: 680px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); padding: 26px; }
dialog::backdrop { background: rgba(5,4,14,.7); backdrop-filter: blur(3px); }
dialog h2 { font-size: 30px; margin-bottom: 10px; }
dialog li { margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 14px 0; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
td.num, th.num { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .steps { display: none; }
  .work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --cw: 92px; }
  .title { grid-template-columns: minmax(0, 1fr); padding-top: 32px; gap: 8px; }
  .hero { height: 340px; order: -1; }
  .hero .gcard { --cw: 112px; }
  .hero .h2 { --cw: 124px; }
  .hero .sack svg { width: 120px; height: 120px; }
  .table { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .rail { order: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .hero { overflow: hidden; }
  .hero .tag { left: auto; right: 4%; }
  .round-label { display: none; }
  .rail .ledger-panel { display: none; }
  .court-row { grid-template-columns: minmax(0, 1fr); }
  .results { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .results > div:first-child { display: contents; }
  .results > div:last-child { order: 2; }
  .results .stalls { order: 3; margin-top: 0 !important; }
  .brow { grid-template-columns: 28px minmax(0, 1fr) 0 0 0 64px; }
  .brow > .num { visibility: hidden; }
  .hud { padding: 0 16px; }
  .pips { display: none; }
  .stage-head h2 { font-size: 30px; }
  .dock .cards, .bagzone { flex-wrap: nowrap; overflow-x: auto; padding-top: 22px; }
}
@media (max-width: 480px) {
  :root { --cw: 80px; }
  .brand { display: none; }
  .hud-right { gap: 6px; margin-left: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .court h2 { font-size: 30px; }
}
