/* ═══════════════════════════════════════════════════════════════
   9RACES — Retro cycling press 80s/90s
   Inspiración: Gazzetta dello Sport · Miroir du Cyclisme · Bicisport
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper:    #F5E6D3;
  --paper2:   #EDD9BE;
  --paper3:   #E2C9A4;
  --ink:      #1C1008;
  --ink2:     #3D2B10;
  --mid:      #7A5C3A;
  --dim:      #A8896A;
  --red:      #D4001A;
  --red-dk:   #A80014;
  --red-lt:   rgba(212,0,26,.08);
  --blue:     #1A4A8A;
  --blue-lt:  rgba(26,74,138,.08);
  --gold:     #B8860B;
  --green:    #1A6B2A;
  --border:   var(--paper3);
  --text:     var(--ink);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.022'/%3E%3C/svg%3E");
}

/* ── HERO ───────────────────────────────────────────────────── */
#screen-hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  border-top: 6px solid var(--red);
}

.hero-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 3rem 2rem;
  align-items: center;
}

/* LEFT */
.hero-left {
  padding-right: 3rem;
  opacity: 0; animation: up .6s ease forwards .1s;
}

.hero-eye {
  font-family: 'DM Mono', monospace;
  font-size: .58rem; letter-spacing: .35em;
  color: var(--mid); text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 900; line-height: .88; letter-spacing: -.02em; color: var(--ink);
  margin-bottom: 1.25rem;
}
.hero-h1 em { display: block; color: var(--red); font-style: italic; font-weight: 700; }

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700; line-height: 1.2; color: var(--ink);
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: .92rem; color: var(--mid); line-height: 1.75;
  max-width: 460px; margin-bottom: 2rem;
}

.btn-start {
  display: inline-block;
  padding: 1rem 3rem;
  background: var(--red); color: #fff; border: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 900; font-style: italic;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--red-dk);
  transition: background .15s, transform .15s, box-shadow .15s;
  margin-bottom: 2.5rem;
}
.btn-start:hover { background: var(--red-dk); transform: translateY(-2px); box-shadow: 0 7px 0 #7A0010; }
.btn-start:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dk); }

/* 3-step explainer */
.hero-steps {
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 2rem;
  border-top: 3px double var(--border);
}
.hero-step {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.hs-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 900; color: var(--red);
  line-height: 1; flex-shrink: 0; width: 2rem;
}
.hs-icon { font-size: 1.3rem; flex-shrink: 0; }
.hs-title {
  font-family: 'DM Mono', monospace;
  font-size: .58rem; letter-spacing: .2em; color: var(--ink);
  font-weight: 500; text-transform: uppercase;
}
.hs-desc { font-size: .8rem; color: var(--mid); margin-top: .1rem; }

/* Slot chips */
.fp-grid {
  display: flex; flex-wrap: wrap; gap: .35rem;
}
.fp-item {
  padding: .28rem .6rem; background: transparent; border: 1px solid var(--paper3);
  font-family: 'DM Mono', monospace; font-size: .54rem; letter-spacing: .07em;
  color: var(--dim); text-transform: uppercase;
}
.fp-item.req { border-color: var(--red); color: var(--red); }
.fp-item.dir { border-color: var(--blue); color: var(--blue); }

/* RIGHT: dream team panel */
.hero-right {
  display: flex; flex-direction: column; align-items: flex-start; gap: .5rem;
  opacity: 0; animation: up .7s ease forwards .35s;
}
.hero-preview-label {
  font-family: 'DM Mono', monospace;
  font-size: .5rem; letter-spacing: .28em; color: var(--dim); text-transform: uppercase;
  align-self: flex-start;
}

/* ── DREAM SQUAD PELOTON PANEL ──────────────────────────────── */
.hero-dream-panel {
  width: 100%; max-width: 420px;
  border: 1px solid var(--paper3);
  border-top: 4px solid var(--ink);
  border-radius: 2px;
  background: var(--paper2);
  box-shadow: 0 8px 32px rgba(28,16,8,.16);
  overflow: hidden;
}

.hdp-score-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem .5rem;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.hdp-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: .46rem; letter-spacing: .15em;
  color: var(--mid); text-transform: uppercase;
}
.hdp-score {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 900;
  color: var(--gold);
}

/* Scene container */
.hdp-scene {
  background: #B8C4B8;
  position: relative;
}
.hdp-director-row {
  display: flex; justify-content: center;
  padding: .8rem 0 .4rem;
  background: linear-gradient(#A8B4A8, #B8C4B8);
}
.hdp-mountain-strip {
  line-height: 0;
}

/* Peloton grid */
.hdp-peloton {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem;
  padding: .6rem .5rem .9rem;
  background: linear-gradient(#B8C4B8 0%, #C8D0B8 100%);
}
.hdp-prow {
  display: flex; justify-content: center; gap: 1.2rem;
  align-items: flex-end;
}
.hdp-prow--front .hdp-jersey-shape { width: 52px; }
.hdp-prow--back .hdp-jersey-shape  { width: 40px; }
.hdp-prow--back .hdp-jersey        { opacity: .82; }

/* Individual jersey card */
.hdp-jersey {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  cursor: default;
  transition: transform .2s;
}
.hdp-jersey:hover { transform: translateY(-3px); }
.hdp-jersey-shape {
  width: 46px; line-height: 0;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.35));
}
.hdp-jersey-shape svg { width: 100%; height: auto; }

/* Director jersey — larger */
.hdp-jersey--dir .hdp-jersey-shape { width: 44px; }

