/* =========================================================================
   Parley Assistant — Glassmorphism Futurista (Diseño #4)
   ========================================================================= */

:root {
    --bg-0: #070b18;
    --bg-1: #0b1226;
    --text: #eaf0ff;
    --muted: #8b96b8;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-2: rgba(255, 255, 255, 0.09);
    --glass-brd: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.18);
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --home: #34d3ff;
    --home-2: #2b8bff;
    --away: #ff5bb3;
    --away-2: #b34bff;
    --draw: #ffcf5c;
    --ok: #35e0a1;
    --danger: #ff6b6b;
    --radius: 22px;
    --radius-sm: 14px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --display: 'Sora', var(--font);
}

:root[data-theme="light"] {
    --bg-0: #eef2fb;
    --bg-1: #e3e9f7;
    --text: #10162b;
    --muted: #5c678a;
    --glass: rgba(255, 255, 255, 0.55);
    --glass-2: rgba(255, 255, 255, 0.7);
    --glass-brd: rgba(255, 255, 255, 0.8);
    --glass-hi: rgba(16, 22, 43, 0.06);
    --shadow: 0 20px 50px -24px rgba(40, 60, 120, 0.35);
}

/* Modo negro: fondo casi negro puro (no el azul/morado del modo oscuro
   normal). Acentos propios —ámbar apagado y verde azulado— pensados para
   tener contraste sobre negro sin competir con los colores de equipo
   (--home/--away/--draw), que se mantienen iguales en los tres modos. */
