/* ── Fonts ────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,600;0,6..96,700;1,6..96,400&family=Jost:wght@300;400;500;600;700&display=swap');

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:           #080810;
  --bg-2:         #0d0d1f;
  --surface:      rgba(255,255,255,.045);
  --surface-hov:  rgba(255,255,255,.075);
  --border:       rgba(255,255,255,.09);
  --border-2:     rgba(255,255,255,.05);

  --gold:         #F59E0B;
  --gold-2:       #FBBF24;
  --gold-dim:     rgba(245,158,11,.12);
  --gold-glow:    rgba(245,158,11,.2);

  --up:           #22c55e;
  --up-dim:       rgba(34,197,94,.1);
  --up-glow:      rgba(34,197,94,.25);
  --down:         #ef4444;
  --down-dim:     rgba(239,68,68,.1);
  --down-glow:    rgba(239,68,68,.25);

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --font-h: 'Bodoni Moda', Georgia, serif;
  --font-b: 'Jost', system-ui, sans-serif;

  --r-s:  8px;
  --r-m:  14px;
  --r-l:  22px;
  --r-xl: 32px;

  --t: 220ms cubic-bezier(.4,0,.2,1);
  --t-fast: 140ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-b);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { opacity: .75; }
button { font-family: var(--font-b); cursor: pointer; }

/* ── Shared glass card ────────────────────────────────────────────────── */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   REGISTER PAGE
══════════════════════════════════════════════════════════════════════ */

.page-register {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ─── Desktop split layout ─────────────────────────────────────────── */
.reg-layout {
  display: flex;
  flex: 1;
  min-height: 100dvh;
}

/* Left panel — branding (hidden on mobile, shows on desktop) */
.reg-left {
  display: none;
  flex: 1;
  background: linear-gradient(160deg, #0d0d1f 0%, #080810 60%);
  border-right: 1px solid var(--border-2);
  position: relative;
  overflow: hidden;
  padding: 3.5rem;
  flex-direction: column;
  justify-content: space-between;
}

.reg-left::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(245,158,11,.07) 0%, transparent 65%);
  pointer-events: none;
}

.reg-left::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,.05) 0%, transparent 65%);
  pointer-events: none;
}

.reg-brand {
  display: flex;
  align-items: center;
  gap: .875rem;
  position: relative;
  z-index: 1;
}

.reg-brand-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold), #D97706);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(245,158,11,.3);
  flex-shrink: 0;
}

.reg-brand-icon svg { width: 26px; height: 26px; color: #000; }

.reg-brand-name {
  font-family: var(--font-h);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.reg-brand-sub {
  font-size: .75rem;
  color: var(--text-3);
  font-weight: 400;
  margin-top: .1rem;
}

/* Big hero text in left panel */
.reg-hero-text {
  position: relative;
  z-index: 1;
}

.reg-hero-text h1 {
  font-family: var(--font-h);
  font-size: clamp(2.5rem, 3.5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 70%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}

.reg-hero-text p {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 380px;
}

/* Stats row in left panel */
.reg-stats {
  display: flex;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.reg-stat-item .num {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.reg-stat-item .lbl {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .2rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}

/* Decorative grid lines on left panel */
.reg-grid-deco {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 40% 40%, black 30%, transparent 70%);
}

/* Right panel — form */
.reg-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 1.5rem 1rem 2rem;
  overflow-y: auto;
}

.reg-form-inner {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

/* Mobile hero (only shown when left panel hidden) */
.reg-mobile-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.reg-mobile-hero .icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--gold), #D97706);
  border-radius: 18px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 28px rgba(245,158,11,.3);
}

.reg-mobile-hero .icon-wrap svg { width: 32px; height: 32px; color: #000; }

.reg-mobile-hero h1 {
  font-family: var(--font-h);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .4rem;
}

.reg-mobile-hero p {
  font-size: .9rem;
  color: var(--text-3);
  letter-spacing: .01em;
}

/* Disclosure block */
.disclosure {
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.18);
  border-radius: var(--r-m);
  padding: 1rem 1.125rem;
  margin-bottom: 1.25rem;
  font-size: .855rem;
  line-height: 1.65;
  color: #cbd5e1;
}

.disclosure-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  margin-bottom: .6rem;
}

.disclosure-label svg { width: 13px; height: 13px; flex-shrink: 0; }

#disclosure-text { min-height: 3.5rem; }
.loading-text { color: var(--text-3); font-style: italic; }

/* Form fields */
.form-group { margin-bottom: .95rem; }

.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: .4rem;
}