.hdp-jersey-name {
  font-family: 'DM Mono', monospace;
  font-size: .36rem; letter-spacing: .04em;
  color: var(--ink);
  background: rgba(245,230,211,.92);
  border: 1px solid rgba(0,0,0,.1);
  padding: 1px 4px;
  white-space: nowrap;
  max-width: 62px;
  overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.hdp-jersey-nat {
  font-size: .55rem; line-height: 1;
}
.hdp-jersey-rat {
  font-family: 'Playfair Display', serif;
  font-size: .55rem; font-weight: 900;
  color: var(--ink); line-height: 1;
}

.hdp-footer {
  text-align: center;
  padding: .55rem 1rem .6rem;
  border-top: 1px solid var(--border);
  background: var(--paper);
  font-family: 'Playfair Display', serif;
  font-size: .72rem; font-weight: 700; font-style: italic;
  color: var(--mid);
  letter-spacing: .02em;
}

/* ── HERO FOOTER ─────────────────────────────────────────────── */
.hero-footer {
  display: flex; align-items: center; gap: 2rem;
  padding: 1.25rem 3rem;
  border-top: 1px solid var(--border);
  max-width: 1100px; width: 100%; margin: 0 auto;
  flex-wrap: wrap;
}
.btn-support {
  display: inline-block;
  padding: .65rem 1.5rem;
  background: var(--red); color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: .85rem; font-weight: 900; font-style: italic;
  letter-spacing: .08em; text-transform: uppercase;
  border: 3px solid var(--ink); border-radius: 2rem;
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.btn-support:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-support:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }

.hero-footer-links {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.hfl-brand {
  font-family: 'DM Mono', monospace;
  font-size: .52rem; letter-spacing: .18em; color: var(--dim); text-transform: uppercase;
}
.hfl-link {
  font-family: 'DM Mono', monospace;
  font-size: .52rem; letter-spacing: .14em; color: var(--dim); text-transform: uppercase;
  text-decoration: underline; cursor: pointer;
  transition: color .15s;
}
.hfl-link:hover { color: var(--ink); }

/* ── HERO TOP BAR (lang select) ─────────────────────────────── */
.hero-topbar {
  display: flex; justify-content: flex-end;
  padding: .7rem 1.5rem .2rem;
  max-width: 1100px; width: 100%; margin: 0 auto;
}

/* ── LANGUAGE SELECT ────────────────────────────────────────── */
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237A5C3A'/%3E%3C/svg%3E") no-repeat right .5rem center;
  border: 1px solid var(--paper3);
  border-radius: 2px;
  font-family: 'DM Mono', monospace;
  font-size: .52rem; letter-spacing: .14em;
  color: var(--mid); text-transform: uppercase;
  padding: .3rem 1.6rem .3rem .6rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lang-select:hover { border-color: var(--mid); color: var(--ink); }
.lang-select:focus { outline: none; border-color: var(--ink); color: var(--ink); }

/* Topbar variant — on red background */
.lang-select--topbar {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.7)'/%3E%3C/svg%3E");
  border-color: rgba(255,255,255,.3);
  color: rgba(255,255,255,.85);
  font-size: .5rem;
}
.lang-select--topbar:hover { border-color: rgba(255,255,255,.7); color: #fff; }
.lang-select--topbar:focus { outline: none; border-color: #fff; color: #fff; }
.lang-select--topbar option { background: var(--red-dk); color: #fff; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1.5rem;
  background: var(--red); border-bottom: 3px solid var(--red-dk);
}
.tb-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 900; font-style: italic; letter-spacing: .04em; color: #fff;
  text-decoration: none; cursor: pointer;
}
.tb-title:hover { opacity: .85; }
.tb-pick { font-family: 'DM Mono', monospace; font-size: .6rem; letter-spacing: .18em; color: rgba(255,255,255,.75); }
.tb-right { display: flex; align-items: center; gap: 1rem; }
.tb-score { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 900; color: #fff; }
.tb-score span { color: #FFD080; }

/* ── THREE-COLUMN LAYOUT ────────────────────────────────────── */

#screen-game {
  display: none;
  background: var(--paper);
}

/* Wrapper centrador — el juego queda centrado, --paper rellena los lados en pantallas grandes */
.game-wrap {
  max-width: 1100px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.game-layout {
  display: grid;
  grid-template-columns: 320px 1fr 220px;
  gap: 0;
  min-height: calc(100vh - 46px);
  align-items: start;
  background: var(--paper);
}

/* COL 1: acción — scroll interno, no arrastra la página */
.col-action {
  position: sticky;
  top: 46px;
  height: calc(100vh - 46px);
  overflow-y: auto;
  padding: 1.25rem 1.25rem 2rem;
  border-right: 1px solid var(--border);
}

/* COL 2: panel visual — sticky, centrado */
.col-visual {
  position: sticky;
  top: 46px;
  height: calc(100vh - 46px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--paper2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: .85rem .75rem;
  gap: .5rem;
}

.col-visual-title {
  font-family: 'DM Mono', monospace;
  font-size: .48rem; letter-spacing: .22em;
  color: var(--dim); text-transform: uppercase;
  align-self: flex-start;
  flex-shrink: 0;
}

/* El panel ciclista — vertical 2:3, máximo 340px de ancho */
.peloton-panel {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 2 / 3;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--paper3);
  border-radius: 2px;
  background: #C8D0BC;
  flex-shrink: 0;
}

/* Cada ciclista en el panel — nuevo diseño card */
.peloton-rider {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: opacity .35s;
  cursor: default;
}
.peloton-rider.slot-target {
  cursor: pointer;
  animation: pulse-rider .9s ease infinite;
}
@keyframes pulse-rider {
  0%,100% { filter: drop-shadow(0 0 4px rgba(212,0,26,.55)); }
  50%      { filter: drop-shadow(0 0 9px rgba(212,0,26,.95)); }
}

/* Name chip — dominant text below the badge */
.pc-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .01em;
  color: var(--ink);
  background: rgba(245,230,211,.95);
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 2px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.pc-name--target {
  font-family: 'DM Mono', monospace;
  font-weight: 400;
  font-size: .52rem;
  color: var(--red);
  background: rgba(212,0,26,.08);
  border-color: rgba(212,0,26,.25);
}
/* Flag sits just before the surname */
.pc-flag {
  font-size: .76rem;
  margin-right: 3px;
  vertical-align: middle;
}
/* Director card slightly larger */
.peloton-rider.is-dir .pc-name {
  font-size: .76rem;
  max-width: 90px;
}
.peloton-rider.is-dir .pc-flag { font-size: .82rem; }

.peloton-rider.clickable { cursor: pointer; }
@media (hover: hover) {
  .peloton-rider.clickable:hover .pc-name {
    background: rgba(212,0,26,.14);
    border-color: rgba(212,0,26,.3);
  }
}

/* COL 3: roster lista */
.col-roster {
  position: sticky;
  top: 46px;
  height: calc(100vh - 46px);
  overflow-y: auto;
  background: var(--paper2);
  border-left: 1px solid var(--border);
}
.roster-panel {
  padding: .85rem .75rem;
}
.roster-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .4rem;
  padding-bottom: .6rem;
  border-bottom: 3px double var(--border);
  margin-bottom: .85rem;
}
.roster-title {
  font-family: 'DM Mono', monospace;
  font-size: .58rem; letter-spacing: .22em;
  color: var(--mid); text-transform: uppercase;
}
.sp-reqs { display: flex; gap: .3rem; flex-wrap: wrap; }
.req-badge {
  font-family: 'DM Mono', monospace; font-size: .46rem; letter-spacing: .05em;
  padding: .1rem .35rem; border: 1px solid var(--border);
  color: var(--dim); text-transform: uppercase; transition: all .3s;
}
.req-badge.ok { border-color: var(--green); color: var(--green); }

/* Squad list — una fila por slot, estilo 7a0 BOX SCORE */
.squad-list {
  display: flex; flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}

.sq-slot {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .5rem;
  background: transparent;
  border-bottom: 1px solid var(--border);
  position: relative; transition: background .15s;
  cursor: default;
}
.sq-slot:first-child { border-top: 1px solid var(--border); }
.sq-slot.filled      { }
.sq-slot.dir-slot    { }
.sq-slot.slot-target {
  background: var(--red-lt);
  cursor: pointer; animation: pulse-slot .9s ease infinite;
}
.sq-slot.slot-target:hover { background: rgba(212,0,26,.12); }
.slot-target-lbl { color: var(--red); font-size: .58rem; font-weight: 600; }
@keyframes pulse-slot {
  0%,100% { background: var(--red-lt); }
  50%      { background: transparent; }
}
.sq-slot.active-slot { background: rgba(212,0,26,.05); }
.sq-slot.dir-slot.active-slot { background: var(--blue-lt); }

/* Jersey SVG — pequeño, en línea */
.jersey-svg {
  width: 26px; height: 30px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12));
}

.sq-slot-info { flex: 1; min-width: 0; }
.sq-pos-lbl  {
  font-family:'DM Mono',monospace; font-size:.38rem; letter-spacing:.06em;
  color:var(--dim); text-transform:uppercase; line-height: 1.1;
}
.sq-name     {
  font-size:.80rem; font-weight:700; line-height:1.2; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.sq-team     { display: none; }  /* eliminado */
.sq-empty-lbl { font-size:.6rem; color:var(--dim); font-style:italic; }
.sq-rat { display:none; }
.sq-rat.dir-rat { display:none; }
.sq-rat-ext {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 900;
  color: var(--ink); flex-shrink: 0;
  min-width: 24px; text-align: right;
}
.sq-rat-ext.dir-rat { color: var(--blue); }

/* Filled squad slots are clickable to open rider info */
.sq-slot.filled { cursor: pointer; }
.sq-slot.filled:hover { background: rgba(28,16,8,.04); }

/* progress dots — más visibles */
.pick-dots { display:flex; gap:.4rem; margin-bottom:1.25rem; }
.dot { width:28px; height:6px; background:var(--paper3); transition:background .3s; border-radius:1px; }
.dot.done       { background: var(--green); }
.dot.active     { background: var(--red); }
.dot.dir-done   { background: var(--blue); }
.dot.dir-active { background: #3A6ACA; }

/* ── SPIN ZONE ──────────────────────────────────────────────── */
#zone-spin {
  display: flex; flex-direction: column;
  align-items: stretch; gap: 1.25rem;
  padding: .5rem 0 1.5rem;
}
.btn-spin { align-self: flex-start; }
.spin-card {
  width: 100%;
  background: var(--paper); border: 1px dashed var(--paper3); border-top: none;
  padding: 1.75rem 2rem; position: relative;
  min-height: 7rem;
}
.spin-card.lit {
  border: 1px solid var(--border); border-top: 4px solid var(--ink);
}

/* Mensaje inicial — visible hasta el primer giro */
.sp-idle-msg {
  font-size: 1rem; font-weight: 400; color: var(--dim);
  line-height: 1.6; text-align: center;
  padding: 1.25rem 0 1rem;
}
.spin-card.lit .sp-idle-msg,
.spin-card.spinning .sp-idle-msg { display: none; }

/* Cuando el card tiene info real, recupera el borde sólido */
.spin-card.lit,
.spin-card.spinning {
  border: 1px solid var(--border);
  border-top: 4px solid var(--ink);
}
.spin-card::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:4px;
  background: var(--red); transform: scaleX(0); transition: transform .4s; transform-origin:center;
}
.spin-card.lit::after     { transform: scaleX(1); }
.spin-card.dir-mode::after { background: var(--blue); transform: scaleX(1); }
.sp-lbl {
  font-family:'DM Mono',monospace; font-size:.55rem; letter-spacing:.28em;
  color:var(--dim); text-transform:uppercase; margin-bottom:.5rem;
}
.sp-val {
  font-family:'Playfair Display',serif; font-size:2.4rem; font-weight:900; line-height:1;
  color:var(--ink); min-height:2.8rem;
}
.sp-val.rolling     { color:var(--red); animation:flicker .07s infinite; }
.sp-val.dir-rolling { color:var(--blue); animation:flicker .07s infinite; }
.sp-sub     { margin-top:.35rem; font-size:.8rem; color:var(--mid); min-height:1rem; font-style:italic; }
.sp-profile { margin-top:.35rem; font-size:.72rem; color:var(--dim); line-height:1.4; }
.sp-slot-hint {
  margin-top:.55rem; display:inline-block; padding:.25rem .6rem;
  background:var(--paper2); border:1px solid var(--border);
  font-family:'DM Mono',monospace; font-size:.53rem; color:var(--mid);
}

/* THE GIRAR BUTTON */
.btn-spin {
  padding: 1rem 4rem;
  background: var(--red); color: #fff; border: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 900; font-style: italic;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--red-dk);
  transition: background .15s, transform .15s, box-shadow .15s;
  animation: spin-idle 2.4s ease-in-out infinite;
}
@keyframes spin-idle {
  0%,100% { transform: translateY(0) scale(1);    box-shadow: 0 5px 0 var(--red-dk); }
  45%      { transform: translateY(-4px) scale(1.015); box-shadow: 0 9px 0 var(--red-dk); }
  55%      { transform: translateY(-4px) scale(1.015); box-shadow: 0 9px 0 var(--red-dk); }
}
.btn-spin:hover  { animation: none; background:var(--red-dk); transform:translateY(-2px); box-shadow:0 7px 0 #7A0010; }
.btn-spin:active { animation: none; transform:translateY(3px); box-shadow:0 2px 0 var(--red-dk); }
.btn-spin:disabled { animation: none; opacity:.3; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-spin.dir { background:var(--blue); box-shadow:0 5px 0 #0E2E5A; }
.btn-spin.dir:hover { animation: none; background:#143880; box-shadow:0 7px 0 #0A1E40; }

/* ── PICK ZONE ──────────────────────────────────────────────── */
#zone-pick { display: none; }
.pick-hd { margin-bottom: 1rem; }
.pick-team {
  font-family:'Playfair Display',serif; font-size:1.75rem; font-weight:900; color:var(--ink);
}
.pick-meta  { font-family:'DM Mono',monospace; font-size:.58rem; letter-spacing:.14em; color:var(--red); margin-top:.12rem; }
.pick-profile { font-size:.76rem; color:var(--mid); margin-top:.25rem; font-style:italic; }
.pick-slot-bar {
  display:flex; align-items:center; gap:.55rem; margin-top:.55rem;
  padding:.38rem .75rem; background:var(--paper2); border:1px solid var(--border);
}
.psb-icon { font-size:.95rem; }
.psb-text { font-size:.74rem; color:var(--mid); }
.psb-name { font-weight:600; color:var(--ink); }
.psb-hint { font-size:.67rem; color:var(--dim); margin-left:.25rem; }
.filter-bar { display:flex; gap:.28rem; flex-wrap:wrap; margin-bottom:.85rem; }
.fb {
  padding:.26rem .62rem; background:var(--paper2); border:1px solid var(--border);
  font-family:'DM Mono',monospace; font-size:.52rem; letter-spacing:.07em;
  color:var(--mid); cursor:pointer; text-transform:uppercase; transition:all .15s;
}
.fb:hover,.fb.on { background:var(--red); border-color:var(--red); color:#fff; }

/* ── ZONE COMPLETE ──────────────────────────────────────────── */
#zone-complete {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0 2rem;
}
.complete-eye {
  font-family: 'DM Mono', monospace;
  font-size: .55rem; letter-spacing: .32em;
  color: var(--mid); text-transform: uppercase;
}
.complete-score {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem; font-weight: 900; line-height: 1;
  color: var(--ink);
}
.btn-simulate-big {
  padding: 1.1rem 1.5rem;
  background: var(--red); color: #fff; border: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-weight: 900; font-style: italic;
  letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--red-dk);
  animation: sim-bounce 1.4s ease infinite;
  transition: background .15s;
}
.btn-simulate-big:hover  { background: var(--red-dk); animation: none; transform: translateY(-2px); }
.btn-simulate-big:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dk); animation: none; }
@keyframes sim-bounce {
  0%,100% { transform: translateY(0);   box-shadow: 0 6px 0 var(--red-dk); }
  50%      { transform: translateY(-5px); box-shadow: 0 11px 0 var(--red-dk); }
}

/* ── RIDER CARDS — lista compacta ───────────────────────────── */
.rider-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1rem;
}
.rc {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: .45rem .75rem .45rem .6rem;
  cursor: pointer; transition: background .12s, border-color .12s;
  position: relative;
}
.rc:first-child { border-top: 1px solid var(--border); }
@media (hover: hover) {
  .rc:hover           { background: var(--paper2); border-left-color: var(--red); }
  .rc.dir-card:hover  { border-left-color: var(--blue); }
  .rc.weak:hover      { opacity:.75; }
  .rc.taken-grey:hover { background: var(--paper); border-left-color: transparent; }
}
.rc.match       { border-left-color: var(--gold); }
.rc.dir-card    { border-left-color: rgba(26,74,138,.4); }
.rc.chosen      { border-left-color: var(--green); background:rgba(26,107,42,.04); cursor:default; }
.rc.pending-pick {
  border-left-color: var(--red);
  background: var(--red-lt);
  outline: 2px solid var(--red);
  outline-offset: -2px;
  opacity: 1 !important;
}
.rc.weak        { opacity:.55; }
.rc.taken-grey  { opacity:.28; cursor:not-allowed; }

/* Fila 1: nombre bandera · · · rating */
.rc-row1 {
  display: flex; align-items: baseline; gap: .3rem;
  flex-wrap: nowrap;
}
.rc-name {
  font-size: .9rem; font-weight: 700; color: var(--ink); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 1; min-width: 0;
}
.rc-nat { font-size: .78rem; flex-shrink: 0; line-height: 1; }
.rc-rat {
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 900; color: var(--red);
  flex-shrink: 0; margin-left: auto; padding-left: .4rem;
}
.rc-rat.dir { color: var(--blue); }

/* Fila 2: roles + badge */
.rc-row2 {
  display: flex; align-items: center; gap: .25rem;
  flex-wrap: wrap; margin-top: .2rem;
}
.rtag {
  font-family:'DM Mono',monospace; font-size:.42rem; letter-spacing:.05em;
  padding:.06rem .3rem; background:var(--paper2); color:var(--mid); text-transform:uppercase;
}
.rtag.hi  { background:rgba(184,134,11,.14); color:var(--gold); }
.rtag.dir { background:rgba(26,74,138,.12); color:var(--blue); }

.rc-match-badge { font-size:.6rem; color:var(--gold); margin-left:auto; flex-shrink:0; }
.rc-taken-lbl   { font-family:'DM Mono',monospace; font-size:.44rem; color:var(--dim); margin-left:auto; flex-shrink:0; }
.rc-weak-note   { font-size:.5rem; color:var(--red); }

/* Botón info (i) */
.rc-info-btn {
  position: absolute; top: .3rem; right: .35rem;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--paper2);
  font-family: 'DM Mono', monospace; font-size: .48rem;
  color: var(--dim); cursor: pointer; line-height: 16px;
  text-align: center; padding: 0;
  transition: border-color .15s, color .15s;
  display: none;
}
@media (hover: hover) {
  .rc:hover .rc-info-btn { display: block; }
  .rc-info-btn:hover { border-color: var(--ink); color: var(--ink); }
}

