/* Flurry: two looks, one game.
   Classic (data-theme="classic"): the 1958 Flurry Exchange. Emerald baize, black lacquer, brass, ivory paper,
     split-flap prices, serif headlines and typewriter tape.
   Modern (data-theme="modern"): a 2026 trading desk. Graphite glass, clean grotesque type, light-up edges.
   Gold is kept for one thing in both: "your move". */
:root {
  color-scheme: dark;
  /* companies (same in both looks) */
  --red: #d23a35; --black: #30353f; --white: #7b52d9; --salmon: #c8743a; --blue: #1f74e0; --yellow: #e8b21c;
  --gold: #f2b829; --gold-hi: #ffcf4d; --gold-ink: #2b1f02; --gold-deep: #b98410;
  --up: #3ccf7a; --down: #ff5a4e; --tip: #b48cff;
  --s-12: 12px; --s-14: 14px; --s-16: 16px; --s-20: 20px; --s-28: 28px;
  --header: 60px;
  --f-logo: "Bungee", "Arial Black", Impact, sans-serif;
}
/* ---------- the two looks ---------- */
[data-theme="modern"] {
  --bg: #090b10; --bg-2: #06070a; --surface: #11141b; --surface-2: #181c26; --raised: #1f2430;
  --line: #242a37; --line-2: #343c4e;
  --fg: #eef1f7; --muted: #98a1b6; --accent: #4de1c1; --accent-ink: #052a22;
  --paper: #151922; --paper-2: #1b202b; --paper-ink: #eef1f7; --paper-muted: #98a1b6;
  --f-display: "Space Grotesk", "Segoe UI", Arial, sans-serif; --w-display: 700;
  --f-num: "Space Grotesk", "Segoe UI", Arial, sans-serif; --w-num: 700;
  --f-body: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --f-type: "JetBrains Mono", Consolas, monospace;
  --r: 14px; --r-sm: 10px;
  --page: radial-gradient(1200px 600px at 15% -10%, rgba(77,225,193,.10), transparent 60%), radial-gradient(1000px 600px at 110% 10%, rgba(123,82,217,.12), transparent 60%), var(--bg);
  --panel-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px rgba(0,0,0,.35);
}
[data-theme="classic"] {
  --bg: #0d1f18; --bg-2: #08140f; --surface: #132a20; --surface-2: #1a3529; --raised: #21402f;
  --line: rgba(201,162,74,.28); --line-2: rgba(201,162,74,.55);
  --fg: #f4ecd8; --muted: #b9c3ae; --accent: #c9a24a; --accent-ink: #231b10;
  --paper: #f1e7cc; --paper-2: #e8dcbc; --paper-ink: #231b10; --paper-muted: #6e6250;
  --f-display: "DM Serif Display", Georgia, serif; --w-display: 400;
  --f-num: "Bebas Neue", Oswald, Impact, sans-serif; --w-num: 400;
  --f-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --f-type: "Special Elite", "Courier New", monospace;
  --r: 6px; --r-sm: 4px;
  --page: radial-gradient(1200px 700px at 50% -20%, rgba(201,162,74,.12), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), var(--bg);
  --panel-shadow: inset 0 0 0 1px rgba(201,162,74,.18), inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(201,162,74,.22), 0 18px 36px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); background-attachment: fixed; color: var(--fg); font: var(--s-16)/1.5 var(--f-body); -webkit-text-size-adjust: 100%; transition: background-color .4s; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bg-2); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.label { font-size: var(--s-12); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--s-14); }
