/*! Míster · © 2026 edugrama. Todos los derechos reservados. */
:root, :root[data-theme="cesped"] {
  --pitch: #0d3526; --turf: #124330; --turf2: #185239; --turf3: #1f6246;
  --line: rgba(240, 245, 234, .14); --chalk: #f0f5ea; --mist: #a7c2b2;
  --acc: #ffd23a; --ink: #0d3526; --board: #0a2a1e; --glass: rgba(13, 53, 38, .92); --goal-bg: #1a4a33;
  --warn-bg: rgba(255, 210, 58, .1); --warn-bd: rgba(255, 210, 58, .35); --warn-tx: #ffe89a; --danger-tx: #ff8a86;
  --in: #b9ef7a; --out: #ff9f80; --gPOR: #ffd23a; --gDEF: #8ec5ff; --gMED: #b9ef7a; --gDEL: #ff9f80;
  --red: #ef3b36; --yel: #ffd23a; --r: 16px;
  --fd: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --fb: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="noche"] {
  --pitch: #0b1020; --turf: #141b30; --turf2: #1b2440; --turf3: #253056; --line: rgba(226, 232, 255, .13);
  --chalk: #eef1fb; --mist: #9ea9c9; --acc: #4fd1c5; --ink: #06201d; --board: #080c18; --glass: rgba(11, 16, 32, .92); --goal-bg: #16303a;
  --warn-bg: rgba(79, 209, 197, .1); --warn-bd: rgba(79, 209, 197, .35); --warn-tx: #b6f1ec;
}
:root[data-theme="granate"] {
  --pitch: #2b0c15; --turf: #3b121e; --turf2: #4a1826; --turf3: #5d2133; --line: rgba(255, 235, 240, .14);
  --chalk: #fbeef1; --mist: #d8aab4; --acc: #f2c14e; --ink: #2b0c15; --board: #1f070e; --glass: rgba(43, 12, 21, .92); --goal-bg: #4a2a1c;
}
:root[data-theme="oceano"] {
  --pitch: #06293a; --turf: #0b384d; --turf2: #10475f; --turf3: #175873; --line: rgba(232, 246, 251, .14);
  --chalk: #eaf6fb; --mist: #9dc5d5; --acc: #ff8a3d; --ink: #06293a; --board: #041d29; --glass: rgba(6, 41, 58, .92); --goal-bg: #2a3a33;
  --warn-bg: rgba(255, 138, 61, .1); --warn-bd: rgba(255, 138, 61, .35); --warn-tx: #ffd2b3;
}
:root[data-theme="claro"] {
  --pitch: #eef2ea; --turf: #ffffff; --turf2: #f1f5ee; --turf3: #e1e9dc; --line: rgba(16, 40, 28, .13);
  --chalk: #13261c; --mist: #5d7266; --acc: #17804a; --ink: #ffffff; --board: #ffffff; --glass: rgba(255, 255, 255, .94); --goal-bg: #eef8e6;
  --warn-bg: #fff6d6; --warn-bd: #f0d27a; --warn-tx: #6b5200; --danger-tx: #c62828;
  --in: #2e7d32; --out: #c0392b; --gPOR: #a67c00; --gDEF: #1565c0; --gMED: #2e7d32; --gDEL: #c0392b;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--pitch); color: var(--chalk); font: 16px/1.45 var(--fb); }
body { min-height: 100dvh; overscroll-behavior-y: contain; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.wrap { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(120px + env(safe-area-inset-bottom)); }
.muted { color: var(--mist); }
.card h2.mt { margin-top: 18px; margin-bottom: 8px; } .small { font-size: 14px; } .center { text-align: center; } .pad { padding: 28px 8px; } .mt { margin-top: 16px; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { flex: 1; margin: 0; font: 700 21px/1.1 var(--fd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { flex: 1; display: flex; align-items: center; gap: 10px; font: 700 26px/1 var(--fd); letter-spacing: .01em; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; cursor: pointer; text-decoration: none; }
.icon-btn:active { background: var(--turf2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--turf3); overflow: hidden; padding: 0; font: 700 18px var(--fd); cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--fb); color: var(--mist); }
.live-tag.running { color: var(--chalk); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--turf2); font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary, .btn.go { background: var(--acc); color: var(--ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger-tx); border-color: rgba(239, 59, 54, .4); background: transparent; }
.btn.danger.solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { min-height: 54px; font-size: 17px; }
.btn.xl { min-height: 64px; font: 700 24px var(--fd); letter-spacing: .01em; border-radius: 16px; }
.btn.full { width: 100%; }
.btn.pause { background: var(--chalk); color: var(--ink); border-color: transparent; }
.btn.ic { flex-direction: column; gap: 2px; min-width: 72px; min-height: 64px; font-size: 12px; border-radius: 16px; }
.btn.google { background: #fff; color: #1f1f1f; border: 0; min-height: 54px; padding: 0 22px; font-size: 17px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .35; pointer-events: none; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* Tarjetas y listas */
.card { display: block; background: var(--turf); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; text-decoration: none; }
.card h2, h2.group-h, h2.mt { margin: 0; font: 700 20px/1.1 var(--fd); }
h2.group-h { margin: 22px 2px 8px; color: var(--mist); font-size: 18px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.count { color: var(--mist); font-weight: 600; margin-left: 4px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list .card { margin: 0; }
.team { display: flex; align-items: center; gap: 14px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pick, .prow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--turf2); border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 54px; }
.prow.static { cursor: default; }
.pick:active, .prow:active { border-color: var(--acc); }
.prow.check input { width: 22px; height: 22px; accent-color: var(--acc); margin: 0; flex: none; }
.grow { flex: 1; min-width: 0; }
.grow strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow small { display: block; color: var(--mist); font-size: 13px; }
.dorsal { min-width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--pitch); font: 700 20px var(--fd); }
.pos-tag, .tag, .fbadge { flex: none; font: 700 13px var(--fd); padding: 3px 8px; border-radius: 6px; background: var(--pitch); }
.fbadge { font-size: 16px; padding: 6px 8px; color: var(--acc); }
.g-POR { color: var(--gPOR); } .g-DEF { color: var(--gDEF); } .g-MED { color: var(--gMED); } .g-DEL { color: var(--gDEL); }
.lrow { display: flex; gap: 6px; align-items: stretch; }
.lrow .prow { flex: 1; }
.star { width: 54px; flex: none; border-radius: 12px; border: 0; background: var(--turf2); color: var(--mist); display: grid; place-items: center; cursor: pointer; }
.star.on { color: var(--acc); }

/* Segmentado, chips */
.seg { display: flex; background: var(--turf); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin: 12px 0; }
.seg.tight { margin-top: 6px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: none; font-weight: 600; color: var(--mist); cursor: pointer; }
.seg button.on { background: var(--turf3); color: var(--chalk); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--turf); font: 700 19px var(--fd); cursor: pointer; }
.chip.on { background: var(--acc); color: var(--ink); border-color: transparent; }

/* Formularios */
label, .field-l { display: block; font-size: 14px; color: var(--mist); margin: 14px 0 0; font-weight: 500; }
input:not([type=checkbox]):not([type=color]), select { display: block; width: 100%; margin-top: 6px; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--pitch); color: var(--chalk); font-size: 16px; outline: none; }
input:focus, select:focus { border-color: var(--acc); }
input[type=color] { display: block; margin-top: 6px; width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--pitch); padding: 4px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--chalk); font-size: 16px; margin-top: 18px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--acc); margin: 0; }
.banner { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-tx); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.banner a { color: var(--acc); font-weight: 600; }
.form label:first-child { margin-top: 0; }