/* ── MODAL RIDER INFO ───────────────────────────────────────── */
#rider-modal {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(28,16,8,.55);
  align-items: center; justify-content: center;
}
.rmodal-box {
  background: var(--paper); border-top: 5px solid var(--red);
  padding: 1.75rem 2rem; max-width: 340px; width: 90%;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.rmodal-close {
  position: absolute; top: .75rem; right: .75rem;
  background: none; border: none; cursor: pointer;
  font-size: .85rem; color: var(--dim);
}
.rmodal-close:hover { color: var(--red); }
.rmodal-rat  {
  font-family:'Playfair Display',serif; font-size:3rem; font-weight:900;
  color:var(--red); line-height:1; margin-bottom:.2rem;
}
.rmodal-name { font-size:1.1rem; font-weight:700; color:var(--ink); margin-bottom:.2rem; }
.rmodal-nat  { font-size:.9rem; margin-bottom:.55rem; }
.rmodal-tags { display:flex; flex-wrap:wrap; gap:.25rem; margin-bottom:.75rem; }
.rmodal-tact { font-size:.74rem; color:var(--mid); margin-bottom:.5rem; }
.rmodal-note { font-size:.78rem; color:var(--dim); font-style:italic; line-height:1.5; }

/* ── SIMULATE BTN (inside roster panel) ────────────────────── */
.btn-simulate {
  display: none;
  width: 100%; margin-top: 1rem; padding: .85rem .5rem;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 900; font-style: italic;
  letter-spacing: .04em; text-transform: uppercase;
  transition: background .2s;
}
.btn-simulate:hover    { background: var(--ink2); }
.btn-simulate:disabled { opacity: .5; cursor: not-allowed; }

/* ── RACE PREVIEW ───────────────────────────────────────────── */
#zone-race-preview {
  display: none; flex-direction: column; align-items: center;
  text-align: center; padding: 1.5rem 1rem 1rem;
  animation: up .25s ease;
}
.rp-eye {
  font-family: 'DM Mono', monospace; font-size: .52rem; letter-spacing: .3em;
  color: var(--red); text-transform: uppercase; margin-bottom: .6rem;
}
.rp-icon { font-size: 3.2rem; line-height: 1; margin-bottom: .3rem; }
.rp-name {
  font-family: 'Playfair Display', serif; font-size: 1.55rem; font-weight: 900;
  color: var(--ink); line-height: 1.1; margin-bottom: .2rem;
}
.rp-cat {
  font-family: 'DM Mono', monospace; font-size: .52rem; color: var(--mid);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: .9rem;
}
.rp-profile { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.rp-role-tag {
  font-family: 'DM Mono', monospace; font-size: .48rem; letter-spacing: .08em;
  padding: .18rem .55rem; background: var(--paper2); border: 1px solid var(--border);
  color: var(--mid); text-transform: uppercase;
}
/* ── CAPTAIN PICKER ─────────────────────────────────────────── */
.rp-captains-label {
  font-family: 'DM Mono', monospace; font-size: .48rem; letter-spacing: .18em;
  color: var(--red); text-transform: uppercase; margin-bottom: .5rem; margin-top: .15rem;
}
.rp-captains {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
  margin-bottom: 1rem; width: 100%;
}
.cap-card {
  display: flex; flex-direction: column; align-items: center;
  padding: .45rem .55rem; min-width: 72px; max-width: 88px;
  background: var(--paper2); border: 2px solid var(--border);
  cursor: pointer; transition: border-color .12s, background .12s;
  text-align: center;
}
@media (hover: hover) { .cap-card:hover { border-color: var(--mid); background: var(--paper3); } }
.cap-card.selected {
  border-color: var(--red); background: rgba(212,0,26,.07);
  box-shadow: 0 0 0 2px rgba(212,0,26,.18);
}
.cap-nat {
  font-size: 1.25rem; line-height: 1; margin-bottom: .2rem;
  position: relative; display: inline-flex; align-items: center; gap: .15rem;
}
.cap-nat-bonus { font-size: .7rem; line-height: 1; }
.cap-name {
  font-family: 'DM Sans', sans-serif; font-size: .56rem; font-weight: 700;
  color: var(--ink); line-height: 1.2; margin-bottom: .25rem;
  word-break: break-word;
}
.cap-bottom { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: center; }
.cap-rat {
  font-family: 'DM Mono', monospace; font-size: .58rem; font-weight: 700;
  color: var(--red); line-height: 1;
}
.cap-role {
  font-family: 'DM Mono', monospace; font-size: .38rem; letter-spacing: .05em;
  padding: .08rem .3rem; background: var(--paper3); border: 1px solid var(--border);
  color: var(--mid); text-transform: uppercase;
}
.cap-card.selected .cap-role { border-color: var(--red); color: var(--red); }
.cap-card.cap-penalised { opacity: .62; }
.cap-fit { font-size: .7rem; line-height: 1; margin-left: .1rem; }
.cap-fit.good { color: var(--green); }
.cap-fit.bad  { color: var(--red); }

/* Worlds course badge */
.rp-course-badge {
  font-family: 'DM Mono', monospace; font-size: .5rem; letter-spacing: .08em;
  padding: .2rem .6rem; text-transform: uppercase; font-weight: 700;
  border: 2px solid currentColor; margin-left: .25rem;
}
.rp-course-flat     { color: #1A4A8A; }
.rp-course-hilly    { color: var(--gold); }
.rp-course-mountain { color: var(--green); }

.rp-progress { display: flex; gap: 5px; justify-content: center; margin-bottom: 1.1rem; }
.rp-pip {
  width: 22px; height: 22px; border-radius: 50%;
  font-family: 'DM Mono', monospace; font-size: .42rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
}
.rp-pip.done    { background: var(--ink); color: #fff; border-color: var(--ink); }
.rp-pip.active  { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 0 0 3px rgba(212,0,26,.2); }
.rp-pip.pending { background: transparent; border-color: var(--paper3); }
.btn-race {
  width: 100%; padding: 1.1rem; margin-top: .4rem;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900;
  font-style: italic; letter-spacing: .05em; text-transform: uppercase;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 0 var(--red-dk);
}
.btn-race:hover  { background: var(--red-dk); }
.btn-race:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-dk); }

/* ── RACE LOADING ───────────────────────────────────────────── */
.rr-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1rem 3rem; gap: .6rem; min-height: 240px;
  animation: up .2s ease;
}
.rrl-icon  { font-size: 3rem; line-height: 1; animation: rrl-pulse 1s ease-in-out infinite; }
.rrl-name  {
  font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900;
  color: var(--ink); text-align: center;
}
.rrl-ticker {
  font-family: 'DM Mono', monospace; font-size: .58rem; letter-spacing: .08em;
  color: var(--red); text-transform: uppercase; min-height: 1.2em;
  transition: opacity .15s;
}
.rrl-ticker.tick-in { animation: tick-fade .35s ease; }
.rrl-bars {
  display: flex; gap: 4px; align-items: flex-end; margin-top: .4rem; height: 28px;
}
.rrl-bar {
  width: 6px; background: var(--red); border-radius: 3px;
  animation: rrl-bar 0.7s ease-in-out infinite;
}
.rrl-bar:nth-child(1) { animation-delay: 0s;    animation-duration: .7s; }
.rrl-bar:nth-child(2) { animation-delay: .14s;  animation-duration: .7s; }
.rrl-bar:nth-child(3) { animation-delay: .28s;  animation-duration: .6s; }
.rrl-bar:nth-child(4) { animation-delay: .42s;  animation-duration: .75s; }
.rrl-bar:nth-child(5) { animation-delay: .56s;  animation-duration: .65s; }

