/* The Wolfs of Wallstreet — midnight trading floor, art deco brass, blood & lime. */
:root {
  --ink: #07100c;
  --felt: #0c1a14;
  --panel: #0e1c16;
  --panel-2: #122520;
  --line: rgba(217, 180, 90, 0.18);
  --line-2: rgba(217, 180, 90, 0.35);
  --gold: #d9b45a;
  --gold-hi: #f5dc93;
  --gold-lo: #8a6a1f;
  --cream: #f3ecdc;
  --muted: rgba(243, 236, 220, 0.56);
  --faint: rgba(243, 236, 220, 0.3);
  --up: #9dff5c;
  --down: #ff3b4e;
  --amber: #ffb547;
  --sel: var(--gold);
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 600px at 88% -8%, rgba(243, 236, 220, 0.10), transparent 60%),
    radial-gradient(1200px 800px at 50% 120%, rgba(217, 180, 90, 0.08), transparent 60%),
    radial-gradient(ellipse at center, #0f2219 0%, var(--ink) 75%);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--cond);
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.38; }
input { font: inherit; }
kbd {
  font-family: var(--mono); font-size: 0.62em; padding: 1px 4px; border-radius: 3px;
  border: 1px solid currentColor; opacity: 0.6; margin-left: 6px; vertical-align: middle;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: 0.07; mix-blend-mode: overlay;
  background-image: 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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ buttons */
.btn {
  border: 1px solid var(--line-2); background: rgba(217, 180, 90, 0.06); padding: 12px 20px; border-radius: var(--r);
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 1.05rem; transition: transform 0.08s, background 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: rgba(217, 180, 90, 0.14); border-color: var(--gold); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #b18a36); color: #1a1406; border-color: var(--gold-hi);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset, 0 8px 30px rgba(217, 180, 90, 0.25);
}
.btn-gold:hover:not(:disabled) { background: linear-gradient(180deg, #fff0bf, var(--gold-hi) 55%, var(--gold)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-big { padding: 16px 28px; font-size: 1.2rem; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); padding: 7px 12px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.04em; font-size: 0.95rem;
}
.chip.on { border-color: var(--gold); background: rgba(217, 180, 90, 0.18); color: var(--gold-hi); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: var(--r); width: 36px; height: 34px; font-size: 1rem; }

/* ------------------------------------------------------------------ title */
.screen { min-height: 100vh; }
.title-screen {
  position: relative; min-height: 100vh; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px;
  align-items: center; padding: 40px clamp(16px, 5vw, 80px); overflow: clip;
}
.sunburst {
  position: absolute; left: 50%; bottom: -60vmax; width: 160vmax; height: 160vmax; transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg, rgba(217, 180, 90, 0.07) 0deg 4deg, transparent 4deg 12deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%);
  animation: spin 240s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: translateX(-50%) rotate(360deg); } }
.title-left, .title-right { position: relative; z-index: 1; }
.eyebrow { color: var(--gold); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.85rem; margin: 0 0 8px; }
.logo { margin: 0; line-height: 0.82; display: flex; flex-direction: column; animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; }
.logo-the { font-family: var(--display); font-style: italic; font-weight: 700; color: var(--gold); font-size: clamp(1.6rem, 3vw, 2.6rem); margin-left: 0.2em; }
.logo-wolfs {
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(5rem, 13vw, 12rem); letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fffaf0 10%, var(--cream) 45%, #c9b98f 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(138, 106, 31, 0.9)) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6));
}
.logo-of { font-family: var(--display); font-style: italic; color: var(--gold); font-size: clamp(1.6rem, 3vw, 2.6rem); margin: 0.1em 0 0.12em 1.6em; }
.logo-wall {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.34em; font-size: clamp(2rem, 5.2vw, 4.6rem);
  color: var(--gold); border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); padding: 0.12em 0; width: fit-content;
  box-shadow: 0 -6px 0 -4px var(--gold-lo), 0 6px 0 -4px var(--gold-lo);
}
.tagline { font-family: var(--display); font-style: italic; font-size: 1.4rem; color: var(--muted); margin: 22px 0 26px; animation: rise 0.9s 0.15s both; }
.cta { display: grid; gap: 12px; max-width: 460px; animation: rise 0.9s 0.25s both; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-input, .name-input {
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--cream); padding: 12px 14px;
}
.code-input { font-family: var(--mono); letter-spacing: 0.35em; text-transform: uppercase; font-size: 1.2rem; }
.code-input:focus, .name-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.stream-toggle { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; color: var(--muted); cursor: pointer; }
.stream-toggle input { accent-color: var(--gold); width: 18px; height: 18px; }
.menu-status { min-height: 1.4em; margin: 12px 0 0; letter-spacing: 0.04em; }
.menu-status.error { color: var(--down); }
.menu-status.busy { color: var(--gold); }
.howto { margin-top: 18px; max-width: 560px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; }
.howto ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.howto li { position: relative; padding-left: 30px; font-size: 1rem; }
.howto li b { color: var(--cream); }
.howto-icon { position: absolute; left: 0; }