.form-group label .req { color: var(--down); margin-left: 2px; }

.form-group input,
.form-group select {
  width: 100%;
  padding: .85rem 1rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  font-family: var(--font-b);
  font-size: .95rem;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder { color: var(--text-3); }

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(245,158,11,.5);
  background: rgba(245,158,11,.04);
  box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-group .err {
  display: none;
  font-size: .75rem;
  color: var(--down);
  margin-top: .3rem;
  padding-left: .2rem;
}

.form-group.has-error input,
.form-group.has-error select {
  border-color: rgba(239,68,68,.5);
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

.form-group.has-error .err { display: block; }

.phone-row { display: flex; gap: .5rem; }
.phone-row select { width: 118px; min-width: 118px; flex-shrink: 0; }
.phone-row input  { flex: 1; }

/* Consent */
.consent-block { margin: 1.1rem 0; display: flex; flex-direction: column; gap: .65rem; }

.consent-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .1rem;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}

.consent-item:has(input:checked) {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.05);
}

.consent-item:hover { border-color: rgba(255,255,255,.15); }

.consent-item input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px;
  margin-top: 2px; cursor: pointer; accent-color: var(--up);
}

.consent-item .ctext {
  font-size: .845rem;
  line-height: 1.55;
  color: var(--text-2);
}

#consent-error {
  display: none;
  font-size: .78rem;
  color: var(--down);
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: rgba(239,68,68,.06);
  border-radius: var(--r-s);
  border: 1px solid rgba(239,68,68,.15);
}

/* CTA */
.btn-submit {
  width: 100%;
  padding: .95rem 1.5rem;
  background: linear-gradient(135deg, var(--gold) 0%, #D97706 100%);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  border: none;
  border-radius: var(--r-m);
  box-shadow: 0 4px 24px rgba(245,158,11,.28);
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  margin-top: .5rem;
}

.btn-submit:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(245,158,11,.4);
}

.btn-submit:active:not(:disabled) { transform: translateY(0); }

.btn-submit:disabled {
  opacity: .28;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-footer-note {
  font-size: .73rem;
  color: var(--text-3);
  text-align: center;
  margin-top: .875rem;
  line-height: 1.55;
}

/* Footer links */
.reg-footer {
  border-top: 1px solid var(--border-2);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.reg-footer a {
  font-size: .75rem;
  color: var(--text-3);
  transition: color var(--t-fast);
}

.reg-footer a:hover { color: var(--gold); opacity: 1; }

/* Success */
#success-screen {
  display: none;
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 50%;
  margin-bottom: 1.25rem;
}

.success-icon svg { width: 36px; height: 36px; color: var(--up); }

#success-screen h2 {
  font-family: var(--font-h);
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

#success-screen p { color: var(--text-2); margin-bottom: 1.75rem; font-size: .95rem; }

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .95rem 2.25rem;
  background: linear-gradient(135deg, var(--gold), #D97706);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  border-radius: var(--r-m);
  box-shadow: 0 4px 24px rgba(245,158,11,.28);
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.btn-play:hover { opacity: .9; transform: translateY(-1px); }
.btn-play svg { width: 16px; height: 16px; }

/* ── Desktop breakpoint for register ──────────────────────────────── */
@media (min-width: 900px) {
  .page-register { flex-direction: row; }

  .reg-layout { min-height: 100dvh; }

  .reg-left {
    display: flex;
    width: 45%;
    flex: none;
    min-height: 100dvh;
  }

  .reg-right {
    flex: 1;
    padding: 2.5rem 3rem 2.5rem 3.5rem;
    min-height: 100dvh;
  }

  .reg-mobile-hero { display: none; }

  .reg-form-inner { max-width: 480px; }
}

/* ══════════════════════════════════════════════════════════════════════
   GAME PAGE
══════════════════════════════════════════════════════════════════════ */

.page-game {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Header */
.game-header {
  padding: .8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-2);
  background: rgba(8,8,16,.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 20;
  flex-shrink: 0;
}

.game-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-h);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}

.game-logo svg { width: 22px; height: 22px; }

.round-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .85rem;
}

/* ── Game body: single column mobile, two-column desktop ──────────── */
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Rate + chart column (shared) */
.game-left {
  display: flex;
  flex-direction: column;
}

/* Controls column */
.game-right {
  display: flex;
  flex-direction: column;
}

/* Rate display */
.rate-display {
  text-align: center;
  padding: 1.25rem 1.25rem .5rem;
}

.pair-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .35rem;
}

.rate-value {
  font-family: var(--font-h);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  transition: color var(--t);
}