/* Equipo */
.hero-team { display: flex; gap: 16px; align-items: center; margin-top: 4px; }
.hero-team label:first-child { margin-top: 0; }
.shirt-prev { display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 14px 10px; border-radius: 18px; background: radial-gradient(circle at 50% 70%, var(--turf3), transparent 70%); flex: none; }
.shirt { display: block; flex: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.shirt-num { font: 700 25px var(--fd); fill: #fff; stroke: rgba(0, 0, 0, .7); stroke-width: 3px; paint-order: stroke; }

/* Campo */
.pitch { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; margin: 12px 0; background: repeating-linear-gradient(180deg, #2a7a50 0 10%, #256f48 10% 20%); box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.pl { position: absolute; inset: 4%; border: 2px solid rgba(255, 255, 255, .55); border-radius: 3px; }
.pl i { position: absolute; }
.pl .half { left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, .55); }
.pl .circle { left: 50%; top: 50%; width: 28%; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, .55); border-radius: 50%; transform: translate(-50%, -50%); }
.pl .box { left: 24%; right: 24%; height: 14%; border: 2px solid rgba(255, 255, 255, .55); }
.pl .box.bt-t { top: -2px; } .pl .box.bt-b { bottom: -2px; }
.slot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 0; width: 70px; cursor: pointer; }
div.slot { cursor: default; }
.slot .empty { width: 42px; height: 42px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .6); display: grid; place-items: center; font: 700 24px var(--fd); background: rgba(0, 0, 0, .15); }
.slot .nm { font: 700 13px/1.2 var(--fd); background: rgba(8, 30, 20, .75); padding: 1px 6px; border-radius: 6px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .nm.dim { opacity: .75; font-weight: 600; }
.cardi { display: inline-block; width: 14px; height: 20px; border-radius: 3px; flex: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.cardi.y { background: var(--yel); } .cardi.r { background: var(--red); }
.cardi.sm { width: 11px; height: 15px; }
.cardi.mini { position: absolute; top: 0; right: 12px; width: 9px; height: 13px; }

/* Marcador */
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 18px 12px 16px; border-radius: 24px; background: var(--board); border: 1px solid var(--line); margin-top: 6px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.bt { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font: 700 17px/1.1 var(--fd); min-width: 0; }
.bt span { overflow-wrap: anywhere; }
.bs { display: flex; align-items: center; gap: 6px; font: 700 68px/1 var(--fd); font-variant-numeric: tabular-nums; }
.bs i { font-style: normal; color: var(--mist); font-size: 44px; transform: translateY(-4px); }
.bclock { grid-column: 1 / -1; text-align: center; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.clk { font: 700 52px/1 var(--fd); color: var(--acc); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.board.paused .clk { animation: blink 1.2s steps(2, start) infinite; }
.board.scheduled .clk, .board.finished .clk { color: var(--chalk); }
.st { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font: 600 15px var(--fb); color: var(--mist); }
.board.running .st { color: var(--chalk); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); display: inline-block; flex: none; animation: pulse 1.4s infinite; }
.bar { height: 5px; border-radius: 5px; background: var(--line); margin: 10px auto 0; max-width: 300px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); transition: width .25s linear; }
.psub { font-size: 13px; color: var(--mist); margin-top: 6px; font-variant-numeric: tabular-nums; }
.meta { text-align: center; color: var(--mist); font-size: 14px; margin: 8px 0 12px; }

/* Controles */
.ctrl { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.evbtns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 4px; }
.eb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border-radius: 16px; border: 1px solid var(--line); background: var(--turf); cursor: pointer; padding: 6px 2px; }
.eb span:last-child { font: 600 12.5px var(--fb); }
.eb .e-ic { font-size: 24px; line-height: 1; }
.eb .cardi { width: 16px; height: 23px; }
.eb.goal { background: var(--acc); color: var(--ink); border-color: transparent; }
.eb:active { transform: scale(.96); }
.eb:disabled { opacity: .35; }

/* Timeline */
.timeline { list-style: none; margin: 8px 0; padding: 4px 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-50%); }
.tl-ev { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; margin: 10px 0; position: relative; }
.tl-ev.own { cursor: pointer; }
.tl-min { grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; background: var(--pitch); border: 2px solid var(--line); border-radius: 999px; min-width: 42px; padding: 2px 6px; text-align: center; font: 700 16px var(--fd); }
.tl-card { grid-row: 1; display: flex; gap: 10px; align-items: center; background: var(--turf); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; min-width: 0; max-width: 100%; }
.tl-ev.l .tl-card { grid-column: 1; justify-self: end; flex-direction: row-reverse; text-align: right; }
.tl-ev.r .tl-card { grid-column: 3; justify-self: start; }
.tl-ic { flex: none; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.tl-tx { min-width: 0; }
.tl-t { font: 700 17px/1.15 var(--fd); }
.tl-s { font-size: 13px; color: var(--mist); overflow-wrap: anywhere; }
.tl-s .in, .tl-s .out { display: block; }
.tl-s .in { color: var(--in); } .tl-s .out { color: var(--out); }
.dor { font: 700 14px var(--fd); color: var(--chalk); }
.t-goal .tl-card, .t-goal_rival .tl-card { border-color: var(--acc); background: var(--goal-bg); }
.t-red .tl-card { border-color: rgba(239, 59, 54, .55); }
.tl-mark { text-align: center; margin: 16px 0; position: relative; z-index: 1; }
.tl-mark span { display: inline-block; background: var(--turf2); border: 1px solid var(--line); padding: 5px 14px; border-radius: 999px; font: 600 13.5px var(--fb); color: var(--mist); }
.tl-mark.final span { background: var(--chalk); color: var(--ink); border-color: transparent; }

/* Compartir */
.switch { position: relative; width: 52px; height: 30px; margin: 0; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--turf3); border: 1px solid var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--chalk); transition: transform .2s; }
.switch input:checked + span { background: var(--acc); }
.switch input:checked + span::after { transform: translateX(22px); background: var(--ink); }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.linkbox input { margin: 0 !important; min-height: 38px !important; font-size: 13px !important; color: var(--mist) !important; }

