/* =====================================================================
   Global Trading Tournament — "Calm Focus" design system
   Midnight-navy surfaces · serene sapphire accents · mint/rose signals
   Designed to lower visual stress: soft contrast, rounded forms,
   generous rhythm and a single cool palette that reads as trustworthy.
   (Visual layer only. All selectors used by the application are kept.)
   ===================================================================== */
:root {
  /* surfaces */
  --black: #070a16;
  --ink: #0b1020;
  --char: #10162b;
  --char-2: #161d34;
  --char-3: #232c4a;
  --raised: #1c2440;
  /* hairlines */
  --line: rgba(142, 168, 255, 0.2);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.1);
  /* accent (variable names kept for compatibility) */
  --gold: #8ea8ff;
  --gold-hi: #c3d0ff;
  --gold-lo: #4f63c4;
  --gold-grad: linear-gradient(180deg, #c3d0ff 0%, #8ea8ff 55%, #6b80e6 100%);
  --gold-text: linear-gradient(100deg, #7f96f0 0%, #dbe3ff 38%, #8ea8ff 64%, #b4c4ff 100%);
  --gold-soft: rgba(142, 168, 255, 0.1);
  /* text */
  --white: #e8ecf7;
  --muted: #8f98b3;
  --dim: #5d6683;
  /* signals */
  --up: #34d399;
  --up-deep: #10a878;
  --down: #fb7185;
  --down-deep: #e04862;
  --warn: #f5b85a;
  /* type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Plus Jakarta Sans", "Geist", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  /* shape & depth */
  --r: 10px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.85), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--char-3) transparent; }
::selection { background: rgba(142, 168, 255, 0.28); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--char-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #2f3a5e; }
::-webkit-scrollbar-track { background: transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--black); color: var(--white);
  font-family: var(--sans); font-size: 15px; line-height: 1.65; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  background-image:
    radial-gradient(1200px 620px at 85% -10%, rgba(142, 168, 255, 0.11), transparent 60%),
    radial-gradient(900px 560px at -10% 22%, rgba(167, 139, 250, 0.07), transparent 62%),
    radial-gradient(1100px 700px at 50% 120%, rgba(56, 189, 248, 0.05), transparent 60%),
    linear-gradient(180deg, #070a16 0%, #0a0f22 100%);
  background-attachment: fixed;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.035; 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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--gold); text-decoration: none; transition: color 0.18s var(--ease); }
a:hover { color: var(--gold-hi); }
main { flex: 1; outline: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
h1, h2, .display { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100, "WONK" 0; font-optical-sizing: auto; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.06; }
h3 { font-size: 1.02rem; letter-spacing: -0.005em; font-weight: 600; }
h4 { font-size: 0.92rem; }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.gold { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.warn { color: var(--warn); }
.eyebrow { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: 0.6rem; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }
.wrap { width: min(1320px, 100% - 3rem); margin-inline: auto; }
.narrow { width: min(840px, 100% - 3rem); margin-inline: auto; }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.page-head { padding: 3.5rem 0 1.8rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 2.2rem; position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 1px; background: var(--gold); }
.page-head h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); margin-top: 0.5rem; }
.page-head p { max-width: 46rem; }
.boot { display: grid; place-items: center; min-height: 60vh; animation: pulse 1.8s var(--ease) infinite; }
.boot img { filter: drop-shadow(0 0 24px rgba(142, 168, 255, 0.25)); }
@keyframes pulse { 50% { opacity: 0.4; } }
.hidden { display: none !important; }
:focus-visible { outline: none; }
a:focus-visible { box-shadow: 0 0 0 2px var(--black), 0 0 0 4px rgba(142, 168, 255, 0.55); border-radius: 3px; }