.rate-value.up   { color: var(--up);   text-shadow: 0 0 30px var(--up-glow); }
.rate-value.down { color: var(--down); text-shadow: 0 0 30px var(--down-glow); }
.rate-value.flat { color: var(--text); }

.rate-delayed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  font-size: .7rem;
  color: var(--gold);
  margin-top: .35rem;
}

.rate-delayed svg { width: 12px; height: 12px; }

/* Chart */
.chart-wrap {
  height: 200px;
  padding: .25rem 1rem .75rem;
  position: relative;
}

.chart-wrap canvas {
  width: 100%; height: 100%;
  display: block;
  border-radius: var(--r-s);
}

/* Phase bar */
.phase-bar {
  margin: 0 1rem .6rem;
  padding: .7rem 1.1rem;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.phase-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.phase-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-label.prediction { color: #60a5fa; }
.phase-label.prediction .phase-dot { background: #60a5fa; box-shadow: 0 0 6px #60a5fa; animation: pulse-dot 1.5s ease infinite; }
.phase-label.live       { color: var(--up); }
.phase-label.live .phase-dot { background: var(--up); box-shadow: 0 0 6px var(--up); animation: pulse-dot 1s ease infinite; }
.phase-label.ended      { color: var(--text-3); }
.phase-label.ended .phase-dot { background: var(--text-3); }

@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.65); }
}

.countdown {
  font-family: var(--font-h);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

/* Score bar */
.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 1.1rem .5rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.score-val {
  font-family: var(--font-h);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: none;
  letter-spacing: 0;
}

/* Status */
.status-msg {
  margin: 0 1rem .5rem;
  padding: .6rem .875rem;
  font-size: .82rem;
  font-weight: 500;
  border-radius: var(--r-s);
  text-align: center;
}

.status-msg.success { background: var(--up-dim);   color: var(--up);   border: 1px solid rgba(34,197,94,.18); }
.status-msg.error   { background: var(--down-dim); color: var(--down); border: 1px solid rgba(239,68,68,.18); }
.status-msg.info    { background: rgba(96,165,250,.07); color: #60a5fa; border: 1px solid rgba(96,165,250,.18); }

/* Prediction buttons */
.predict-section { padding: .5rem 1rem 1.25rem; }

.predict-prompt {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .75rem;
}

.predict-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.btn-predict {
  padding: 1.3rem .5rem;
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.btn-predict svg { width: 30px; height: 30px; }
.btn-predict:active:not(:disabled) { transform: scale(.97); }

.btn-predict-up:hover:not(:disabled) {
  border-color: rgba(34,197,94,.45);
  background: var(--up-dim);
  color: var(--up);
  box-shadow: 0 0 24px var(--up-glow);
}

.btn-predict-down:hover:not(:disabled) {
  border-color: rgba(239,68,68,.45);
  background: var(--down-dim);
  color: var(--down);
  box-shadow: 0 0 24px var(--down-glow);
}

.btn-predict-up.selected   { border-color: rgba(34,197,94,.5); background: var(--up-dim);   color: var(--up);   box-shadow: 0 0 24px var(--up-glow); }
.btn-predict-down.selected { border-color: rgba(239,68,68,.5); background: var(--down-dim); color: var(--down); box-shadow: 0 0 24px var(--down-glow); }
.btn-predict:disabled { opacity: .3; cursor: not-allowed; }

/* ── Desktop game layout ─────────────────────────────────────────── */
@media (min-width: 900px) {
  .game-body {
    flex-direction: row;
    height: calc(100dvh - 57px);
    overflow: hidden;
  }

  .game-left {
    flex: 1;
    border-right: 1px solid var(--border-2);
    overflow: hidden;
  }

  .rate-display {
    padding: 1.75rem 2rem .75rem;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
  }

  .rate-display .pair-label { margin-bottom: 0; font-size: .75rem; }
  .rate-value { font-size: clamp(2.25rem, 3vw, 3.25rem); }

  .chart-wrap {
    flex: 1;
    height: auto;
    padding: .5rem 1.75rem 1.25rem;
  }

  .game-right {
    width: 340px;
    flex-shrink: 0;
    padding: 1.5rem;
    justify-content: center;
    gap: .5rem;
    overflow-y: auto;
  }

  .phase-bar   { margin: 0 0 .5rem; }
  .score-bar   { padding: .3rem 0 .5rem; }
  .status-msg  { margin: 0 0 .5rem; }
  .predict-section { padding: .5rem 0 0; }
  .predict-buttons { gap: 1rem; }

  .btn-predict {
    padding: 1.5rem .5rem;
    min-height: unset;
    border-radius: var(--r-l);
    gap: .65rem;
  }

  .btn-predict svg { width: 36px; height: 36px; }
}

/* Overlays */
.reconnect-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 1.25rem;
  z-index: 100; text-align: center;
}

.reconnect-overlay.visible { display: flex; }

.spinner {
  width: 44px; height: 44px;
  border: 2.5px solid rgba(255,255,255,.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#result-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem;
  z-index: 50; text-align: center; padding: 2rem;
}

#result-overlay.visible { display: flex; }

.result-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .25rem;
}

.result-icon-wrap.up   { background: var(--up-dim);   border: 1px solid rgba(34,197,94,.25); }
.result-icon-wrap.down { background: var(--down-dim); border: 1px solid rgba(239,68,68,.25); }
.result-icon-wrap.flat { background: var(--surface);  border: 1px solid var(--border); }
.result-icon-wrap svg  { width: 40px; height: 40px; }

.result-title {
  font-family: var(--font-h);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.result-title.up   { color: var(--up); }
.result-title.down { color: var(--down); }
.result-title.flat { color: var(--text-2); }

.result-sub   { font-size: .9rem;  color: var(--text-2); }
.result-score { font-family: var(--font-h); font-size: 1.4rem; font-weight: 700; color: var(--gold); margin-top: .25rem; }

/* ══════════════════════════════════════════════════════════════════════
   LEADERBOARD  1920 × 1080  kiosk
══════════════════════════════════════════════════════════════════════ */

.page-leaderboard {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: 196px 1fr 88px;
  position: relative;
}

/* Background glow */
.page-leaderboard::before {
  content: '';
  position: absolute;
  top: -400px; left: 50%;
  transform: translateX(-50%);
  width: 1400px; height: 900px;
  background: radial-gradient(ellipse, rgba(245,158,11,.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Grid background lines */
.lb-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
}

/* Header */
.lb-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(24px);
  position: relative; z-index: 1;
}

/* Gold line under header */
.lb-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,.25) 25%, rgba(245,158,11,.25) 75%, transparent);
}

/* Brand block (left) */
.lb-brand { display: flex; align-items: center; gap: 1.25rem; }

.lb-brand-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--gold), #D97706);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 28px rgba(245,158,11,.3);
  flex-shrink: 0;
}

