/* Sports Odds: estilos de toda la web.
   Los colores son variables: tema claro por defecto y oscuro con data-theme="dark" (lo pone base.html
   según el sistema o lo que se eligió con el botón de la cabecera). */

:root {
  color-scheme: light;
  --bg: #F1F4F2;
  --surface: #FFFFFF;
  --surface-2: #F4F7F5;
  --ink: #14201B;
  --muted: #5A6962;
  --line: #DCE4DF;
  --brand: #1E4D3B;
  --brand-2: #143528;
  --on-brand: #F4F7F5;
  --accent: #157347;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(21, 115, 71, .10);
  --gold: #EFC531;
  --red: #C93F33;
  --home: #1B7F54;
  --away: #D9A514;
  --shadow: 0 1px 2px rgba(20, 32, 27, .05), 0 4px 14px rgba(20, 32, 27, .05);
  --shadow-lg: 0 2px 4px rgba(20, 32, 27, .06), 0 12px 28px rgba(20, 32, 27, .10);
  --c1: #1B7F54; --c2: #C93F33; --c3: #2F6DB5; --c4: #D98A1F; --c5: #7A4FA3; --c6: #5A6962;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C1310;
  --surface: #141D19;
  --surface-2: #1A2520;
  --ink: #E7EEEA;
  --muted: #8D9E97;
  --line: #25322C;
  --brand: #174032;
  --brand-2: #0D231B;
  --accent: #45D48A;
  --on-accent: #08170F;
  --accent-soft: rgba(69, 212, 138, .13);
  --gold: #F2CB45;
  --red: #F0685C;
  --home: #45D48A;
  --away: #F2CB45;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .22);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 14px 32px rgba(0, 0, 0, .38);
  --c1: #45D48A; --c2: #F0685C; --c3: #6FA8F5; --c4: #F2B24A; --c5: #B693E6; --c6: #9AA8A1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }
.pos { color: var(--accent); } .neg { color: var(--red); }
@view-transition { navigation: auto; }

/* ---------- cabecera: el campo ---------- */
.top { position: relative; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); }
.top-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.top-bg::before, .top-bg::after { content: ""; position: absolute; border: 2px solid rgba(244, 247, 245, .10); }
.top-bg::before { width: 220px; height: 220px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.top-bg::after { width: 0; height: 200%; left: 50%; top: -50%; border-width: 0 0 0 2px; }
.top-in { position: relative; max-width: 1120px; margin: 0 auto; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.brand { margin: 0 auto 0 0; font: 700 30px/1 var(--cond); letter-spacing: .01em; }
.brand a { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand small { display: block; margin-top: 3px; font: 400 13px/1.2 var(--body); letter-spacing: 0; opacity: .75; }
.search { position: relative; flex: 1 1 260px; max-width: 400px; }
.search input { width: 100%; height: 42px; padding: 0 16px 0 42px; border: 1px solid rgba(244, 247, 245, .18); border-radius: 999px; background: rgba(244, 247, 245, .12); color: var(--on-brand); font: 16px var(--body); transition: background .15s, border-color .15s; }
.search input::placeholder { color: rgba(244, 247, 245, .7); }
.search input:focus { outline: none; background: rgba(244, 247, 245, .2); border-color: var(--gold); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.7); }
.search > svg { position: absolute; left: 14px; top: 12px; width: 18px; height: 18px; opacity: .8; pointer-events: none; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; text-decoration: none; font-weight: 600; }
.suggest a:hover, .suggest a:focus { background: var(--accent-soft); outline: none; }
.suggest a small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.suggest img { width: 30px; height: 30px; flex: none; object-fit: contain; }
.suggest img.round { border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.suggest p { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.suggest .all { justify-content: center; color: var(--accent); font-size: 14px; }
.theme-btn { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(244, 247, 245, .18); border-radius: 50%; background: rgba(244, 247, 245, .12); color: var(--on-brand); cursor: pointer; transition: background .15s, transform .25s; }
.theme-btn:hover { background: rgba(244, 247, 245, .22); transform: rotate(18deg); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 20px 44px; }
.foot { border-top: 1px solid var(--line); padding: 18px 20px 26px; text-align: center; color: var(--muted); font-size: 14px; }
.foot a { color: var(--accent); font-weight: 600; text-decoration: none; margin: 0 8px; }
.foot a:hover { text-decoration: underline; }
.backbar { display: flex; gap: 8px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; transition: color .15s, border-color .15s; }
.back:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- piezas comunes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.block { margin-bottom: 34px; scroll-margin-top: 68px; }
.block > h2, .day > h2, .results h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 22px/1.2 var(--cond); letter-spacing: .03em; text-transform: uppercase; }
.block > h2::before, .day > h2::before, .results h2::before { content: ""; flex: none; width: 4px; height: 20px; border-radius: 2px; background: var(--accent); }
.block > .muted { margin: -4px 0 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 10px; font: 600 15px var(--body); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.chips .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 500; text-decoration: none; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip .comp-logo { margin: 0; width: 18px; height: 18px; }
.empty { padding: 26px 22px; text-align: center; }
.empty p { margin: 0 auto 6px; max-width: 60ch; }
.empty strong { font: 700 22px var(--cond); }
.notice { margin: 0 0 14px; padding: 11px 15px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); }
.notice.error { border-left-color: var(--red); }
.crest { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-right: 7px; }
.crest-none { display: inline-block; border-radius: 50%; background: var(--line); }
.comp-logo { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 6px; }
.face { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); vertical-align: -8px; margin-right: 8px; }
.shirt { display: inline-block; min-width: 22px; margin-right: 6px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--red); color: #fff; font: 700 12px/1.5 var(--body); letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { transform: scale(1.5); color: var(--gold); } 60% { color: var(--gold); } 100% { transform: scale(1); } }
/* explicación que aparece al pasar el ratón, al tocar o al llegar con el teclado */
.tip { position: relative; border-bottom: 1px dotted currentColor; }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip); position: absolute; right: 0; top: calc(100% + 6px); z-index: 5;
  width: max-content; max-width: min(260px, 70vw); padding: 8px 10px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font: 400 13px/1.4 var(--body); letter-spacing: 0; text-align: left; text-transform: none; white-space: normal;
}