/* ------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 50; background: rgba(7, 10, 22, 0.78);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.35) 30%, rgba(142, 168, 255, 0.35) 70%, transparent); pointer-events: none; }
.topbar .wrap { display: flex; align-items: center; gap: 1.75rem; height: var(--topbar-h); width: min(1600px, 100% - 2.5rem); }
.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--white); flex-shrink: 0; }
.brand:hover { color: var(--white); }
.brand-mark { width: 30px; height: 34px; filter: drop-shadow(0 2px 8px rgba(142, 168, 255, 0.18)); transition: transform 0.4s var(--ease); }
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--sans); font-size: 1.05rem; letter-spacing: 0.32em; font-weight: 600; }
.brand-text small { font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.34em; color: var(--muted); margin-top: 5px; }
.nav { display: flex; gap: 0.1rem; align-items: center; flex: 1; min-width: 0; }
.nav a { color: var(--muted); font-size: 0.8rem; font-weight: 500; padding: 0.45rem 0.62rem; border-radius: var(--r); position: relative; white-space: nowrap; letter-spacing: 0.005em; transition: color 0.18s var(--ease), background 0.18s var(--ease); }
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, 0.035); }
.nav a.active { color: var(--white); }
.nav a.active::after { content: ""; position: absolute; left: 0.62rem; right: 0.62rem; bottom: -13px; height: 1px; background: var(--gold); box-shadow: 0 0 12px rgba(142, 168, 255, 0.7); }
.nav-right { display: flex; gap: 0.55rem; align-items: center; margin-left: auto; }
.menu-btn { display: none; background: var(--char); border: 1px solid var(--line-strong); color: var(--white); width: 38px; height: 38px; border-radius: var(--r); cursor: pointer; font-size: 0.95rem; transition: border-color 0.18s; }
.menu-btn:hover { border-color: var(--line); }
.user-chip { display: flex; align-items: center; gap: 0.55rem; color: var(--white); font-size: 0.82rem; font-weight: 500; padding: 0.2rem 0.7rem 0.2rem 0.2rem; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255, 255, 255, 0.02); transition: border-color 0.18s; }
.user-chip:hover { color: var(--white); border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: linear-gradient(160deg, var(--char-3), var(--char)); display: inline-grid; place-items: center; font: 600 0.72rem var(--mono); letter-spacing: 0.04em; color: var(--gold-hi); border: 1px solid var(--line); flex-shrink: 0; }
.avatar.lg { width: 88px; height: 88px; font-size: 1.6rem; box-shadow: 0 0 0 4px var(--ink), 0 0 0 5px var(--line); }

@media (max-width: 1240px) { .nav a { padding: 0.45rem 0.45rem; font-size: 0.76rem; } .nav a.active::after { left: 0.45rem; right: 0.45rem; } }
@media (max-width: 1080px) {
  .menu-btn { display: inline-grid; place-items: center; }
  .nav { display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: rgba(9, 13, 28, 0.98); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); padding: 0.5rem 1.25rem 1.25rem; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  .nav.open { display: flex; animation: drop 0.22s var(--ease); }
  .nav a { padding: 0.85rem 0.4rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; font-size: 0.92rem; }
  .nav a:hover { background: transparent; }
  .nav a.active { color: var(--gold-hi); }
  .nav a.active::after { display: none; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

.announce { background: linear-gradient(90deg, rgba(142, 168, 255, 0.1), rgba(142, 168, 255, 0.02) 60%, transparent); border-bottom: 1px solid var(--line-soft); font-size: 0.82rem; }
.announce .wrap { padding: 0.6rem 0; display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------ buttons & forms */
.btn {
  --bg: var(--char-2); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.68rem 1.2rem; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); color: var(--white);
  font: 500 0.86rem var(--sans); letter-spacing: 0.005em; cursor: pointer; white-space: nowrap; line-height: 1.2;
  box-shadow: var(--hl);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s, opacity 0.18s, filter 0.18s;
}
.btn:hover { border-color: rgba(142, 168, 255, 0.45); color: var(--white); background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn:focus-visible { box-shadow: 0 0 0 2px var(--black), 0 0 0 4px rgba(142, 168, 255, 0.55); }
.btn.primary { background: var(--gold-grad); color: #0a1030; border-color: rgba(195, 208, 255, 0.5); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 20px -8px rgba(142, 168, 255, 0.55); }
.btn.primary:hover { color: #000; filter: brightness(1.07); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 26px -8px rgba(142, 168, 255, 0.6); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.035); }
.btn.sm { padding: 0.42rem 0.8rem; font-size: 0.78rem; }
.btn.xs { padding: 0.22rem 0.5rem; font-size: 0.72rem; border-radius: 4px; }
.btn.buy { background: linear-gradient(180deg, #3ee0a5, var(--up-deep)); border-color: rgba(52, 211, 153, 0.65); color: #fff; font-weight: 600; letter-spacing: 0.04em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -10px rgba(52, 211, 153, 0.7); }
.btn.sell { background: linear-gradient(180deg, #fd8a9b, var(--down-deep)); border-color: rgba(251, 113, 133, 0.65); color: #fff; font-weight: 600; letter-spacing: 0.04em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -10px rgba(251, 113, 133, 0.7); }
.btn.buy:hover:not(:disabled), .btn.sell:hover:not(:disabled) { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.btn.danger { border-color: rgba(251, 113, 133, 0.4); color: #fda4b4; background: rgba(251, 113, 133, 0.07); }
.btn.danger:hover { border-color: rgba(251, 113, 133, 0.7); background: rgba(251, 113, 133, 0.14); color: #fecdd6; }
.btn.block { width: 100%; }

label { display: block; font-size: 0.74rem; font-weight: 500; color: var(--muted); margin-bottom: 0.38rem; letter-spacing: 0.02em; }
input, select, textarea {
  width: 100%; background: var(--ink); color: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 0.66rem 0.8rem; font: 400 0.9rem var(--sans); transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.16); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(142, 168, 255, 0.14); }
select { appearance: none; -webkit-appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8d94' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; }
select option { background: var(--char); color: var(--white); }
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--gold); box-shadow: none; }
input[type="file"] { padding: 0.5rem; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field { margin-bottom: 1.05rem; }
.field .hint { font-size: 0.74rem; color: var(--dim); margin-top: 0.35rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; }
.form-error { background: rgba(251, 113, 133, 0.08); border: 1px solid rgba(251, 113, 133, 0.3); border-left: 2px solid var(--down); color: #fecdd6; padding: 0.7rem 0.9rem; border-radius: var(--r); font-size: 0.84rem; margin-bottom: 1rem; }
.form-ok { background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.3); border-left: 2px solid var(--up); color: #a8f0cd; padding: 0.7rem 0.9rem; border-radius: var(--r); font-size: 0.84rem; margin-bottom: 1rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.84rem; color: var(--white); cursor: pointer; }
.check input { margin-top: 0.2rem; }

/* ------------------------------------------------ cards & panels */
.card {
  background: linear-gradient(180deg, rgba(22, 29, 52, 0.75), rgba(11, 16, 32, 0.9)); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 1.5rem; position: relative; box-shadow: var(--hl), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card.gilt { border-color: rgba(142, 168, 255, 0.16); }
.card.gilt::before { content: ""; position: absolute; inset: 0 1.5rem auto 1.5rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(195, 208, 255, 0.7), transparent); }
.card.gilt:hover { border-color: rgba(142, 168, 255, 0.32); }
.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.stat .k { font-size: 0.64rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.stat .v { font-family: var(--mono); font-size: 1.35rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .v.big { font-size: 2.1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.2rem; font-size: 0.86rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 0.4rem; font: 500 0.62rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.28rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; background: rgba(255, 255, 255, 0.02); line-height: 1.2; }
.badge.live { color: #86efc1; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pm-pulse 1.6s ease-out infinite; }
.badge.open { color: var(--gold-hi); border-color: rgba(142, 168, 255, 0.35); background: var(--gold-soft); }
.badge.done { color: var(--dim); }
.badge.bad { color: #fda4b4; border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.06); }
.empty { text-align: center; padding: 3rem 1.25rem; color: var(--muted); border: 1px dashed rgba(255, 255, 255, 0.09); border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.012); }
.empty b { display: block; color: var(--white); font-family: var(--display); font-size: 1.5rem; font-weight: 400; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.skeleton { background: linear-gradient(90deg, var(--char) 0%, var(--char-2) 50%, var(--char) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); min-height: 1rem; border-color: transparent; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: rgba(11, 16, 32, 0.6); box-shadow: var(--hl); }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
th { text-align: left; font: 500 0.62rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0.75rem 0.85rem; background: var(--char); border-bottom: 1px solid var(--line-soft); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
td { padding: 0.68rem 0.85rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr td { transition: background 0.15s; }
tr:hover td { background: rgba(255, 255, 255, 0.022); }
tr.clickable { cursor: pointer; }
tr.me td { background: rgba(142, 168, 255, 0.07); }
tr.me td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.rank { font-family: var(--mono); font-weight: 500; font-size: 0.95rem; width: 2.75rem; text-align: center; color: var(--muted); }
.rank.r1 { color: var(--gold-hi); text-shadow: 0 0 14px rgba(195, 208, 255, 0.45); } .rank.r2 { color: #d5d7de; } .rank.r3 { color: #cf9a6a; }
.trader { display: flex; align-items: center; gap: 0.65rem; }

/* ------------------------------------------------ tabs / segmented */
.tabs { display: flex; gap: 0.15rem; flex-wrap: wrap; border-bottom: 1px solid var(--line-soft); margin-bottom: 1.3rem; }
.tabs button { background: none; border: none; color: var(--muted); padding: 0.7rem 0.95rem; font: 500 0.83rem var(--sans); cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px; transition: color 0.18s, border-color 0.18s; }
.tabs button:hover { color: var(--white); }
.tabs button.active { color: var(--white); border-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; background: var(--ink); padding: 2px; gap: 1px; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 0.3rem 0.58rem; font: 500 0.72rem var(--mono); cursor: pointer; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.seg button:hover { color: var(--white); }
.seg button.active { background: var(--char-3); color: var(--gold-hi); box-shadow: var(--hl); }
.toolbar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar .spacer { flex: 1; }
.toolbar h2 { margin-top: 0.4rem; margin-bottom: 0; }

/* ------------------------------------------------ hero */
.hero { position: relative; padding: clamp(3.5rem, 8vw, 7.5rem) 0 clamp(3rem, 5vw, 4.5rem); overflow: hidden; isolation: isolate; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.8rem, 6.6vw, 5.9rem); line-height: 0.96; margin: 1rem 0 1.5rem; letter-spacing: -0.025em; }
.hero h1 em { font-style: italic; }
.hero .lead { font-size: 1.08rem; color: #b3bad0; max-width: 35rem; line-height: 1.7; }
.hero .lead b { color: var(--white); }
.hero-ctas { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 2.2rem; }
.hero-lines { position: absolute; inset: 0; z-index: -1; opacity: 0.6; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.028) 79px 80px), repeating-linear-gradient(0deg, transparent 0 79px, rgba(255, 255, 255, 0.022) 79px 80px);
  mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, black, transparent 72%); -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, black, transparent 72%); }
.hero-lines::after { content: ""; position: absolute; right: 8%; top: -10%; width: 46vw; height: 46vw; max-width: 720px; max-height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(142, 168, 255, 0.13), transparent 62%); filter: blur(10px); }
.prize-plate { border: 1px solid rgba(142, 168, 255, 0.22); border-radius: 14px; background: linear-gradient(165deg, rgba(20, 26, 52, 0.95), rgba(11, 16, 32, 0.96) 55%); padding: 2.2rem; position: relative; box-shadow: var(--shadow), 0 40px 90px -40px rgba(142, 168, 255, 0.25); overflow: hidden; }
.prize-plate::before { content: ""; position: absolute; inset: 0 2rem auto 2rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); opacity: 0.8; }
.prize-plate::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(142, 168, 255, 0.08); border-radius: 9px; pointer-events: none; }
.prize-plate .figure { font-family: var(--display); font-size: clamp(3.8rem, 7.4vw, 6rem); line-height: 1; margin: 0.8rem 0 0.5rem; letter-spacing: -0.03em; }
.prize-plate .split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); margin-top: 1.8rem; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.prize-plate .split > div { background: rgba(9, 12, 26, 0.92); padding: 1rem 1.1rem; }
.prize-plate .split .v { font-size: 1.05rem; }
.ticker { border-block: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--ink), #080b18); overflow: hidden; white-space: nowrap; position: relative; mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent); }
.ticker-track { display: inline-flex; gap: 2.8rem; padding: 0.8rem 0; animation: marquee 70s linear infinite; font-family: var(--mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: baseline; gap: 0.15rem; }
.ticker-item b { color: var(--white); font-weight: 500; margin-right: 0.5rem; letter-spacing: 0.04em; }
@keyframes marquee { to { transform: translateX(-50%); } }
.reveal { animation: rise 0.9s var(--ease) both; }
.reveal.d1 { animation-delay: 0.08s; } .reveal.d2 { animation-delay: 0.16s; } .reveal.d3 { animation-delay: 0.24s; } .reveal.d4 { animation-delay: 0.32s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.steps { counter-reset: s; gap: 2rem; }
.step { border-top: 1px solid var(--line-soft); padding-top: 1.4rem; position: relative; }
.step::after { content: ""; position: absolute; top: -1px; left: 0; width: 40px; height: 1px; background: var(--gold); }
.step::before { counter-increment: s; content: "0" counter(s); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.2em; display: block; margin-bottom: 0.9rem; color: var(--gold); }
.step h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.5), transparent); opacity: 0.45; margin: 0; border: 0; }

/* ------------------------------------------------ tournaments */
.t-card { display: flex; flex-direction: column; gap: 1.1rem; }
.t-card:hover { border-color: rgba(142, 168, 255, 0.28); transform: translateY(-2px); box-shadow: var(--hl), 0 30px 60px -30px rgba(0, 0, 0, 0.95); }
.t-card .t-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.t-card h3 { font-family: var(--display); font-size: 1.65rem; font-weight: 400; letter-spacing: -0.01em; margin: 0.4rem 0 0; line-height: 1.1; }
.countdown { font-family: var(--mono); font-size: 1.1rem; display: flex; gap: 0.45rem; font-variant-numeric: tabular-nums; }
.countdown span { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.9rem; background: linear-gradient(180deg, var(--char-2), var(--ink)); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 0.38rem 0.3rem 0.3rem; box-shadow: var(--hl); font-weight: 500; }
.countdown small { font-size: 0.52rem; color: var(--dim); letter-spacing: 0.18em; margin-top: 0.1rem; }
.t-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; font-size: 0.82rem; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.t-meta div { background: var(--ink); padding: 0.65rem 0.75rem; }
.t-meta b { display: block; font-family: var(--mono); font-weight: 500; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.t-meta small { color: var(--muted); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--mono); }
.reasons { margin: 0; padding-left: 1.1rem; color: var(--warn); font-size: 0.84rem; }
.prose { color: #c5cbdd; line-height: 1.75; }
.prose h2 { margin-top: 2.6rem; color: var(--white); }
.prose h3 { margin-top: 1.8rem; color: var(--gold-hi); }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--gold); }
.prose pre { white-space: pre-wrap; font-family: var(--sans); }
details.faq { border-bottom: 1px solid var(--line-soft); padding: 1.15rem 0; transition: background 0.2s; }
details.faq summary { cursor: pointer; font-weight: 500; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; transition: color 0.18s; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary:hover { color: var(--gold-hi); }
details.faq summary::after { content: "+"; color: var(--gold); font-family: var(--mono); font-size: 1.1rem; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-soft); border-radius: 50%; flex-shrink: 0; transition: transform 0.25s var(--ease), border-color 0.2s; }
details.faq[open] summary::after { content: "–"; border-color: var(--line); }
details.faq p { margin: 0.85rem 0 0; color: #bdbcb6; max-width: 46rem; animation: fade 0.25s; }

/* ------------------------------------------------ terminal */
body.terminal-mode .footer { display: none; }
body.terminal-mode main { display: flex; }
body.terminal-mode .grain { display: none; }
.term {
  display: grid; width: 100%; height: calc(100vh - var(--topbar-h)); min-height: 640px;
  grid-template-columns: 260px 1fr; grid-template-rows: auto 1fr 260px; gap: 1px; background: rgba(255, 255, 255, 0.055);
}
.term > * { background: #0b1020; min-width: 0; min-height: 0; }
.term-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 0; padding: 0.45rem 0.9rem; overflow-x: auto; font-size: 0.78rem; background: linear-gradient(180deg, #0e1429, #0c1124); scrollbar-width: none; }
.term-bar::-webkit-scrollbar { display: none; }
.term-bar > * { flex-shrink: 0; }
.term-bar > .conn { margin-right: 0.35rem; }
.term-bar > a, .term-bar > .badge, .term-bar > span { margin-right: 0.9rem; }
.term-bar .stat { padding: 0.1rem 1.05rem; border-left: 1px solid var(--line-soft); gap: 0.15rem; }
.term-bar .stat .k { font-size: 0.56rem; letter-spacing: 0.16em; color: var(--dim); }
.term-bar .stat .v { font-size: 0.92rem; letter-spacing: -0.01em; }
.term-watch { overflow-y: auto; scrollbar-width: thin; }
.term-watch .w-search { padding: 0.6rem; position: sticky; top: 0; background: rgba(9, 13, 28, 0.96); backdrop-filter: blur(8px); z-index: 1; border-bottom: 1px solid var(--line-soft); }
.term-watch .w-search input { padding: 0.48rem 0.7rem 0.48rem 2rem; font-size: 0.78rem; background-color: var(--char);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%235c5f67' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0.7rem center; }
.w-group { font: 500 0.58rem var(--mono); letter-spacing: 0.22em; color: var(--dim); padding: 0.9rem 0.85rem 0.35rem; text-transform: uppercase; display: flex; align-items: center; gap: 0.5rem; }
.w-group::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.w-row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.55rem; padding: 0.46rem 0.85rem; cursor: pointer; font-size: 0.77rem; border-left: 2px solid transparent; align-items: center; transition: background 0.15s, border-color 0.15s; }
.w-row:hover { background: rgba(255, 255, 255, 0.03); }
.w-row.active { background: linear-gradient(90deg, rgba(142, 168, 255, 0.1), rgba(142, 168, 255, 0.02)); border-left-color: var(--gold); }
.w-row.active .sym { color: var(--gold-hi); }
.w-row.off { opacity: 0.4; }
.w-row .sym { font-weight: 600; letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.35rem; min-width: 0; white-space: nowrap; }
.w-row .px { font-family: var(--mono); text-align: right; min-width: 4.5rem; font-variant-numeric: tabular-nums; border-radius: 3px; padding: 0 0.15rem; }
.w-row .chg { font-family: var(--mono); font-size: 0.68rem; text-align: right; min-width: 3.4rem; }
.flash-up { animation: fu 0.7s ease-out; } .flash-down { animation: fd 0.7s ease-out; }
@keyframes fu { from { background: rgba(52, 211, 153, 0.28); color: #b4f5d6; } } @keyframes fd { from { background: rgba(251, 113, 133, 0.28); color: #fecdd6; } }
.term-chart { display: flex; flex-direction: column; position: relative; }
.chart-tools { display: flex; gap: 0.45rem; align-items: center; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; font-size: 0.76rem; background: #0b1020; }
.chart-tools > .dim { color: rgba(255, 255, 255, 0.08); }
.chart-tools .sym-title { font-weight: 600; font-size: 0.98rem; margin-right: 0.5rem; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-tools .tool { background: none; border: 1px solid transparent; color: var(--muted); padding: 0.26rem 0.5rem; border-radius: 4px; cursor: pointer; font: 500 0.7rem var(--mono); transition: color 0.15s, border-color 0.15s, background 0.15s; }
.chart-tools .tool:hover { color: var(--white); background: rgba(255, 255, 255, 0.03); border-color: var(--line-soft); }
.chart-tools .tool.active { color: var(--gold-hi); border-color: rgba(142, 168, 255, 0.3); background: var(--gold-soft); }
#chart { flex: 1; position: relative; min-height: 280px; }
.chart-legend { position: absolute; left: 0.85rem; top: 0.6rem; z-index: 3; font: 0.72rem var(--mono); color: var(--dim); pointer-events: none; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.chart-legend b { color: var(--white); font-weight: 500; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); z-index: 4; background: rgba(9, 13, 28, 0.86); backdrop-filter: blur(4px); padding: 1rem; line-height: 1.6; }
.chart-msg b { color: var(--white); font-weight: 500; }
.feed-note { font: 0.64rem var(--mono); color: var(--dim); padding: 0.32rem 0.75rem; border-top: 1px solid var(--line-soft); display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; letter-spacing: 0.02em; background: #090d1c; }

/* on-chart order ticket */
.chart-ticket { position: absolute; left: 0.6rem; top: 1.9rem; z-index: 5; width: 300px; max-width: calc(100% - 4.5rem); max-height: calc(100% - 2.6rem); overflow-y: auto; background: linear-gradient(180deg, rgba(22, 29, 52, 0.9), rgba(11, 16, 32, 0.92)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.45rem; box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.8), var(--hl); transition: width 0.2s var(--ease); scrollbar-width: thin; }
.chart-ticket:has(.ct-more:not(.hidden)) { width: 340px; }
/* Reference-aligned execution strip: [order type] · spread · [TP/SL] above [Buy] [− lot +] [Sell] */
.ct-quick { display: grid; grid-template-columns: 1fr minmax(124px, 0.95fr) 1fr; gap: 8px; align-items: stretch; }
.ct-side {
  position: relative; padding: 0.4rem 0.75rem; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.08rem; text-align: center;
  transition: transform 0.14s var(--ease), filter 0.18s var(--ease), box-shadow 0.18s var(--ease); min-width: 0; line-height: 1.1; min-height: 48px; overflow: hidden; isolation: isolate;
}
.ct-side::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 60%); pointer-events: none; }
.ct-side:hover:not(:disabled) { filter: brightness(1.1); }
.ct-side:active:not(:disabled) { transform: scale(0.985); filter: brightness(0.95); }
.ct-side:focus-visible { box-shadow: 0 0 0 2px var(--black), 0 0 0 4px rgba(142, 168, 255, 0.6) !important; }
.ct-side:disabled { opacity: 0.38; cursor: not-allowed; filter: saturate(0.4); }
.ct-side.buyq { background: #0f9a72; border-color: rgba(134, 239, 193, 0.22); color: #fff; box-shadow: 0 10px 24px -16px rgba(16, 168, 120, 0.9); }
.ct-side.sellq { background: #c8343f; border-color: rgba(253, 164, 180, 0.22); color: #fff; box-shadow: 0 10px 24px -16px rgba(224, 72, 98, 0.9); }
.ct-side .lbl { font: 600 1.02rem var(--sans); letter-spacing: 0.01em; }
.ct-side .px { font: 500 0.66rem var(--mono); color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* lot size stepper */
.ct-lots { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 34px; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #090d1c; min-height: 48px; transition: border-color 0.15s, box-shadow 0.15s; }
.ct-lots input { padding: 0; text-align: right; font: 600 1rem var(--mono); border: none; border-radius: 0; background: transparent; -moz-appearance: textfield; box-shadow: none; min-width: 0; color: var(--white); height: 100%; font-variant-numeric: tabular-nums; }
.ct-lots input:focus { outline: none; background: transparent; box-shadow: none; color: var(--gold-hi); }
.ct-lots .lot-u { font: 500 0.72rem var(--sans); color: var(--muted); padding: 0 0.15rem 0 0.4rem; }
.ct-lots:focus-within { border-color: rgba(142, 168, 255, 0.6); box-shadow: 0 0 0 3px rgba(142, 168, 255, 0.12); }
.ct-lots input::-webkit-outer-spin-button, .ct-lots input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ct-lots button { background: transparent; border: none; color: var(--white); cursor: pointer; font: 400 1.2rem var(--sans); line-height: 1; height: 100%; transition: color 0.12s, background 0.12s; }
.ct-lots button:hover { color: var(--gold-hi); background: rgba(255, 255, 255, 0.04); }
.ct-lots button:active { background: rgba(142, 168, 255, 0.12); }
.ct-sub { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.spread { font: 500 0.62rem var(--mono); color: var(--dim); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.ct-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--white); cursor: pointer; font: 500 0.82rem var(--sans); padding: 0.45rem 0.75rem; transition: border-color 0.15s, background 0.15s, color 0.15s; white-space: nowrap; }
.ct-pill span { color: var(--muted); font-size: 0.78rem; }
.ct-pill:hover { border-color: rgba(142, 168, 255, 0.4); background: rgba(255, 255, 255, 0.025); }
.ct-pill[aria-expanded="true"] { border-color: rgba(142, 168, 255, 0.5); color: var(--gold-hi); }
.ct-toggle:hover { color: var(--gold-hi); }
.ct-why p { margin: 0.35rem 0.2rem 0.1rem; font-size: 0.68rem !important; line-height: 1.45; }
.ct-more { border-top: 1px solid var(--line-soft); margin-top: 0.5rem; padding-top: 0.7rem; animation: fade 0.2s; }
.ct-more .field { margin-bottom: 0.6rem; }
.ct-more input, .ct-more select { padding: 0.45rem 0.6rem; font-size: 0.8rem; }
.ct-more select { padding-right: 1.8rem; background-position: right 0.6rem center; }
.ct-more label { font: 500 0.58rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.ct-more label.check { font-family: var(--sans); text-transform: none; letter-spacing: 0; color: var(--muted); }
#o-sl:focus { border-color: rgba(251, 113, 133, 0.7); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12); }
#o-tp:focus { border-color: rgba(52, 211, 153, 0.7); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.ticket-calc { font-size: 0.76rem; background: #090d1c; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 0.65rem 0.75rem; margin: 0.65rem 0 0.9rem; }
.ticket-calc .kv { gap: 0.32rem 1rem; }
.ticket-calc .kv dt { font-size: 0.72rem; }
.ticket-calc .kv dd { font-size: 0.76rem; }
.lot-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.3rem; }
.lot-row button { width: 34px; }
.term-book { grid-column: 1 / -1; display: flex; flex-direction: column; }
.term-book .tabs { margin: 0; padding: 0 0.7rem; background: #0b1020; align-items: center; }
.term-book .tabs button { padding: 0.6rem 0.8rem; font-size: 0.77rem; }
.book-body { flex: 1; overflow: auto; scrollbar-width: thin; }
.book-body table { font-size: 0.77rem; }
.book-body th { background: #0d1326; padding: 0.5rem 0.7rem; font-size: 0.58rem; }
.book-body td, .book-body th { padding: 0.45rem 0.7rem; }
.book-foot { display: flex; align-items: baseline; gap: 0.7rem; flex-shrink: 0; padding: 0.5rem 0.9rem; border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, #0c1124, #0e1429); font-size: 0.78rem; }
.book-foot.hidden { display: none; }
.book-foot .k { font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.book-foot .v { font: 600 1rem var(--mono); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.book-foot .dim { font-size: 0.7rem; }
.book-body .btn.xs { padding: 0.2rem 0.5rem; font-size: 0.68rem; }
.margin-alert { padding: 0.55rem 0.9rem; background: rgba(245, 184, 90, 0.1); border-bottom: 1px solid rgba(245, 184, 90, 0.35); color: #ffe0a8; font-size: 0.8rem; grid-column: 1 / -1; }
.margin-alert.so { background: rgba(251, 113, 133, 0.13); border-color: rgba(251, 113, 133, 0.45); color: #fecdd6; animation: alertpulse 2s ease-in-out infinite; }
@keyframes alertpulse { 50% { background: rgba(251, 113, 133, 0.2); } }
.conn { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; flex-shrink: 0; }
.conn.on { background: var(--up); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16), 0 0 10px rgba(52, 211, 153, 0.6); }
.conn.poll { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 184, 90, 0.14); }
.term-mobile-tabs { display: none; }
@media (max-width: 620px) {
  .ct-quick { grid-template-columns: 1fr minmax(112px, 1fr) 1fr; gap: 6px; }
  .ct-lots { grid-template-columns: 30px minmax(0, 1fr) auto 30px; }
  .ct-side { padding: 0.32rem 0.45rem; min-height: 46px; }
  .ct-side .lbl { font-size: 0.98rem; }
  .ct-pill { padding: 0.42rem 0.7rem; font-size: 0.8rem; }
}
@media (max-width: 1100px) {
  .term { grid-template-columns: 220px 1fr; }
}
@media (max-width: 860px) {
  .term { display: flex; flex-direction: column; height: auto; min-height: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .term > * { width: 100%; }
  /* floating bottom navigation (Home · Markets · Trade · Positions · Account) */
  .term-mobile-tabs { display: flex; position: fixed; left: 0.6rem; right: 0.6rem; bottom: calc(0.55rem + env(safe-area-inset-bottom)); width: auto !important; z-index: 40; padding: 0.3rem; gap: 0.15rem; background: rgba(18, 24, 46, 0.92) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9), var(--hl); }
  .term-mobile-tabs > button, .term-mobile-tabs > a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; background: none; border: none; border-radius: 14px; color: var(--muted); padding: 0.42rem 0.2rem; font: 500 0.66rem var(--sans); cursor: pointer; text-decoration: none; transition: color 0.15s, background 0.15s; min-width: 0; }
  .term-mobile-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .term-mobile-tabs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .term-mobile-tabs > button.active { color: var(--gold-hi); background: rgba(142, 168, 255, 0.08); }
  .term-mobile-tabs > button.active svg { stroke-width: 1.9; }
  .term-mobile-tabs .tm-acct { border-left: 1px solid var(--line-soft); border-radius: 0 14px 14px 0; }
  .term-watch { max-height: none; min-height: 60vh; }
  .term-chart { height: calc(100dvh - var(--topbar-h) - 84px - env(safe-area-inset-bottom)); min-height: 520px; }
  .chart-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chart-tools::-webkit-scrollbar { display: none; }
  .chart-tools > * { flex-shrink: 0; }
  .chart-tools .sym-title { cursor: pointer; }
  .chart-tools .sym-title::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; border: 1.6px solid var(--muted); border-radius: 50%; box-shadow: 4px 4px 0 -3px var(--muted); margin-right: 0.15rem; }
  .term-book { min-height: 60vh; }
  .term .m-hide { display: none; }
}

/* ------------------------------------------------ modal & toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 5, 14, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 80; display: grid; place-items: center; padding: 1rem; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(500px, 100%); max-height: 90vh; overflow: auto; background: linear-gradient(180deg, #151d3a, #0d1326); border: 1px solid var(--line-strong); border-radius: 14px; padding: 1.75rem; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95), var(--hl); animation: pop 0.28s var(--ease); position: relative; }
.modal::before { content: ""; position: absolute; inset: 0 2rem auto 2rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(195, 208, 255, 0.6), transparent); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal h3 { font-family: var(--display); font-size: 1.65rem; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.modal .actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line-soft); }
.toasts { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 90; display: flex; flex-direction: column; gap: 0.55rem; max-width: min(390px, calc(100vw - 2rem)); }
.toast { background: rgba(20, 27, 50, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line-strong); border-left: 2px solid var(--gold); padding: 0.85rem 1.05rem; border-radius: 8px; font-size: 0.84rem; line-height: 1.5; box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.9); animation: slidein 0.32s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }
.toast.err { border-left-color: var(--down); }
.toast.ok { border-left-color: var(--up); }

/* ------------------------------------------------ footer */
.footer { border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--ink), #070a16); margin-top: 5rem; font-size: 0.83rem; color: var(--muted); position: relative; }
.footer::before { content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: min(600px, 80%); height: 1px; background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.5), transparent); }
.footer .wrap { padding: 3.5rem 0 2.2rem; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2.4rem; }
.footer h4 { font: 500 0.62rem var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer a { color: var(--muted); display: block; padding: 0.2rem 0; transition: color 0.18s, transform 0.18s; }
.footer a:hover { color: var(--white); }
.footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); padding-top: 1.4rem; font-size: 0.72rem; color: var(--dim); line-height: 1.7; }
@media (max-width: 760px) { .footer .wrap { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------ dashboards */
.chart-box { height: 280px; position: relative; }
.bar-list { display: flex; flex-direction: column; gap: 0.55rem; }
.bar-item { display: grid; grid-template-columns: 90px 1fr 90px; gap: 0.7rem; align-items: center; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; background: var(--char-2); border-radius: 999px; position: relative; overflow: hidden; }
.bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 1.75rem; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; align-self: start; padding: 0.4rem; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: rgba(11, 16, 32, 0.6); }
.admin-nav button { text-align: left; background: none; border: none; color: var(--muted); padding: 0.6rem 0.8rem; border-radius: var(--r); cursor: pointer; font: 500 0.84rem var(--sans); display: flex; justify-content: space-between; align-items: center; transition: color 0.15s, background 0.15s; white-space: nowrap; }
.admin-nav button:hover { color: var(--white); background: rgba(255, 255, 255, 0.03); }
.admin-nav button.active { background: var(--char-2); color: var(--white); box-shadow: inset 2px 0 0 var(--gold), var(--hl); }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } .admin-nav { flex-direction: row; overflow-x: auto; position: static; } }
.pill-count { background: var(--down); color: #fff; font: 600 0.62rem var(--mono); padding: 0.08rem 0.42rem; border-radius: 999px; }
.json { font: 0.7rem var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-all; max-width: 420px; }

@media (max-width: 620px) {
  :root { --topbar-h: 60px; }
  .wrap, .narrow { width: calc(100% - 2rem); }
  .topbar .wrap { gap: 0.6rem; width: calc(100% - 1.5rem); }
  .hide-sm { display: none; }
  .user-chip { padding: 0.15rem; }
  .nav-right { gap: 0.4rem; }
  .nav-right .btn.sm { padding: 0.4rem 0.6rem; }
  .brand-text b { font-size: 0.92rem; letter-spacing: 0.26em; }
  .brand-text small { font-size: 0.44rem; letter-spacing: 0.22em; }
  .brand-mark { width: 26px; height: 30px; }
  .card { padding: 1.2rem; }
  .prize-plate { padding: 1.6rem; }
}

/* ---------------------------------------------------------------- Practice Academy */
.academy-hero { padding: 5rem 0 3.4rem; border-bottom: 1px solid var(--line-soft); background: radial-gradient(1200px 420px at 80% -10%, rgba(142, 168, 255, 0.1), transparent 60%), transparent; position: relative; }
.academy-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.4), transparent); }
.academy-hero h1 { font-family: var(--display); font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.02; margin: 0.9rem 0 1.1rem; }
.academy-hero p { max-width: 44rem; color: #b3bad0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.6rem; }
.crumbs { font: 0.72rem var(--mono); color: var(--dim); letter-spacing: 0.08em; margin-bottom: 0.8rem; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--gold-hi); }
.section-h { font-family: var(--display); font-weight: 400; font-size: 1.9rem; margin: 2.8rem 0 1.1rem; letter-spacing: -0.01em; }
.sim-note { border: 1px solid rgba(245, 184, 90, 0.28); border-left: 2px solid var(--warn); background: rgba(245, 184, 90, 0.05); color: #d9d6cd; padding: 0.85rem 1.05rem; border-radius: var(--r); font-size: 0.84rem; margin-bottom: 1.5rem; }
.sim-note b { color: var(--warn); }
.academy-top { grid-template-columns: 1.3fr 1fr; gap: 1.25rem; display: grid; }
@media (max-width: 860px) { .academy-top { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.9rem; margin-top: 0.8rem; }
.kpis .k { display: block; font: 500 0.6rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.2rem; }
.kpis b { font-family: var(--mono); font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--char-3); border-radius: 999px; overflow: hidden; margin-top: 0.7rem; }
.bar.big { height: 6px; margin-top: 1.1rem; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); border-radius: 999px; transition: width 0.6s var(--ease); }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.mod-card { display: flex; gap: 1.1rem; padding: 1.25rem; background: linear-gradient(180deg, rgba(22, 29, 52, 0.7), rgba(11, 16, 32, 0.9)); border: 1px solid var(--line-soft); border-radius: var(--r-lg); color: var(--white); box-shadow: var(--hl); transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease); }
.mod-card:hover { border-color: rgba(142, 168, 255, 0.35); color: var(--white); transform: translateY(-2px); box-shadow: var(--hl), 0 24px 48px -28px rgba(0, 0, 0, 0.95); }
.mod-card h3 { margin-bottom: 0.2rem; }
.mod-card p { font-size: 0.82rem; margin: 0.3rem 0 0.7rem; }
.mod-n { font: 400 2rem var(--display); color: var(--gold); min-width: 2.4rem; line-height: 1; }
.mod-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.74rem; }
.mod-pc { margin-left: auto; font: 500 0.72rem var(--mono); }
.badge.lvl-beginner { color: #86e3b7; border-color: rgba(52, 211, 153, 0.32); background: rgba(52, 211, 153, 0.05); }
.badge.lvl-intermediate { color: var(--gold-hi); border-color: rgba(142, 168, 255, 0.32); background: var(--gold-soft); }
.badge.lvl-advanced { color: #fda4b4; border-color: rgba(251, 113, 133, 0.32); background: rgba(251, 113, 133, 0.05); }
.badge.practice { color: #0a1030; background: var(--gold-grad); border-color: transparent; font-weight: 600; }
.lesson h1 { font-family: var(--display); font-size: clamp(2.1rem, 4.2vw, 3rem); margin: 0.3rem 0 0.8rem; }
.lesson h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 2.2rem 0 0.7rem; color: var(--gold-hi); }
.lesson p { color: #cfcdc5; line-height: 1.75; }
.keypoints { margin-top: 1.5rem; } .keypoints ul { margin: 0.6rem 0 1rem; padding-left: 1.2rem; } .keypoints li::marker { color: var(--gold); }
.sc-opts { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.sc-opt { text-align: left; padding: 0.8rem 1rem; background: var(--char); border: 1px solid var(--line-soft); color: var(--white); border-radius: var(--r); cursor: pointer; font: inherit; transition: border-color 0.18s, background 0.18s; }
.sc-opt:hover, .sc-opt.sel { border-color: rgba(142, 168, 255, 0.55); background: var(--gold-soft); }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.quiz legend { font-weight: 600; margin-bottom: 0.5rem; }
.quiz .check { display: flex; gap: 0.55rem; margin: 0.3rem 0; padding: 0.45rem 0.6rem; border-radius: var(--r); transition: background 0.15s; }
.quiz .check:hover { background: rgba(255, 255, 255, 0.025); }
.q-fb { font-size: 0.82rem; margin-top: 0.35rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); font-size: 0.88rem; }
.ex-wrap { margin-top: 0.7rem; }
.ex-chart { height: 360px; border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; background: #0b1020; }
@media (max-width: 620px) { .ex-chart { height: 280px; } }
.ex-q { margin-top: 0.9rem; }
.ex-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ex-result { display: flex; gap: 1.1rem; align-items: flex-start; margin-top: 0.9rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); border: 1px solid var(--line-soft); background: var(--char); animation: rise 0.35s var(--ease); }
.ex-result.good { border-color: rgba(52, 211, 153, 0.4); box-shadow: inset 2px 0 0 var(--up); } .ex-result.mid { border-color: rgba(245, 184, 90, 0.4); box-shadow: inset 2px 0 0 var(--warn); } .ex-result.bad { border-color: rgba(251, 113, 133, 0.4); box-shadow: inset 2px 0 0 var(--down); }
.ex-result ul { margin: 0; padding-left: 1.1rem; font-size: 0.83rem; }
.ex-score { font: 400 2.5rem var(--display); color: var(--gold-hi); line-height: 1; white-space: nowrap; }
.ex-score small { font: 0.72rem var(--mono); color: var(--dim); }
.ex-score.sm { font-size: 1.8rem; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
@media (max-width: 420px) { .ch-grid, .mod-grid { grid-template-columns: 1fr; } }
.ch-card h3 { margin: 0.7rem 0 0.35rem; font-family: var(--display); font-weight: 400; font-size: 1.45rem; }
.ch-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; font-size: 0.72rem; }
.ch-score { display: flex; gap: 1rem; margin: 0.9rem 0; font-size: 0.83rem; }
.ch-score ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }

/* data-quality badges (market-data engine) */
.dbadge { display: inline-block; font: 600 0.52rem var(--mono); letter-spacing: 0.1em; padding: 0.1rem 0.32rem; border-radius: 3px; vertical-align: middle; border: 1px solid; line-height: 1.3; }
.dbadge.rt { color: #86efc1; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.06); }
.dbadge.ind { color: var(--warn); border-color: rgba(245, 184, 90, 0.4); }
.dbadge.stale { color: var(--warn); border-color: rgba(245, 184, 90, 0.45); background: rgba(245, 184, 90, 0.07); }
.dbadge.closed { color: var(--muted); border-color: var(--char-3); }
.dbadge.nofeed { color: var(--dim); border-color: var(--char-3); }
.feed-note #feed-badge { margin-right: 0.5rem; }
.term.practice { box-shadow: inset 0 1px 0 var(--gold); }

/* ------------------------------------------------------------ Practice Mode */
.pm-hero { background: radial-gradient(1100px 380px at 85% -10%, rgba(52, 211, 153, 0.08), transparent 60%), radial-gradient(900px 340px at 10% 0%, rgba(142, 168, 255, 0.08), transparent 60%), transparent; }
.pm-pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 0.45rem; vertical-align: middle; animation: pm-pulse 1.6s ease-out infinite; }
@keyframes pm-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
.pm-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.85rem; margin-top: 1.1rem; }
.pm-tile { display: block; background: linear-gradient(180deg, rgba(22, 29, 52, 0.75), rgba(11, 16, 32, 0.92)); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1rem 1.1rem; color: inherit; text-decoration: none; box-shadow: var(--hl); transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease); }
.pm-tile:hover { border-color: rgba(142, 168, 255, 0.35); transform: translateY(-2px); color: inherit; box-shadow: var(--hl), 0 20px 40px -24px rgba(0, 0, 0, 0.95); }
.pm-tile-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.76rem; gap: 0.5rem; }
.pm-tile-h b { font-size: 0.95rem; letter-spacing: 0.02em; }
.pm-name { font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.pm-px { font-family: var(--mono); font-size: 1.45rem; font-weight: 500; margin: 0.55rem 0 0.3rem; transition: color 0.3s; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pm-ba { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.68rem; font-variant-numeric: tabular-nums; padding-top: 0.45rem; border-top: 1px solid var(--line-soft); }
.pm-st { font-size: 0.62rem; margin-top: 0.45rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; }
.pm-tile.flash-up { animation: pm-up 0.8s ease-out; }
.pm-tile.flash-down { animation: pm-down 0.8s ease-out; }
@keyframes pm-up { from { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.4); } }
@keyframes pm-down { from { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); } }

/* Chart stage: vertical drawing rail + chart canvas */
.chart-stage { flex: 1; display: flex; min-height: 280px; }
.chart-stage #chart { flex: 1; min-width: 0; min-height: 0; }
.draw-rail { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 44px; flex-shrink: 0; padding: 0.55rem 0; border-right: 1px solid var(--line-soft); background: #0c1124; }
.rail-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s; }
.rail-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { color: var(--white); background: rgba(255, 255, 255, 0.04); }
.rail-btn.active { color: var(--gold-hi); background: var(--gold-soft); border-color: rgba(142, 168, 255, 0.3); }
.rail-sep { width: 20px; height: 1px; background: var(--line-soft); margin: 0.2rem 0; }

/* Buy/sell ticket docked below the chart in every terminal, never over it */
.ticket-dock { position: relative; display: flex; align-items: flex-end; justify-content: flex-end; gap: 1rem; padding: 0.65rem 0.75rem 0.7rem; border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, #0e1429, #0c1124); }
.chart-ticket.docked { position: static; display: flex; flex-direction: column; width: min(540px, 100%); max-width: none; max-height: none; overflow: visible; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: none; box-shadow: none; padding: 0; border-radius: 0; }
.chart-ticket.docked:has(.ct-more:not(.hidden)) { width: min(540px, 100%); }
.chart-ticket.docked .ct-why { text-align: center; }
.chart-ticket.docked .ct-more { position: static; order: -1; width: auto; max-height: 36vh; overflow-y: auto; margin: 0 0 0.6rem; padding: 0.85rem; background: rgba(11, 16, 32, 0.85); border: 1px solid var(--line-strong); border-radius: 12px; scrollbar-width: thin; box-shadow: var(--hl); }
.chart-ticket.docked .ct-more.hidden { display: none; }
@media (max-width: 860px) {
  .ticket-dock { padding: 0.6rem 0.6rem 0.65rem; }
  .chart-ticket.docked, .chart-ticket.docked:has(.ct-more:not(.hidden)) { width: 100%; }
  .draw-rail { width: 38px; }
  .rail-btn { width: 30px; height: 30px; }
}

/* ------------------------------------------------ live arena (tournament live simulation) */
.demo-chip { display: inline-flex; align-items: center; font: 600 0.55rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; padding: 0.14rem 0.42rem; margin-left: 0.35rem; border-radius: 3px; color: var(--gold-hi); background: rgba(142, 168, 255, 0.1); border: 1px dashed rgba(142, 168, 255, 0.5); vertical-align: middle; white-space: nowrap; }
.demo-chip.lg { font-size: 0.62rem; padding: 0.3rem 0.65rem; margin-left: 0; }
.real-chip { display: inline-flex; font: 600 0.54rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.12rem 0.38rem; margin-left: 0.35rem; border-radius: 3px; color: #86efc1; border: 1px solid rgba(52, 211, 153, 0.38); background: rgba(52, 211, 153, 0.05); vertical-align: middle; }
.demo-banner { display: flex; gap: 0.9rem; align-items: center; margin: 1.3rem 0; padding: 0.9rem 1.15rem; border: 1px solid rgba(142, 168, 255, 0.25); border-left: 2px solid var(--gold); background: linear-gradient(90deg, rgba(142, 168, 255, 0.08), rgba(142, 168, 255, 0.01)); border-radius: var(--r); font-size: 0.84rem; color: #ddd6c2; }
.demo-banner.compact { margin: 0 0 1rem; padding: 0.6rem 0.85rem; font-size: 0.8rem; }
.arena-hero { position: relative; overflow: hidden; padding: 3rem 0 2.4rem; border-bottom: 1px solid var(--line-soft);
  background: radial-gradient(900px 380px at 50% -40%, rgba(142, 168, 255, 0.16), transparent 70%), linear-gradient(180deg, rgba(10, 14, 30, 0.8), transparent); }
.arena-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.6), transparent); }
.arena-top { display: grid; grid-template-columns: auto 1fr auto; gap: 1.8rem; align-items: center; }
.crest svg { width: 72px; height: 72px; filter: drop-shadow(0 0 22px rgba(142, 168, 255, 0.3)); }
.arena-title h1 { font-size: clamp(2.1rem, 3.8vw, 3.2rem); margin: 0.5rem 0 0.8rem; }
.arena-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.arena-clock { text-align: right; display: flex; flex-direction: column; gap: 0.55rem; align-items: flex-end; }
.ar-select { max-width: 320px; font-size: 0.8rem; padding: 0.45rem 2rem 0.45rem 0.7rem; }
.arena-ticker { margin-bottom: 1.5rem; border-radius: var(--r); border: 1px solid var(--line-soft); }
.arena-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.8rem; box-shadow: var(--hl); }
.a-stat { background: linear-gradient(180deg, #10162b, #0b1020); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.a-stat .k { font: 500 0.58rem var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.a-stat .v { font: 500 1.55rem var(--mono); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 0.45rem; letter-spacing: -0.02em; }
.a-stat .s { font-size: 0.7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pm-pulse 1.6s infinite; display: inline-block; }
.arena-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 1.5rem; align-items: start; padding-bottom: 4rem; }
.arena-side { display: grid; gap: 1.25rem; position: sticky; top: 84px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 1rem; align-items: end; margin-bottom: 1.3rem; }
.pod { text-align: center; padding: 1.3rem 0.9rem 1.1rem; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: linear-gradient(180deg, #151c38, #0b1020); display: flex; flex-direction: column; align-items: center; gap: 0.4rem; position: relative; box-shadow: var(--hl); }
.pod.p1 { padding-top: 2rem; border-color: rgba(195, 208, 255, 0.38); background: linear-gradient(180deg, #1a1710, #0b1020); box-shadow: var(--hl), 0 0 50px -16px rgba(142, 168, 255, 0.4); }
.pod.p1::before { content: ""; position: absolute; inset: 0 1.5rem auto 1.5rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); }
.pod-medal { font-family: var(--mono); font-weight: 600; font-size: 0.95rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; color: #1a1406; background: var(--gold-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.6); }
.pod.p2 .pod-medal { background: linear-gradient(180deg, #f1f2f5, #9ea1aa); } .pod.p3 .pod-medal { background: linear-gradient(180deg, #e9bb8e, #94603a); }
.pod-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-ret { font: 500 1.5rem var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.avatar.sim { background: repeating-linear-gradient(135deg, #1e1b12 0 5px, #15130d 5px 10px); color: var(--gold-hi); border: 1px dashed rgba(142, 168, 255, 0.45); }
.live-board { overflow-x: auto; }
.lr { display: grid; grid-template-columns: 2.6rem 2.6rem minmax(220px, 1.6fr) 1fr 0.8fr 0.7fr 0.55fr 0.6fr 0.65fr 1.1fr; gap: 0.5rem; align-items: center; padding: 0.55rem 1.2rem; border-bottom: 1px solid var(--line-soft); font-size: 0.83rem; position: relative; background: transparent; transition: background 0.3s, box-shadow 0.3s; }
.lr:not(.head):hover { background: rgba(255, 255, 255, 0.02); }
.lr.head { font: 500 0.58rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); background: var(--char); }
.lr.top3 { background: linear-gradient(90deg, rgba(142, 168, 255, 0.06), transparent 60%); }
.lr.me { background: rgba(142, 168, 255, 0.1); box-shadow: inset 2px 0 0 var(--gold); }
.lr.lr-rise { box-shadow: inset 2px 0 0 var(--up); } .lr.lr-fall { box-shadow: inset 2px 0 0 var(--down); }
.lr.lr-new { animation: fade 0.8s; }
.lr .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lr-trader { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.lr-trader > div { min-width: 0; } .lr-trader > div > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 0.66rem; font-family: var(--mono); }
.presence { width: 6px; height: 6px; border-radius: 50%; background: var(--char-3); flex: none; }
.presence.on { background: var(--up); box-shadow: 0 0 6px var(--up); }
.mv { font: 600 0.68rem var(--mono); } .mv.up { color: var(--up); } .mv.down { color: var(--down); } .mv.flat { color: var(--dim); }
.pos-chip { font: 500 0.68rem var(--mono); padding: 0.16rem 0.42rem; border: 1px solid var(--char-3); border-radius: 3px; white-space: nowrap; }
.pos-chip.buy { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.05); } .pos-chip.sell { border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.05); }
.feed-card { padding-bottom: 0.7rem; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; font-size: 0.8rem; scrollbar-width: thin; }
.ev { display: grid; grid-template-columns: 10px 1fr; gap: 0.65rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft); }
.ev:last-child { border-bottom: none; }
.ev time { font-size: 0.66rem; font-family: var(--mono); }
.ev-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--char-3); margin-top: 0.45rem; }
.ev.win .ev-dot { background: var(--up); } .ev.loss .ev-dot { background: var(--down); } .ev.lead .ev-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); } .ev.join .ev-dot { background: var(--gold-lo); }
.ev-new { animation: ev-in 0.6s var(--ease); }
@keyframes ev-in { from { opacity: 0; transform: translateX(12px); background: rgba(142, 168, 255, 0.08); } }
.ev-tag { font: 600 0.55rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); padding: 0.06rem 0.32rem; border-radius: 3px; }
.movers { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.8rem; display: grid; gap: 0.4rem; }
.movers li { display: flex; gap: 0.4rem; align-items: center; } .movers li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.t-demo { font-size: 0.68rem; color: var(--gold); font-family: var(--mono); }
.sim-admin .row { align-items: end; }
@media (max-width: 1180px) { .arena-grid { grid-template-columns: 1fr; } .arena-side { position: static; grid-template-columns: repeat(2, 1fr); } .arena-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .lr { grid-template-columns: 2.4rem 2.4rem minmax(180px, 1.6fr) 1fr 0.8fr 0.55fr 0.6fr; } .lr .hide-md { display: none; } }
@media (max-width: 760px) { .arena-top { grid-template-columns: 1fr; } .arena-clock { align-items: flex-start; text-align: left; } .crest { display: none; } .arena-side { grid-template-columns: 1fr; } .arena-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .lr { grid-template-columns: 2rem 2.2rem minmax(150px, 1fr) auto auto; padding: 0.5rem 0.8rem; } .lr .hide-sm { display: none; } .podium { grid-template-columns: 1fr; } }

/* ------------------------------------------------ motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .ticker-track { animation: marquee 140s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: 140s !important; }
}

/* =====================================================================
   Calm layer — Global Trading Tournament
   Psychological intent:
   · Cool sapphire + violet hues signal trust and composure (less arousal
     than gold/red), so traders stay focused under pressure.
   · Rounded corners and soft depth read as approachable, not aggressive.
   · Profit/loss use mint & rose — clearly legible but never alarming.
   · Motion is slow and eased; nothing flashes or jolts.
   ===================================================================== */
:root {
  --violet: #a78bfa;
  --aqua: #67d4f5;
  --aurora: linear-gradient(120deg, #8ea8ff 0%, #a78bfa 50%, #67d4f5 100%);
  --glass: linear-gradient(180deg, rgba(28, 36, 66, 0.62), rgba(13, 19, 38, 0.82));
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 28px 60px -30px rgba(2, 4, 16, 0.9), 0 2px 10px -4px rgba(2, 4, 16, 0.6);
  --ease: cubic-bezier(0.22, 0.8, 0.25, 1);
}
.grain { opacity: 0.025; }
p { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
.gold { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { letter-spacing: 0.22em; color: var(--gold-hi); }
.eyebrow::before { width: 22px; height: 2px; border-radius: 2px; background: var(--aurora); opacity: 1; }

/* topbar — frosted, airy */
.topbar { background: rgba(9, 13, 28, 0.72); backdrop-filter: saturate(170%) blur(20px); -webkit-backdrop-filter: saturate(170%) blur(20px); }
.topbar::after { background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.4) 25%, rgba(167, 139, 250, 0.4) 75%, transparent); }
.brand-text b { letter-spacing: 0.08em; font-weight: 700; font-size: 1rem; }
.brand-text small { letter-spacing: 0.26em; color: var(--muted); }
.nav a { border-radius: 999px; }
.nav a:hover { background: rgba(142, 168, 255, 0.07); }
.nav a.active { background: rgba(142, 168, 255, 0.1); color: var(--gold-hi); }
.nav a.active::after { height: 2px; border-radius: 2px; background: var(--aurora); box-shadow: 0 0 14px rgba(142, 168, 255, 0.6); }
@media (max-width: 1080px) { .nav a { border-radius: 0; } .nav a.active { background: transparent; } }

/* buttons — tactile, friendly */
.btn { border-radius: 999px; padding: 0.7rem 1.3rem; }
.btn.sm { padding: 0.45rem 0.95rem; }
.btn.xs { border-radius: 999px; padding: 0.24rem 0.6rem; }
.btn:hover { border-color: rgba(142, 168, 255, 0.5); background: #212a4a; }
.btn.primary { background: linear-gradient(135deg, #b4c4ff 0%, #8ea8ff 45%, #a78bfa 100%); color: #0a1030; border-color: rgba(195, 208, 255, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 28px -10px rgba(142, 168, 255, 0.7); }
.btn.primary:hover { color: #050a24; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 14px 34px -10px rgba(167, 139, 250, 0.7); }
.btn.buy, .btn.sell { border-radius: var(--r); }
.btn:focus-visible, a:focus-visible { box-shadow: 0 0 0 2px var(--black), 0 0 0 4px rgba(142, 168, 255, 0.75); }

/* inputs — soft wells */
input, select, textarea { border-radius: var(--r); background: rgba(9, 13, 28, 0.85); border-color: rgba(255, 255, 255, 0.09); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(142, 168, 255, 0.16); background: rgba(11, 16, 34, 0.95); }
.form-error, .form-ok { border-radius: var(--r); border-left-width: 3px; }

/* cards — glass with a gentle lift */
.card { background: var(--glass); border-color: rgba(142, 168, 255, 0.09); box-shadow: var(--hl), 0 24px 50px -32px rgba(2, 4, 16, 0.95); }
a.card:hover, .card.t-card:hover, .card.gilt:hover { transform: translateY(-2px); border-color: rgba(142, 168, 255, 0.24); box-shadow: var(--hl), 0 30px 60px -30px rgba(40, 60, 160, 0.45); }
.card.gilt { border-color: rgba(142, 168, 255, 0.16); }
.card.gilt::before { background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.7), rgba(142, 168, 255, 0.7), transparent); }
.badge { letter-spacing: 0.12em; }
.stat .v { letter-spacing: -0.015em; }

/* hero — aurora atmosphere */
.hero h1 em { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.05em; }
.hero .lead { color: #bcc4dc; }
.hero-lines::after { background: radial-gradient(circle at 40% 40%, rgba(142, 168, 255, 0.16), transparent 58%), radial-gradient(circle at 70% 65%, rgba(167, 139, 250, 0.12), transparent 55%); filter: blur(18px); animation: breathe 14s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06) translate(-2%, 2%); opacity: 0.85; } }
.prize-plate { border-radius: 24px; background: linear-gradient(160deg, rgba(30, 40, 78, 0.9), rgba(12, 17, 36, 0.96) 60%); }
.prize-plate::after { border-radius: 18px; }
.prize-plate .split { border-radius: 14px; }
.step::after { height: 2px; border-radius: 2px; background: var(--aurora); }
.step h3 { font-weight: 400; }
.divider { background: linear-gradient(90deg, transparent, rgba(142, 168, 255, 0.55), rgba(167, 139, 250, 0.55), transparent); }
.page-head::after { height: 2px; border-radius: 2px; background: var(--aurora); }

/* tables — calm zebra-free rows with soft hover */
tr:hover td { background: rgba(142, 168, 255, 0.045); }
.tabs button.active { color: var(--gold-hi); }
.seg { border-radius: 999px; } .seg button { border-radius: 999px; }

/* toasts & modals — rounded and soft */
.toast { border-radius: 14px; border-left-width: 3px; }
.modal { border-radius: 22px; background: linear-gradient(180deg, #151d3a, #0d1326); border-color: rgba(142, 168, 255, 0.14); }
.modal-bg { background: rgba(4, 6, 18, 0.66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* topbar: keep the nav from running under the account / sign-out controls */
.nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex-shrink: 0; }
.nav-right { flex-shrink: 0; }
.user-chip .hide-sm { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1440px) { .user-chip .hide-sm { display: none; } .user-chip { padding: 0.2rem; } }
@media (max-width: 1080px) { .nav { overflow: visible; -webkit-mask-image: none; mask-image: none; } .nav.open { overflow-y: auto; } }