.lb-brand-icon svg { width: 33px; height: 33px; color: #000; }

.lb-title {
  font-family: var(--font-h);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.lb-subtitle {
  font-size: .82rem;
  color: var(--text-3);
  margin-top: .25rem;
  letter-spacing: .04em;
}

.round-pill {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .9rem;
  font-size: .78rem;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: .05em;
  margin-top: .4rem;
}

/* Rate (centre) */
.lb-rate-block { text-align: center; }

.lb-pair-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .3rem;
}

.lb-rate-value {
  font-family: var(--font-h);
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  transition: color var(--t);
}

.lb-rate-value.up   { color: var(--up);   text-shadow: 0 0 50px var(--up-glow); }
.lb-rate-value.down { color: var(--down); text-shadow: 0 0 50px var(--down-glow); }
.lb-rate-value.flat { color: var(--text); }

.lb-rate-delayed {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  font-size: .75rem; color: var(--gold); margin-top: .35rem;
}

/* Phase (right) */
.lb-phase-block { text-align: right; }

.lb-phase-lbl {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: .2rem;
}

.lb-phase-state {
  font-family: var(--font-h);
  font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: flex-end;
  gap: .5rem; margin-bottom: .3rem;
  color: #60a5fa;
}

.lb-phase-state.live { color: var(--up); }
.lb-phase-state.up   { color: var(--up); }
.lb-phase-state.down { color: var(--down); }

.lb-countdown {
  font-family: var(--font-h);
  font-size: 3.5rem; font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

.live-dot {
  display: inline-block;
  width: 11px; height: 11px;
  background: var(--up);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--up);
  animation: pulse-dot 1.1s ease infinite;
}

/* Chart area */
.lb-chart-area {
  padding: 1.25rem 1.75rem 1rem 3.5rem;
  display: flex;
  flex-direction: column;
  position: relative; z-index: 1;
  background: rgba(0,0,0,.1);
}

.lb-chart-area canvas { width: 100%; flex: 1; border-radius: var(--r-m); }

/* Sidebar */
.lb-sidebar {
  border-left: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: .65rem;
  position: relative; z-index: 1;
  background: rgba(0,0,0,.3);
}

.lb-sidebar-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .1rem;
}