/* Lista de partidos */
.mcard { margin: 0; }
.mc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mist); }
.mc-live { display: inline-flex; align-items: center; gap: 6px; color: var(--chalk); }
.mc-live b { color: var(--acc); font: 700 17px var(--fd); font-variant-numeric: tabular-nums; }
.mc-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 8px; }
.mc-t { font: 700 19px/1.1 var(--fd); overflow-wrap: anywhere; }
.mc-t.r { text-align: right; }
.mc-s { font: 700 28px var(--fd); font-variant-numeric: tabular-nums; }
.mcard.running { border-color: rgba(255, 210, 58, .5); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--turf3); color: var(--chalk); }

/* Vacíos, login, splash */
.empty-state { text-align: center; padding: 40px 16px; }
.empty-state h2 { font: 700 26px/1.1 var(--fd); margin: 10px 0 6px; }
.empty-state p { color: var(--mist); margin: 0 auto 18px; max-width: 34ch; }
.es-art { display: inline-block; opacity: .9; transform: rotate(-6deg); }
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash svg { width: 64px; height: 64px; animation: pulse-s 1.2s ease-in-out infinite; }
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: repeating-linear-gradient(180deg, var(--turf) 0 12.5%, var(--pitch) 12.5% 25%); position: relative; }
.login-pitch svg { width: 88px; height: 88px; }
.login h1 { font: 700 64px/1 var(--fd); margin: 16px 0 8px; }
.login p { color: var(--mist); max-width: 30ch; margin: 0 0 28px; font-size: 17px; }