.portrait-frame {
  position: relative; width: min(360px, 80vw); margin: 0 auto 18px; padding: 16px 16px 0;
  border: 2px solid var(--gold); border-radius: 180px 180px 8px 8px; outline: 1px solid var(--gold-lo); outline-offset: 5px;
  background: radial-gradient(circle at 50% 30%, rgba(243, 236, 220, 0.18), transparent 55%), linear-gradient(180deg, #16392a, #0a1812);
  animation: rise 0.9s 0.1s both;
}
.preview { aspect-ratio: 1; }
.preview .wolf { width: 100%; height: 100%; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.55)); }
.nameplate { margin: 0 -16px; padding: 10px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-radius: 0 0 6px 6px; }
.nameplate .name-input {
  width: 100%; text-align: center; background: #1a1406; border-color: #1a1406; color: var(--gold-hi); font-family: var(--display);
  font-style: italic; font-weight: 700; font-size: 1.4rem;
}
.picker { display: flex; align-items: center; gap: 12px; margin: 12px auto; width: min(420px, 90vw); }
.picker-label { width: 52px; color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.8rem; flex: none; }
.swatch-row, .acc-row, .chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px var(--line); transition: transform 0.1s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold); }
.acc-row .chip { padding: 5px 10px; font-size: 0.88rem; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ------------------------------------------------------------------ lobby */
.lobby { max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 40px; display: grid; gap: 22px; animation: rise 0.6s both; }
.lobby-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid var(--line-2); padding-bottom: 16px; }
.lobby-title { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0; color: var(--cream); }
.invite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.invite-label { color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem; }
.invite-code {
  font-family: var(--mono); font-weight: 700; font-size: 2rem; letter-spacing: 0.3em; padding: 6px 14px; border-radius: var(--r);
  background: #000; color: var(--amber); border: 1px solid var(--gold-lo); text-shadow: 0 0 12px rgba(255, 181, 71, 0.7);
}
.invite-code.masked { color: var(--faint); text-shadow: none; }
.lobby-pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.lobby-wolf {
  display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(22, 57, 42, 0.6), rgba(10, 24, 18, 0.6)); animation: rise 0.5s both;
}
.lobby-wolf.me { border-color: var(--gold); }
.lobby-wolf .wolf { width: 100px; height: 100px; }
.lobby-wolf.bots { border-style: dashed; align-content: center; }
.bot-count { font-family: var(--display); font-size: 3rem; font-style: italic; color: var(--gold); line-height: 1; }
.lobby-name { font-weight: 700; font-size: 1.15rem; }
.lobby-tag { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.lobby-settings { display: flex; flex-wrap: wrap; gap: 20px 40px; }
.setting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper-val { min-width: 70px; text-align: center; font-weight: 700; }
.lobby-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rule { display: grid; gap: 2px; padding: 12px 14px; border-left: 2px solid var(--gold); background: rgba(217, 180, 90, 0.05); color: var(--muted); }
.rule b { color: var(--cream); font-size: 1.1rem; }
.rule-icon { font-size: 1.3rem; }
.lobby-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lobby-status { color: var(--amber); flex: 1; }
.waiting { color: var(--muted); font-style: italic; font-family: var(--display); font-size: 1.15rem; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

/* ------------------------------------------------------------------ floor layout */
.floor {
  height: 100vh; display: grid; gap: 8px; padding: 8px;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr) minmax(280px, 340px);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top top top" "tape tape tape" "left center right";
  transition: box-shadow 0.3s;
}
.floor.frenzy { box-shadow: inset 0 0 0 3px rgba(255, 59, 78, 0.6), inset 0 0 120px rgba(255, 59, 78, 0.18); animation: frenzy 0.9s ease-in-out infinite; }
@keyframes frenzy { 50% { box-shadow: inset 0 0 0 3px rgba(255, 59, 78, 0.25), inset 0 0 60px rgba(255, 59, 78, 0.08); } }
.floor.margin-warn .col-center { box-shadow: 0 0 0 2px var(--down), 0 0 40px rgba(255, 59, 78, 0.35); animation: warnpulse 0.6s ease-in-out infinite; border-radius: 10px; }
@keyframes warnpulse { 50% { box-shadow: 0 0 0 2px rgba(255, 59, 78, 0.3), 0 0 10px rgba(255, 59, 78, 0.1); } }
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.35rem; color: var(--cream); white-space: nowrap; }
.brand i { color: var(--gold); font-weight: 700; }
.day-box { display: flex; flex-direction: column; line-height: 1; margin-left: auto; text-align: right; }
.day-name { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.25rem; color: var(--gold-hi); }
.day-num { font-size: 0.78rem; letter-spacing: 0.22em; color: var(--muted); }
.clock-box { display: flex; align-items: baseline; gap: 8px; padding: 2px 14px; background: #000; border: 1px solid var(--gold-lo); border-radius: var(--r); }
.phase { font-size: 0.72rem; letter-spacing: 0.25em; color: var(--muted); }
.clock { font-family: var(--mono); font-weight: 700; font-size: 1.9rem; color: var(--amber); text-shadow: 0 0 10px rgba(255, 181, 71, 0.6); min-width: 4ch; text-align: right; }
.clock.hurry { color: var(--down); text-shadow: 0 0 14px rgba(255, 59, 78, 0.9); animation: hurry 1s steps(2) infinite; }
@keyframes hurry { 50% { opacity: 0.55; } }
.lev-badge { font-weight: 700; letter-spacing: 0.1em; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--gold); }
.lev-badge.final { background: var(--down); color: #fff; border-color: var(--down); }
.room-tag { font-family: var(--mono); color: var(--muted); font-size: 0.8rem; }

.tape { grid-area: tape; overflow: hidden; background: #020403; border-top: 1px solid var(--gold-lo); border-bottom: 1px solid var(--gold-lo); position: relative; height: 30px; }
.tape::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, transparent 55%, rgba(0, 0, 0, 0.55) 56%) 0 0 / 3px 3px; pointer-events: none; }
.tape-inner { display: flex; width: max-content; animation: tape 60s linear infinite; }
.tape-strip { display: flex; gap: 34px; padding-right: 34px; align-items: center; height: 30px; white-space: nowrap; font-family: var(--mono); font-size: 0.9rem; color: var(--amber); text-shadow: 0 0 8px rgba(255, 181, 71, 0.6); }
.tape-item b { color: var(--cream); }
.tape-item.up span { color: var(--up); text-shadow: 0 0 8px rgba(157, 255, 92, 0.5); }
.tape-item.down span { color: var(--down); text-shadow: 0 0 8px rgba(255, 59, 78, 0.5); }
@keyframes tape { to { transform: translateX(-50%); } }