.up { color: var(--up); } .down { color: var(--down); }
.warn { color: var(--down); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 700; font-size: var(--s-14); transition: transform .08s, background .15s, opacity .15s, box-shadow .15s; }
.btn:hover:not(:disabled) { background: var(--raised); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.gold { background: var(--gold); border-color: var(--gold-hi); color: var(--gold-ink); }
.btn.gold:hover:not(:disabled) { background: var(--gold-hi); }
.btn.gold:disabled { opacity: .6; filter: saturate(.5); cursor: progress; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: var(--s-12); }
.btn.xs { min-height: 34px; padding: 4px 10px; font-size: var(--s-12); }
.btn.big { font-family: var(--f-display); font-weight: var(--w-display); font-size: 22px; min-height: 60px; padding: 10px 28px; letter-spacing: .01em; border-radius: calc(var(--r) + 2px); box-shadow: 0 6px 0 var(--gold-deep), 0 14px 28px rgba(0,0,0,.4); }
.btn.big:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-deep), 0 6px 12px rgba(0,0,0,.35); }
.btn.big:not(:disabled) { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-3px) rotate(-1deg); } 96% { transform: translateY(0) rotate(1deg); } }
.dice-ico { font-size: 1.3em; line-height: 1; }
.btn.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-hi); }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; height: var(--header); background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
[data-theme="classic"] .top { border-bottom: 3px double var(--line-2); }
.logo { display: inline-flex; align-items: flex-end; gap: 1px; font-family: var(--f-logo); font-size: 26px; line-height: 1; color: var(--gold); text-decoration: none; flex: 0 0 auto; }
.logo span { display: inline-block; }
.logo span:nth-of-type(1) { transform: translateY(5px) rotate(-6deg); }
.logo span:nth-of-type(2) { transform: translateY(3px) rotate(-3deg); }
.logo span:nth-of-type(3) { transform: translateY(1px); }
.logo span:nth-of-type(4) { transform: translateY(-1px) rotate(3deg); }
.logo span:nth-of-type(5) { transform: translateY(-3px) rotate(5deg); }
.logo span:nth-of-type(6) { transform: translateY(-6px) rotate(9deg); color: var(--fg); }
.top .meta { flex: 1; min-width: 0; color: var(--muted); font-size: var(--s-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="classic"] .top .meta { font-family: var(--f-type); }
.top .acts { display: flex; gap: 8px; }
.top .acts .btn { white-space: nowrap; }
.open-tables .card-head { flex-wrap: wrap; }

/* lobby */
.lobby { max-width: 1180px; margin: 0 auto; padding-block: 32px 64px; display: grid; gap: 28px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center; min-height: 320px; }
[data-theme="classic"] .hero::before { content: ""; position: absolute; inset: -40px -20px auto; height: 420px; z-index: -1; opacity: .5;
  background: repeating-conic-gradient(from 270deg at 30% 100%, rgba(201,162,74,.16) 0 2deg, transparent 2deg 9deg); -webkit-mask: radial-gradient(70% 90% at 30% 100%, #000 30%, transparent 75%); mask: radial-gradient(70% 90% at 30% 100%, #000 30%, transparent 75%); }
[data-theme="modern"] .hero::before { content: ""; position: absolute; inset: -40px -20px auto; height: 420px; z-index: -1;
  background: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 48px 48px; -webkit-mask: radial-gradient(60% 80% at 30% 50%, #000, transparent 75%); mask: radial-gradient(60% 80% at 30% 50%, #000, transparent 75%); }
.hero h1 { margin: 0; font-family: var(--f-logo); font-size: clamp(64px, 12vw, 148px); line-height: .9; color: var(--gold); font-weight: 400; display: flex; align-items: flex-end; }
.hero h1 span { display: inline-block; text-shadow: 0 6px 0 #8a5d00, 0 18px 30px rgba(0,0,0,.45); }
.hero h1 span:nth-of-type(1) { transform: translateY(18px) rotate(-7deg); }
.hero h1 span:nth-of-type(2) { transform: translateY(10px) rotate(-3deg); }
.hero h1 span:nth-of-type(3) { transform: translateY(3px); }
.hero h1 span:nth-of-type(4) { transform: translateY(-5px) rotate(3deg); }
.hero h1 span:nth-of-type(5) { transform: translateY(-14px) rotate(6deg); }
.hero h1 span:nth-of-type(6) { transform: translateY(-26px) rotate(11deg); color: var(--fg); text-shadow: 0 6px 0 rgba(0,0,0,.3), 0 18px 30px rgba(0,0,0,.45); }
.hero p.tag { font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.3; max-width: 26ch; margin: 22px 0 0; color: var(--fg); }
.hero .stack { position: relative; height: 320px; }
.cert-fly { position: absolute; width: 200px; height: 128px; border-radius: var(--r-sm); box-shadow: 0 18px 30px rgba(0,0,0,.45); overflow: hidden; animation: float 6s ease-in-out infinite alternate; padding: 12px 14px; display: grid; align-content: start; gap: 4px; }
[data-theme="classic"] .cert-fly { background: var(--paper) repeating-radial-gradient(ellipse at 50% 50%, transparent 0 5px, rgba(120,90,30,.07) 5px 6px); color: var(--paper-ink); border: 6px solid var(--pc); outline: 1px solid #c9a24a; outline-offset: -10px; }
[data-theme="modern"] .cert-fly { background: linear-gradient(135deg, var(--pc), #0c0e13 85%); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.cert-fly i { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pc); color: var(--pi); }
[data-theme="modern"] .cert-fly i { background: rgba(255,255,255,.15); color: #fff; }
.cert-fly b { font-family: var(--f-display); font-weight: var(--w-display); font-size: 17px; line-height: 1.1; }
.cert-fly small { font-family: var(--f-type); font-size: 11px; opacity: .75; }
@keyframes float { to { transform: translateY(-14px) rotate(var(--r2)); } }
.panels { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.panel { grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); padding: 24px; display: grid; gap: 16px; align-content: start; min-width: 0; box-shadow: var(--panel-shadow); }
.panel h2 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 26px; }
.panel p { margin: 0; color: var(--muted); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field label { font-size: var(--s-12); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
input[type=text], input[type=number], select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-height: 44px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > .grow { flex: 1 1 180px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px 14px; font-weight: 700; font-size: var(--s-14); min-height: 44px; }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.or { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: var(--s-12); text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#joinCode { font-family: var(--f-num); font-weight: var(--w-num); letter-spacing: .3em; text-transform: uppercase; font-size: 22px; width: 7.5em; }
.names { display: grid; gap: 8px; }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row input { flex: 1; min-width: 0; }
.cpu { display: inline-flex; align-items: center; gap: 6px; font-size: var(--s-14); color: var(--muted); white-space: nowrap; }
.rejoin { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; background: color-mix(in srgb, var(--up) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--up) 50%, transparent); border-radius: var(--r); padding: 10px 14px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mode-card { border-radius: var(--r); padding: 18px; display: grid; gap: 6px; border: 1px solid var(--line); }
.mode-card h3 { margin: 0; font-size: 24px; color: var(--gold); }
.mode-card p { margin: 0; color: var(--muted); font-size: var(--s-14); }
.mode-card.classic { background: #132a20; border: 3px double rgba(201,162,74,.5); }
.mode-card.classic h3 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; color: #e8c46a; }
.mode-card.modern { background: linear-gradient(135deg, #141824, #0d1016); border-color: #2a3142; }
.mode-card.modern h3 { font-family: "Space Grotesk", Arial, sans-serif; font-weight: 700; color: #4de1c1; }
.names-btn { min-width: 0; max-width: 100%; display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; min-height: 44px; }
.names-btn .names-sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--s-14); }
.names-btn .names-sum span { color: var(--muted); }
.names-btn .names-edit { color: var(--gold); font-weight: 700; font-size: var(--s-14); flex: 0 0 auto; }
.names-grid { display: grid; gap: 10px; }
.nrow { display: flex; gap: 12px; align-items: center; }
.nfield { flex: 1; display: grid; gap: 2px; min-width: 0; }
.nfield small { color: var(--muted); font-size: var(--s-12); }

/* open tables */
.open-tables { display: grid; gap: 10px; }
.open-tables h2 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 26px; }
.otables { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.otable { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "code info btn" "code seats btn"; gap: 4px 14px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--panel-shadow); }
.ot-code { grid-area: code; font-family: var(--f-num); font-weight: var(--w-num); font-size: 30px; letter-spacing: .12em; color: var(--gold); }
.ot-info { grid-area: info; display: grid; min-width: 0; }
.ot-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-info span { font-size: var(--s-12); color: var(--muted); }
.ot-seats { grid-area: seats; display: flex; gap: 3px; align-items: center; }
.ot-seats i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-2); }
.ot-seats i.on { background: var(--up); border-color: var(--up); }
.ot-seats small { margin-left: 6px; font-size: var(--s-12); color: var(--muted); }
.otable .btn { grid-area: btn; }
.otable[data-theme-chip="classic"] { border-left: 4px solid #c9a24a; }
.otable[data-theme-chip="modern"] { border-left: 4px solid #4de1c1; }

/* waiting room */
.room { max-width: 680px; margin: 0 auto; padding-block: 32px 64px; display: grid; gap: 18px; }
.bigcode { margin: 0; font-family: var(--f-num); font-weight: var(--w-num); font-size: clamp(56px, 16vw, 110px); letter-spacing: .14em; color: var(--gold); line-height: 1; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite input { flex: 1 1 240px; font-family: var(--f-type); }
.seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seats li { display: flex; gap: 10px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; min-height: 52px; }
.seats .tag { margin-left: auto; font-size: var(--s-12); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pdot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.odot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.odot.on { background: var(--up); }

/* company logo badge */
.mlogo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--pc); color: var(--pi); flex: 0 0 auto; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); vertical-align: middle; }
[data-theme="classic"] .mlogo { box-shadow: 0 0 0 2px #c9a24a, inset 0 -2px 0 rgba(0,0,0,.25); }
[data-theme="modern"] .mlogo { border-radius: 10px; box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.report .mlogo, .n-kick .mlogo { width: 24px; height: 24px; }

/* game screen */
.game { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - var(--header) - env(safe-area-inset-top, 0px)); }
.strip { display: flex; gap: 10px; overflow-x: auto; padding-block: 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.strip::-webkit-scrollbar { display: none; }
.pchip { flex: 0 0 auto; min-width: 210px; display: grid; gap: 5px; padding: 9px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); position: relative; border-top: 3px solid var(--pcol); }
.pchip.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(242,184,41,.15); border-top-color: var(--gold); }
.pchip .top-line { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--s-16); white-space: nowrap; }
.pchip .pname { overflow: hidden; text-overflow: ellipsis; }
.pchip .lead { color: var(--gold); }
.tagc { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 6px; }
.pchip .cash { margin-left: auto; font-family: var(--f-num); font-weight: var(--w-num); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold); }
.pchip .sub { font-size: var(--s-12); color: var(--muted); display: flex; gap: 8px; }
.bar { height: 5px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--up), var(--gold)); transition: width .6s; }
.react-float { position: absolute; top: -6px; right: 8px; font-size: 26px; animation: pop 1.8s ease-out forwards; pointer-events: none; }
@keyframes pop { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 20% { transform: translateY(-6px) scale(1.2); opacity: 1; } 100% { transform: translateY(-40px) scale(1); opacity: 0; } }
.holds { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; align-items: center; font-size: var(--s-12); }
.hchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 800; font-size: var(--s-12); font-variant-numeric: tabular-nums; color: var(--fg); }
.hchip svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--pc); color: var(--pi); box-sizing: border-box; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 0; }
.stage { position: relative; min-height: 0; background: var(--bg-2); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 4; flex-wrap: wrap; }
.stage-tools .btn { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); }
.stage-tools .btn.on { background: var(--gold); color: var(--gold-ink); }
.stage-hint { position: absolute; right: 12px; bottom: 14px; font-size: var(--s-12); color: var(--muted); background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 4px 10px; border-radius: 99px; z-index: 2; }
.side { overflow-y: auto; border-left: 1px solid var(--line); padding: 16px; display: grid; gap: 16px; align-content: start; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r) + 2px); padding: 16px; display: grid; gap: 12px; min-width: 0; box-shadow: var(--panel-shadow); }
.card h2 { margin: 0; font-size: var(--s-12); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
[data-theme="classic"] .card h2 { font-family: var(--f-display); font-size: 20px; letter-spacing: .02em; text-transform: none; font-weight: 400; color: #e8c46a; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* turn card */
.turn-head { display: flex; gap: 12px; align-items: center; }
.turn h3 { margin: 2px 0 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(26px, 2.4vw, 34px); line-height: 1.05; text-wrap: balance; }
.tracker { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.tracker li { flex: 1; display: flex; gap: 6px; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 99px; font-size: var(--s-12); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.tracker li span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line-2); color: var(--fg); font-size: 11px; }
.tracker li.now { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-hi); }
.tracker li.now span { background: var(--gold-ink); color: var(--gold); }
.tracker li.done { color: var(--up); border-color: color-mix(in srgb, var(--up) 60%, transparent); }
.tracker li.done span { background: var(--up); color: #062; }
.hint { margin: 0; font-size: var(--s-16); line-height: 1.45; }
.more summary { cursor: pointer; color: var(--gold); font-weight: 700; font-size: var(--s-14); }
.more > div { display: grid; gap: 8px; margin-top: 8px; font-size: var(--s-14); color: var(--muted); }
.more p { margin: 0; }
.turn .roll-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.last-roll { display: inline-flex; gap: 6px; align-items: center; }
.mini-die { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-num); font-weight: var(--w-num); font-size: 20px; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.mini-die.num { background: #c8261c; }
.mini-die.let { background: var(--pc, #17171c); color: var(--pi, #fff); }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.reacts button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-size: 20px; }

/* the market */
.mkt { display: grid; gap: 10px; }
.mrow { border-radius: var(--r); padding: 12px; display: grid; gap: 10px; position: relative; transition: transform .15s, box-shadow .15s; }
[data-theme="classic"] .mrow { background: var(--paper) repeating-radial-gradient(ellipse at 100% 0, transparent 0 7px, rgba(120,90,30,.05) 7px 8px); color: var(--paper-ink); border-left: 8px solid var(--pc); box-shadow: 0 6px 16px rgba(0,0,0,.3), inset 0 0 0 1px rgba(120,90,30,.25); }
[data-theme="modern"] .mrow { background: linear-gradient(110deg, color-mix(in srgb, var(--pc) 18%, var(--paper)) 0, var(--paper) 45%); color: var(--paper-ink); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--pc); }
.mrow:hover { transform: translateY(-1px); }
.mrow.held { box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(0,0,0,.3); }
.mrow.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 6px 16px rgba(0,0,0,.3); } }
.mtop { display: flex; gap: 10px; align-items: center; min-width: 0; }
.mname { flex: 1; min-width: 0; display: grid; }
.mname b { font-family: var(--f-display); font-weight: var(--w-display); font-size: 19px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mname small { font-size: var(--s-12); color: var(--paper-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="classic"] .mname small { font-family: var(--f-type); }
.mprice { display: grid; justify-items: end; gap: 2px; flex: 0 0 auto; }
.flaps { display: inline-flex; gap: 2px; font-family: var(--f-num); font-weight: var(--w-num); font-variant-numeric: tabular-nums; }
[data-theme="classic"] .flaps i { font-style: normal; display: grid; place-items: center; width: 22px; height: 32px; border-radius: 3px; background: linear-gradient(#2a251d 0 49%, #000 49% 51%, #221e17 51%); color: #f6d97a; font-size: 26px; line-height: 1; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
[data-theme="classic"] .flaps i.cur { width: 16px; font-size: 20px; color: #c9a24a; }
[data-theme="modern"] .flaps { font-size: 26px; line-height: 1; letter-spacing: -.01em; }
[data-theme="modern"] .flaps i { font-style: normal; }
[data-theme="modern"] .flaps i.cur { font-size: 18px; opacity: .7; margin-right: 1px; align-self: flex-start; padding-top: 3px; }
.chg { font-size: var(--s-12); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--paper-muted); }
.chg.up { color: #1d9c55; } .chg.down { color: #d33a2c; }
[data-theme="modern"] .chg.up { color: var(--up); } [data-theme="modern"] .chg.down { color: var(--down); }
.mstat { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; gap: 5px; align-items: center; font-size: var(--s-12); font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(127,127,127,.14); color: var(--paper-ink); }
.pill.dim { opacity: .7; }
.pill.pays { background: color-mix(in srgb, var(--up) 22%, transparent); color: #127a3f; }
[data-theme="modern"] .pill.pays { color: var(--up); }
.pill.bad { background: color-mix(in srgb, var(--down) 20%, transparent); color: #b3271b; }
[data-theme="modern"] .pill.bad { color: var(--down); }
.own { margin-left: auto; font-size: var(--s-12); font-weight: 800; background: var(--gold); color: var(--gold-ink); padding: 3px 9px; border-radius: 99px; }
.mbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.mbtns .btn { min-height: 40px; font-size: var(--s-14); }
.mbtns .btn.buy { flex: 1 1 120px; background: #1c7a47; border-color: #1c7a47; color: #fff; }
.mbtns .btn.buy:hover:not(:disabled) { background: #22925a; }
.mbtns .btn.sell { flex: 1 1 110px; }
[data-theme="classic"] .mbtns .btn.sell, [data-theme="classic"] .mbtns .btn.xs { background: #fff8e6; border-color: #cdbd93; color: var(--paper-ink); }
.mbtns .btn.boost { background: var(--gold); border-color: var(--gold-hi); color: var(--gold-ink); }
@media (pointer: coarse) { .mbtns .btn, .btn.sm, .btn.xs { min-height: 44px; } }

/* portfolio + tips + offers */
.port { width: 100%; border-collapse: collapse; font-size: var(--s-14); font-variant-numeric: tabular-nums; }
.port th { font-size: var(--s-12); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; font-weight: 700; padding: 0 6px 6px; }
.port td { padding: 7px 6px; border-top: 1px solid var(--line); }
.port .num { text-align: right; }
.port tfoot td { font-weight: 800; }
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.tip-state { font-size: var(--s-12); font-weight: 800; color: var(--muted); }
.tip-state.go { color: var(--gold); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.tipcard { position: relative; text-align: left; border-radius: var(--r); padding: 12px 10px 10px; display: grid; gap: 6px; align-content: start; min-height: 150px; color: #fff; border: 0;
  background: linear-gradient(160deg, var(--tc1), var(--tc2)); box-shadow: 0 8px 18px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.18); transition: transform .15s, box-shadow .15s; }
.tipcard.t-rumour { --tc1: #1d9c55; --tc2: #0c4f2b; }
.tipcard.t-scandal { --tc1: #d33a2c; --tc2: #6b1a12; }
.tipcard.t-hedge { --tc1: #2f6fd0; --tc2: #172f63; }
.tipcard.t-double { --tc1: #7b52d9; --tc2: #3a2275; }
.tipcard .t-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2); font-family: var(--f-num); font-weight: var(--w-num); font-size: 20px; }
.tipcard b { font-family: var(--f-display); font-weight: var(--w-display); font-size: 18px; line-height: 1.1; color: #fff; }
.tipcard .t-txt { font-size: 13px; line-height: 1.35; opacity: .92; }
.tipcard .t-cta { margin-top: auto; font-size: var(--s-12); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; background: rgba(0,0,0,.28); border-radius: 99px; padding: 4px 8px; text-align: center; }
.tipcard.live { cursor: pointer; animation: tipglow 2.2s ease-in-out infinite; }
.tipcard.live .t-cta { background: var(--gold); color: var(--gold-ink); }
.tipcard.live:hover { transform: translateY(-4px) rotate(-1deg); }
@keyframes tipglow { 50% { box-shadow: 0 8px 18px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.18), 0 0 0 3px rgba(242,184,41,.55); } }
.tipcard[aria-pressed="true"] { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold), 0 14px 28px rgba(0,0,0,.45); animation: none; }
.tipcard:disabled { opacity: .55; filter: saturate(.55); cursor: not-allowed; }
[data-theme="classic"] .tipcard { border-radius: 4px; box-shadow: 0 8px 18px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,240,200,.35), inset 0 0 0 5px rgba(0,0,0,.15); }
[data-theme="classic"] .tipcard .t-txt { font-family: var(--f-type); }
.tip-target { display: grid; gap: 8px; padding: 12px; border-radius: var(--r); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px dashed var(--gold); }
.tip-target p { margin: 0; }
.pick-co { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick-co button { display: flex; gap: 6px; align-items: center; min-height: 44px; border-radius: var(--r-sm); border: 0; background: var(--pc); color: var(--pi); font-weight: 800; font-size: var(--s-12); padding: 4px 8px; }
.pick-co button:hover { filter: brightness(1.15); }

/* news-card scenes: Classic prints them as inked newspaper engravings; Modern lights them like a news-app photo */
.n-art { border-radius: var(--r-sm); overflow: hidden; }
.art { display: block; width: 100%; height: auto; }
.art * { transform-box: fill-box; transform-origin: center; }
[data-theme="classic"] .n-art { border: 2px solid #231b10; outline: 1px solid #231b10; outline-offset: 2px; margin: 2px; }
[data-theme="classic"] .art { --sky: #e9dfc3; --gnd: #b9a77f; --bld: #7d6a4c; --roof: #4f3f2a; --door: #2e2418; --win: #e9dfc3; --ink: #231b10; --paper: #f6efdc; --fill: #a8936b; --dark: #3a2f20; --metal: #6f6656;
  filter: sepia(.55) saturate(.65) contrast(1.08); }
[data-theme="classic"] .a-hatch { fill: url(#hatch); opacity: .1; }
[data-theme="modern"] .n-art { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
[data-theme="modern"] .art { --sky: #182134; --gnd: #0e131d; --bld: #2a3448; --roof: #1f2737; --door: #0f141e; --win: #ffd27a; --ink: #eef1f7; --paper: #eef1f7; --fill: #3a4458; --dark: #0b0e14; --metal: #8d97ab;
  background: radial-gradient(120% 90% at 80% 0%, color-mix(in srgb, var(--pc) 35%, transparent), transparent 60%); }
[data-theme="modern"] .a-sky { fill: transparent; }
[data-theme="modern"] .a-hatch { display: none; }
[data-theme="modern"] .art .a-win { filter: drop-shadow(0 0 4px #ffd27a); }
/* Party: daylight Memphis, in the look's cobalt and office white with the flamingo accent (it had no palette, so every shape drew black) */
[data-theme="party"] .n-art { border: 2px solid #161C7A; }
[data-theme="party"] .art { --sky: #DCDFFB; --gnd: #161C7A; --bld: #2E3FE8; --roof: #161C7A; --door: #161C7A; --win: #FF5C98; --ink: #161C7A; --paper: #F3F0F8; --fill: #9AA2F3; --dark: #161C7A; --metal: #6B72C9; }
[data-theme="party"] .a-hatch { display: none; }
.a-sky { fill: var(--sky); } .a-ground { fill: var(--gnd); }
.a-bld rect, .a-bld path { fill: var(--bld); } .a-bld .a-roof { fill: var(--roof); } .a-bld .a-door { fill: var(--door); } .a-bld .a-win { fill: var(--win); } .a-bld .a-col { fill: var(--paper); opacity: .8; }
.a-engrave { fill: var(--paper); font: 700 9px Georgia, serif; letter-spacing: .2em; text-anchor: middle; }
.a-person { fill: var(--dark); } [data-theme="modern"] .a-person { fill: #c9d1e2; }
.a-coin { fill: #e3b23c; stroke: #8a6100; stroke-width: 1.5; }
.a-rain { stroke: #6aa7dd; stroke-width: 2; stroke-linecap: round; }
.a-stick { stroke: var(--dark); stroke-width: 4; fill: var(--dark); } [data-theme="modern"] .a-stick { stroke: #c9d1e2; fill: #c9d1e2; }
.a-sign { fill: var(--paper); stroke: var(--dark); stroke-width: 2; } .a-sign-t { fill: #b0281b; font: 900 10px Georgia, serif; text-anchor: middle; letter-spacing: .04em; } .a-sign-t.sm { font-size: 8px; fill: var(--dark); }
.a-paper { fill: var(--paper); stroke: var(--dark); stroke-width: .8; } .a-lines { stroke: var(--fill); stroke-width: 3; } .a-ink { stroke: var(--dark); stroke-width: 2; }
.a-step { fill: var(--fill); } .a-redbox { fill: #a8261c; stroke: var(--dark); stroke-width: 1.5; }
.a-chest { fill: #6b4a2a; stroke: var(--dark); stroke-width: 1.5; } [data-theme="modern"] .a-chest { fill: #2a3448; stroke: #8d97ab; }
.a-safe { fill: var(--metal); stroke: var(--dark); stroke-width: 2; } .a-safedoor { fill: var(--fill); stroke: var(--dark); stroke-width: 2; } .a-dial { fill: var(--paper); stroke: var(--dark); stroke-width: 2; }
.a-note { fill: #8fbf8f; stroke: #2f5a2f; stroke-width: 1; }
.a-shop { fill: var(--bld); } .a-shelf { stroke: var(--paper); stroke-width: 3; opacity: .7; }
.a-box { fill: #b88a52; stroke: var(--dark); stroke-width: 1; } .a-boxline { stroke: var(--dark); stroke-width: 1; opacity: .6; }
.a-belt { fill: var(--dark); }
.a-robot rect { fill: var(--metal); } .a-robot path { stroke: var(--metal); }
.a-board { fill: #22302a; stroke: #6b4a2a; stroke-width: 5; } .a-chalk { fill: #f2f2ea; font: 700 20px Georgia, serif; text-anchor: middle; } .a-strike { text-decoration: line-through; opacity: .55; }
.a-ribbon { fill: #e3b23c; } .a-ribbon-box { fill: color-mix(in srgb, var(--pc) 80%, #000); }
.a-hat { fill: var(--dark); stroke: var(--dark); stroke-width: 2; } [data-theme="modern"] .a-hat { fill: #c9d1e2; stroke: #c9d1e2; }
.a-whisper { fill: var(--dark); font: italic 700 11px Georgia, serif; text-anchor: middle; } [data-theme="modern"] .a-whisper { fill: #c9d1e2; }
.a-water { fill: #3f7fbf; opacity: .85; } .a-water2 { fill: #6aa7dd; opacity: .8; }
.a-chain { stroke: #8d8577; stroke-width: 4; stroke-dasharray: 5 2; } .a-lock { fill: #c9a24a; stroke: var(--dark); stroke-width: 1.5; }
.a-chip { fill: #2a2f3a; stroke: #9aa3b2; stroke-width: 1; }
.a-moon { fill: #f2d98a; } .a-bed { fill: var(--fill); } .a-pillow { fill: var(--paper); }
.a-phone { fill: #111; } .a-screen { fill: #23324a; } .a-phone-t { fill: #fff; font: 700 12px Arial, sans-serif; text-anchor: middle; } .a-phone-l { stroke: #9fb3d6; stroke-width: 3; }
[data-theme="modern"] .art .a-screen { filter: drop-shadow(0 0 8px #6aa7ff); }
.a-spark { fill: #e3b23c; }
.art .wave { animation: wave 1.6s linear infinite; } .art .wave.slow { animation-duration: 2.6s; animation-direction: reverse; }
.art .wave path { animation: waterrise 2.4s ease-out both; }
@keyframes wave { to { transform: translateX(-60px); } }
@keyframes waterrise { from { transform: translateY(34px); } }
.art .bob { animation: bob 1.6s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(-5px) rotate(6deg); } }
.art .rise { animation: rise 1.4s ease-in-out infinite alternate; } @keyframes rise { from { transform: translateY(5px); } to { transform: translateY(-5px); } }
.art .sink { animation: sink 1.6s ease-in-out infinite alternate; } @keyframes sink { to { transform: translateY(4px) scaleY(.94); } }
.art .float { animation: bob 2.6s ease-in-out infinite; }
.art .pulse { animation: pulseA 1.2s ease-in-out infinite; } @keyframes pulseA { 50% { transform: scale(1.1); } }
.art .shake { animation: shakeA .6s ease-in-out infinite; } @keyframes shakeA { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.art .hop { animation: hopA .9s ease-in-out infinite; } @keyframes hopA { 50% { transform: translateY(-4px); } }
.art .drop { animation: dropA .9s cubic-bezier(.3,1.4,.5,1) both; } @keyframes dropA { from { transform: translateY(-70px); opacity: 0; } }
.art .flyaway { animation: flyA 1.8s ease-in infinite; } @keyframes flyA { to { transform: translate(70px, -70px) rotate(120deg); opacity: 0; } }
.art .fall { animation: rainA .7s linear infinite; } @keyframes rainA { to { transform: translate(-6px, 40px); opacity: 0; } }
.art .toss { animation: tossA 1.6s ease-in-out infinite; } @keyframes tossA { 50% { transform: translateY(-14px) rotate(25deg); } }
.art .roll { animation: rollA 1.5s linear infinite; } @keyframes rollA { from { transform: translateX(0); } to { transform: translateX(110px) rotate(360deg); opacity: 0; } }
.art .run { animation: runA 1.2s ease-in-out infinite alternate; } @keyframes runA { to { transform: translateX(10px) rotate(6deg); } }
.art .lean { animation: leanA 2s ease-in-out infinite; } @keyframes leanA { 50% { transform: rotate(8deg); } }
.art .lean2 { animation: leanB 2s ease-in-out infinite; } @keyframes leanB { 50% { transform: rotate(-8deg); } }
.art .slide { animation: slideA 3s linear infinite; } @keyframes slideA { to { transform: translateX(-120px); } }
.art .grow { animation: growA 1.2s ease-out both; } @keyframes growA { from { transform: scaleX(0); } }
.art .zoom { animation: zoomA .7s cubic-bezier(.2,1.6,.4,1) both; } @keyframes zoomA { from { transform: scale(.2); } }
.art .swing { transform-origin: 61px 88px; transform-box: view-box; animation: swingA 1.2s ease-in-out infinite alternate; } @keyframes swingA { from { transform: rotate(-12deg); } to { transform: rotate(10deg); } }

.offer-in { background: color-mix(in srgb, var(--tip) 18%, var(--surface)); border: 1px solid var(--tip); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; }

/* ticker tape */
.tape { border-top: 1px solid var(--line); background: var(--bg-2); overflow: hidden; height: 36px; display: flex; align-items: center; }
[data-theme="classic"] .tape { background: #efe7d2; border-top: 3px double #c9a24a; }
.tape .run { display: inline-flex; gap: 48px; white-space: nowrap; font-family: var(--f-type); font-size: var(--s-14); color: var(--muted); padding-left: 100%; animation: tape 60s linear infinite; }
[data-theme="classic"] .tape .run { color: #231b10; }
.tape .run b { color: var(--gold); font-weight: 400; }
[data-theme="classic"] .tape .run b { color: #8e1d10; }
@keyframes tape { to { transform: translateX(-100%); } }

/* roll banner, dice, notices and board key over the stage */
.stage-banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line-2); font-size: var(--s-16); white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.stage-banner.in { animation: bannerIn .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes bannerIn { from { transform: translate(-50%, -24px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

.dice-ov { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; align-content: center; gap: 14px; pointer-events: none; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); transition: opacity .35s; }
.dice-ov.done { opacity: 0; }
.dice-pair { display: flex; gap: 22px; }
.die { width: 92px; height: 92px; border-radius: 18px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.25), 0 18px 30px rgba(0,0,0,.5); animation: tumble .22s linear infinite; }
.dice-pair .die:nth-child(2) { animation-duration: .27s; animation-direction: reverse; }
.dice-pair.land .die { animation: land .55s cubic-bezier(.2,1.6,.4,1); }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-14px) scale(.92); } 100% { transform: rotate(360deg) translateY(0); } }
@keyframes land { 0% { transform: scale(1.35) rotate(-20deg); } 100% { transform: none; } }
.die.num { background: #c8261c; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 14px; gap: 4px; }
.die.num i { border-radius: 50%; }
.die.num i.on { background: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.die.let { background: var(--pc); color: var(--pi); display: grid; place-items: center; align-content: center; gap: 2px; }
.die.let b { font-family: var(--f-num); font-weight: var(--w-num); font-size: 44px; line-height: 1; }
.dice-say { font-family: var(--f-display); font-weight: var(--w-display); font-size: 28px; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.8); }

.notice { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 5; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow-y: auto; border-radius: calc(var(--r) + 4px); padding: 16px 18px; display: grid; gap: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
[data-theme="modern"] .notice { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line-2); }
[data-theme="classic"] .notice { background: #efe7d2; color: #231b10; border: 1px solid #c9a24a; box-shadow: 0 0 0 4px #efe7d2, 0 0 0 5px #c9a24a, 0 24px 60px rgba(0,0,0,.6); }
[data-theme="classic"] .notice .muted { color: #6e6250; }
.notice.in { animation: noticeIn .4s cubic-bezier(.2,1.3,.4,1); }
@keyframes noticeIn { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.notice h4 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 26px; line-height: 1.1; }
.notice h4.good { color: #1c8a4f; } .notice h4.bad { color: #d33a2c; } .notice h4.gold { color: #b07c00; } .notice h4.news { color: #6a3fc0; }
[data-theme="modern"] .notice h4.good { color: var(--up); } [data-theme="modern"] .notice h4.bad { color: var(--down); } [data-theme="modern"] .notice h4.gold { color: var(--gold); } [data-theme="modern"] .notice h4.news { color: #b9a0ff; }
.notice p { margin: 0; }
.n-kick { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--s-12); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; opacity: .75; }
[data-theme="classic"] .n-kick { font-family: var(--f-type); font-weight: 400; border-bottom: 2px solid #231b10; padding-bottom: 6px; opacity: 1; }
.n-news .head { font-family: var(--f-display); font-weight: var(--w-display); font-size: 28px; line-height: 1.05; margin-bottom: 4px; }
[data-theme="classic"] .n-news .head { font-family: var(--f-num); font-size: 34px; letter-spacing: .02em; }
[data-theme="classic"] .n-news > div:last-child { font-family: var(--f-type); }
.n-fx { margin: 0; padding-left: 18px; font-size: var(--s-14); display: grid; gap: 2px; }
.n-foot { display: flex; gap: 12px; align-items: center; margin-top: 4px; }

.board-key { position: absolute; top: 64px; left: 12px; z-index: 5; width: min(420px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow-y: auto; background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: calc(var(--r) + 4px); padding: 14px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.55); display: grid; gap: 8px; }
.board-key ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board-key li { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; font-size: var(--s-14); line-height: 1.4; }
.board-key p { margin: 0; color: var(--muted); }
.key-head { display: flex; justify-content: space-between; align-items: center; }
.key-head h4 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 22px; }
.kicon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 800; font-size: 12px; color: var(--gold); }
.kicon.puck::before { content: ""; width: 22px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 3px 0 #0c3b77, 0 0 0 2px #c9a24a; }
.kicon.pawn::before { content: ""; width: 12px; height: 22px; background: var(--blue); border-radius: 50% 50% 4px 4px; }
.kicon.slump { color: var(--down); }

/* flat board */
.flat { position: absolute; inset: 0; overflow: auto; padding: 16px; display: grid; place-items: start center; }
.board { border-radius: 10px; display: grid; grid-template-columns: 64px repeat(6, minmax(34px, 56px)); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
[data-theme="classic"] .board { background: #24513d; color: #efe5c8; border: 10px solid #16110c; outline: 2px solid #c9a24a; }
[data-theme="modern"] .board { background: #e7ebf2; color: #141821; border: 6px solid #2b303b; box-shadow: 0 0 0 1px #4de1c1, 0 18px 40px rgba(0,0,0,.4); }
.board .hdr { display: grid; place-items: center; padding: 6px 0 4px; }
.board .lab { font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; height: 20px; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; font-family: var(--f-num); }
.board .lab.pay { color: var(--gold); }
.board .lab.slump, .board .lab.bankrupt { color: var(--down); }
.cell { position: relative; height: 20px; border-bottom: 1px solid rgba(0,0,0,.2); margin: 0 4px; display: grid; place-items: center; }
.cell::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: rgba(0,0,0,.45); }
.c-red { background: var(--red); } .c-black { background: var(--black); } .c-white { background: var(--white); }
.c-salmon { background: var(--salmon); } .c-blue { background: var(--blue); } .c-yellow { background: var(--yellow); }
.cell .cm { position: absolute; font-weight: 800; font-size: 11px; color: #fff; }
.c-yellow .cm { color: #241a02; }
.peg { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.peg.parent { width: 20px; height: 20px; border: 4px solid #111; background: var(--pc); z-index: 1; }
.peg.trav { width: 12px; height: 12px; border: 2px solid #111; background: radial-gradient(circle at 35% 35%, #fff 0 25%, var(--pc) 30%); z-index: 2; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(3,5,8,.72); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.sheet { background: var(--surface); border: 1px solid var(--line-2); border-radius: calc(var(--r) + 6px); width: min(660px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; display: grid; gap: 14px; box-shadow: 0 30px 70px rgba(0,0,0,.55); }
[data-theme="classic"] .sheet { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(201,162,74,.4), 0 30px 70px rgba(0,0,0,.55); }
.sheet h2 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 32px; line-height: 1.1; text-wrap: balance; }
.sheet h3 { margin: 4px 0 0; font-size: var(--s-12); text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.sheet p, .sheet li { margin: 0; }
.sheet ul, .sheet ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.report { width: 100%; border-collapse: collapse; font-size: var(--s-14); font-variant-numeric: tabular-nums; }
.report th, .report td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); }
.report th { border-top: 0; font-size: var(--s-12); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.payday { font-family: var(--f-display); font-weight: var(--w-display); font-size: 20px; }
.scroll-x { overflow-x: auto; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.35); vertical-align: middle; }
.quick { list-style: none; padding: 0 !important; counter-reset: q; }
.quick li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.quick li::before { counter-increment: q; content: counter(q); width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-family: var(--f-num); font-weight: var(--w-num); }
.legend-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: var(--bg-2); border-radius: var(--r); padding: 12px; font-size: var(--s-14); }
.legend-grid b { color: var(--gold); }
details.full summary { cursor: pointer; font-weight: 800; color: var(--gold); }
.winner-banner { background: var(--gold); color: var(--gold-ink); border-radius: var(--r); padding: 14px 16px; font-weight: 800; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 80; box-shadow: 0 10px 24px rgba(0,0,0,.45); max-width: calc(100% - 32px); }

/* player pieces */
.ptoken { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-2); color: var(--pcol); border: 2px solid var(--pcol); flex: 0 0 auto; padding: 0; }
.ptoken svg { width: 16px; height: 16px; }
.ptoken.big { width: 48px; height: 48px; cursor: pointer; }
.ptoken.big svg { width: 26px; height: 26px; }
.turn-token .ptoken.big { cursor: default; box-shadow: 0 0 0 4px color-mix(in srgb, var(--pcol) 25%, transparent); }
.piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.piece-opt { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); font-size: var(--s-12); font-weight: 700; min-height: 72px; }
.piece-opt svg { width: 28px; height: 28px; color: var(--fg); }
.piece-opt[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.piece-opt[aria-pressed="true"] svg { color: var(--gold); }

/* phone action bar */
.dock { display: none; }

@media (max-width: 1100px) { .main { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero .stack { display: none; }
  .lobby { padding-block: 20px 48px; gap: 20px; }
  .panels { grid-template-columns: 1fr; }
  .game { height: auto; display: block; }
  .main { display: block; }
  .stage { height: 58dvh; min-height: 360px; }
  .side { border-left: 0; overflow: visible; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .tape { position: sticky; bottom: 0; }
  .top .meta { display: none; }
  .top { justify-content: space-between; }
  .stage-hint { display: none; }
  .stage-tools { left: 8px; bottom: 8px; gap: 6px; }
  .notice { bottom: 54px; padding: 12px 14px; }
  .notice h4 { font-size: 21px; }
  .die { width: 72px; height: 72px; }
  .dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg-2) 95%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .dock .btn { flex: 1; }
  .dock .btn.big { flex: 2; min-height: 54px; font-size: var(--s-16); }
  .side .roll-row .btn.big { display: none; }
}
@media (max-width: 460px) {
  .top .acts { gap: 5px; }
  .top .acts .btn { padding: 4px 8px; font-size: 11px; }
  body:has(#game:not([hidden])) #rulesBtn { display: none; }
  .logo { font-size: 22px; }
  .stage-tools .btn { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* new tips */
.tipcard.t-buyback { --tc1: #c8941c; --tc2: #6b4a07; }
.tipcard.t-short { --tc1: #5d6476; --tc2: #252935; }
.tipcard.t-bullrun { --tc1: #0fa38a; --tc2: #07493e; }

/* trades as they happen, over the table */
.feed { position: absolute; top: 62px; right: 12px; z-index: 4; display: grid; gap: 6px; justify-items: end; pointer-events: none; max-width: min(360px, calc(100% - 24px)); }
.feed-chip { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; font-size: var(--s-14); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line-2); box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: feedIn .35s cubic-bezier(.2,1.4,.4,1); transition: opacity .4s, transform .4s; }
.feed-chip.buy { border-color: color-mix(in srgb, var(--up) 70%, transparent); }
.feed-chip.sell { border-color: color-mix(in srgb, var(--down) 70%, transparent); }
.feed-chip.bet { border-color: var(--gold); }
.feed-chip .mlogo { width: 22px; height: 22px; }
.feed-chip.out { opacity: 0; transform: translateX(20px); }
@keyframes feedIn { from { transform: translateX(40px); opacity: 0; } }

/* rank in the player strip */
.rank { font-weight: 800; color: var(--fg); }
.rank.r0 { color: var(--gold); }

/* side bets */
.bet-who { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.bet-who button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 700; font-size: var(--s-14); }
.bet-who button .ptoken { grid-row: span 2; }
.bet-who button small { color: var(--muted); font-weight: 600; }
.bet-who button[aria-pressed="true"] { border-color: var(--pcol); box-shadow: inset 0 0 0 2px var(--pcol); }
.bet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--s-14); }
.bet-list li { display: flex; gap: 8px; align-items: center; }

/* standings in the round report */
.standings { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 6px; }
.standings li { display: grid; grid-template-columns: 28px auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.standings li.first { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.standings .pos { font-family: var(--f-num); font-weight: var(--w-num); font-size: 22px; color: var(--gold); text-align: center; }
.standings .w { display: grid; justify-items: end; font-family: var(--f-num); font-weight: var(--w-num); font-size: 20px; line-height: 1.1; }
.standings .w small { font-family: var(--f-body); font-size: var(--s-12); color: var(--muted); font-weight: 600; }

/* turning over a new tip */
.reveal-ov { z-index: 70; }
.reveal { display: grid; justify-items: center; gap: 18px; text-align: center; }
.reveal .label { color: var(--gold); font-size: var(--s-14); }
.flipcard { position: relative; width: 210px; height: 290px; border: 0; padding: 0; background: none; cursor: pointer; animation: dealIn .6s cubic-bezier(.2,1.3,.4,1); }
@keyframes dealIn { from { transform: translateY(-120px) rotate(-20deg) scale(.6); opacity: 0; } }
.flipcard > span { position: absolute; inset: 0; transition: transform .22s ease-in; border-radius: 14px; }
.fc-back { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--gold-ink);
  background: repeating-linear-gradient(45deg, var(--gold) 0 10px, var(--gold-hi) 10px 20px); box-shadow: 0 20px 50px rgba(0,0,0,.6), inset 0 0 0 6px rgba(255,255,255,.35); }
.fc-back b { font-family: var(--f-display); font-weight: var(--w-display); font-size: 90px; line-height: 1; }
.fc-back small { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.flipcard:not(.flipped) .fc-back { animation: wiggle 1.6s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } }
.fc-front.tipcard { transform: scaleX(0); min-height: 0; padding: 20px 16px; gap: 12px; align-content: center; justify-items: center; text-align: center; }
.fc-front.tipcard .t-ico { width: 64px; height: 64px; font-size: 30px; }
.fc-front.tipcard b { font-size: 28px; }
.fc-front.tipcard .t-txt { font-size: 15px; }
.flipcard.flipped .fc-back { transform: scaleX(0); }
.flipcard.flipped .fc-front { transform: scaleX(1); transition: transform .35s cubic-bezier(.2,1.6,.4,1) .22s; }

/* Market News in the notice: a newspaper clipping (Classic) or a breaking-news alert (Modern) */
.n-mast { display: none; }
[data-theme="classic"] .n-mast { display: block; text-align: center; font-family: var(--f-display); font-size: 28px; line-height: 1; border-bottom: 3px double #231b10; padding-bottom: 6px; }
[data-theme="classic"] .notice.news { background: #f1e9d3; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 3px); transform: translateX(-50%) rotate(-.6deg); }
[data-theme="classic"] .notice.news .n-news .head { font-family: var(--f-num); font-size: 38px; line-height: .95; text-transform: uppercase; }
[data-theme="classic"] .notice.news .n-news > div:last-child { font-family: var(--f-type); columns: 2; column-gap: 16px; column-rule: 1px solid rgba(35,27,16,.3); font-size: 14px; }
[data-theme="modern"] .n-kick .live { color: #ff5a4e; font-weight: 800; }
[data-theme="modern"] .n-kick .live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff5a4e; margin-right: 6px; animation: blink 1s infinite; }

/* Classic on the 3D table: the printed card is on the board, so the notice is just a slim bar to carry on */
.notice.slim { grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; width: min(640px, calc(100% - 24px)); bottom: 58px; }
.notice.slim .n-line { margin: 0; font-size: var(--s-14); line-height: 1.4; }
.notice.slim .n-foot { margin: 0; }
.notice.slim .n-foot .muted { display: none; }
[data-theme="classic"] .notice.slim { box-shadow: 0 0 0 3px #efe7d2, 0 0 0 4px #c9a24a, 0 14px 40px rgba(0,0,0,.55); }

/* a passing move: shows briefly with a countdown bar, no click needed */
.notice.passing { opacity: .96; }
.n-timer { flex: 1; height: 3px; border-radius: 99px; background: var(--gold); transform-origin: left; animation: ntimer var(--wait, 1.7s) linear forwards; }
@keyframes ntimer { to { transform: scaleX(0); } }

/* compact market table: one line per company, tap a row for the full card */
.mkt:has(.compact) { gap: 6px; }
.mrow.compact { padding: 8px 10px; gap: 8px; }
.mrow.compact .mtop { cursor: pointer; gap: 8px; }
.mrow.compact .mlogo { width: 28px; height: 28px; }
.mrow.compact .mname b { font-size: 15px; }
.mrow.compact .mquick .btn { padding: 2px 7px; }
.mrow.compact .mname small { font-size: 12px; white-space: normal; overflow: visible; }
.mrow.compact .mname .mine { white-space: nowrap; }
.mrow.compact .spark { display: none; } /* the side column is narrow: the name and what you own come first */
.mrow.compact .mname .mine { color: var(--gold-deep); }
[data-theme="modern"] .mrow.compact .mname .mine { color: var(--gold); }
.mrow.compact .flaps i { width: 18px; height: 26px; font-size: 21px; }
[data-theme="modern"] .mrow.compact .flaps { font-size: 21px; }
.mrow.compact.open { box-shadow: 0 0 0 2px var(--pc), 0 6px 16px rgba(0,0,0,.3); }
.mquick { display: flex; gap: 4px; }
.mquick .btn { min-height: 32px; padding: 2px 9px; font-size: 12px; }
.mquick .btn.buy { background: #1c7a47; border-color: #1c7a47; color: #fff; }
[data-theme="classic"] .mquick .btn.sell { background: #fff8e6; border-color: #cdbd93; color: var(--paper-ink); }
.spark { flex: 0 0 auto; width: 44px; height: 22px; }
.spark polyline { stroke: var(--paper-muted); }
.spark.up polyline { stroke: #1d9c55; } .spark.down polyline { stroke: #d33a2c; }
[data-theme="modern"] .spark.up polyline { stroke: var(--up); } [data-theme="modern"] .spark.down polyline { stroke: var(--down); }
.mrow:not(.compact) .spark { display: none; }
#mktView { margin-left: auto; }
.card-head #cashNote { margin-left: auto; }
.card-head #cashNote + #mktView { margin-left: 8px; }
/* tips fold to a header line when you can't use them */
.tips.folded .hand, .tips.folded .tip-target { display: none; }
[data-tipsfold] { cursor: pointer; }
.tips.folded [data-tipsfold]::after { content: " ▸"; color: var(--muted); }
@media (max-width: 460px) { .mrow.compact .spark { display: none; } }

/* online extras */
.turn-timer { font-size: var(--s-14); font-weight: 700; color: var(--muted); }
.turn-timer.low { color: var(--down); animation: blink 1s infinite; }
.says { display: flex; gap: 6px; flex-wrap: wrap; }
.says button { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 99px; padding: 5px 10px; font-size: var(--s-12); font-weight: 700; }
.says button:hover { border-color: var(--gold); }
.stage-say { position: absolute; bottom: 64px; left: 12px; z-index: 7; max-width: calc(100% - 24px); background: var(--fg); color: var(--bg); border-left: 6px solid var(--pcol); font-weight: 700; font-size: var(--s-14, 14px); padding: 8px 12px; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.35); pointer-events: none; animation: sayIn .3s ease-out; }
.stage-say.right { left: auto; right: 12px; }
.stage-say.emoji { background: none; box-shadow: none; border: 0; font-size: 40px; padding: 0; animation: pop 1.8s ease-out forwards; }
.say-bubble { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; white-space: nowrap; background: var(--fg); color: var(--bg); font-weight: 800; font-size: var(--s-12); padding: 5px 10px; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: sayIn .3s ease-out; pointer-events: none; }
@keyframes sayIn { from { opacity: 0; } }


.otable.live .ot-code { color: var(--muted); }

/* the winning screen */
.win-ov { z-index: 75; }
.win-sheet { width: min(640px, 100%); position: relative; z-index: 2; }
.win-head { display: flex; gap: 16px; align-items: center; }
.win-head .ptoken.big { width: 72px; height: 72px; cursor: default; box-shadow: 0 0 0 6px color-mix(in srgb, var(--pcol) 25%, transparent); }
.win-head .ptoken.big svg { width: 40px; height: 40px; }
.win-head h2 { font-size: clamp(34px, 6vw, 52px); color: var(--gold); }
.win-head p { margin: 0; }
.worth-chart { width: 100%; height: auto; background: var(--bg-2); border-radius: var(--r); border: 1px solid var(--line); }
.worth-chart .goal { stroke: var(--gold); stroke-dasharray: 5 5; opacity: .7; }
.worth-chart .goal-t { fill: var(--gold); font: 700 11px var(--f-body); text-anchor: end; }
.worth-chart .tick { fill: var(--muted); font: 600 10px var(--f-body); text-anchor: middle; }
.win-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.win-stats div { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.win-stats span { font-size: var(--s-12); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: confall linear infinite; }
@keyframes confall { to { transform: translateY(110vh) rotate(720deg); } }

/* computer level picker */
.name-row .lvl { width: auto; min-height: 44px; padding: 6px 8px; }
/* Learn to play */
.learn { display: flex; }
.coach { position: fixed; z-index: 90; background: var(--fg); color: var(--bg); border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.6); display: grid; gap: 10px; animation: sayIn .3s ease-out; }
.coach p { margin: 0; font-size: var(--s-16); line-height: 1.45; }
.coach .row { align-items: center; gap: 8px; }
.coach .muted { color: color-mix(in srgb, var(--bg) 60%, transparent); margin-right: auto; }
.coach .btn.ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.coach-glow { outline: 3px solid var(--gold) !important; outline-offset: 3px; border-radius: var(--r); animation: coachGlow 1.4s ease-in-out infinite; }
@keyframes coachGlow { 50% { outline-color: transparent; } }

/* roll for first turn */
.rolloff { width: min(520px, 100%); }
.ro-list { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.ro-list li { display: grid; grid-template-columns: auto 1fr auto 44px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); transition: transform .4s, box-shadow .3s; }
.ro-list li.ranked:first-child, .ro-list li.ranked[style*="order: 0"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.ro-dice { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.ro-die { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: #c8261c; color: #fff; font-family: var(--f-num); font-weight: var(--w-num); font-size: 22px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.ro-die.rolling { animation: shakeA .25s linear infinite; opacity: .8; }
.ro-list li.shown .ro-die { animation: land .5s cubic-bezier(.2,1.6,.4,1); }
.ro-pos { font-family: var(--f-num); font-weight: var(--w-num); font-size: 20px; color: var(--gold); text-align: right; }
@keyframes shakeA { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes land { 0% { transform: scale(1.35) rotate(-20deg); } 100% { transform: none; } }

/* phone + tablet polish */
.hero { overflow-x: clip; }
[data-theme="modern"] .flaps { gap: 0; }
@media (max-width: 820px) {
  .stage-tools { right: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .stage-tools::-webkit-scrollbar { display: none; }
  .stage-tools .btn { flex: 0 0 auto; }
}

.seats li.empty { opacity: .6; border-style: dashed; }
.seats li.empty .ptoken { color: var(--muted); font-weight: 800; }

.order-line { margin: 0; font-size: var(--s-14); }
.playpos { font-size: 11px; font-weight: 800; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 6px; }

/* ===== home page (rebuilt): play first, with the race itself as the opening scene ===== */
.lobby { max-width: 1180px; padding-block: 28px 72px; gap: 40px; }
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; min-height: 0; align-items: center; }
.hero::before { display: none; }
.hero-copy { display: grid; gap: 14px; justify-items: start; }
.hero h1 { font-size: clamp(64px, 10vw, 132px); margin-bottom: 6px; }
.hero p.tag { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; max-width: 18ch; }
.hero p.sub { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 44ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-cta .btn.big { min-height: 56px; font-size: 19px; }
.hero-cta .btn.big.ghost { box-shadow: none; border: 2px solid var(--line-2); animation: none; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--gold); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* the race: a living slice of the board */
.race { position: relative; border-radius: calc(var(--r) + 6px); padding: 14px 14px 10px; display: grid; gap: 7px; }
[data-theme="classic"] .race { background: #24513d; border: 10px solid #16110c; outline: 2px solid #c9a24a; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
[data-theme="modern"] .race { background: #e7ebf2; border: 6px solid #c3c9d4; box-shadow: 0 0 0 1px #4de1c1, 0 30px 60px rgba(0,0,0,.5), 0 0 60px rgba(77,225,193,.18); }
.race-top { display: grid; grid-template-columns: 40px 1fr 54px; align-items: center; gap: 8px; font-family: var(--f-num); font-weight: var(--w-num); font-size: 13px; }
[data-theme="classic"] .race-top { color: #efe5c8; } [data-theme="modern"] .race-top { color: #141821; }
.race-top .scale { display: flex; justify-content: space-between; opacity: .7; }
.race-top .pay { color: var(--gold); text-align: right; }
[data-theme="modern"] .race-top .pay { color: #0b7a63; }
.lane { position: relative; display: grid; grid-template-columns: 40px 1fr 54px; align-items: center; gap: 8px; height: 34px; }
.lane .badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: var(--pi); }
[data-theme="classic"] .lane .badge { box-shadow: 0 0 0 2px #c9a24a; }
.lane .track { position: relative; height: 26px; border-radius: 6px; background: var(--pc); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.2);
  background-image: linear-gradient(90deg, transparent calc(100% - 22%), rgba(255,255,255,.28) calc(100% - 22%)); }
[data-theme="modern"] .lane .track { border-radius: 13px; }
.lane .pawn { position: absolute; top: 50%; left: 2%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, color-mix(in srgb, var(--pc) 70%, #fff) 22%, var(--pc) 70%); box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 4px 8px rgba(0,0,0,.4); transition: left .45s cubic-bezier(.3,1.5,.5,1); }
.lane .price { font-family: var(--f-num); font-weight: var(--w-num); font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; transition: color .3s; }
[data-theme="classic"] .lane .price { color: #f6d97a; } [data-theme="modern"] .lane .price { color: #141821; }
.lane .price.up { color: #1d9c55 !important; } .lane .price.down { color: #d33a2c !important; }
.lane.hit .track { animation: hitflash .9s ease-out; }
@keyframes hitflash { 0% { box-shadow: 0 0 0 3px var(--gold), 0 0 24px var(--gold); } 100% { box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); } }
.race-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; padding-top: 4px; }
[data-theme="classic"] .race-foot { color: #efe5c8; font-family: var(--f-type); font-weight: 400; } [data-theme="modern"] .race-foot { color: #4b5466; }
.race-foot .die { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #c8261c; color: #fff; font-family: var(--f-num); font-weight: var(--w-num); margin-right: 6px; animation: none; box-shadow: none; }

/* pick a look */
.looks { display: grid; gap: 14px; }
.looks h2, .open-tables h2 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 28px; }
.look-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.look-tile { text-align: left; display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto 1fr; column-gap: 18px; row-gap: 4px; align-items: start; padding: 16px; border-radius: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.look-tile .lt-art { grid-row: span 2; height: 84px; border-radius: 8px; display: grid; gap: 3px; padding: 8px; }
.look-tile .lt-art i { display: block; border-radius: 3px; }
.look-tile .lt-art i:nth-child(1) { background: #d23a35; width: 78%; } .look-tile .lt-art i:nth-child(2) { background: #30353f; width: 52%; }
.look-tile .lt-art i:nth-child(3) { background: #7b52d9; width: 90%; } .look-tile .lt-art i:nth-child(4) { background: #c8743a; width: 40%; }
.look-tile .lt-art i:nth-child(5) { background: #1f74e0; width: 66%; } .look-tile .lt-art i:nth-child(6) { background: #e8b21c; width: 58%; }
.look-tile b { font-size: 24px; line-height: 1.1; }
.look-tile > span:last-child { font-size: 14px; line-height: 1.45; opacity: .85; }
.look-tile.classic { background: #132a20; color: #f4ecd8; border: 3px double rgba(201,162,74,.6); }
.look-tile.classic b { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; color: #e8c46a; }
.look-tile.classic .lt-art { background: #24513d; border: 4px solid #16110c; box-shadow: 0 0 0 1px #c9a24a; }
.look-tile.modern { background: #12151d; color: #eef1f7; border: 1px solid #2a3142; }
.look-tile.modern b { font-family: "Space Grotesk", Arial, sans-serif; font-weight: 700; color: #4de1c1; }
.look-tile.modern .lt-art { background: #e7ebf2; border: 3px solid #c3c9d4; }
.look-tile.modern .lt-art i { border-radius: 99px; }
.look-tile[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--gold), 0 14px 30px rgba(0,0,0,.4); transform: translateY(-2px); }
.look-tile:hover { transform: translateY(-2px); }

/* start a game: one card, two tabs */
.setup { display: grid; gap: 0; scroll-margin-top: 80px; }
.setup .rejoin { margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 12px 20px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 16px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); border-color: var(--line-2); }
.setup .panels { display: block; }
.setup .panel { border-top-left-radius: 0; max-width: 760px; }
.setup .mode-field { display: none; } /* the look tiles above choose the rules */
.field label, .joinrow label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; color: var(--fg); }
.joinrow { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.joinrow .row { align-items: center; }
#joinCode { width: 7.5em; }
.otables:has(> p:only-child) { display: block; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .look-tiles { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .lobby { padding-block: 18px 56px; gap: 30px; }
  .hero h1 { font-size: 72px; }
  .hero p.sub { font-size: 16px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn.big { flex: 1 1 100%; }
  .race { padding: 10px 10px 8px; border-width: 6px; }
  .lane, .race-top { grid-template-columns: 30px 1fr 44px; gap: 6px; }
  .lane .badge { width: 26px; height: 26px; }
  .lane .badge svg { width: 14px; height: 14px; }
  .lane .price { font-size: 15px; }
  .look-tile { grid-template-columns: 84px 1fr; padding: 12px; column-gap: 12px; }
  .look-tile .lt-art { height: 70px; }
  .tabs button { flex: 1; padding: 12px 8px; font-size: 15px; }
  .looks h2, .open-tables h2 { font-size: 24px; }
}
body:has(#lobby:not([hidden])) #guideBtn { display: none; }
/* desktop: start a game on the left, open tables beside it */
@media (min-width: 901px) {
  .lobby { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 32px; }
  .lobby > .hero, .lobby > .looks { grid-column: 1 / -1; }
  .lobby > .setup { grid-column: 1; }
  .lobby > .open-tables { grid-column: 2; align-self: start; padding-top: 6px; }
  .open-tables .otables { grid-template-columns: 1fr; }
  .setup .panel { max-width: none; }
}

/* the Flurry mark, real piece renders and company monograms */
.logo i[data-mark] { display: inline-flex; margin-right: 8px; align-self: center; transform: none !important; }
.logo i[data-mark] svg { display: block; }
.hero h1 .hero-mark { display: inline-flex; margin-right: 18px; align-self: center; transform: rotate(-8deg) !important; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.hero h1 .hero-mark svg { width: clamp(64px, 9vw, 112px); height: auto; }
.tok-img { width: 135%; height: 135%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.ptoken { overflow: visible; }
.ptoken.big .tok-img { width: 120%; height: 120%; }
.piece-opt .tok-img { width: 52px; height: 52px; }
.mlogo svg.mono, .hchip svg.mono, .pick-co svg.mono, .badge svg.mono, .cert-fly svg.mono { overflow: visible; }
[data-theme="classic"] .mlogo { box-shadow: 0 0 0 2px #c9a24a, inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.25); }

/* stock-exchange identity: hall mark + carved serif name */
.logo .wordmark { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 23px; letter-spacing: .16em; color: var(--gold); align-self: center; line-height: 1; }
.hero h1 { display: block; text-shadow: none; }
.hero-lockup { display: block; width: min(100%, 600px); }
.hero-lockup svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 26px rgba(0,0,0,.45)); }
@media (max-width: 520px) { .logo .wordmark { font-size: 19px; letter-spacing: .12em; } }
.hero-lockup, .logo i { font-style: normal; }

/* =====================================================================
   HOME — "a 1958 trading floor in print"  (see BRAND.md)
   Paper, ink, one accent (exchange green). DM Serif / Libre Franklin / JetBrains Mono.
   Scoped to body.home so the in-game Classic and Modern looks are untouched.
   ===================================================================== */
body.home {
  --paper-bg: #EFE9DC; --paper-bg-2: #E4DCCB; --ink: #17140F; --ink-muted: #5C5548; --rule: #CFC4AE;
  --brand: #1F5C45; --brand-hi: #17493A; --tick-down: #A8322A;
  --ease: cubic-bezier(.2,.7,.2,1);
  /* re-point the shared theme tokens so existing panels, fields and tables print on paper */
  color-scheme: light;
  --bg: var(--paper-bg); --bg-2: #F6F2E8; --surface: var(--paper-bg-2); --surface-2: #F6F2E8; --raised: #EDE6D6;
  --line: var(--rule); --line-2: #B9AD94; --fg: var(--ink); --muted: var(--ink-muted);
  --accent: var(--brand); --accent-ink: #F6F2E8; --page: var(--paper-bg);
  --f-display: "DM Serif Display", Georgia, serif; --w-display: 400;
  --f-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif; --f-type: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 0px; --r-sm: 0px; --panel-shadow: none;
  background: var(--paper-bg); color: var(--ink); font-family: var(--f-body);
}
body.home::before { background: var(--paper-bg); }
body.home :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink, #111); color: #fff; padding: 10px 14px; }
.skip:focus { left: 8px; }
.home-nav, .home-only { display: none; }

/* header */
body.home .top { background: color-mix(in srgb, var(--paper-bg) 92%, transparent); border-bottom: 1px solid var(--rule); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
body.home .logo .wordmark { color: var(--ink); font-size: 22px; letter-spacing: .18em; }
body.home .top .meta { display: none; }
body.home .home-nav { display: flex; gap: 28px; flex: 1; justify-content: center; }
body.home .home-nav a { font: 500 13px/1 var(--f-type); letter-spacing: .02em; color: var(--ink-muted); text-decoration: none; transition: color .2s; }
body.home .home-nav a b { color: var(--brand); font-weight: 500; margin-right: 4px; }
body.home .home-nav a:hover { color: var(--ink); }
body.home .home-only { display: inline-flex; }
body.home .top .btn { border-radius: 0; background: transparent; border-color: var(--line-2); color: var(--ink); font-family: var(--f-body); font-weight: 600; }
body.home .top .btn.ink, body.home .btn.ink { background: var(--ink); border-color: var(--ink); color: #F6F2E8; }
body.home .top .btn.ink:hover { background: var(--brand); border-color: var(--brand); }

/* page frame */
body.home .lobby { display: block; max-width: none; margin: 0; padding: 0; }
body.home .h-sec { max-width: 1200px; margin: 0 auto; padding: 120px clamp(16px, 4vw, 40px) 0; scroll-margin-top: 64px; }
body.home .sec-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: 40px; }
body.home .sec-no { margin: 0; font: 500 12px/1 var(--f-type); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
body.home h2, body.home .sec-head h2 { margin: 0; font: 400 clamp(40px, 5.4vw, 64px)/1 var(--f-display); letter-spacing: -.012em; color: var(--ink); }
body.home .sec-sub { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-muted); max-width: 56ch; }

/* hero: the real table, with a share certificate laid over it */
body.home .h-hero { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; min-height: min(86vh, 860px); padding: 40px clamp(16px, 4vw, 40px) 64px; max-width: 1440px; margin: 0 auto; }
body.home .h-shot { grid-column: 5 / -1; grid-row: 1; align-self: stretch; margin-right: calc(-1 * clamp(16px, 4vw, 40px)); position: relative; overflow: hidden; background: #0d1f18; }
body.home .h-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
body.home .h-card { grid-column: 1 / 7; grid-row: 1; position: relative; z-index: 2; background: #F6F2E8; padding: 48px 48px 40px; display: grid; gap: 20px; justify-items: start;
  /* engraved certificate border: double hairline + inset rule */
  outline: 1px solid var(--ink); outline-offset: -10px; box-shadow: inset 0 0 0 14px #F6F2E8, inset 0 0 0 15px var(--rule), 0 30px 60px -20px rgba(23,20,15,.45); }
body.home .h-card::before, body.home .h-card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--ink); transform: rotate(45deg); background: #F6F2E8; }
body.home .h-card::before { top: 3px; left: 3px; } body.home .h-card::after { bottom: 3px; right: 3px; }
body.home .h-stamp { position: absolute; top: -40px; right: -40px; transform: rotate(-12deg); filter: drop-shadow(0 10px 16px rgba(23,20,15,.35)); }
body.home .h-stamp svg { display: block; width: 96px; height: 96px; }
body.home .eyebrow { margin: 0; font: 500 12px/1.3 var(--f-type); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
body.home .h-card h1 { margin: 0; font: 400 clamp(52px, 6.6vw, 104px)/.95 var(--f-display); letter-spacing: -.018em; color: var(--ink); }
body.home .h-card h1 em { font-style: normal; color: var(--brand); display: block; }
body.home .h-card .sub { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-muted); max-width: 44ch; }
body.home .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
body.home .btn.big { border-radius: 0; box-shadow: none; animation: none; min-height: 54px; padding: 10px 26px; font: 600 17px/1 var(--f-body); letter-spacing: 0; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
body.home .btn.big.ink { background: var(--brand); border: 1.5px solid var(--brand); color: #F6F2E8; }
body.home .btn.big.ink:hover:not(:disabled) { background: var(--brand-hi); transform: translateY(-1px); }
body.home .btn.big.line { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
body.home .btn.big.line:hover:not(:disabled) { background: var(--ink); color: #F6F2E8; transform: translateY(-1px); }
body.home .btn.big:active:not(:disabled) { transform: translateY(1px); }
body.home .linkish { color: var(--ink); font-weight: 600; text-decoration-color: var(--brand); text-decoration-thickness: 1.5px; }
body.home .linkish:hover { color: var(--brand); }
body.home .facts { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font: 500 12px/1 var(--f-type); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
body.home .facts span + span::before { content: "·"; margin-right: 18px; color: var(--rule); }

/* signature: the price tape */
body.home .ticker { border-block: 1px solid var(--ink); background: var(--ink); color: #F6F2E8; overflow: hidden; white-space: nowrap; }
body.home .ticker-run { display: inline-flex; gap: 0; padding: 12px 0; font: 500 14px/1 var(--f-type); letter-spacing: .04em; text-transform: uppercase; animation: tape 48s linear infinite; will-change: transform; }
body.home .ticker-run span { padding: 0 28px; border-right: 1px solid #3a352c; }
body.home .ticker-run .u { color: #9FD8B8; } body.home .ticker-run .d { color: #F08A7E; }
@keyframes tape { to { transform: translateX(-50%); } }

/* 01 the tables */
body.home .look-tiles { grid-template-columns: 1fr 1fr; gap: 24px; }
body.home .look-tile { display: grid; grid-template-columns: 1fr; padding: 0; gap: 0; border-radius: 0; background: transparent; color: var(--ink); border: 0; box-shadow: none; transform: none; text-align: left; }
body.home .look-tile img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 444; object-fit: cover; outline: 1px solid var(--rule); transition: outline-color .2s var(--ease); }
body.home .lt-txt { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 0 0; border-top: 0; }
body.home .look-tile b { font: 400 32px/1 var(--f-display); color: var(--ink); }
body.home .lt-txt > span { grid-column: 1 / -1; font-size: 16px; line-height: 1.5; color: var(--ink-muted); max-width: 46ch; opacity: 1; }
body.home .lt-sel { grid-row: 1; grid-column: 2; align-self: center; font: 500 11px/1 var(--f-type); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--brand); border: 1px solid var(--brand); padding: 6px 8px; visibility: hidden; }
body.home .look-tile[aria-pressed="true"] img { outline: 3px solid var(--ink); outline-offset: 0; }
body.home .look-tile[aria-pressed="true"] .lt-sel { visibility: visible; }
body.home .look-tile:hover img { outline-color: var(--ink); }

/* 02 play + 03 open tables */
body.home .setup-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: start; }
body.home .setup { scroll-margin-top: 80px; }
body.home .tabs { gap: 0; border-bottom: 1px solid var(--ink); }
body.home .tabs button { border: 0; border-radius: 0; background: transparent; padding: 14px 20px 12px; font: 600 16px/1 var(--f-body); color: var(--ink-muted); margin-bottom: -1px; border-bottom: 3px solid transparent; }
body.home .tabs button[aria-selected="true"] { background: transparent; color: var(--ink); border-bottom-color: var(--brand); }
body.home .setup .panel { background: #F6F2E8; border: 1px solid var(--rule); border-top: 0; border-radius: 0; padding: 28px; box-shadow: none; }
body.home input[type=text], body.home input[type=number], body.home select, body.home .names-btn { background: var(--paper-bg); border: 1px solid var(--line-2); border-radius: 0; color: var(--ink); }
body.home .names-btn .names-edit { color: var(--brand); }
body.home .btn { border-radius: 0; }
body.home .btn.gold { background: var(--brand); border-color: var(--brand); color: #F6F2E8; }
body.home .btn.gold:hover:not(:disabled) { background: var(--brand-hi); }
body.home .seg button[aria-pressed="true"] { background: var(--ink); color: #F6F2E8; }
body.home .open-tables { gap: 14px; }
body.home .open-tables .card-head { display: grid; gap: 10px; justify-content: start; }
body.home .open-tables h3 { margin: 0; font: 400 32px/1.05 var(--f-display); color: var(--ink); }
body.home .otables { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--ink); }
body.home .otable { border-radius: 0; background: transparent; border: 0; border-bottom: 1px solid var(--rule); box-shadow: none; padding: 16px 0; }
body.home .otable[data-theme-chip] { border-left: 0; }
body.home .otables > p { padding: 18px 0; margin: 0; }

/* footer */
body.home .h-foot { max-width: 1200px; margin: 140px auto 0; padding: 40px clamp(16px, 4vw, 40px) 56px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; }
body.home .foot-lockup { font-style: normal; display: block; width: 260px; }
body.home .foot-lockup svg { display: block; width: 100%; height: auto; }
body.home .h-foot p { margin: 0; color: var(--ink-muted); max-width: 52ch; justify-self: end; text-align: right; }

/* one reveal: section headings rise once */
@media (prefers-reduced-motion: no-preference) {
  body.home .sec-head.pre { opacity: 0; transform: translateY(16px); }
  body.home .sec-head { transition: opacity .5s var(--ease), transform .5s var(--ease); }
}
@media (prefers-reduced-motion: reduce) { body.home .ticker-run { animation: none; } }

/* tablet */
@media (max-width: 1080px) {
  body.home .home-nav { display: none; }
  body.home .h-card { grid-column: 1 / 8; padding: 40px 36px 34px; }
}
@media (max-width: 900px) {
  body.home .h-hero { grid-template-columns: 1fr; min-height: 0; padding: 0 0 48px; }
  body.home .h-shot { grid-column: 1; grid-row: 1; margin: 0; aspect-ratio: 16 / 10; }
  body.home .h-card { grid-column: 1; grid-row: 2; margin: -64px clamp(16px, 4vw, 40px) 0; }
  body.home .setup-grid { grid-template-columns: 1fr; gap: 64px; }
  body.home .h-sec { padding-top: 88px; }
}
/* phone */
@media (max-width: 560px) {
  body.home .top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  body.home #navOpen, body.home #rulesBtn { display: none; }
  body.home .h-card { margin: -40px 12px 0; padding: 32px 24px 28px; gap: 16px; }
  body.home .h-stamp { top: -30px; right: -6px; }
  body.home .h-stamp svg { width: 68px; height: 68px; }
  body.home .h-card h1 { font-size: clamp(44px, 12.5vw, 56px); }
  body.home .h-card .sub { font-size: 17px; }
  body.home .hero-cta, body.home .hero-cta .btn.big { width: 100%; }
  body.home .look-tiles { grid-template-columns: 1fr; gap: 40px; }
  body.home .sec-sub { font-size: 17px; }
  body.home .setup .panel { padding: 20px 16px; }
  body.home .tabs button { flex: 1; padding: 14px 8px 12px; font-size: 15px; }
  body.home .h-foot { grid-template-columns: 1fr; margin-top: 96px; }
  body.home .h-foot p { justify-self: start; text-align: left; }
  body.home .ticker-run { font-size: 13px; }
}
@media (max-width: 900px) { body.home .h-stamp { right: -6px; top: -36px; } }
@media (max-width: 560px) { body.home .facts span + span::before { content: none; } body.home .facts { gap: 8px 16px; } }
.tipcard.t-takeover { --tc1: #138a5a; --tc2: #0a3f2a; }
.tipcard.t-warning { --tc1: #b2452f; --tc2: #5a1d12; }
.tipcard.t-special { --tc1: #b8862b; --tc2: #5b3f0c; }
.tipcard.t-jitters { --tc1: #8a3b52; --tc2: #3f1826; }
.tipcard.t-handshake { --tc1: #9a7b2e; --tc2: #45360f; }

/* insider tips: a face-down spread to pick from */
.reveal.pick { gap: 14px; }
.pick-h { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.05; color: #fff; }
.pick-sub { margin: 0; color: rgba(255,255,255,.75); }
.fan { display: flex; justify-content: center; gap: 0; padding: 18px 0 8px; perspective: 900px; }
.fan .flipcard { width: clamp(118px, 15vw, 170px); height: clamp(166px, 21vw, 238px); margin: 0 -10px;
  transform: rotate(calc(var(--o) * 6deg)) translateY(calc(var(--d) * 8px));
  animation: dealIn .55s cubic-bezier(.2,1.3,.4,1) both; animation-delay: calc(var(--k) * 90ms); transition: transform .25s cubic-bezier(.2,.7,.2,1), opacity .4s, filter .4s; }
.fan .flipcard:not(.flipped):not(.away):hover, .fan .flipcard:not(.flipped):not(.away):focus-visible { transform: rotate(calc(var(--o) * 6deg)) translateY(-18px); z-index: 2; }
.fan .flipcard.flipped { transform: translateY(-14px) scale(1.06); z-index: 3; }
.fan .flipcard.away { opacity: .25; filter: grayscale(1); transform: rotate(calc(var(--o) * 6deg)) translateY(30px) scale(.92); cursor: default; }
.fan .flipcard:not(.flipped) .fc-back { animation: none; }
.fan .fc-back b { font-size: 64px; }
.fan .fc-front.tipcard { padding: 14px 10px; gap: 8px; }
.fan .fc-front.tipcard .t-ico { width: 46px; height: 46px; font-size: 20px; }
.fan .fc-front.tipcard b { font-size: 19px; line-height: 1.1; }
.fan .fc-front.tipcard .t-txt { font-size: 12.5px; line-height: 1.35; }
@media (max-width: 560px) {
  .fan { flex-wrap: wrap; gap: 10px; padding-top: 8px; }
  .fan .flipcard { margin: 0; width: 104px; height: 148px; transform: none; }
  .fan .flipcard.away { transform: scale(.92); }
  .fan .fc-front.tipcard .t-txt { font-size: 11px; }
  .fan .fc-front.tipcard b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .fan .flipcard { animation: none; } }

/* ===== flat board: laid out like the printed board, with pieces you can find at a glance ===== */
.flat { padding: 20px; place-items: center; }
.board.h, .board.v { display: grid; gap: 0; border-radius: 6px; width: 100%; }
.board.h { grid-template-columns: 132px repeat(31, minmax(0, 1fr)); max-width: 1400px; }
.board.v { grid-template-columns: 52px repeat(6, minmax(0, 1fr)); max-width: 520px; }
.board .corner { min-height: 0; }
.board.h .lab, .board.v .lab { border: 0; padding: 0; height: auto; display: grid; place-items: center; font: 700 11px/1 var(--f-num); letter-spacing: .02em; text-transform: uppercase; opacity: .9; }
.board.h .lab { padding: 8px 0 6px; }
.board.h .lab span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.board.v .lab { justify-content: end; padding-right: 8px; height: 30px; }
.board .lab.par span { padding: 2px 3px; border-radius: 3px; background: currentColor; }
.board .lab.par span { color: inherit; }
[data-theme="classic"] .board .lab.par span { background: #c9a24a; color: #16110c; }
[data-theme="modern"] .board .lab.par span { background: #141821; color: #e7ebf2; }
.board .lab.pay { color: #1b9a5a; } [data-theme="classic"] .board .lab.pay { color: #e8c46a; }
.board .lab.slump, .board .lab.bankrupt { color: #e2493b; }
.board .lab.cont { color: inherit; }
.board .hdr { display: flex; align-items: center; gap: 8px; padding: 0 10px; min-width: 0; }
.board.v .hdr { flex-direction: column; gap: 3px; padding: 8px 0 6px; }
.board .hdr span { display: grid; min-width: 0; line-height: 1.1; }
.board .hdr b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .hdr em { font: 700 12px/1 var(--f-num); font-style: normal; opacity: .8; }
.board.h .cell, .board.v .cell { margin: 0; height: auto; border: 0; position: relative; display: grid; place-items: center; background: color-mix(in srgb, var(--pc) 82%, #000 0%); }
.board.h .cell { height: 46px; border-right: 1px solid rgba(0,0,0,.14); }
.board.v .cell { height: 30px; border-bottom: 1px solid rgba(0,0,0,.14); }
.board.h .cell.pays, .board.v .cell.pays { background: color-mix(in srgb, var(--pc) 70%, #fff 30%); }
.board.h .hdr + .cell, .board.h .cell:nth-child(32n + 2) { border-left: 2px solid rgba(0,0,0,.35); }
.board .cell::after { width: 4px; height: 4px; background: rgba(0,0,0,.35); }
.board .cell .cm { font-style: normal; position: absolute; font: 800 10px/1 var(--f-body); color: rgba(255,255,255,.85); top: 3px; left: 3px; }
.board .cell .cm.sl { color: #fff; }
/* the traveller: a big enamel pawn top with a white collar, so it never blends into its own lane */
.board .pawn { position: absolute; z-index: 2; width: 26px; height: 26px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85) 0 14%, var(--pc) 32%, color-mix(in srgb, var(--pc) 70%, #000) 100%);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(0,0,0,.65), 0 4px 8px rgba(0,0,0,.45); }
.board .pawn.on-tag { top: 40%; }
.board .pawn.last { animation: pawnPing 1.6s cubic-bezier(.2,.7,.2,1) 2; }
@keyframes pawnPing { 0% { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(0,0,0,.65), 0 0 0 4px rgba(255,255,255,.9); } 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(0,0,0,.65), 0 0 0 22px rgba(255,255,255,0); } }
/* the share-price marker: a small ink price tag, a different shape from the pawn */
.board .tag { position: absolute; z-index: 1; bottom: 3px; left: 50%; transform: translateX(-50%); min-width: 18px; height: 16px; padding: 0 3px; border-radius: 3px;
  display: grid; place-items: center; font: 800 11px/1 var(--f-body); color: #fff; background: #141821; box-shadow: 0 0 0 2px var(--pc), 0 0 0 3px rgba(255,255,255,.8); }
[data-theme="classic"] .board .tag { background: #16110c; color: #e8c46a; }
.board.v .pawn { width: 22px; height: 22px; }
.board.v .tag { bottom: 2px; height: 13px; font-size: 10px; min-width: 15px; }
.board.v .pawn.on-tag { top: 36%; }
[data-theme="classic"] .board.h, [data-theme="classic"] .board.v { background: #24513d; color: #efe5c8; border: 10px solid #16110c; outline: 2px solid #c9a24a; }
[data-theme="modern"] .board.h, [data-theme="modern"] .board.v { background: #e7ebf2; color: #141821; border: 6px solid #2b303b; }
@media (prefers-reduced-motion: reduce) { .board .pawn.last { animation: none; } }

/* ===== the table view: keep the lanes clear ===== */
/* view tools: small, out of the way, and gone while a notice is up */
.stage-tools { gap: 6px; }
.stage-tools .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.stage:has(.notice:not([hidden])) .stage-tools, .stage:has(.notice:not([hidden])) .stage-hint { opacity: 0; pointer-events: none; }
.stage-tools, .stage-hint { transition: opacity .2s; }
@media (max-width: 1280px) { .stage-hint { display: none; } }
/* notices dock at the foot of the stage, over the seats, never over the board */
.notice { bottom: 12px; max-height: 44%; }
.notice.slim { bottom: 12px; }
@media (max-width: 820px) { .notice, .notice.slim { bottom: 8px; max-height: 50%; } }
/* the players strip uses the full width instead of bunching left */
.strip > * { flex: 1 1 0; max-width: 360px; }
@media (max-width: 560px) { .strip > * { flex: 0 0 auto; max-width: none; } }

/* ===== the trading floor (insider tips) ===== */
.overlay.floor { padding: 0; background: #05070b; display: block; }
.floor-ov { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; }
.floor-stage { position: absolute; inset: 0; }
.floor-top, .floor-foot { position: relative; z-index: 2; padding: 20px clamp(16px, 4vw, 40px); pointer-events: none; }
.floor-top { background: linear-gradient(rgba(5,7,11,.95) 55%, rgba(5,7,11,0)); padding-bottom: 48px; }
.floor-ov.classic .floor-top { background: linear-gradient(rgba(18,13,9,.95) 55%, rgba(18,13,9,0)); padding-bottom: 48px; }
.floor-top .label { color: var(--gold); margin: 0 0 6px; }
.floor-top .pick-h { color: #fff; text-align: left; }
.floor-top .pick-sub { color: rgba(255,255,255,.78); margin-top: 6px; text-align: left; }
.floor-foot { grid-row: 3; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: linear-gradient(rgba(5,7,11,0), rgba(5,7,11,.85)); }
.floor-foot > * { pointer-events: auto; }
.floor-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.floor-picks .btn { background: rgba(20,24,33,.8); color: #eef1f7; border-color: rgba(255,255,255,.18); }
.floor-picks .btn:disabled { opacity: .55; cursor: default; }
.floor-picks .btn.mine { opacity: 1; background: var(--gold); color: var(--gold-ink); border-color: var(--gold-hi); }
.floor-order { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: rgba(255,255,255,.7); }
.floor-order li { display: flex; align-items: center; gap: 6px; }
.floor-order li.now { color: #fff; font-weight: 700; }
.floor-order li.done { opacity: .5; text-decoration: line-through; }
.floor-order .pdot { width: 10px; height: 10px; border-radius: 50%; }
.floor-ov.no3d .floor-picks .btn { min-height: 64px; font-size: 16px; }
.floor-foot #revealGo { min-height: 50px; padding: 10px 26px; font-size: 16px; }
@media (max-width: 560px) { .floor-picks .btn { min-height: 40px; } .floor-top { padding-top: 14px; } }
/* phones: a compact notice so the moved pawn stays in view */
@media (max-width: 560px) {
  .notice { padding: 10px 12px; gap: 4px; max-height: none; }
  .notice .label { font-size: 11px; }
  .notice h4 { font-size: 18px; }
  .notice p { font-size: 14px; line-height: 1.35; }
  .notice p.muted, .notice .n-foot .muted { display: none !important; }
  .notice p:not(.label):not(.n-foot):not(.muted) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .notice .n-foot .btn { min-height: 40px; }
}

/* ===== Party mode: 80s Wall Street after hours ===== */
[data-theme="party"] {
  --bg: #0b0716; --bg-2: #07040f; --surface: #150d26; --surface-2: #1d1233; --raised: #26183f;
  --line: #2e1f4a; --line-2: #45306b;
  --fg: #fbf3ff; --muted: #b7a6d6; --accent: #2de2e6; --accent-ink: #04191a;
  --paper: #1a1030; --paper-2: #221540; --paper-ink: #fbf3ff; --paper-muted: #b7a6d6;
  --gold: #ffd166; --gold-hi: #ffe39a; --gold-ink: #2a1600; --gold-deep: #c9952a;
  --up: #3dffa8; --down: #ff4d8d;
  --f-display: Bungee, "Arial Black", Impact, sans-serif; --w-display: 400;
  --f-num: Bungee, "Arial Black", Impact, sans-serif; --w-num: 400;
  --f-body: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --f-type: "JetBrains Mono", Consolas, monospace;
  --r: 10px; --r-sm: 6px;
  --page: radial-gradient(900px 500px at 10% -10%, rgba(255,63,164,.22), transparent 60%), radial-gradient(900px 600px at 110% 0%, rgba(45,226,230,.16), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 80px), var(--bg);
  --panel-shadow: 0 0 0 1px rgba(255,63,164,.25), 0 0 24px rgba(255,63,164,.12), 0 18px 40px rgba(0,0,0,.5);
}
[data-theme="party"] .notice { background: color-mix(in srgb, #150d26 95%, transparent); border: 1px solid #ff3fa4; box-shadow: 0 0 0 1px rgba(45,226,230,.35), 0 0 30px rgba(255,63,164,.35), 0 24px 60px rgba(0,0,0,.6); }
[data-theme="party"] .notice h4 { font-family: var(--f-display); letter-spacing: .01em; }
[data-theme="party"] .btn.gold { background: linear-gradient(#ff5fb4, #ff3fa4); border-color: #ff8fcb; color: #2a0016; }
[data-theme="party"] .btn.gold:hover:not(:disabled) { background: #ff7cc2; }
[data-theme="party"] .seg button[aria-pressed="true"] { background: #2de2e6; color: #04191a; }
[data-theme="party"] .top { border-bottom: 1px solid #ff3fa4; box-shadow: 0 1px 0 rgba(45,226,230,.35), 0 8px 30px rgba(255,63,164,.15); }

/* the setup: Party-only options show once Party is picked */
.party-only { display: none !important; }
body.pick-party .party-only { display: grid !important; }
body.pick-party label.party-only { display: flex !important; }
.setup .opts { flex-wrap: wrap; gap: 12px 18px; }
.look-tile .age { font-style: normal; font: 700 11px/1 var(--f-type, monospace); letter-spacing: .06em; border: 1px solid currentColor; padding: 3px 5px; margin-left: 8px; vertical-align: middle; }
body.home .look-tiles { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { body.home .look-tiles { grid-template-columns: 1fr; } }

/* in the game: the tally, the Wolf and the buddy on each player chip */
.pchip .tally { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.pchip .tally b { color: var(--fg); }
.glass { width: 14px; height: 14px; color: #ff3fa4; flex: 0 0 auto; }
.pchip .wolf, .pchip .buddy { font: 700 10.5px/1 var(--f-type); letter-spacing: .05em; text-transform: uppercase; padding: 3px 6px; border-radius: 99px; }
.pchip .wolf { background: #ffd166; color: #2a1600; }
.pchip .buddy { background: #2de2e6; color: #04191a; }
.party-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; background: linear-gradient(90deg, rgba(255,63,164,.12), rgba(45,226,230,.08)); }
.party-bar .hr b { font: 400 12px/1 var(--f-display); color: #ff3fa4; margin-right: 6px; letter-spacing: .03em; }
.party-bar .btn.sm { min-height: 30px; }
/* drink calls: a neon card stack over the table */
.drink-calls { position: absolute; top: 64px; right: 12px; z-index: 6; display: grid; gap: 8px; width: min(340px, calc(100% - 24px)); pointer-events: none; }
.drink-call { background: rgba(15,8,28,.94); border: 1px solid #ff3fa4; border-radius: 12px; padding: 10px 12px; box-shadow: 0 0 0 1px rgba(45,226,230,.3), 0 0 28px rgba(255,63,164,.35); animation: dcIn .45s cubic-bezier(.2,1.4,.4,1); transition: opacity .5s, transform .5s; color: #fbf3ff; }
.drink-call.out { opacity: 0; transform: translateX(16px); }
.drink-call p { margin: 3px 0; font-size: 13.5px; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.drink-call .dc-head { font: 400 18px/1 Bungee, Impact, sans-serif; color: #ff3fa4; text-shadow: 0 0 12px rgba(255,63,164,.8); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.drink-call .dc-head .glass { width: 20px; height: 20px; color: #2de2e6; }
.drink-call .amt { color: #2de2e6; } .drink-call .amt.shot { color: #ffd166; }
.drink-call .why { color: #b7a6d6; font-size: 12px; flex-basis: 100%; padding-left: 16px; }
.drink-call .pdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
@keyframes dcIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@media (max-width: 820px) { .drink-calls { top: auto; bottom: 64px; right: 8px; left: 8px; width: auto; } }
/* hand-outs, the house rule and the buddy pick */
#partyOv { z-index: 72; }
.party-sheet { max-width: 520px; display: grid; gap: 12px; }
.party-sheet h3 { margin: 0; font-family: var(--f-display); font-weight: var(--w-display); font-size: 26px; line-height: 1.1; }
.party-sheet .label { color: #ff3fa4; margin: 0; }
.give-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.give-btn { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg); position: relative; }
.give-btn:not(:disabled):hover { border-color: var(--pcol); box-shadow: 0 0 18px color-mix(in srgb, var(--pcol) 40%, transparent); }
.give-btn .ptoken { width: 44px; height: 44px; }
.give-btn em { font-style: normal; font: 400 18px/1 var(--f-display); color: #2de2e6; min-height: 18px; }
.rule-list { display: grid; gap: 8px; }
.rule-list .btn { justify-content: flex-start; text-align: left; min-height: 46px; font-weight: 600; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.party-round { margin: 10px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid #ff3fa4; background: rgba(255,63,164,.08); display: grid; gap: 4px; }
.party-round p { margin: 0; }
.party-round .water { color: #2de2e6; }

/* ---------- Party: drunk effects (only on the affected player's screen) ---------- */
.pchip .fxb { font: 700 11px/1 var(--f-body); letter-spacing: .01em; padding: 3px 6px; border-radius: 99px; background: #2de2e6; color: #071318; white-space: nowrap; }
.fx-call { border-color: #2de2e6; box-shadow: 0 0 0 1px rgba(255,63,164,.35), 0 0 28px rgba(45,226,230,.35); }
.fx-call .dc-head { color: #2de2e6; }
/* flat view and the market list get the same treatment as the 3D table */
/* the flat board's callouts: what just happened, for a moment, over the board */
.flat-call { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: grid; gap: 2px; justify-items: center; text-align: center; max-width: min(92%, 420px); padding: 10px 18px; background: var(--fg); color: var(--bg); border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(0,0,0,.35); pointer-events: none; animation: flatCall 1.9s ease both; }
.flat-call b { font: var(--w-display, 700) 22px/1.1 var(--f-display); letter-spacing: .02em; }
.flat-call span { font-size: var(--s-13, 13px); opacity: .92; }
.flat-call.bad { background: var(--down); color: #fff; } .flat-call.gold { background: var(--gold); color: var(--gold-ink); } .flat-call.pay { background: var(--accent); color: var(--accent-ink, #fff); }
@keyframes flatCall { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.92); } 12%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .flat-call { animation: none; } }
body.fx-double #board { filter: drop-shadow(10px 3px 0 rgba(255,255,255,.28)) blur(.4px); }
body.fx-goggles #board, body.fx-goggles #certs .mprice { filter: blur(1.2px) sepia(.35) saturate(1.4); }
body.fx-spins #board { animation: fxSway 3.2s ease-in-out infinite; }
body.fx-double #certs .mprice { text-shadow: 6px 2px 0 rgba(127,127,127,.45); }
/* Double Vision on the panels too: every name and figure has a ghost beside it, drifting */
body.fx-double #side .mname b, body.fx-double #side .mprice, body.fx-double #side .turn h3, body.fx-double #side .hint, body.fx-double #strip .pname, body.fx-double #strip .cash { animation: fxGhost 2.6s ease-in-out infinite; }
@keyframes fxGhost { 0%, 100% { text-shadow: 5px 1px 0 rgba(127,127,127,.5); } 50% { text-shadow: 11px 3px 0 rgba(127,127,127,.42); } }
@media (prefers-reduced-motion: reduce) { body.fx-double #side .mname b, body.fx-double #side .mprice, body.fx-double #side .turn h3, body.fx-double #side .hint, body.fx-double #strip .pname, body.fx-double #strip .cash { animation: none; text-shadow: 7px 2px 0 rgba(127,127,127,.45); } }
@keyframes fxSway { 0%, 100% { transform: rotate(-1.4deg) translateX(-6px); } 50% { transform: rotate(1.6deg) translateX(8px); } }
@media (prefers-reduced-motion: reduce) { body.fx-spins #board { animation: none; filter: blur(.8px); } }
.fx-swap { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(45,226,230,.45); }
.fx-swap .pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Party: the house-rule bar gets its own row between the players and the table */
.game:has(> .party-bar:not([hidden])) { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.give-btn .ptoken { width: 50px; height: 50px; margin-bottom: 6px; }
@media (max-width: 560px) {
  /* phones: the house rule and its button on one row, the pacing note dropped */
  .party-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding-block: 6px; font-size: 12.5px; line-height: 1.3; }
  .party-bar > .hr { grid-column: 1; }
  .party-bar > #ruleBreak { grid-column: 2; grid-row: 1; align-self: center; min-height: 30px; padding-inline: 10px; }
  .party-bar > .hr.muted:last-child { display: none; }
}

/* ---------- How to play: readable on paper, opens at the top, close button always in reach ---------- */
.rules-sheet { position: relative; outline: none; scroll-padding-top: 64px; }
.sheet-top { position: sticky; top: -24px; z-index: 2; margin: -24px -24px 0; padding: 18px 24px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-top h2 { margin: 0; }
.sheet-x { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg); font-size: 24px; line-height: 1; cursor: pointer; }
.sheet-x:hover { border-color: var(--fg); }
.rules-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.rules-jump a { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: var(--s-14); }
.rules-jump a:hover { border-color: var(--fg); }
/* on the paper home page, section heads and links print in ink and exchange green, not gold */
body.home .sheet h3, body.home details.full summary, body.home .legend-grid b, body.home .more summary { color: var(--brand); }
body.home .sheet h3 { font-size: 13px; letter-spacing: .1em; }
body.home .rules-jump a { border-radius: 0; }
body.home .sheet-x { border-radius: 0; }
/* phones: How to play stays reachable as a small ? button */
@media (max-width: 560px) {
  body.home #rulesBtn { display: inline-flex; }
}
@media (max-width: 560px) {
  #rulesBtn { font-size: 0 !important; width: 34px; min-width: 34px; padding: 0 !important; justify-content: center; align-items: center; }
  #rulesBtn::before { content: "?"; font-size: 16px; font-weight: 800; }
  body:has(#game:not([hidden])) #rulesBtn { display: inline-flex; }
}
@media (max-width: 560px) {
  .sheet-top { padding: 14px 16px 10px; margin: -24px -24px 0; }
  .sheet-top h2 { font-size: 26px; line-height: 1.1; }
  .sheet-x { width: 36px; height: 36px; font-size: 22px; }
  .rules-jump a { padding: 5px 10px; font-size: 13px; }
}
/* the 18+ line wraps on phones instead of widening the page */
.age-note { white-space: normal; line-height: 1.35; margin: 0; }
body.home .sheet-top h2 { font-size: 34px; line-height: 1.05; }
.rules-sheet [id] { scroll-margin-top: 96px; }
@media (max-width: 560px) { body.home .sheet-top h2 { font-size: 26px; } }

/* Party 18+: date of birth */
.age-sheet { width: min(520px, 100%); }
.age-sheet h2 { margin: 0; }
.age-row { display: grid; grid-template-columns: 1fr 1.5fr 1.2fr; gap: 10px; }
.age-row label { display: grid; gap: 6px; font-size: var(--s-14); font-weight: 700; }
.age-row select { width: 100%; min-height: 46px; }
.age-msg { margin: 0; font-weight: 700; } .age-msg.bad { color: var(--down, #c0331f); }

/* ---------- the side column: tabs, and full height on desktop ---------- */
.side-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: -6px; }
.side-tabs[hidden] { display: none; }
.side-tabs button { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); font: 700 var(--s-14, 14px)/1.1 var(--f-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.side-tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.side-tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.side-tabs .st-n:empty:not(.live) { display: none; }
.side-tabs .st-n { font-style: normal; font-size: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bg-2); color: var(--fg); display: inline-grid; place-items: center; }
.side-tabs .st-n.live { background: var(--gold); color: var(--gold-ink); }
.side-tabs .st-n.live:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; }
.side [data-pane]:not(.pane-on) { display: none !important; }
@media (min-width: 821px) {
  /* the column runs the full height beside the player strip, so nothing sits in an empty corner */
  .game { grid-template-columns: minmax(0, 1fr) var(--side-w, 440px); grid-template-areas: "strip side" "stage side" "tape tape"; }
  .game > .strip { grid-area: strip; min-width: 0; }
  .game > .main { display: contents; }
  .game > .main > .stage { grid-area: stage; }
  .game > .main > .side { grid-area: side; min-height: 0; }
  .game > .tape { grid-area: tape; }
  /* a tighter turn card */
  .side .card.turn { gap: 10px; }
  .side .card.turn .roll-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
}
@media (min-width: 821px) and (max-width: 1100px) { .game { --side-w: 380px; } }

/* ---------- desktop: the whole column fits the window ---------- */
/* The turn card and the tabs always show; only the open tab's own content scrolls, and only on short windows. */
@media (min-width: 821px) {
  [data-theme]:not(.home) #side { display: flex; flex-direction: column; overflow: hidden; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  [data-theme]:not(.home) #side > * { flex: 0 0 auto; }
  [data-theme]:not(.home) #side > [data-pane].pane-on { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  [data-theme]:not(.home) #side .card.turn { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  [data-theme]:not(.home) #side .turn .roll-row .btn.big { flex: 1 1 200px; min-width: 0; }
  [data-theme]:not(.home) #side > * { min-width: 0; max-width: 100%; }
  [data-theme]:not(.home) #side .turn .roll-row .last-roll { flex: 0 0 auto; }
  [data-theme]:not(.home) #side .turn .roll-row #skipBtn { flex: 0 0 auto; }
  [data-theme]:not(.home) #side .card.market { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  [data-theme]:not(.home) #side .mrow.compact { padding-top: 5px; padding-bottom: 5px; }
}
/* short windows: the step tracker goes (the hint says the same), so the market still fits */
@media (min-width: 821px) and (max-height: 880px) {
  [data-theme]:not(.home) #side .turn .tracker { display: none; }
  [data-theme]:not(.home) #side .turn-head .ptoken.big { width: 44px; height: 44px; }
}

@media (min-width: 821px) and (max-height: 960px) {
  /* the tab already says Market: the header keeps just the cash and the view switch */
  [data-theme]:not(.home) #side .card.market > .card-head { min-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
  [data-theme]:not(.home) #side .card.market > .card-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-theme]:not(.home) #side .turn-head .label { display: none; }
  [data-theme]:not(.home) #side .turn h3 { font-size: 24px; }
  [data-theme]:not(.home) #side .turn .roll-row .btn.big { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
  [data-theme]:not(.home) #side .card.turn { gap: 6px; }
  [data-theme]:not(.home) #side .card.market { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  [data-theme]:not(.home) #side .card.market > .card-head { grid-column: 1; grid-row: 1; }
  [data-theme]:not(.home) #side .card.market:has(> #dealBtn[hidden]) > .card-head { grid-column: 1 / -1; }
  [data-theme]:not(.home) #side .card.market > #dealBtn { grid-column: 2; grid-row: 1; min-height: 44px; padding: 4px 12px; font-size: 13px; width: auto; }
  [data-theme]:not(.home) #side .card.market > .mkt { grid-column: 1 / -1; }
  [data-theme]:not(.home) #side .card.market > .card-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
  [data-theme]:not(.home) #side .card.market > .card-head #cashNote { display: none; }
}

/* short desktop windows with a mouse: tighter market rows (still well over the 24px pointer target) */
@media (min-width: 821px) and (max-height: 960px) and (pointer: fine) {
  [data-theme]:not(.home) #side .mrow.compact { padding-top: 2px; padding-bottom: 2px; }
  [data-theme]:not(.home) #side .mrow.compact .mquick .btn { min-height: 34px; }
  [data-theme]:not(.home) #side { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  [data-theme]:not(.home) #side .side-tabs button { min-height: 38px; }
  [data-theme]:not(.home) #side .card.market, [data-theme]:not(.home) #side .card.turn { padding-top: 8px; padding-bottom: 8px; }
  [data-theme]:not(.home) #side .mini-live { padding-top: 4px; padding-bottom: 4px; }
  [data-theme]:not(.home) #side .mrow.compact .mlogo { width: 24px; height: 24px; }
  [data-theme]:not(.home) #side .turn .hint { font-size: 14px; line-height: 1.4; margin: 0; }
  [data-theme]:not(.home) #side .turn .more:not([open]) { margin-top: -6px; }
}

@media (min-width: 821px) {
  /* the two dice say it all; the button keeps its words on one line */
  [data-theme]:not(.home) #side .last-roll > .small.muted:first-child:not(:only-child) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-theme]:not(.home) #side .turn .roll-row .btn.big { white-space: nowrap; }
  /* company names stay whole on one line */
  [data-theme]:not(.home) #side .mrow.compact .mname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; overflow-wrap: normal; }
}

/* desktop news notices: the picture small on the left, the story beside it, so the whole card shows without scrolling */
@media (min-width: 821px) {
  .notice { max-height: 56%; }
  .notice.news { width: min(660px, calc(100% - 24px)); grid-template-columns: minmax(140px, 34%) minmax(0, 1fr); column-gap: 16px; align-items: start; }
  .notice.news > * { grid-column: 2; }
  .notice.news > .n-mast, .notice.news > .n-kick, .notice.news > .n-foot { grid-column: 1 / -1; }
  .notice.news > .n-art { grid-column: 1; grid-row: span 3; align-self: start; }
}
/* Party market rows: "pays" reads on the dark rows */
[data-theme="party"]:not(.home) .mrow .mname small .up { color: var(--pt-paper); font-weight: 700; }