/* FAB */
.fab { position: fixed; right: max(18px, calc(50% - 262px)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 20px; border: 0; background: var(--acc); color: var(--ink); display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 0, 0, .4); cursor: pointer; z-index: 30; }
.fab:active { transform: scale(.94); }

/* Modales */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(3, 15, 10, .6); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.modal-back.in { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--turf); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(30px); transition: transform .18s ease-out; }
.modal-back.in .sheet { transform: none; }
.grab { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 2px 0 12px; font: 700 24px/1.1 var(--fd); }
.sheet h3 small { display: block; font: 400 14px var(--fb); color: var(--mist); margin-top: 2px; }
.sheet .confirm { font-size: 17px; margin: 8px 0 4px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.actions [data-del] { margin-right: auto; }
.picklist { display: flex; flex-direction: column; gap: 6px; }
.menu .mi { display: block; width: 100%; text-align: left; padding: 15px 14px; border-radius: 12px; background: var(--turf2); border: 0; margin-bottom: 6px; font-weight: 600; cursor: pointer; }
.menu .mi.danger { color: var(--danger-tx); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: #10221a; color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 600; display: flex; gap: 14px; align-items: center; z-index: 60; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { background: none; border: 0; color: #ffd23a; font-weight: 700; cursor: pointer; padding: 4px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: .35; } }
@keyframes pulse-s { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); } }
@media (max-width: 380px) {
  .evbtns { gap: 6px; } .eb span:last-child { font-size: 11px; }
  .bs { font-size: 56px; } .clk { font-size: 46px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Instalación */
.install { display: flex; align-items: center; gap: 10px; background: var(--turf2); border: 1px solid rgba(255, 210, 58, .35); border-radius: 14px; padding: 10px 6px 10px 14px; margin: 8px 0; }
.install strong, .install small { white-space: normal; }
.install .x { width: 34px; height: 34px; color: var(--mist); font-size: 16px; }
.install-login { margin-top: 14px; color: var(--mist); border-color: transparent; }
.steps { margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.6; }
.steps li { margin: 6px 0; }

/* Selector de equipo y menú inferior */
.team-sw { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 12px; text-align: left; cursor: pointer; }
.team-sw:active { background: var(--turf2); }
.team-sw strong { font: 700 21px/1.1 var(--fd); }
.team-sw svg:last-child { color: var(--mist); flex: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; padding: 6px 10px calc(4px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--mist); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.tabbar a.on { color: var(--ink); background: var(--acc); }
.page-h { margin: 8px 0 4px; }
.page-t { font: 700 26px/1.1 var(--fd); margin: 0; }
.mt8 { margin-top: 8px; }
.row-btns { display: flex; gap: 6px; }
#toast { bottom: calc(100px + env(safe-area-inset-bottom)); }

/* Asistente de nuevo partido */
.wiz { list-style: none; display: flex; gap: 6px; padding: 0; margin: 6px 0 4px; }
.wiz li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--turf); color: var(--mist); font-size: 14px; font-weight: 600; }
.wiz li b { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--turf3); color: var(--chalk); font: 700 15px var(--fd); }
.wiz li.on { color: var(--chalk); background: var(--turf2); box-shadow: inset 0 0 0 1px var(--acc); }
.wiz li.on b, .wiz li.done b { background: var(--acc); color: var(--ink); }
.wiz-foot { margin-top: 16px; }
.wiz-foot.two { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.load-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.chip.sm { font-size: 15px; padding: 7px 12px; }
@media (max-width: 340px) { .wiz li span { display: none; } .wiz li { justify-content: center; } }

/* Histórico */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; text-align: center; }
.stats b { display: block; font: 700 30px/1 var(--fd); }
.stats span { font-size: 12.5px; color: var(--mist); }
.mc-tags { display: inline-flex; gap: 6px; align-items: center; }
.res { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 16px var(--fd); }
.res-G { background: #3fb86b; color: #06210f; } .res-E { background: var(--mist); color: var(--ink); } .res-P { background: var(--red); color: #fff; }

/* Varios */
.email-chip { display: table; margin-left: auto !important; margin-right: auto !important; background: var(--turf2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; color: var(--chalk) !important; font-weight: 600; margin-bottom: 20px !important; }
.demo-note { color: var(--mist); margin-top: 16px !important; max-width: 32ch; }
.check-row.inline { margin: 0 auto 0 0; font-size: 14px; }
.actions .check-row.inline input { width: 20px; height: 20px; }

/* Menú de 4 + créditos */
.tabbar .tabs { display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 560px; }
.tabbar .tabs a { max-width: none; }
.credit { font-size: 11.5px; color: var(--mist); text-align: center; letter-spacing: .02em; padding-top: 3px; }
.credit b { color: var(--chalk); font-weight: 600; }
.foot { padding: 0 0 calc(18px + env(safe-area-inset-bottom)); margin-top: -90px; position: relative; }
.login + .foot { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; }

.pal { color: var(--mist); }
.login-pal { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.tphoto { border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--line); }
.adm-tag { background: var(--acc); color: var(--ink); border-radius: 6px; padding: 0 5px; font-weight: 700; font-size: 11px; }

/* Temas */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.th { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--turf2); cursor: pointer; font-weight: 600; }
.th.on { border-color: var(--acc); }
.th .sw { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(128, 128, 128, .4); }
.th .sw i { width: 20px; height: 20px; border-radius: 50%; }

/* Camisetas */
.shirt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 6px; }
.sg { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; border: 2px solid transparent; background: var(--turf2); cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--mist); }
.sg.on { border-color: var(--acc); color: var(--chalk); }