@keyframes rrl-pulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.15); opacity: .8; }
}
@keyframes rrl-bar {
  0%,100% { height: 6px; }
  50%      { height: 28px; }
}
@keyframes tick-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ROW REVEAL ANIMATION ───────────────────────────────────── */
.t10-hidden  { opacity: 0; transform: translateX(-8px); }
.t10-reveal  {
  opacity: 1; transform: translateX(0);
  transition: opacity .22s ease, transform .22s ease;
}

/* ── RACE RESULT ────────────────────────────────────────────── */
#zone-race-result {
  display: none; flex-direction: column;
  padding: 1.2rem 1rem 1rem;
  animation: up .3s ease;
}
.rr-hd {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem; padding-bottom: .75rem;
  border-bottom: 3px double var(--paper3);
}
.rr-icon { font-size: 2rem; flex-shrink: 0; }
.rr-name {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 900;
  color: var(--ink); line-height: 1.1;
}
.rr-pts {
  font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900;
  line-height: 1;
}
.rr-pts span { font-size: .7rem; color: var(--dim); }
.rr-result-txt {
  font-size: .78rem; color: var(--mid); font-style: italic;
  margin-bottom: .9rem; line-height: 1.4;
}
/* Top-10 classification table */
.rr-top10 {
  border: 1px solid var(--border); border-top: 3px solid var(--ink);
  margin-bottom: .85rem; font-size: .75rem;
}
.t10-row {
  display: grid; grid-template-columns: 2rem 1.6rem 1fr 4rem 5rem;
  align-items: center; gap: .3rem;
  padding: .32rem .55rem;
  border-bottom: 1px solid var(--paper2);
  transition: background .15s;
}
.t10-row:last-child { border-bottom: none; }
.t10-row.yours {
  background: rgba(212,0,26,.07);
  border-left: 3px solid var(--red);
  font-weight: 700;
}
.t10-pos  { font-family: 'DM Mono', monospace; font-size: .68rem; color: var(--dim); text-align: right; }
.t10-nat  { font-size: .82rem; text-align: center; }
.t10-name { font-size: .76rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t10-row.yours .t10-name { color: var(--red); }
.t10-gap  { font-family: 'DM Mono', monospace; font-size: .52rem; color: var(--mid); text-align: right; white-space: nowrap; }
.t10-row.yours .t10-gap { color: var(--red); }
.t10-team { font-family: 'DM Mono', monospace; font-size: .46rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
/* Running score */
.rr-running-score {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .5rem .65rem; background: var(--paper2);
  border: 1px solid var(--border); margin-bottom: .85rem;
}
.rrs-label { font-family: 'DM Mono', monospace; font-size: .5rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mid); }
.rrs-val   { font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 900; color: var(--ink); }
.rrs-max   { font-size: .68rem; color: var(--dim); }
.btn-next-race {
  width: 100%; padding: .85rem;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 900;
  font-style: italic; letter-spacing: .04em; text-transform: uppercase;
  transition: background .15s;
}
.btn-next-race:hover { background: var(--ink2); }

/* ── RESULTS FINAL ──────────────────────────────────────────── */
#zone-results { display: none; }
.res-hd { text-align: center; margin-bottom: 1.75rem; padding-top: .5rem; }
.res-eye {
  font-family: 'DM Mono', monospace; font-size: .58rem; letter-spacing: .28em;
  color: var(--mid); text-transform: uppercase; margin-bottom: .75rem;
}
.res-score {
  font-family: 'Playfair Display', serif; font-size: clamp(4rem,14vw,7rem);
  font-weight: 900; line-height: .88; color: var(--ink);
}
.res-score span { color: var(--gold); }
.res-grade {
  font-family: 'DM Mono', monospace; font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--red); margin: .65rem 0 .3rem;
}
.res-verdict { margin: .4rem auto 0; max-width: 560px; font-size: .82rem; color: var(--mid); line-height: 1.65; }