.col-left { grid-area: left; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.col-center { grid-area: center; display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.col-right { grid-area: right; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 0; }
.panel-title {
  margin: 0 0 6px; font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.05rem; color: var(--gold);
  display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.panel-title small { font-family: var(--cond); font-style: normal; font-weight: 500; color: var(--faint); letter-spacing: 0.15em; text-transform: uppercase; font-size: 0.7rem; }

/* watchlist */
.watch { display: grid; gap: 3px; }
.watch-row {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) 54px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  text-align: left; background: transparent; border: 1px solid transparent; border-left: 3px solid var(--tc); border-radius: 6px; padding: 5px 8px;
  transition: background 0.12s;
}
.watch-row:hover { background: rgba(255, 255, 255, 0.03); }
.watch-row.sel { background: rgba(217, 180, 90, 0.10); border-color: var(--line-2); border-left-color: var(--tc); }
.watch-row.halted { background: repeating-linear-gradient(-45deg, rgba(255, 59, 78, 0.12) 0 6px, transparent 6px 12px); }
.w-key { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); grid-row: span 2; }
.w-id { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.w-sym { color: var(--tc); font-size: 1.1rem; letter-spacing: 0.04em; }
.w-id small { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-spark { width: 54px; height: 26px; grid-row: span 2; }
.w-nums { display: flex; flex-direction: column; align-items: end; font-family: var(--mono); line-height: 1.15; grid-row: span 2; }
.w-price { font-size: 0.95rem; }
.w-chg { font-size: 0.75rem; }
.w-pos { grid-column: 2; font-size: 0.66rem; letter-spacing: 0.15em; font-weight: 700; }
.w-pos.long { color: var(--up); }
.w-pos.short { color: var(--down); }

/* intel */
.intel { flex: 1; overflow: auto; }
.intel-list { display: grid; gap: 6px; }
.tip {
  text-align: left; display: grid; gap: 2px; padding: 7px 9px; border-radius: 6px; border: 1px dashed var(--line-2); background: rgba(0, 0, 0, 0.25);
  position: relative; overflow: hidden;
}
.tip.bull { border-left: 3px solid var(--up); }
.tip.bear { border-left: 3px solid var(--down); }
.tip-src { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.tip-body { font-size: 1.05rem; }
.tip-when { font-family: var(--mono); font-size: 0.75rem; color: var(--amber); }
.tip.true { border-style: solid; background: rgba(157, 255, 92, 0.07); }
.tip.true .tip-when { color: var(--up); }
.tip.dud { opacity: 0.45; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }

/* chart */
.chart-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 0 4px; }
.ch-id { display: flex; align-items: end; gap: 12px; min-width: 0; }
.ch-sym { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 2.4rem; line-height: 0.9; color: var(--sel); text-shadow: 0 0 30px color-mix(in srgb, var(--sel) 40%, transparent); }
.ch-name { display: block; font-weight: 700; font-size: 1.05rem; }
.ch-tag { display: block; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-quote { display: flex; align-items: baseline; gap: 12px; font-family: var(--mono); }
.ch-price { font-size: 1.9rem; font-weight: 700; }
.ch-chg { font-size: 1.1rem; }
.chart-wrap {
  flex: 1; min-height: 200px; position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: radial-gradient(ellipse at 50% 0%, rgba(217, 180, 90, 0.06), transparent 70%), rgba(0, 0, 0, 0.3);
}
.chart { position: absolute; inset: 0; width: 100%; height: 100%; }

/* deck */
.deck { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: linear-gradient(180deg, #142b22, #0c1812); }
.deck-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deck-top { justify-content: space-between; }
.equity-box { display: flex; align-items: baseline; gap: 10px; }
.equity-box small, .deck small { color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.7rem; }
.equity { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; }
.day-pnl { font-family: var(--mono); font-size: 0.9rem; }
.pos-line { font-family: var(--mono); font-size: 0.92rem; color: var(--muted); }
.pos-line.long { color: var(--up); }
.pos-line.short { color: var(--down); }
.pos-line.busted { color: var(--down); font-weight: 700; }
.size-row { display: flex; align-items: center; gap: 6px; flex: 1; }
.size-btn { flex: 1; padding: 6px 4px; border-radius: 6px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); font-weight: 700; }
.size-btn.on { background: var(--gold); color: #1a1406; border-color: var(--gold-hi); }
.trade-row { display: grid; grid-template-columns: 1fr 1fr; }
.trade-btn {
  display: grid; justify-items: center; gap: 0; padding: 10px; border-radius: 8px; border: 0; position: relative;
  font-weight: 700; letter-spacing: 0.12em; transition: transform 0.06s, filter 0.1s;
}
.trade-btn .tb-main { font-size: 1.5rem; line-height: 1; }
.trade-btn .tb-sub { font-family: var(--mono); font-size: 0.8rem; opacity: 0.8; letter-spacing: 0; }
.trade-btn kbd { position: absolute; top: 6px; right: 8px; }
.trade-btn.buy { background: linear-gradient(180deg, #c4ff93, var(--up) 50%, #5fcf28); color: #0b2104; box-shadow: 0 6px 24px rgba(157, 255, 92, 0.2); }
.trade-btn.sell { background: linear-gradient(180deg, #ff8a95, var(--down) 50%, #c81d2f); color: #2a0409; box-shadow: 0 6px 24px rgba(255, 59, 78, 0.2); }
.trade-btn:hover:not(:disabled) { filter: brightness(1.1); }
.trade-btn:active:not(:disabled) { transform: scale(0.98); }
.mini-btn { flex: 1; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.3); font-weight: 600; }
.mini-btn.panic { border-color: rgba(255, 59, 78, 0.5); color: #ffb3ba; }
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gauge { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.gauge small { grid-row: span 2; }
.gauge-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.gauge-fill.hot { background: var(--amber); }
.gauge-fill.danger { background: var(--down); }
.gauge-fill.heat { background: linear-gradient(90deg, var(--amber), var(--down)); }
.gauge .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(243, 236, 220, 0.5); }
.gauge .mark.max { left: var(--max-at, 50%); }
.gauge .mark.warn { left: var(--warn-at, 75%); background: var(--down); }
.gauge-text { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.rumor-row .rumor-btn { flex: 1; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.3); font-weight: 600; white-space: nowrap; }
.rumor-btn.pump:hover:not(:disabled) { border-color: var(--up); }
.rumor-btn.dump:hover:not(:disabled) { border-color: var(--down); }
.cred { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.emote-row { display: flex; gap: 6px; }
.emote-btn { flex: 1; padding: 4px; border-radius: 6px; border: 1px solid var(--line); background: transparent; font-size: 0.95rem; font-weight: 700; }
.emote-btn:hover { background: rgba(217, 180, 90, 0.12); }

/* pack */
.pack { flex: 0 1 auto; max-height: 56%; overflow: auto; }
.pack-list { display: grid; gap: 3px; }
.pack-row {
  position: relative; display: grid; grid-template-columns: 16px 42px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px;
  align-items: center; padding: 3px 6px; border-radius: 6px; border: 1px solid transparent; transition: background 0.3s;
}
.pack-row.me { background: rgba(217, 180, 90, 0.09); border-color: var(--line-2); }
.pack-row.lead .p-rank { color: var(--gold-hi); }
.p-rank { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.1rem; color: var(--faint); grid-row: span 2; }
.p-face { width: 42px; height: 42px; grid-row: span 2; }
.p-face .wolf { width: 100%; height: 100%; }
.p-who { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.p-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bot, .p-you { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint); }
.p-you { color: var(--gold); }
.p-nums { display: flex; flex-direction: column; align-items: end; font-family: var(--mono); grid-row: span 2; line-height: 1.15; }
.p-eq { font-size: 0.95rem; }
.p-chg { font-size: 0.72rem; }
.p-meta { display: flex; gap: 6px; align-items: center; font-size: 0.72rem; min-height: 1em; }
.p-lev { font-family: var(--mono); color: var(--muted); }
.p-heat { letter-spacing: -2px; }
.p-status { font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.p-status.warn { color: var(--down); animation: hurry 0.8s steps(2) infinite; }
.p-status.busted { color: #fff; background: var(--down); padding: 0 5px; border-radius: 3px; }
.p-bubble {
  position: absolute; left: 44px; top: -6px; padding: 2px 8px; background: var(--cream); color: var(--ink); border-radius: 10px 10px 10px 2px;
  font-weight: 700; font-size: 0.85rem; opacity: 0; pointer-events: none; transform: translateY(6px) scale(0.6); z-index: 2;
}
.p-bubble.pop { animation: bubble 2.2s ease-out forwards; }
@keyframes bubble { 12% { opacity: 1; transform: translateY(-4px) scale(1.08); } 20% { transform: translateY(-4px) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }

/* wire */
.wire { flex: 1; display: flex; flex-direction: column; }
.wire-list { overflow-y: auto; overflow-x: hidden; flex: 1; display: grid; align-content: start; gap: 2px; }
.wire-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); overflow-wrap: anywhere; gap: 6px; font-size: 0.92rem; line-height: 1.25; padding: 3px 2px; border-bottom: 1px solid rgba(217, 180, 90, 0.06); }
.wire-item.fresh { animation: wirein 0.5s ease-out; }
@keyframes wirein { from { background: rgba(217, 180, 90, 0.2); transform: translateX(10px); opacity: 0; } }
.wire-t { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); padding-top: 2px; }
.wire-item.k-news { color: var(--cream); font-weight: 600; }
.wire-item.k-liq, .wire-item.k-bust, .wire-item.k-raid { color: #ffb3ba; }
.wire-item.k-cascade, .wire-item.k-frenzy { color: var(--gold-hi); font-weight: 700; }
.wire-item.k-rumor { color: var(--muted); font-style: italic; }
.wire-item.k-bell, .wire-item.k-sys { color: var(--gold); }
.who { color: var(--cream); font-style: normal; }
.who.me { color: var(--gold-hi); }
.sym-tag { font-family: var(--mono); font-weight: 700; font-style: normal; color: var(--tc, var(--gold)); }
.sym-tag.all { color: var(--amber); }
.cred-chip { font-family: var(--mono); font-size: 0.68rem; color: var(--faint); margin-left: 4px; font-style: normal; }

/* ------------------------------------------------------------------ overlays */
.slam {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.6); z-index: 60; text-align: center; pointer-events: none;
  opacity: 0; width: min(94vw, 1100px);
}
.slam.show { animation: slam 1.5s cubic-bezier(.2, 1.4, .3, 1) forwards; }
@keyframes slam {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-3deg); filter: blur(8px); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); filter: blur(0); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1.04) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12) rotate(-2deg); }
}
.slam-text {
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(2.2rem, 6vw, 5rem); line-height: 0.95; letter-spacing: -0.01em;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.8); paint-order: stroke fill; text-shadow: 0 8px 0 rgba(0, 0, 0, 0.6), 0 0 60px currentColor;
}
.slam-text.big { font-size: clamp(3rem, 9vw, 8rem); }
.slam-sub {
  display: inline-block; margin-top: 12px; padding: 6px 16px; background: rgba(0, 0, 0, 0.8); border: 1px solid var(--line-2); font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.06em; border-radius: 4px;
}
.tone-gold.slam-text, .slam-text.tone-gold { color: var(--gold-hi); }
.slam-text.tone-red { color: var(--down); }
.slam-text.tone-green { color: var(--up); }
.slam-text.tone-white { color: var(--cream); }

.banner {
  position: fixed; top: 86px; left: 50%; transform: translate(-50%, -20px); z-index: 55; opacity: 0; pointer-events: none;
  padding: 10px 22px; background: rgba(4, 8, 6, 0.94); border: 1px solid var(--line-2); border-radius: 6px; font-size: 1.25rem; font-weight: 600;
  max-width: min(92vw, 900px); text-align: center; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6); transition: opacity 0.25s, transform 0.25s;
}
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner.tone-green { border-color: var(--up); box-shadow: 0 0 30px rgba(157, 255, 92, 0.2); }
.banner.tone-red { border-color: var(--down); box-shadow: 0 0 30px rgba(255, 59, 78, 0.25); }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 58; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast {
  padding: 7px 14px; background: rgba(4, 8, 6, 0.95); border: 1px solid var(--line-2); border-radius: 6px; font-family: var(--mono); font-size: 0.85rem;
  animation: toastin 0.25s ease-out; transition: opacity 0.4s, transform 0.4s;
}
.toast.up { border-color: rgba(157, 255, 92, 0.5); }
.toast.down { border-color: rgba(255, 59, 78, 0.5); }
.toast.warn { color: var(--amber); }
.toast.danger { color: #fff; background: var(--down); border-color: #fff; font-weight: 700; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

.flash { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0; }
.flash.tone-red { background: radial-gradient(ellipse at center, rgba(255, 59, 78, 0.05), rgba(255, 59, 78, 0.55)); }
.flash.tone-green { background: radial-gradient(ellipse at center, rgba(157, 255, 92, 0.05), rgba(157, 255, 92, 0.4)); }
.flash.go { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

body.shaking .floor { animation: shake 0.45s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translate(calc(var(--shake) * -0.3), 0); }
  20%, 80% { transform: translate(calc(var(--shake) * 0.6), calc(var(--shake) * 0.2)); }
  30%, 50%, 70% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * -0.3)); }
  40%, 60% { transform: translate(var(--shake), calc(var(--shake) * 0.3)); }
}

.rain { position: fixed; inset: 0; pointer-events: none; z-index: 57; overflow: hidden; }
.rain span { position: absolute; top: -40px; font-size: 1.8rem; animation: rain linear forwards; }
@keyframes rain { to { transform: translateY(110vh) rotate(540deg); } }

.modal { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; padding: 16px; background: rgba(2, 6, 4, 0.72); backdrop-filter: blur(5px); overflow: auto; }
.modal.show { display: grid; animation: fadein 0.25s ease-out; }
.modal.pm { background: rgba(2, 6, 4, 0.55); }
@keyframes fadein { from { opacity: 0; } }
.modal > div {
  position: relative; background: linear-gradient(180deg, #13291f, #0a1510); border: 2px solid var(--gold); outline: 1px solid var(--gold-lo); outline-offset: 5px;
  border-radius: 10px; padding: 26px clamp(16px, 3vw, 36px); max-width: min(960px, 96vw); width: 100%; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); overflow: clip;
}

.premarket { text-align: center; max-width: 620px !important; }
.pm-day { letter-spacing: 0.4em; text-transform: uppercase; color: var(--gold); }
.pm-name { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1; }
.pm-final { margin: 8px 0; color: #fff; background: var(--down); display: inline-block; padding: 4px 12px; font-weight: 700; letter-spacing: 0.12em; }
.pm-tips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 18px 0; }
.pm-label { width: 100%; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem; }
.pm-tip { padding: 6px 12px; border-radius: 6px; border: 1px dashed var(--line-2); background: rgba(0, 0, 0, 0.3); font-size: 1.15rem; display: flex; gap: 6px; align-items: baseline; }
.pm-tip.bull { color: var(--up); }
.pm-tip.bear { color: var(--down); }
.pm-tip small { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; }
.pm-open { color: var(--muted); letter-spacing: 0.25em; text-transform: uppercase; font-size: 0.85rem; }
.pm-count { font-family: var(--mono); font-weight: 700; font-size: 5rem; color: var(--amber); text-shadow: 0 0 30px rgba(255, 181, 71, 0.7); line-height: 1; }

.recap .rc-head { display: flex; align-items: center; gap: 12px; }
.rc-head h2, .fin-title, .help h2 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0; }
.rc-bell { font-size: 2rem; animation: ring 0.6s ease-in-out 3; display: inline-block; }
@keyframes ring { 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.award {
  display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 8px; text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(217, 180, 90, 0.2), transparent 70%), rgba(0, 0, 0, 0.25); border: 1px solid var(--line-2);
  animation: rise 0.5s both;
}
.award:nth-child(2) { animation-delay: 0.1s; } .award:nth-child(3) { animation-delay: 0.2s; } .award:nth-child(4) { animation-delay: 0.3s; }
.award:nth-child(5) { animation-delay: 0.4s; } .award:nth-child(6) { animation-delay: 0.5s; }
.award.me { border-color: var(--gold); }
.aw-icon { font-size: 1.6rem; }
.aw-title { color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; font-weight: 700; }
.aw-face { width: 56px; height: 56px; }
.aw-face .wolf { width: 100%; height: 100%; }
.aw-name { font-size: 1.1rem; }
.award small { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.rc-table, .fin-table { display: grid; gap: 4px; }
.rc-row { display: grid; grid-template-columns: 24px 40px 1fr auto auto 90px; gap: 10px; align-items: center; padding: 3px 8px; border-radius: 6px; }
.rc-row.me, .fin-row.me { background: rgba(217, 180, 90, 0.1); }
.rc-rank { font-family: var(--display); font-style: italic; font-weight: 900; color: var(--gold); }
.rc-face { width: 40px; height: 40px; }
.rc-face .wolf { width: 100%; height: 100%; }
.rc-pct, .rc-eq { font-family: var(--mono); }
.rc-fine { color: var(--down); font-family: var(--mono); font-size: 0.85rem; }
.rc-next { text-align: center; margin-top: 14px; color: var(--muted); }
.rc-count { font-family: var(--mono); color: var(--amber); font-weight: 700; }

.finale { text-align: center; max-width: 1000px !important; }
.finale .sunburst { bottom: -80vmax; opacity: 0.8; }
.finale > :not(.sunburst) { position: relative; }
.podium { display: flex; justify-content: center; align-items: end; gap: 12px; margin: 16px 0 8px; }
.pod { display: grid; justify-items: center; gap: 2px; width: min(200px, 30vw); animation: rise 0.7s both; }
.pod .wolf { width: 100%; max-width: 150px; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.6)); }
.pod-1 { animation-delay: 0.5s; } .pod-2 { animation-delay: 0.2s; } .pod-3 { animation-delay: 0s; }
.pod-1 .wolf { max-width: 190px; }
.pod-name { font-size: 1.2rem; }
.pod-score { font-family: var(--mono); color: var(--gold-hi); }
.pod-block {
  width: 100%; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 2.4rem; color: #1a1406;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, #9c7a2c); border-radius: 6px 6px 0 0; padding-top: 6px;
}
.pod-1 .pod-block { height: 110px; } .pod-2 .pod-block { height: 80px; } .pod-3 .pod-block { height: 56px; }
.pod-2 .pod-block, .pod-3 .pod-block { background: linear-gradient(180deg, #e8e4dc, #a9a39a); }
.pod-3 .pod-block { background: linear-gradient(180deg, #e0a472, #9a5d2e); }
.fin-me { font-size: 1.2rem; color: var(--gold-hi); }
.fin-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; text-align: left; padding: 4px 10px; border-radius: 6px; }
.fin-row span:nth-child(3) { font-family: var(--mono); }
.fin-row small { grid-column: 2 / -1; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.fin-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.help { max-width: 520px !important; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 18px 0; }
.help dt kbd { font-size: 0.9rem; margin: 0; opacity: 1; color: var(--gold-hi); }
.help dd { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .floor { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); grid-template-areas: "top top" "tape tape" "left center" "right right"; grid-template-rows: auto auto minmax(560px, 1fr) auto; height: auto; min-height: 100vh; }
  .col-right { display: grid; grid-template-columns: 1fr 1fr; }
  .pack { max-height: 360px; }
  .wire { max-height: 360px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .title-screen { grid-template-columns: 1fr; padding-top: 24px; }
  .title-right { order: -1; }
  .portrait-frame { width: min(240px, 60vw); }
  .floor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "tape" "center" "left" "right"; grid-template-rows: auto; padding: 6px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand { font-size: 1.05rem; width: 100%; }
  .day-box { margin-left: 0; text-align: left; }
  .room-tag { display: none; }
  .chart-wrap { min-height: 42vh; }
  .ch-sym { font-size: 1.9rem; }
  .ch-tag { display: none; }
  .col-right { grid-template-columns: 1fr; }
  .watch { grid-template-columns: 1fr 1fr; }
  .w-spark { display: none; }
  .watch-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .gauges { grid-template-columns: 1fr; }
  kbd { display: none; }
  .rc-row { grid-template-columns: 20px 32px 1fr auto; }
  .rc-eq, .rc-fine { display: none; }
  .banner { top: 64px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .slam.show { opacity: 1; transform: translate(-50%, -50%); animation: none !important; }
}
.cash-out { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.cash-out.paper { color: var(--amber); }
.cash-out.paper::after { content: ' 🧻 paper'; }
/* Bodoni's large optical sizes thin the hairlines until capitals fall apart ("W olfs"); pin a sturdier cut */
.logo-wolfs, .logo-the, .logo-of, .slam-text, .pm-name, .lobby-title, .ch-sym, .fin-title, .brand, .rc-head h2, .help h2 { font-variation-settings: 'opsz' 14; }