.lb-entry {
  display: flex; align-items: center; gap: 1rem;
  padding: .72rem 1rem;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--border);
  animation: slideIn .35s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

.lb-entry:first-of-type {
  background: rgba(245,158,11,.07);
  border-color: rgba(245,158,11,.22);
}

.lb-rank {
  font-family: var(--font-h); font-size: 1.15rem; font-weight: 700;
  color: var(--text-3); width: 2rem; text-align: center; flex-shrink: 0;
}

.lb-entry:nth-child(1) .lb-rank { color: var(--gold); }
.lb-entry:nth-child(2) .lb-rank { color: #94a3b8; }
.lb-entry:nth-child(3) .lb-rank { color: #a16207; }

.lb-initials {
  font-family: var(--font-h); font-size: 1.25rem; font-weight: 600;
  flex: 1; letter-spacing: .02em;
}

.lb-score { font-size: .9rem; font-weight: 700; color: var(--gold); white-space: nowrap; }

.lb-empty { color: var(--text-3); font-size: .9rem; text-align: center; padding: 2.5rem 0; }

/* Footer */
.lb-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3.5rem;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(24px);
  position: relative; z-index: 1;
}

.lb-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,.18) 30%, rgba(245,158,11,.18) 70%, transparent);
}

.lb-participants { font-size: .85rem; color: var(--text-3); font-weight: 500; }

.lb-participants strong {
  font-family: var(--font-h); font-size: 2.5rem; font-weight: 700;
  color: var(--text); display: block; line-height: 1; margin-bottom: .1rem;
}

.lb-qr-section { display: flex; align-items: center; gap: 1.25rem; }

.lb-qr-img {
  width: 66px; height: 66px;
  background: #fff;
  border-radius: var(--r-s);
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
}

.lb-qr-img img { width: 100%; height: 100%; display: block; border-radius: 3px; }

.lb-qr-text { font-family: var(--font-h); font-size: 1.2rem; font-weight: 700; }
.lb-qr-sub  { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }

.lb-ticker {
  font-size: .75rem; color: var(--text-3); letter-spacing: .05em;
  display: flex; align-items: center; gap: .625rem;
}

.lb-ticker-sep { color: var(--border); }

/* ── Leaderboard mobile (phones / tablets < 1000px) ─────────────── */
@media (max-width: 999px) {
  /* Reset the fixed kiosk dimensions */
  body.page-leaderboard {
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh;
    display: flex !important;
    flex-direction: column;
    overflow-y: auto !important;
    transform: none !important;
  }

  .lb-bg-grid { display: none; }

  /* ── Mobile header: stacked centre-aligned ── */
  .lb-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    height: auto;
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
  }

  .lb-brand         { justify-content: center; }
  .lb-brand-icon    { width: 48px; height: 48px; border-radius: 14px; }
  .lb-brand-icon svg{ width: 26px; height: 26px; }
  .lb-title         { font-size: 1.35rem; }
  .lb-subtitle      { font-size: .75rem; }
  .round-pill       { font-size: .72rem; }

  /* Rate block */
  .lb-rate-block    { text-align: center; }
  .lb-rate-value    { font-size: 2.8rem; letter-spacing: -.04em; }
  .lb-pair-label    { font-size: .72rem; letter-spacing: .14em; }

  /* Phase block */
  .lb-phase-block   { text-align: center; }
  .lb-phase-lbl     { text-align: center; }
  .lb-phase-state   { justify-content: center; font-size: 1.15rem; margin-bottom: .15rem; }
  .lb-countdown     { font-size: 2.25rem; letter-spacing: -.03em; }

  /* ── Chart strip ── */
  .lb-chart-area {
    height: 190px;
    flex: none;
    padding: .75rem 1.25rem;
  }

  /* ── Leaderboard list ── */
  .lb-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    flex: 1;
    gap: .55rem;
  }

  .lb-sidebar-title { font-size: .7rem; }

  .lb-entry {
    padding: .65rem .875rem;
    gap: .75rem;
  }

  .lb-rank     { font-size: 1rem; width: 1.75rem; }
  .lb-initials { font-size: 1.1rem; }
  .lb-score    { font-size: .85rem; }

  /* ── Footer ── */
  .lb-footer {
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    padding: 1.25rem;
    text-align: center;
  }

  .lb-participants strong { font-size: 2rem; }
  .lb-ticker    { justify-content: center; flex-wrap: wrap; }
  .lb-qr-section { justify-content: center; }
  .lb-qr-img    { width: 72px; height: 72px; }
  .lb-qr-text   { font-size: 1.05rem; }
}

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