/* ── SQUAD SUMMARY (results screen) ────────────────────────── */
.res-squad-summary {
  margin: 1rem 0 .5rem;
  padding: .75rem .5rem;
  background: var(--paper2);
  border-top: 3px double var(--paper3);
  border-bottom: 3px double var(--paper3);
}
.rsq-grid {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
}
.rsq-tile {
  display: flex; flex-direction: column; align-items: center;
  width: 52px; text-align: center;
}
.rsq-jersey { width: 32px; height: 34px; overflow: hidden; flex-shrink: 0; }
.rsq-jersey svg { width: 32px !important; height: 34px !important; }
.rsq-nat  { font-size: .75rem; line-height: 1; margin-top: .1rem; }
.rsq-name {
  font-family: 'DM Sans', sans-serif; font-size: .46rem; font-weight: 700;
  color: var(--ink); line-height: 1.2; margin-top: .1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52px;
}
.rsq-rat  {
  font-family: 'DM Mono', monospace; font-size: .44rem;
  color: var(--red); line-height: 1;
}

/* ── STATS BLOCK ────────────────────────────────────────────── */
.res-stats { margin: 1.2rem 0 1.5rem; }
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border); border-top: 3px solid var(--red);
}
.stat-box {
  padding: .85rem .7rem .75rem; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-box:last-child { border-right: none; }
.stat-num {
  font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900;
  color: var(--ink); line-height: 1;
}
.stat-lbl {
  font-family: 'DM Mono', monospace; font-size: .44rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--red); margin: .2rem 0 .45rem;
}
.stat-detail {
  font-family: 'DM Mono', monospace; font-size: .46rem; color: var(--dim);
  line-height: 1.5; min-height: 2.2em;
}