/* Foto del equipo */
.photo-card { position: relative; border-radius: 18px; overflow: hidden; background: var(--turf); border: 1px solid var(--line); margin-top: 6px; }
.photo-card img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.photo-empty { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--mist); font-size: 14px; }
.photo-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.photo-actions .btn { background: var(--glass); }
.photo-pick { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.photo-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }

/* Posiciones */
.poschips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 6px; }
.pchip { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 7px 9px; border-radius: 10px; border: 2px solid var(--line); background: var(--pitch); color: var(--mist); cursor: pointer; text-align: left; }
.pchip b { font: 700 16px var(--fd); }
.pchip span { font-size: 11.5px; line-height: 1.2; color: var(--mist); }
.pchip.on { border-color: currentColor; background: var(--turf2); }
.pchip.main { box-shadow: 0 0 0 2px var(--acc); }
.pchip i { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--acc); }
.field-l small { font-weight: 400; }

/* Inicio */
.home-hero { position: relative; border-radius: 20px; overflow: hidden; margin-top: 6px; background: var(--turf); border: 1px solid var(--line); min-height: 120px; }
.home-hero img { display: block; width: 100%; height: 200px; object-fit: cover; }
.home-hero .hh-shirt { display: grid; place-items: center; padding: 18px 0 64px; background: radial-gradient(circle at 50% 40%, var(--turf3), transparent 70%); }
.hh-tx { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff; }
.hh-tx h2 { margin: 0; font: 700 28px/1.05 var(--fd); }
.hh-tx p { margin: 2px 0 0; font-size: 13.5px; opacity: .9; }
.stats .wide { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.streak { display: inline-flex; gap: 4px; }
.wdl { height: 8px; border-radius: 8px; overflow: hidden; gap: 0 !important; flex-wrap: nowrap !important; }
.wdl i { display: block; height: 100%; } .wdl .w { background: #3fb86b; } .wdl .d { background: var(--mist); } .wdl .l { background: var(--red); }
.rank { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 10px; }
.rk { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--turf2); font: 700 15px var(--fd); }
.rank li:first-child .rk { background: var(--acc); color: var(--ink); }
.rbar { display: block; height: 5px; border-radius: 5px; background: var(--line); margin-top: 4px; overflow: hidden; }
.rbar b { display: block; height: 100%; background: var(--acc); }
.rv { font: 700 20px var(--fd); min-width: 36px; text-align: right; }
.cc { display: inline-flex; align-items: center; gap: 4px; font: 700 16px var(--fd); margin-left: 6px; }
.tscroll { overflow-x: auto; margin: 10px -4px 6px; }
.stbl { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.stbl th { font-weight: 600; color: var(--mist); text-align: center; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.stbl th:first-child, .stbl td:first-child { text-align: left; position: sticky; left: 0; background: var(--turf); }
.stbl td { text-align: center; padding: 7px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stbl tr:last-child td { border-bottom: 0; }

/* Título fijo Edugrama Coach */
.top { flex-wrap: wrap; row-gap: 2px; }
.app-title { order: -1; width: 100%; text-align: center; font: 700 15px/1 var(--fd); letter-spacing: .16em; text-transform: uppercase; color: var(--acc); pointer-events: none; padding-bottom: 2px; }
@media (min-width: 760px) {
  .app-title { position: absolute; left: 50%; top: calc(50% + env(safe-area-inset-top) / 2); transform: translate(-50%, -50%); width: auto; font-size: 24px; padding: 0; }
}
.logo { width: 34px; height: 34px; border-radius: 10px; display: block; flex: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.login-pitch .logo { width: 112px; height: 112px; border-radius: 28px; }
.splash .logo { width: 88px; height: 88px; border-radius: 22px; animation: pulse-s 1.2s ease-in-out infinite; }
.login h1 { font-size: 52px; }

/* Tipo de partido */
.pill.tp { font-weight: 700; }
.tp-liga { background: #2a6df4; color: #fff; } .tp-copa { background: #b8860b; color: #fff; }
.tp-amistoso { background: #3fb86b; color: #06210f; } .tp-otro { background: var(--turf3); color: var(--chalk); }
.meta .pill { vertical-align: 1px; }
.filt { margin: 4px 0 8px; }

/* Calendario */
.dt-btn { justify-content: flex-start; margin-top: 6px; font-weight: 600; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-h strong { font: 700 20px var(--fd); }
.flip svg { transform: scaleX(-1); }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-g b { font-size: 12px; color: var(--mist); padding: 4px 0; }
.cd { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--turf2); font-weight: 600; cursor: pointer; }
.cd.today { box-shadow: inset 0 0 0 2px var(--mist); }
.cd.on { background: var(--acc); color: var(--ink); }
.time-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.time-row select { flex: 1; margin: 0 !important; font: 700 22px var(--fd) !important; text-align: center; }
.time-row b { font: 700 24px var(--fd); }

.app-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.at-mark { height: 22px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
@media (min-width: 760px) { .app-title { gap: 12px; } .at-mark { height: 38px; } }
.login-tools { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: flex; gap: 4px; }
.mi.lang-opt.on { box-shadow: inset 0 0 0 2px var(--acc); }
.seg button { padding: 0 4px; line-height: 1.15; overflow-wrap: anywhere; }
.seg.tight button { font-size: 14.5px; }

/* Equipo rival */
.rival-kit { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.rival-kit .shirt-prev { padding: 8px; }
.rival-kit label:first-child { margin-top: 0; }
.rival-add { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.rival-add input { margin-top: 0 !important; }
.rival-add .btn { flex: none; }

/* Barra de acciones fija (asistente y alineación) */
.actbar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 26; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom) / 3); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.wiz-foot.actbar { margin-top: 18px; }
.wiz-foot.two.actbar { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.wrap { padding-bottom: calc(205px + env(safe-area-inset-bottom)); }

/* Eventos en dos filas: nuestro equipo y rival */
.evbtns { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.evrow { display: flex; align-items: center; gap: 8px; background: var(--turf); border: 1px solid var(--line); border-radius: 16px; padding: 6px 8px 6px 10px; }
.evrow.them { border-color: rgba(214, 58, 58, .35); }
.evteam { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; flex: none; }
.evteam b { font: 700 11px/1.1 var(--fb); text-align: center; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evb { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; min-width: 0; }
.evb .eb { min-height: 52px; gap: 3px; border-radius: 12px; padding: 4px 2px; }
.evb .eb span:last-child { font-size: 11px; }
.evb .eb .e-ic { font-size: 19px; }
.evb .eb .cardi { width: 13px; height: 18px; }
.evb .eb svg { width: 20px; height: 20px; }

#toast { bottom: calc(172px + env(safe-area-inset-bottom)); }

/* Avisos arriba, para no tapar los botones ni la barra de acciones */
#toast { top: calc(74px + env(safe-area-inset-top)); bottom: auto; transform: translate(-50%, -14px); }
#toast.show { transform: translate(-50%, 0); }

/* Elección de rol */
.role-pick { padding: 18px 0; text-align: center; }
.role-pick h2 { font: 700 27px/1.15 var(--fd); margin: 6px 0 4px; }
.role-pick p { margin: 0 0 18px; }
.role-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; margin-bottom: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--turf); cursor: pointer; }
.role-card svg { flex: none; color: var(--acc); width: 30px; height: 30px; }
.role-card strong { display: block; font: 700 20px/1.1 var(--fd); }
.role-card small { color: var(--mist); font-size: 13.5px; }

/* Código del equipo */
.team-code { margin-top: 10px; text-align: center; }
.team-code span { display: inline-block; font: 700 32px/1 var(--fd); letter-spacing: .3em; padding: 12px 10px 12px 22px; border-radius: 14px; background: var(--pitch); border: 1px dashed var(--line); color: var(--acc); }

/* Tarjeta para compartir el equipo con las familias */
.followcard .fc-top { display: flex; align-items: center; gap: 10px; }
.followcard .fc-top svg:first-child { flex: none; color: var(--acc); }
.followcard strong { display: block; font: 700 18px/1.1 var(--fd); }
.followcard small { color: var(--mist); font-size: 13px; }
.followcard p { margin: 8px 0 0; }

/* Acciones de la vista pública */
.pub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.pub-actions .btn { min-height: 50px; }
.star.ok { color: #3fb86b; font: 700 22px var(--fd); }
.star { font: 700 20px var(--fd); }

/* Entrada por modo y campanita */
.login-entries { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.btn.google.ghost-g { background: transparent; color: var(--chalk); border: 1px solid var(--line); box-shadow: none; }
.btn.google.ghost-g svg { color: var(--acc); }
.bell { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--turf2); color: var(--mist); cursor: pointer; }
.bell.on { background: var(--acc); color: var(--ink); border-color: transparent; }
.mcard .mc-row { display: grid; text-decoration: none; }

/* Cambio rápido de modo (entrenador / seguidor) */
.mode-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--turf2); color: var(--chalk); font: 600 12.5px var(--fb); cursor: pointer; flex: none; }
.mode-chip svg { width: 17px; height: 17px; color: var(--acc); }
.mode-chip.fan svg { color: #8ec5ff; }
.mode-chip:active { transform: scale(.96); }
@media (max-width: 380px) { .mode-chip span { display: none; } .mode-chip { padding: 0 8px; } }