/* ---------- tablas ---------- */
.table-wrap { overflow-x: auto; }
.card.table-wrap { margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td a { text-decoration: none; font-weight: 600; }
td a:hover { color: var(--accent); text-decoration: underline; }
table.data td, table.data th { text-align: right; }
table.data td:first-child, table.data th:first-child, table.data td.l, table.data th.l { text-align: left; }
td .crest { width: 20px; height: 20px; }
.res { display: inline-block; width: 24px; border-radius: 6px; font: 700 14px/24px var(--cond); text-align: center; color: #fff; }
.res-G { background: #1F9D61; } .res-E { background: #7F8C85; } .res-P { background: #D9573F; }
.rt { display: inline-block; min-width: 36px; padding: 0 6px; border-radius: 6px; font: 700 15px/22px var(--cond); text-align: center; color: #fff; }
.rt-5 { background: #2E7BD6; } .rt-4 { background: #1F9D61; } .rt-3 { background: #7FA82E; } .rt-2 { background: #D9941A; } .rt-1 { background: #D9573F; }

/* ---------- portada ---------- */
.filter-panel { margin-bottom: 24px; }
.filter-panel > summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; user-select: none; transition: border-color .15s, color .15s; }
.filter-panel > summary:hover { border-color: var(--accent); color: var(--accent); }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::after { content: "▾"; }
.filter-panel[open] > summary::after { content: "▴"; }
.filter-panel > .card { margin-top: 12px; padding: 16px; }
.filter-panel > .card > .muted { margin: 14px 0 0; }
.filter-panel a { color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; font-size: 13px; font-weight: 500; color: var(--muted); }
.filters select, .filters input, form.inline input { max-width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 15px var(--body); }
.filters select:focus, .filters input:focus, form.inline input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.export { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 4px 0 0; padding: 12px 14px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.export legend { padding: 0 6px; font-size: 14px; font-weight: 600; }
form.inline { display: flex; gap: 8px; align-items: center; }
form.inline .btn { min-height: 34px; padding: 5px 12px; }

.day { margin-bottom: 28px; }
.day > h2 { flex-wrap: wrap; row-gap: 2px; }
.day > h2 .comp-logo { width: 24px; height: 24px; margin: 0; }
.day > h2 small { font: 500 14px var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.day > h2 .tag { padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 13px/1.6 var(--body); letter-spacing: .03em; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fx { display: flex; flex-direction: column; gap: 7px; padding: 13px 16px 15px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.fx:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.fx.is-live { border-color: var(--red); }
.fx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; margin-bottom: 3px; font-size: 13px; color: var(--muted); }
.fx-comp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-when { flex: none; font: 600 16px var(--cond); color: var(--ink); font-variant-numeric: tabular-nums; }
.fx-when.end { color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.fx-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin: 4px 0 2px; }
.fx-side { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.15; text-align: center; }
.fx-side .crest { width: 42px; height: 42px; margin: 0; flex: none; }
.fx-side .nm { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.fx-side.lost { color: var(--muted); font-weight: 500; }
.fx-mid { display: flex; align-items: center; justify-content: center; min-width: 68px; height: 42px; font-family: var(--cond); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-mid .sc { font-size: 32px; line-height: 1; }
.fx-mid .sc span { display: inline-block; }
.fx-mid .ko { font-size: 24px; line-height: 1; }
/* las cuotas van siempre abajo, para que queden a la misma altura en toda la fila de tarjetas */
.fx-odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 7px; }
.odd { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font: 600 17px var(--cond); font-variant-numeric: tabular-nums; }
.odd i { font: 500 12px var(--body); font-style: normal; color: var(--muted); }
.odd.hit { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.odd.hit i { color: inherit; }
.fx-note { margin-top: auto; padding: 13px 0 6px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- ficha de partido ---------- */
.hero { position: relative; overflow: hidden; margin-bottom: 14px; padding: 16px 18px 18px; border-radius: 18px; background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: var(--on-brand); box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ""; position: absolute; pointer-events: none; border: 2px solid rgba(244, 247, 245, .08); }
.hero::before { width: 240px; height: 240px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hero::after { width: 0; height: 200%; left: 50%; top: -50%; border-width: 0 0 0 2px; }
.hero > * { position: relative; }
.hero-meta { margin: 0; text-align: center; font-size: 14px; opacity: .85; }
.hero-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0 12px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; text-decoration: none; font: 700 clamp(18px, 3.4vw, 28px)/1.1 var(--cond); }
.hero-team:hover span { text-decoration: underline; }
.hero-team .crest { width: clamp(52px, 11vw, 88px); height: clamp(52px, 11vw, 88px); margin: 0; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .35)); transition: transform .2s ease; }
.hero-team:hover .crest { transform: scale(1.06); }
.hero-mid { min-width: 104px; text-align: center; }
.hero-score { display: inline-block; font: 700 clamp(42px, 10vw, 72px)/1 var(--cond); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-time { font: 700 clamp(32px, 8vw, 52px)/1 var(--cond); font-variant-numeric: tabular-nums; }
.hero-state { margin-top: 7px; font-size: 14px; opacity: .9; }
.hero-state.end { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hero-foot { margin: 0; text-align: center; font-size: 14px; opacity: .9; }
.hero-foot + .hero-foot { margin-top: 4px; }
.hero-foot a { color: var(--gold); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.actions form { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tabs { position: sticky; top: 0; z-index: 10; display: flex; gap: 6px; overflow-x: auto; margin: -10px -20px 20px; padding: 9px 20px; border-bottom: 1px solid var(--line); background: var(--bg); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.live-note { margin: 0 0 14px; }
.skel { height: 120px; border-radius: 14px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* estadísticas: valor de cada equipo y una barra a cada lado */
.sides { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-weight: 600; }
.sides span { display: inline-flex; align-items: center; gap: 8px; }
.sides span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--home); }
.sides .a { flex-direction: row-reverse; text-align: right; }
.sides .a::before { background: var(--away); }
.stat-grid { columns: 2 340px; column-gap: 16px; }
.stat-card { break-inside: avoid; margin: 0 0 16px; padding: 14px 16px 10px; }
.stat-card h3 { margin: 0 0 8px; font: 600 12.5px var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat { padding: 7px 0 8px; }
.stat-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 10px; }
.stat-line .v { font: 600 17px var(--cond); font-variant-numeric: tabular-nums; color: var(--muted); }
.stat-line .v.a { text-align: right; }
.stat-line .n { font-size: 14px; text-align: center; }
.stat.lead-h .v.h, .stat.lead-a .v.a, .stat.even .v { color: var(--ink); }
.bar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 5px; }
.bar span { display: flex; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar .h { justify-content: flex-end; }
.bar i { width: var(--w); border-radius: 3px; background: var(--home); opacity: .4; transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.bar .a i { background: var(--away); }
.stat.lead-h .bar .h i, .stat.lead-a .bar .a i, .stat.even .bar i { opacity: 1; }
.js .stat:not(.in) .bar i { width: 0; }

/* incidencias: local a la izquierda, visitante a la derecha y el minuto en el centro */
.tl-card { padding: 8px 14px; }
.tl { position: relative; max-width: 760px; list-style: none; margin: 0 auto; padding: 0; }
.tl::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; margin-left: -1px; background: var(--line); }
.tl li { position: relative; display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; gap: 10px; padding: 7px 0; }
.tl .min { grid-area: 1 / 2; justify-self: center; min-width: 46px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 15px var(--cond); font-variant-numeric: tabular-nums; text-align: center; }
.tl .ev { grid-area: 1 / 3; display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 15px; line-height: 1.3; }
.tl li.home .ev { grid-area: 1 / 1; flex-direction: row-reverse; text-align: right; }
.tl .ev small { display: block; font-size: 13px; color: var(--muted); }
.tl .ev-goal strong { font-size: 16px; }
.tl .sc { display: inline-block; margin: 0 2px; padding: 0 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 15px/22px var(--cond); white-space: nowrap; }
.ic { flex: none; width: 20px; height: 20px; }
.ic-card { flex: none; width: 13px; height: 18px; margin: 0 3px; border-radius: 3px; background: #F2C230; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.ic-card.red { background: #DC4034; }
.ic-card.yellowRed { background: linear-gradient(135deg, #F2C230 50%, #DC4034 50%); }
.ic-var { flex: none; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; font: 700 12px/18px var(--cond); letter-spacing: .05em; color: var(--muted); }

/* jugadores */
.pl-card { margin-bottom: 16px; overflow: hidden; }
.pl-card > h3 { display: flex; align-items: center; gap: 4px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font: 700 20px var(--cond); }
.pl-card > h3 .crest { width: 26px; height: 26px; vertical-align: 0; }
table.players td:not(:first-child), table.players th:not(:first-child) { text-align: right; }
table.players td:first-child, table.players th:first-child { position: sticky; left: 0; background: var(--surface); }
table.players tbody tr:hover td:first-child { background: var(--surface-2); }
table.players tr.sub td { color: var(--muted); }

/* cuotas */
.mk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.mk-search { flex: 1 1 240px; max-width: 360px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 15px var(--body); }
.mk-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.markets-split { display: flex; gap: 16px; align-items: flex-start; }
.markets-split .col { flex: 1; min-width: 0; }
.markets-split.filtering { display: block; columns: 2 340px; column-gap: 16px; }
.markets-split.filtering .col { display: contents; }
@media (max-width: 760px) {
  .markets-split { flex-direction: column; gap: 0; align-items: stretch; }
  .markets-split .col { display: contents; }
}
.market { break-inside: avoid; margin: 0 0 16px; }
.market h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); border-radius: 13px 13px 0 0; background: var(--surface-2); font: 600 18px var(--cond); }
.tip-l:hover::after, .tip-l:focus::after { left: 0; right: auto; }
.market h3 > span:first-child { flex: 1; min-width: 0; }
.market h3 .margin { flex: none; font: 500 13px var(--body); color: var(--muted); }
.market table td { white-space: normal; }
.market table td:first-child, .market table th:first-child { width: 100%; }
.market table td + td { white-space: nowrap; text-align: right; font: 600 18px var(--cond); font-variant-numeric: tabular-nums; }
.market table thead th { font-size: 12px; text-align: right; }
.market table td.open { color: var(--muted); font-weight: 500; }
.market table td.down { color: var(--accent); }
.market table td.up { color: var(--red); }
.market table td.down::after, .market table td.up::after { margin-left: 4px; font-size: 10px; vertical-align: 2px; }
.market table td.down::after { content: "▼"; }
.market table td.up::after { content: "▲"; }
.market table td.prob span { display: inline-block; min-width: 68px; padding: 0 7px; border-radius: 6px; background: linear-gradient(90deg, var(--accent-soft) var(--p), transparent var(--p)); font: 500 15px/24px var(--body); color: var(--muted); }
.market.collapsed tr.extra { display: none; }
.market .more { display: block; width: 100%; padding: 9px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 13px 13px; background: none; color: var(--accent); font: 600 15px var(--body); cursor: pointer; transition: background .15s; }
.market .more:hover { background: var(--accent-soft); }
.chart-btn { flex: none; padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent); font: 600 13px var(--body); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chart-btn:hover, .chart-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chart { padding: 12px 14px 4px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg text { fill: var(--muted); font-size: 11px; }
.chart svg .grid { stroke: var(--line); stroke-width: 1; }
.chart svg path { fill: none; stroke-width: 2; stroke-linejoin: round; transition: stroke-dashoffset 1s ease; }
.chart svg circle { animation: fade .4s ease .7s both; }
@keyframes fade { from { opacity: 0; } }
.chart ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 8px 0; padding: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart li span { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; }
.chart p { margin: 0 0 8px; }
details.pairing > summary, details.more > summary { margin: 10px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
details.pairing .card { padding: 16px; }
details.pairing .card > .muted { margin: 0 0 12px; }

/* ---------- fichas de equipo y jugador ---------- */
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin-bottom: 16px; padding: 18px 20px; }
.profile .crest, .profile .face { width: 84px; height: 84px; margin: 0; flex: none; }
.profile-main { flex: 1 1 240px; min-width: 0; }
.profile h2 { margin: 0 0 4px; font: 700 clamp(28px, 5vw, 42px)/1.05 var(--cond); }
.profile p { margin: 0; color: var(--muted); }
.profile p a { color: var(--accent); font-weight: 600; text-decoration: none; }
.form { display: flex; align-items: center; gap: 5px; }
.form small { margin-right: 4px; font-size: 13px; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 30px; }
.figures div { padding: 12px 14px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.figures dt { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.figures dd { margin: 2px 0 0; font: 700 30px/1.1 var(--cond); font-variant-numeric: tabular-nums; }
.figures + .muted { margin: -18px 0 22px; }
.figures dd small { display: block; font: 500 13px/1.3 var(--body); color: var(--muted); }
.results ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; list-style: none; margin: 0 0 26px; padding: 0; }
.results li a { display: flex; align-items: center; gap: 12px; height: 100%; padding: 11px 14px; text-decoration: none; font-weight: 600; transition: transform .15s, border-color .15s; }
.results li a:hover { transform: translateY(-2px); border-color: var(--accent); }
.results li small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.results .crest, .results .face { width: 36px; height: 36px; margin: 0; flex: none; }

@media (max-width: 600px) {
  main { padding: 16px 14px 36px; }
  .top-in { padding: 13px 14px; }
  .brand { font-size: 26px; }
  .brand small { display: none; }
  .search { flex-basis: 100%; max-width: none; order: 3; }
  .tabs { margin: -10px -14px 18px; padding: 8px 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip, .chips .sep { flex: none; }
  .fx-grid { grid-template-columns: 1fr; }
  .hero { padding: 14px 12px 16px; border-radius: 16px; }
  .hero-mid { min-width: 84px; }
  .actions .btn { flex: 1 1 auto; min-height: 38px; padding: 6px 10px; font-size: 14px; }
  .actions form { flex: 1 1 auto; margin-left: 0; }
  .tl li { grid-template-columns: 1fr 44px 1fr; gap: 6px; }
  .tl .ev { font-size: 14px; gap: 6px; }
  .tl .min { min-width: 40px; }
  .profile .crest, .profile .face { width: 64px; height: 64px; }
  th, td { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