.races-lbl {
  font-family: 'DM Mono', monospace; font-size: .55rem; letter-spacing: .22em;
  color: var(--dim); text-transform: uppercase;
  margin: 1.75rem 0 .8rem; padding-bottom: .45rem;
  border-bottom: 3px double var(--paper3);
}
.races-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: .55rem; margin-bottom: 2rem; }
.rrc {
  background: var(--paper); border: 1px solid var(--border); border-left: 3px solid var(--red);
  padding: .85rem 1rem;
}
.rrc-hd      { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.rrc-icon    { font-size: 1.2rem; flex-shrink: 0; }
.rrc-name    { font-family: 'Playfair Display', serif; font-size: .95rem; font-weight: 700; color: var(--ink); }
.rrc-cat     { font-family: 'DM Mono', monospace; font-size: .46rem; color: var(--dim); }
.rrc-pts-sm  { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; margin-left: auto; flex-shrink: 0; }
.rrc-pts-sm span { font-size: .58rem; color: var(--dim); }
.rrc-bar-bg  { height: 4px; background: var(--paper3); margin-bottom: .4rem; }
.rrc-bar     { height: 100%; transition: width 1.1s cubic-bezier(.22,1,.36,1); }
.rrc-bot     { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.rrc-txt     { font-size: .62rem; color: var(--mid); line-height: 1.35; }
.rrc-winner  { font-family: 'DM Mono', monospace; font-size: .52rem; color: var(--dim); text-align: right; flex-shrink: 0; }
.rrc-year    { font-family: 'DM Mono', monospace; font-size: .52rem; color: var(--mid); margin-left: .35rem; font-weight: 400; }
.rrc-yours   { margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--paper3); }
.rrc-yours-pos {
  font-family: 'DM Mono', monospace; font-size: .52rem; font-weight: 700;
  color: var(--red); background: rgba(212,0,26,.07);
  padding: .15rem .45rem; display: inline-block;
}
.btn-share {
  display: block; width: 100%; margin: 1rem 0 .5rem; padding: .9rem 1.5rem;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700;
  font-style: italic; letter-spacing: .06em; text-transform: uppercase;
  transition: background .15s;
}
.btn-share:hover { background: var(--red); }
.btn-restart {
  display: block; margin: .75rem auto 0; padding: .8rem 2.5rem;
  background: transparent; color: var(--ink); border: 2px solid var(--ink);
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700;
  letter-spacing: .06em; cursor: pointer; transition: all .2s; text-transform: uppercase;
}
.btn-restart:hover { border-color: var(--red); color: var(--red); }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast {
  position:fixed; bottom:1.5rem; left:50%;
  transform:translateX(-50%) translateY(80px);
  background:var(--ink); color:#fff; border-left:4px solid var(--red);
  padding:.55rem 1rem; font-size:.78rem; z-index:9998;
  transition:transform .3s; max-width:90vw; text-align:center;
}
#toast.show { transform:translateX(-50%) translateY(0); }

/* ── ANIMACIONES ────────────────────────────────────────────── */
@keyframes up { from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);} }
@keyframes flicker { 0%,100%{opacity:1;}50%{opacity:.3;} }
.fadein { opacity:0; animation:up .3s ease forwards; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Hero: tablet */
@media (max-width: 860px) {
  .hero-layout {
    grid-template-columns: 1fr;
    padding: 3rem 2rem 1.5rem;
    align-items: start;
  }
  .hero-left { padding-right: 0; }
  .hero-right {
    display: flex;
    width: 100%;
    align-items: center;
    margin-top: .5rem;
  }
  .hero-dream-panel {
    max-width: 100%;
    width: 100%;
  }
  /* Compact jerseys on tablet/mobile */
  .hdp-prow--front .hdp-jersey-shape { width: 38px; }
  .hdp-prow--back  .hdp-jersey-shape { width: 30px; }
  .hdp-jersey--dir .hdp-jersey-shape { width: 34px; }
  .hdp-jersey-shape { width: 34px; }
  .hdp-prow { gap: .7rem; }
  .hero-footer { padding: 1rem 2rem; }
}

/* Hero: mobile */
@media (max-width: 500px) {
  .hero-h1 { font-size: 2.8rem; }
  .hero-tagline { font-size: 1.25rem; }
  .hero-layout { padding: 2rem 1.25rem 1rem; }
  .hero-footer { gap: 1rem; }
  .hfl-brand { display: none; }
  /* Even more compact jerseys on mobile */
  .hdp-prow--front .hdp-jersey-shape { width: 30px; }
  .hdp-prow--back  .hdp-jersey-shape { width: 24px; }
  .hdp-jersey--dir .hdp-jersey-shape { width: 28px; }
  .hdp-prow { gap: .5rem; }
  .hdp-jersey-name { font-size: .3rem; max-width: 50px; }
}

/* Game: tablet: ocultar panel visual, 2 columnas */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr 200px;
  }
  .col-visual { display: none; }
}