:root[data-theme="black"] {
    --bg-0: #050506;
    --bg-1: #0b0b0d;
    --text: #f2f2f5;
    --muted: #8f8f98;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-2: rgba(255, 255, 255, 0.075);
    --glass-brd: rgba(255, 255, 255, 0.1);
    --glass-hi: rgba(255, 255, 255, 0.16);
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
    --accent-a: #c9a24b;
    --accent-b: #3d7a68;
}
:root[data-theme="black"] .bg-aurora {
    background:
        radial-gradient(1100px 750px at 12% -10%, rgba(201, 162, 75, 0.10), transparent 60%),
        radial-gradient(900px 700px at 92% 8%, rgba(61, 122, 104, 0.12), transparent 55%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
:root[data-theme="black"] .orb-a { background: var(--accent-a); opacity: 0.32; }
:root[data-theme="black"] .orb-b { background: var(--accent-b); opacity: 0.28; }
:root[data-theme="black"] .orb-c { background: #55555c; opacity: 0.18; }

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-0);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center-block { display: block; text-align: center; }
code { font-family: ui-monospace, monospace; background: var(--glass); padding: 2px 7px; border-radius: 7px; }

/* ---- Fondo aurora ------------------------------------------------------ */
.bg-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
    radial-gradient(1200px 800px at 15% -10%, rgba(43, 139, 255, 0.18), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(179, 75, 255, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1)); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 18s ease-in-out infinite; }
.orb-a { width: 460px; height: 460px; background: #2b8bff; top: -120px; left: -80px; }
.orb-b { width: 380px; height: 380px; background: #b34bff; bottom: -140px; right: -60px; animation-delay: -6s; }
.orb-c { width: 300px; height: 300px; background: #ff5bb3; top: 40%; left: 55%; animation-delay: -11s; opacity: 0.3; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -40px) scale(1.08); } }

/* ---- Glass primitives -------------------------------------------------- */
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--shadow);
}
.glass-soft {
    background: var(--glass-2);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ---- Topbar ------------------------------------------------------------ */
.topbar {
    position: sticky; top: 12px; z-index: 40;
    margin: 12px 16px; padding: 10px 16px;
    display: flex; align-items: center; gap: 16px;
    border-radius: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
    background: linear-gradient(135deg, var(--home-2), var(--away-2)); color: #fff; box-shadow: 0 8px 20px -6px var(--home-2); }
.brand-text b { background: linear-gradient(90deg, var(--home), var(--away)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: var(--muted); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 0.9rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.pill { padding: 7px 13px; font-size: 0.8rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-brd);
    background: var(--glass); color: var(--text); cursor: pointer; transition: 0.2s; }
.icon-btn:hover { background: var(--glass-hi); transform: translateY(-2px); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
    background: linear-gradient(135deg, var(--away-2), var(--home-2)); color: #fff; }
.menu-toggle { display: none; }

/* ---- Shell / Sidebar --------------------------------------------------- */
.shell { display: grid; grid-template-columns: 250px 1fr; gap: 18px; padding: 4px 16px 40px; align-items: start; }
.sidebar { position: sticky; top: 92px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
    color: var(--muted); font-weight: 600; font-size: 0.9rem; transition: 0.18s; }
.nav-item i { width: 20px; text-align: center; }
.nav-item:hover { background: var(--glass-2); color: var(--text); }
.nav-item.is-active { color: var(--text); background: linear-gradient(90deg, rgba(52, 211, 255, 0.18), rgba(179, 75, 255, 0.14));
    border: 1px solid var(--glass-brd); }
.sidebar-foot { margin-top: 10px; padding: 12px; display: flex; align-items: center; gap: 11px; font-size: 0.78rem; }
.sidebar-foot small { display: block; color: var(--muted); }
.engine-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(53, 224, 161, 0.6);
    animation: pulse 2.2s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(53, 224, 161, 0.5); } 70% { box-shadow: 0 0 0 9px rgba(53, 224, 161, 0); } 100% { box-shadow: 0 0 0 0 rgba(53, 224, 161, 0); } }

.content { min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.app-footer { padding: 0 16px 24px 284px; color: var(--muted); font-size: 0.76rem; text-align: center; }
.app-footer span { padding: 0 5px; color: var(--home); }

/* ---- Page / sections --------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.9rem; }
.source-tag { padding: 8px 14px; font-size: 0.82rem; display: flex; align-items: center; gap: 8px; }
.source-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.section-head h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.section-head h2 i { color: var(--home); }

/* ---- Match cards grid -------------------------------------------------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.match-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; transition: 0.28s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
/* El buscador global marca [hidden] en los elementos filtrados, pero
   cualquier regla de "display" del propio componente (ej. .match-card,
   .tg-row) le gana en cascada al UA stylesheet de [hidden] — sin esta regla
   el atributo se aplicaba pero no ocultaba nada visualmente. */
[hidden] { display: none !important; }
.match-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(52,211,255,.08), transparent 40%); opacity: 0; transition: 0.3s; }
.match-card:hover { transform: translateY(-6px); border-color: var(--glass-hi); box-shadow: 0 30px 60px -25px rgba(43, 139, 255, 0.5); }
.match-card:hover::before { opacity: 1; }
.mc-top { display: flex; justify-content: space-between; align-items: center; }
.mc-round { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.conf-chip { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; display: inline-flex; gap: 5px; align-items: center; }
.conf-high { background: rgba(53, 224, 161, 0.16); color: var(--ok); }
.conf-mid { background: rgba(255, 207, 92, 0.16); color: var(--draw); }
.conf-low { background: rgba(255, 107, 107, 0.16); color: var(--danger); }
.conf-live { background: rgba(255, 91, 91, 0.16); color: var(--danger); }
.conf-finished { background: rgba(255,255,255,0.08); color: var(--muted); }
.fa-fade { animation: parley-fade 1.6s ease-in-out infinite; }
@keyframes parley-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.mc-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mc-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mc-logo { width: 52px; height: 52px; }
.mc-name { font-weight: 700; font-size: 0.95rem; }
.mc-vs { text-align: center; color: var(--muted); font-weight: 800; font-family: var(--display); }
.mc-vs small { display: block; font-weight: 600; color: var(--text); font-size: 0.8rem; }
.mc-live-score { font-size: 1.3rem; color: var(--text); }
.prob-bar { height: 8px; border-radius: 20px; overflow: hidden; display: flex; background: var(--glass-2); }
.prob-bar span { display: block; height: 100%; }
.p-home { background: linear-gradient(90deg, var(--home), var(--home-2)); }
.p-draw { background: var(--draw); }
.p-away { background: linear-gradient(90deg, var(--away-2), var(--away)); }
.prob-legend { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.prob-legend .lead { color: var(--text); }
.mc-foot { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); gap: 8px; }
.mc-foot span { display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Dashboard columns ------------------------------------------------- */
.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-list { padding: 8px; display: flex; flex-direction: column; }
.mini-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 13px; transition: 0.18s; }
.mini-row:hover { background: var(--glass-2); }
.mini-teams { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.88rem; }
.mini-logo { width: 26px; height: 26px; }
.mini-prob { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.mini-list-plain { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mini-list-plain .mini-row { padding: 10px 4px; }
.rank-num { width: 20px; color: var(--muted); font-weight: 700; font-size: 0.8rem; }

/* ---- Table ------------------------------------------------------------- */
.table-glass { padding: 8px 6px; overflow-x: auto; }
.tg-head, .tg-row { display: grid; grid-template-columns: 34px 1fr 40px 34px 34px 34px 52px 48px; align-items: center; gap: 4px;
    padding: 9px 12px; font-size: 0.85rem; }
.tg-head { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.tg-row { border-radius: 11px; transition: 0.15s; }
.tg-row:hover { background: var(--glass-2); }
.tg-row.is-top .tg-pos { color: var(--home); font-weight: 800; }
.tg-team { display: flex; align-items: center; gap: 9px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-head .tg-team { justify-content: flex-start; }
.tg-head span, .tg-row span:not(.tg-team) { text-align: center; }
.tg-pts { font-weight: 800; color: var(--text); }
.pt-head, .pt-row { display: grid; grid-template-columns: 1fr 44px 60px 84px 60px 108px; align-items: center; gap: 4px;
    padding: 10px 12px; }
.pt-head { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.pt-row { border-radius: 11px; transition: 0.15s; }
.pt-row:hover { background: var(--glass-2); }
.pt-head span:not(.tg-team), .pt-row span:not(.tg-team) { text-align: center; }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* ---- Match analysis: hero --------------------------------------------- */
.back-link { color: var(--muted); font-weight: 600; font-size: 0.88rem; display: inline-flex; gap: 8px; align-items: center; width: fit-content; }
.back-link:hover { color: var(--text); }
.match-hero { padding: 26px; display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; }
.match-hero::after { content: ''; position: absolute; top: -60%; left: 50%; width: 60%; height: 200%; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(52, 211, 255, 0.12), transparent 60%); pointer-events: none; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.hero-meta i { color: var(--home); margin-right: 5px; }
.hero-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-logo { width: 96px; height: 96px; filter: drop-shadow(0 12px 24px rgba(0,0,0,0.4)); }
.hero-team h2 { font-size: 1.3rem; text-align: center; }
.tag-local, .tag-visit { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; padding: 4px 11px; border-radius: 20px; }
.tag-local { background: rgba(52, 211, 255, 0.16); color: var(--home); }
.tag-visit { background: rgba(255, 91, 179, 0.16); color: var(--away); }
.hero-center { text-align: center; }
.hero-score-hint { font-family: var(--display); font-size: 2.6rem; font-weight: 800;
    background: linear-gradient(90deg, var(--home), var(--away)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-score-hint-sm { font-size: 1.4rem; }
.hero-real-score { font-family: var(--display); font-size: 2.6rem; font-weight: 800; color: var(--text); }
.hero-live-badge { color: var(--danger); font-weight: 700; }
.hero-facts { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 0.84rem; color: var(--muted); }
.hero-facts i { color: var(--home); margin-right: 6px; }

/* ---- Comparativa en vivo ------------------------------------------------ */
.live-compare-grid { display: flex; flex-direction: column; gap: 12px; }
.lc-row { display: grid; grid-template-columns: 110px 1fr 2fr 1fr; gap: 12px; align-items: center;
    padding: 12px 16px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-brd); }
.lc-row b { text-align: center; font-family: var(--display); }
.lc-label { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.lc-pred { font-size: 0.78rem; color: var(--muted); }
@media (max-width: 640px) {
    .lc-row { grid-template-columns: 1fr; text-align: center; gap: 4px; }
}

/* ---- Panels grid ------------------------------------------------------- */
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel-wide { grid-column: 1 / -1; }
.panel-title { font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.panel-title i { color: var(--home); }

/* Prediction donut */
.pred-main { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut-wrap { position: relative; width: 200px; height: 200px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-family: var(--display); font-size: 1.9rem; display: block; }
.donut-center small { color: var(--muted); font-weight: 700; }
.pred-legend { list-style: none; display: flex; flex-direction: column; gap: 12px; min-width: 160px; }
.pred-legend li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; }
.pred-legend b { margin-left: auto; }
.sw { width: 12px; height: 12px; border-radius: 4px; }
.sw-home { background: var(--home); } .sw-draw { background: var(--draw); } .sw-away { background: var(--away); }
.confidence-box { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.stars { color: var(--draw); font-size: 1.05rem; margin-top: 4px; }
.conf-num { font-family: var(--display); font-size: 1.7rem; font-weight: 800; }

/* Scorelines */
.score-main { font-family: var(--display); font-size: 2.4rem; font-weight: 800; text-align: center;
    background: linear-gradient(90deg, var(--home), var(--away)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-list { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.score-list li { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 12px; font-size: 0.86rem; }
.score-tag { font-weight: 800; font-family: var(--display); }
.mini-bar { height: 7px; border-radius: 10px; background: var(--glass-2); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--home), var(--home-2)); border-radius: 10px; }
.score-list b { text-align: right; }

/* AI narrative */
.ai-panel { background: linear-gradient(135deg, rgba(52,211,255,0.05), rgba(179,75,255,0.05)), var(--glass); }
.ai-text { font-size: 1.02rem; line-height: 1.7; }
.ai-signature { display: flex; align-items: center; gap: 9px; font-size: 0.78rem; color: var(--muted); }

/* ---- Factor cards ------------------------------------------------------ */
.factors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.factor-card { padding: 16px; display: flex; flex-direction: column; gap: 13px; transition: 0.2s; }
.factor-card:hover { transform: translateY(-3px); border-color: var(--glass-hi); }
.fc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.9rem; }
.fc-weight { font-size: 0.72rem; color: var(--home); background: rgba(52,211,255,0.14); padding: 3px 9px; border-radius: 20px; }
.fc-compare { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.fc-side { text-align: center; opacity: 0.55; transition: 0.2s; }
.fc-side.win { opacity: 1; }
.fc-side b { font-family: var(--display); font-size: 1.2rem; display: block; }
.fc-side small { color: var(--muted); font-size: 0.7rem; }
.fc-track { height: 8px; border-radius: 10px; overflow: hidden; display: flex; background: var(--glass-2); }
.fc-home { background: linear-gradient(90deg, var(--home), var(--home-2)); }
.fc-away { background: linear-gradient(90deg, var(--away-2), var(--away)); }
.fc-winner { font-size: 0.78rem; color: var(--muted); text-align: center; }
.fc-winner b { color: var(--text); }

/* Explain */
.explain-list { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.explain-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 0.85rem; }
.explain-bar { height: 8px; background: var(--glass-2); border-radius: 10px; position: relative; overflow: hidden; }
.eb-fill { position: absolute; top: 0; height: 100%; }
.eb-home { color: var(--home); }
.eb-away { color: var(--away); }
.eb-fill.eb-home { left: 0; background: linear-gradient(90deg, var(--home), var(--home-2)); }
.eb-fill.eb-away { right: 0; background: linear-gradient(90deg, var(--away-2), var(--away)); }
.explain-row b { text-align: right; font-family: var(--display); }

/* ---- Markets ----------------------------------------------------------- */
.markets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.market-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: 0.2s; }
.market-card:hover { transform: translateY(-3px); }
.mk-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.mk-yesno { display: flex; gap: 10px; }
.mk-yes, .mk-no { flex: 1; text-align: center; padding: 8px; border-radius: 12px; }
.mk-yes { background: rgba(53, 224, 161, 0.14); } .mk-yes b { color: var(--ok); }
.mk-no { background: rgba(255, 107, 107, 0.12); } .mk-no b { color: var(--danger); }
.mk-yes b, .mk-no b { font-family: var(--display); font-size: 1.25rem; display: block; }
.mk-yes small, .mk-no small { color: var(--muted); font-size: 0.72rem; }
.mk-single { font-family: var(--display); font-size: 1.8rem; font-weight: 800; }

/* ---- Form / injuries --------------------------------------------------- */
.form-team { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--glass-brd); }
.form-team:last-child { border-bottom: none; }
.form-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.form-dots { display: flex; gap: 7px; }
.form-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 0.78rem; color: #fff; }
.fd-v { background: linear-gradient(135deg, #35e0a1, #1eb87f); }
.fd-e { background: linear-gradient(135deg, #ffcf5c, #f0a83c); }
.fd-d { background: linear-gradient(135deg, #ff6b6b, #e0453d); }
.inj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inj-team { font-weight: 800; font-family: var(--display); display: block; margin-bottom: 10px; }
.inj-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 0.82rem; border-bottom: 1px solid var(--glass-brd); }
.inj-player { flex: 1; font-weight: 600; }
.inj-player small { color: var(--muted); font-weight: 500; }
.inj-status { font-size: 0.68rem; padding: 3px 8px; border-radius: 12px; font-weight: 700; }
.inj-alta { background: rgba(255,107,107,0.16); color: var(--danger); }
.inj-media { background: rgba(255,207,92,0.16); color: var(--draw); }
.inj-baja { background: rgba(139,150,184,0.16); color: var(--muted); }
.inj-prob { font-weight: 800; font-size: 0.78rem; }

/* ---- H2H --------------------------------------------------------------- */
.h2h-glass { padding: 6px; }
.h2h-row { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.h2h-row:hover { background: var(--glass-2); }
.h2h-row > span:first-child { text-align: right; }
.h2h-score { font-family: var(--display); font-weight: 800; padding: 4px 12px; background: var(--glass-2); border-radius: 10px; }
.h2h-row small { text-align: right; }

/* ---- Empty state ------------------------------------------------------- */
.empty-state { padding: 22px; text-align: center; color: var(--muted); font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-state i { font-size: 1.3rem; color: var(--home); }
.empty-state small { font-size: 0.78rem; opacity: 0.8; }

/* ---- Noticias y disponibilidad --------------------------------------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.news-card { overflow: hidden; display: flex; flex-direction: column; }
.news-image { width: 100%; height: 155px; object-fit: cover; background: var(--glass-2); }
.news-body { padding: 16px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; }
.news-body h2 { font-size: 1rem; line-height: 1.3; }
.news-body p { color: var(--muted); font-size: 0.84rem; }
.news-body .btn-ghost { margin-top: auto; }
.availability-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--glass-brd); }
.availability-row:last-child { border-bottom: 0; }
.availability-row span, .availability-row small { color: var(--muted); font-size: 0.82rem; }
a.availability-row:hover strong { color: var(--home); }

/* ---- Weights form ------------------------------------------------------ */
.weights-form { padding: 24px; display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.codex-preset { padding: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-color: rgba(52, 211, 255, 0.3); }
.codex-preset strong { font-family: var(--display); display: flex; gap: 8px; align-items: center; }
.codex-preset strong i { color: var(--home); }
.codex-preset p { color: var(--muted); font-size: 0.8rem; margin-top: 4px; max-width: 390px; }
.btn-codex { border: 0; cursor: pointer; white-space: nowrap; padding: 10px 14px; border-radius: 12px; color: #fff; font-weight: 700; font-family: var(--font); background: linear-gradient(135deg, var(--home-2), var(--away-2)); }
.btn-codex:hover { filter: brightness(1.12); transform: translateY(-1px); }
.opus-preset { border-color: rgba(124, 92, 255, 0.32); }
.opus-preset strong i { color: #a78bfa; }
.btn-opus { border: 0; cursor: pointer; white-space: nowrap; padding: 10px 14px; border-radius: 12px; color: #fff; font-weight: 700; font-family: var(--font); background: linear-gradient(135deg, #7c5cff, #a78bfa); }
.btn-opus:hover { filter: brightness(1.12); transform: translateY(-1px); }
.gemini-preset { border-color: rgba(66, 133, 244, 0.32); }
.gemini-preset strong i { color: #4285f4; }
.btn-gemini { border: 0; cursor: pointer; white-space: nowrap; padding: 10px 14px; border-radius: 12px; color: #fff; font-weight: 700; font-family: var(--font); background: linear-gradient(135deg, #4285f4, #ff6b9d); }
.btn-gemini:hover { filter: brightness(1.12); transform: translateY(-1px); }
.manual-preset { border-color: rgba(255, 207, 92, 0.32); }
.manual-preset strong i { color: var(--draw); }
.btn-manual { border: 1px solid rgba(255, 207, 92, 0.55); cursor: pointer; white-space: nowrap; padding: 10px 14px; border-radius: 12px; color: var(--draw); font-weight: 700; font-family: var(--font); background: rgba(255, 207, 92, 0.1); }
.btn-manual:hover { background: rgba(255, 207, 92, 0.18); transform: translateY(-1px); }
.wrow { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: 16px; }
.wrow label { font-weight: 600; font-size: 0.9rem; }
.wslider { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 10px; background: var(--glass-2); outline: none; }
.wslider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
    background: linear-gradient(135deg, var(--home), var(--home-2)); cursor: pointer; box-shadow: 0 4px 12px -2px var(--home-2); }
.wval { font-family: var(--display); font-weight: 800; text-align: right; }
.wtotal { color: var(--muted); font-size: 0.9rem; }
.wtotal b { color: var(--text); font-family: var(--display); }

/* ---- Mis resultados ------------------------------------------------------ */
.weights-form select, .weights-form input[type="text"] {
    background: var(--glass-2); border: 1px solid var(--glass-brd); border-radius: 10px;
    padding: 9px 12px; color: var(--text); font-family: var(--font); font-size: 0.9rem; outline: none;
}
.weights-form select:focus, .weights-form input[type="text"]:focus { border-color: var(--home); }
.bet-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.bet-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bet-head strong { font-family: var(--display); margin-right: auto; }
.bet-delete { margin-left: auto; }
.bet-delete .btn-ghost { color: var(--danger); padding: 7px 10px; }
.bet-compare { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bet-col { background: var(--glass-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column;
    gap: 4px; align-items: flex-start; position: relative; }
.bet-col b { font-family: var(--display); }
.bet-hit, .bet-miss { position: absolute; top: 10px; right: 10px; font-size: 0.9rem; }
.bet-hit { color: var(--ok); }
.bet-miss { color: var(--danger); }
@media (max-width: 860px) {
    .bet-compare { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .bet-compare { grid-template-columns: 1fr; }
}
.alert-ok { padding: 12px 18px; color: var(--ok); display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* ---- Buttons ----------------------------------------------------------- */
.btn-primary { border: none; cursor: pointer; padding: 12px 22px; border-radius: 14px; font-weight: 700; font-size: 0.9rem;
    color: #fff; background: linear-gradient(135deg, var(--home-2), var(--away-2)); box-shadow: 0 12px 28px -10px var(--home-2);
    display: inline-flex; gap: 9px; align-items: center; width: fit-content; transition: 0.2s; font-family: var(--font); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px var(--away-2); }
.btn-ghost { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--glass-brd); background: var(--glass);
    font-size: 0.82rem; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; color: var(--text); }
.btn-ghost:hover { background: var(--glass-hi); }

/* ---- Error ------------------------------------------------------------- */
.error-page { padding: 60px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.err-code { font-family: var(--display); font-size: 5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--home), var(--away)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 60; border-radius: 0 20px 20px 0;
        transform: translateX(-105%); transition: 0.3s; height: 100vh; overflow-y: auto; }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: grid; place-items: center; }
    .dash-columns { grid-template-columns: 1fr; }
    .inj-cols { grid-template-columns: 1fr; }
    .app-footer { padding-left: 16px; }
}
@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: 100%; margin-top: 4px; }
    .pill { display: none; }
    .hero-logo { width: 70px; height: 70px; }
    .hero-score-hint { font-size: 2rem; }
    .page-head h1 { font-size: 1.5rem; }
    .codex-preset { align-items: stretch; flex-direction: column; }
}
