/* ============================================================
   CariPredi — sistema de diseño (dark, tema tenis)
   Tokens primero. Sin dependencias externas (self-hosted).
   ============================================================ */
:root {
  --bg: #0d0f14;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #16202a 0%, transparent 55%),
             radial-gradient(900px 500px at -10% 10%, #171326 0%, transparent 50%);
  --surface: #151a23;
  --surface-2: #1b212d;
  --surface-3: #212938;
  --border: #262d3b;
  --border-strong: #37415440;
  --text: #eaf0f7;
  --text-muted: #96a2b6;
  --text-dim: #64708320;

  --accent: #c2f24a;         /* pelota de tenis */
  --accent-soft: #c2f24a1a;
  --accent-ink: #101609;
  --clay: #e07a3e;
  --grass: #58c06a;
  --hard: #4aa6e0;
  --carpet: #a98be6;
  --wta: #e368a6;
  --atp: #4aa6e0;
  --danger: #f2585d;
  --gold: #f2c14a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sp: 4px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 20px 50px -20px rgba(0,0,0,.7);
  --ring: 0 0 0 3px var(--accent-soft);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: 100%; max-width: 1060px; margin-inline: auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px;
  border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { left: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-ball {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8ff7a, var(--accent) 60%, #9cc72f);
  position: relative; box-shadow: 0 0 18px -2px var(--accent-soft), inset 0 -3px 6px #7fae2a55;
  flex: none;
}
.brand-ball::before, .brand-ball::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.6px solid #0d0f1466;
}
.brand-ball::before { clip-path: inset(0 60% 0 0); transform: scaleX(1.9) translateX(18%); }
.brand-ball::after { clip-path: inset(0 0 0 60%); transform: scaleX(1.9) translateX(-18%); }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); }