/* Game: móvil: 1 columna — spin arriba, peloton en medio, squad lista abajo */
@media (max-width: 700px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .col-action {
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: none;
    padding: 1rem .9rem .75rem;
    order: 1;
  }
  /* Peloton siempre visible en móvil, debajo de col-action */
  .col-visual {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    order: 2;
    position: static;
    height: auto;
    padding: .5rem .9rem .5rem;
    border-right: none;
    border-top: 2px solid var(--border);
    background: var(--paper2);
  }
  .col-visual-title { display: none; }
  .col-visual .peloton-panel {
    max-width: 100%;
    width: 100%;
    aspect-ratio: unset;
    height: 300px;
  }
  /* Squad lista compacta, siempre visible debajo del peloton */
  .col-roster {
    display: block;
    order: 3;
    position: static;
    height: auto;
    overflow-y: visible;
    border-left: none;
    border-top: 3px double var(--border);
  }
  /* Squad slots en grid compacto 2 columnas */
  .squad-list { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
  .sq-slot { padding: .4rem .5rem; }
  .sq-slot .jersey-svg { width: 28px; height: auto; }
  .sq-rat-ext { font-size: .85rem; }
  .sq-name { font-size: .68rem; }
  .sq-pos-lbl { font-size: .34rem; }
  .btn-simulate { margin-top: .5rem; }
  /* rider-grid as grid for 2-col layout */
  .rider-grid { display: grid; grid-template-columns: 1fr 1fr; }
  /* Spin button full-width on mobile for easy tap */
  .btn-spin   { padding: .9rem 1.5rem; font-size: 1.25rem; width: 100%; align-self: stretch; }
  /* Race preview/result — tighter spacing on mobile */
  #zone-race-preview { padding: 1rem .5rem .75rem; }
  .rp-icon { font-size: 2.4rem; }
  .rp-name { font-size: 1.25rem; }
  .rr-hd { margin-bottom: .5rem; padding-bottom: .5rem; }
  .rr-pts { font-size: 1.5rem; }
  .t10-row { padding: .28rem .4rem; grid-template-columns: 2rem 1.4rem 1fr 3.5rem 4rem; }
  .t10-name { font-size: .7rem; }
  .t10-gap  { font-size: .48rem; }
  .t10-team { font-size: .42rem; }
}

/* En modo resultados: el col-roster se convierte en fila debajo de col-action */
/* En pantallas donde el roster se vería pegado/solapado, lo integramos mejor */
@media (max-width: 1100px) {
  .game-layout.is-results {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .game-layout.is-results .col-visual { display: none; }
  .game-layout.is-results .col-roster {
    display: block; /* override the mobile display:none */
    position: static;
    height: auto;
    overflow-y: visible;
    border-left: none;
    border-top: 3px double var(--border);
  }
  .game-layout.is-results .col-action {
    border-right: none;
  }
  /* Squad list becomes horizontal scroll in results mode */
  .game-layout.is-results #squad-row1 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .5rem 0;
  }
  .game-layout.is-results .sq-slot {
    flex: 0 0 auto;
    width: calc(20% - .3rem);
    min-width: 140px;
  }
}

/* En pantalla muy ancha con resultados, el roster sigue en columna lateral */
@media (min-width: 1101px) {
  .game-layout.is-results .col-roster {
    position: sticky;
    top: 46px;
    height: calc(100vh - 46px);
    overflow-y: auto;
  }
}