.tabs { display: flex; gap: 4px; margin-inline: auto; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  padding: 9px 14px; border-radius: var(--r-md); display: inline-flex; align-items: center; gap: 7px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.tab.is-active .tab-ico { filter: saturate(1.2); }
.tab-ico { font-size: 15px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-muted); font-weight: 500;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.status-pill.ok .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status-pill.err .dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* ---------- Vistas ---------- */
.view { display: none; padding-block: 30px 60px; animation: fade .35s var(--ease); }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-title { font-size: 26px; font-weight: 720; letter-spacing: -.03em; }
.view-sub { color: var(--text-muted); font-size: 14px; max-width: 62ch; margin-top: 4px; }

.btn-ghost {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  padding: 9px 14px; border-radius: var(--r-md); display: inline-flex; align-items: center; gap: 7px;
  transition: all .2s var(--ease); white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.ico-refresh { display: inline-block; font-size: 15px; }
.btn-ghost.spin .ico-refresh { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips de filtro ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  padding: 8px 13px; border-radius: 999px; transition: all .18s var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-count {
  font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: #ffffff14; color: inherit; min-width: 20px; text-align: center;
}
.chip.is-active .chip-count { background: #10160933; }

/* ---------- Lista de fixtures ---------- */
.fixtures { display: grid; gap: 22px; }
.day-group { display: grid; gap: 12px; }
.day-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding-left: 2px; display: flex; align-items: center; gap: 10px;
}
.day-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.match-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-md);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
  animation: rise .4s var(--ease) backwards;
}
.match-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.match-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 12.5px; }
.tour-badge {
  font-weight: 800; font-size: 10.5px; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px;
  color: var(--accent-ink);
}
.tour-badge.atp { background: var(--atp); }
.tour-badge.wta { background: var(--wta); }
.surf-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.surf-dot.hard { background: var(--hard); }
.surf-dot.clay { background: var(--clay); }
.surf-dot.grass { background: var(--grass); }
.surf-dot.carpet { background: var(--carpet); }
.match-tourney { color: var(--text-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-time { margin-left: auto; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.tier-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px;
}

.match-players { display: grid; gap: 9px; }
.pl-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; }
.pl-name { display: flex; align-items: center; gap: 9px; font-weight: 640; font-size: 15px; min-width: 0; }
.pl-name .name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-fav { color: var(--gold); font-size: 13px; flex: none; }
.pl-flag { font-size: 12px; color: var(--text-muted); font-weight: 700; flex: none; }
.pl-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.pl-odd { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.pl-prob { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; letter-spacing: -.02em; }
.pl-row.winner .pl-prob { color: var(--accent); }
.pl-row.winner .pl-name { color: var(--text); }
.pl-row:not(.winner) .pl-name { color: var(--text-muted); }

.prob-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.prob-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #9cc72f, var(--accent)); width: 0; transition: width .7s var(--ease); }
.prob-fill.dim { background: linear-gradient(90deg, #3a4356, #4a5568); }

.match-nopred { color: var(--text-dim); color: var(--text-muted); font-size: 13px; padding: 6px 0; opacity: .8; }

/* ---------- Estados ---------- */
.empty, .loading-block {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--surface);
}
.empty-ico { font-size: 34px; display: block; margin-bottom: 12px; opacity: .8; }
.error-block {
  padding: 18px; border-radius: var(--r-md); background: #f2585d14;
  border: 1px solid #f2585d40; color: #ffb8bb; font-size: 14px;
}

/* skeleton */
.skeleton-card { height: 128px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Card genérica ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-md); }

/* ---------- Predicción manual ---------- */
.players-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.vs-badge { align-self: center; margin-top: 24px; font-weight: 800; font-size: 13px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; background: var(--surface-2); }
.player-slot label, .field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .02em; }

.combo { position: relative; }
.combo-input {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.combo-input::placeholder { color: var(--text-muted); opacity: .6; }
.combo-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.combo-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; list-style: none; padding: 6px;
}
.combo-opt { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.combo-opt:hover, .combo-opt.active { background: var(--surface); }
.combo-opt .opt-name { font-weight: 600; font-size: 14px; }
.combo-opt .opt-meta { margin-left: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.combo-opt .opt-no { font-size: 12px; color: var(--text-dim); }

.chosen { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid #c2f24a40; margin-top: 8px; }
.chosen .c-name { font-weight: 700; }
.chosen .c-elo { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.chosen .c-clear { appearance: none; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.chosen .c-clear:hover { color: var(--danger); background: #f2585d1a; }

.surface-row { margin-top: 22px; }
.segmented { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px; flex-wrap: wrap; }
.seg { appearance: none; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; padding: 8px 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; transition: all .18s var(--ease); }
.seg:hover { color: var(--text); }
.seg.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

.btn-primary {
  margin-top: 24px; width: 100%; appearance: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 15px; padding: 15px; border-radius: var(--r-md);
  background: linear-gradient(180deg, #d0ff5c, var(--accent)); color: var(--accent-ink);
  box-shadow: 0 8px 24px -10px var(--accent); transition: transform .15s var(--ease), filter .2s var(--ease), opacity .2s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

/* Resultado de predicción */
.predict-result { margin-top: 26px; }
.result-card { animation: rise .4s var(--ease); }
.result-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; text-align: center; flex-wrap: wrap; }
.result-vs { color: var(--text-muted); font-weight: 700; }
.result-name { font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.result-surface { font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }

.big-prob { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.bp-cell { text-align: center; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.bp-cell.win { border-color: #c2f24a55; background: var(--accent-soft); }
.bp-pct { font-size: 34px; font-weight: 820; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bp-cell.win .bp-pct { color: var(--accent); }
.bp-name { font-size: 13px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }

.big-track { height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); display: flex; margin-bottom: 20px; }
.big-track .seg-a { background: linear-gradient(90deg, #9cc72f, var(--accent)); }
.big-track .seg-b { background: var(--surface-3); }

.elo-note { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }

.factors { width: 100%; border-collapse: collapse; font-size: 14px; }
.factors caption { text-align: left; font-weight: 700; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.factors th, .factors td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.factors th:first-child, .factors td:first-child { text-align: left; color: var(--text-muted); font-weight: 600; }
.factors thead th { color: var(--text); font-weight: 700; }
.factors tr:last-child td { border-bottom: 0; }
.factors td.hi { color: var(--accent); font-weight: 700; }

.model-meta { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-block: 26px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12.5px; margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .header-inner { height: auto; flex-wrap: wrap; padding-block: 12px; gap: 12px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab { flex: 1; justify-content: center; }
  .status-pill { order: 2; margin-left: auto; }
  .view-title { font-size: 22px; }
  .players-grid { grid-template-columns: 1fr; }
  .vs-badge { justify-self: center; margin-top: 0; }
  .bp-pct { font-size: 28px; }
  .btn-ghost .txt { display: none; }
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===================== Cards clickeables ===================== */
.match-card.is-clickable { cursor: pointer; transition: border-color .18s var(--ease), transform .18s var(--ease); }
.match-card.is-clickable:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-cta {
  margin-top: 10px; font-size: .8rem; font-weight: 600; color: var(--accent);
  opacity: .0; transition: opacity .18s var(--ease);
}
.match-card.is-clickable:hover .card-cta,
.match-card.is-clickable:focus-visible .card-cta { opacity: 1; }

/* ===================== Modal de detalle ===================== */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,8,12,.72); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; z-index: 1; width: min(880px, 94vw); max-height: 92vh; overflow-y: auto;
  margin: 4vh 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 26px 28px 32px;
  animation: modal-in .22s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
  font-size: 1rem; cursor: pointer; transition: all .15s var(--ease);
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.detail-loading { padding: 40px; text-align: center; color: var(--text-muted); }

.detail-head h2 { margin: 0 0 4px; font-size: 1.5rem; }
.detail-head .vs { color: var(--text-muted); font-weight: 400; font-size: 1.1rem; }
.detail-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 18px; }

.detail-prob { margin-top: 6px; }
.detail-sec { margin-top: 26px; }
.detail-sec h3 { font-size: 1.05rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-sec .muted, .muted { color: var(--text-muted); }

/* ===================== Panel Kelly (gestión de banca) ===================== */
.staking { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 18px 16px; }
.stake-params { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stake-params label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.stake-params input, .stake-params select {
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); padding: 9px 10px; font-size: .95rem; font-variant-numeric: tabular-nums;
}
.stake-params input:focus, .stake-params select:focus { outline: none; border-color: var(--accent); }
#stake-out { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stake-row { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; }
.stake-row.value { border-color: var(--grass); background: linear-gradient(180deg, #58c06a12, transparent); }
.stake-row.novalue, .stake-row.muted { opacity: .72; }
.stake-row.outband { border-color: var(--clay); background: linear-gradient(180deg, #e07a3e12, transparent); opacity: 1; }
.stake-params.rules { grid-template-columns: 1fr 1fr; margin-top: 4px; margin-bottom: 14px; }
.sr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sr-name { font-weight: 700; }
.sr-edge { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sr-edge.pos { color: var(--grass); }
.sr-edge.neg { color: var(--text-muted); }
.sr-body { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--text-muted); }
.sr-stake { color: var(--text); font-size: .95rem; }
.sr-stake b { color: var(--accent); font-size: 1.15rem; }
.sr-skip { color: var(--text-muted); font-style: italic; }
.stake-note { margin: 14px 0 0; font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

/* ===================== H2H y forma reciente ===================== */
.mini-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mini-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 6px 8px; font-size: .76rem; }
.mini-table td { padding: 7px 8px; border-top: 1px solid var(--border); }
.mini-table .h2h-win { color: var(--accent); font-weight: 600; }
.mini-table .h2h-score { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-col h4 { margin: 0 0 10px; font-size: .95rem; display: flex; justify-content: space-between; align-items: baseline; }
.form-col .wl { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.form-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 22px 1fr auto; grid-template-areas: "res opp score" "res meta meta"; gap: 2px 8px; align-items: center; padding: 7px 10px; background: var(--surface-2); border-radius: var(--r-sm); font-size: .82rem; }
.form-row .fr-res { grid-area: res; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: .72rem; font-weight: 800; }
.form-row.w .fr-res { background: var(--grass); color: #06210c; }
.form-row.l .fr-res { background: var(--clay); color: #2a1204; }
.fr-opp { grid-area: opp; font-weight: 600; }
.fr-score { grid-area: score; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fr-meta { grid-area: meta; color: var(--text-muted); font-size: .74rem; }

@media (max-width: 720px) {
  .stake-params { grid-template-columns: 1fr 1fr; }
  #stake-out, .form-cols { grid-template-columns: 1fr; }
  .modal-panel { padding: 20px 16px 26px; }
}

/* ============================ Score por factor (0-100) ============================ */
.detail-sec.scores .score-overall {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; margin: 4px 0 14px;
}
.so-cell { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.so-cell.right, .so-cell:last-child { justify-content: flex-end; }
.so-cell.hi { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.so-name { font-weight: 600; color: var(--text); font-size: .92rem; }
.so-num { font-size: 1.6rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.so-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); text-align: center; }

.score-grid { display: flex; flex-direction: column; gap: 10px; }
.score-row { display: grid; grid-template-columns: 74px 1fr 74px; align-items: center; gap: 10px; }
.sc-side { display: flex; flex-direction: column; line-height: 1.15; }
.sc-side.right { align-items: flex-end; text-align: right; }
.sc-num { font-size: 1.05rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sc-side.hi .sc-num { color: var(--accent); }
.sc-raw { font-size: .66rem; color: var(--text-muted); }
.sc-mid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.sc-label { font-size: .74rem; color: var(--text-muted); text-align: center; white-space: nowrap; }
.sc-bar { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.sc-bar.r { transform: scaleX(-1); }
.sc-fill { height: 100%; border-radius: 999px; transition: width .5s var(--ease); }
.sc-fill.a { background: var(--accent); }
.sc-fill.b { background: var(--hard); }

/* ============================ Mercado (Kalshi) ============================ */
.detail-sec.market .mkt-vol { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.mkt-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; align-items: center;
  gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); margin-bottom: 8px; }
.mkt-row.value { border-color: var(--grass); box-shadow: 0 0 0 1px var(--grass) inset; }
.mkt-name { font-weight: 600; color: var(--text); }
.mkt-cell { display: flex; flex-direction: column; align-items: center; }
.mkt-cell .mkt-lab { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.mkt-cell b { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--text); }
.mkt-diff { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.mkt-diff.pos { color: var(--grass); }
.mkt-diff.neg { color: var(--text-muted); }

@media (max-width: 720px) {
  .score-row { grid-template-columns: 56px 1fr 56px; gap: 6px; }
  .sc-num { font-size: .92rem; }
  .mkt-row { grid-template-columns: 1fr 1fr 1fr; }
  .mkt-row .mkt-diff { grid-column: 1 / -1; text-align: left; }
}
