/* Estilo "Marcador": granate del club, tipografía condensada para categorías y horas. */
:root {
  --accent: #70273A;
  --accent-dark: #4d1a28;
  --accent-soft: #F2E3E7;
  --ink: #1b1718;
  --ink-2: #3d3a3b;
  --muted: #6b6466;
  --muted-2: #7a7375;
  --line: #ECE6E4;
  --bg: #F3F0EE;
  --card: #fff;
  --card-done: #EBE6E4;
  --pending: #8A5300;
  --pending-strong: #B06A00;
  --radius: 14px;
  --font: Barlow, "Helvetica Neue", Arial, sans-serif;
  --font-condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.35; background: var(--bg); overflow-x: clip; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; }
small, .muted { color: var(--muted); }
.condensed { font-family: var(--font-condensed); text-transform: uppercase; line-height: 1; }

/* Cabecera */
.site-header { background: var(--accent); color: #fff; }
.site-header a { color: #fff; }
.site-header-inner { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
/* La marca cede espacio (y su texto se parte) para que el menú no salte a otra línea
   con letra grande (p. ej. Firefox Android con el tamaño de fuente aumentado). */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; flex: 1 1 0; min-width: 0; }
.brand img { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 3px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-family: var(--font-condensed); font-weight: 800; font-size: 24px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand-subtitle { font-size: 13px; opacity: .85; }
.beta-pill { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 6px 1px; border-radius: 6px; background: #FFD38A; color: #5C3A00; font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: .06em; line-height: 1.3; position: relative; top: -2px; }
.beta-banner { display: flex; align-items: flex-start; gap: 12px; background: #FFF3CD; color: #5C4400; padding: 10px max(16px, calc(50vw - 544px)); font-size: 14px; line-height: 1.4; }
.beta-banner[hidden] { display: none; }
.beta-banner p { margin: 0; flex: 1; }
.beta-banner a { color: #5C4400; font-weight: 700; }
.beta-banner-close { background: none; border: 0; color: inherit; font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1.4; }
.menu { position: relative; flex-shrink: 0; }
.menu summary { list-style: none; width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: 52px; z-index: 10; min-width: 220px; max-width: calc(100vw - 32px); background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(40,10,20,.18); padding: 6px; display: flex; flex-direction: column; }
.menu-items a, .menu-items button { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; padding: 12px 14px; border-radius: 8px; font: 600 16px var(--font); text-align: left; justify-content: flex-start; min-height: 0; background: none; border: 0; cursor: pointer; width: 100%; }
.menu-items a:hover, .menu-items button:hover { background: var(--bg); color: var(--ink); }
.menu-items form { margin: 0; }
.menu-items .menu-icon { flex-shrink: 0; color: var(--accent); }
.menu-items .locales { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu-items .locales a, .menu-items .locales span { padding: 8px 12px; }
.menu-items .locales span { font-weight: 800; color: var(--accent); }
/* Móvil: marca y menú en la primera fila; la barra Mis equipos / Todos debajo, a todo el ancho. */
.menu { order: 1; }
.segmented { order: 2; flex-basis: 100%; display: flex; gap: 6px; background: rgba(0,0,0,.18); padding: 4px; border-radius: 12px; }
.segmented a { flex: 1; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; text-decoration: none; color: #fff; }
.segmented a.is-active { background: #fff; color: var(--accent); font-weight: 700; }
@media (min-width: 800px) {
  .segmented { flex-basis: auto; width: 300px; order: 1; }
  .menu { order: 2; }
}

/* Contenido */
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.flash { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #E6F2E8; color: #1E4D2B; font-weight: 600; }
.flash-alert { background: #FDF0E6; color: #7A3E00; }
.empty { color: var(--muted); padding: 8px 0; }

/* Días y tarjetas de partido */
.day { margin-top: 26px; }
.day-title { font-family: var(--font-condensed); font-weight: 800; font-size: 28px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); margin: 0 0 12px; line-height: 1; }
.day-title.is-today { color: var(--accent); }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.match-card { display: flex; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(60,20,30,.08); color: inherit; text-decoration: none; min-height: 100%; }
a.match-card:hover { box-shadow: 0 2px 8px rgba(60,20,30,.16); color: inherit; }
.match-time { width: 82px; flex-shrink: 0; background: #FAF7F6; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 12px 4px; text-align: center; }
.match-time .time { font-family: var(--font-condensed); font-weight: 800; font-size: 30px; line-height: 1; }
.match-time .day-short { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.match-time .pending-time { font-family: var(--font-condensed); font-weight: 700; font-size: 26px; color: var(--pending-strong); line-height: 1; }
.match-time .pending-label { font-size: 11px; font-weight: 600; color: var(--pending); line-height: 1.15; }
.match-body { flex-grow: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.match-category { font-family: var(--font-condensed); font-weight: 800; font-size: 21px; line-height: 1; text-transform: uppercase; color: var(--accent); }
.match-teams { display: flex; flex-direction: column; gap: 2px; }
.team-line { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; line-height: 1.25; color: var(--ink-2); }
.team-line.ours { font-weight: 700; color: var(--ink); }
.match-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.venue { display: inline-flex; align-items: center; gap: 4px; }
a.venue { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.location-icon { flex-shrink: 0; }
.federation-card { margin-top: 24px; }
.badge { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--line); color: var(--ink-2); }
.badge-live { background: var(--accent); color: #fff; }
.badge-postponed, .badge-cancelled { background: #FDE3C8; color: #7A3E00; }

/* Partido terminado: menos destacado */
.match-card.is-done { background: var(--card-done); box-shadow: none; }
.match-card.is-done .match-time { background: transparent; border-right-color: #DDD5D3; }
.match-card.is-done .final-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.match-card.is-done .final-time { font-size: 13px; color: var(--muted-2); }
.match-card.is-done .match-category { font-size: 17px; font-weight: 700; color: #8b6a72; }
.match-card.is-done .team-line { font-size: 15px; color: var(--muted-2); font-weight: 400; }
.match-card.is-done .team-line.ours { color: #4a4446; font-weight: 600; }
.match-card.is-done .team-line.win { color: var(--ink); font-weight: 700; }
.match-card.is-off { opacity: .8; }

.more { display: flex; justify-content: center; margin-top: 24px; }
.button, button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 2px solid var(--accent); background: var(--accent); color: #fff; font: 700 16px var(--font); text-decoration: none; cursor: pointer; }
.button:hover, button:hover, input[type=submit]:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button-secondary { background: transparent; color: var(--accent); }
.button-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button-light { background: #fff; border-color: #fff; color: var(--accent); }
.button-light:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-dark); }
.button-small { min-height: 40px; padding: 0 12px; font-size: 14px; border-width: 1px; }
.button-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: none; color: var(--accent-dark); }

/* Cabecera de página (equipo, partido, formularios) */
/* A todo el ancho de la ventana aunque esté dentro del contenedor centrado. */
.page-hero { background: var(--accent); color: #fff; margin-inline: calc(50% - 50vw); padding: 16px max(16px, calc(50vw - 544px)) 22px; display: flex; flex-direction: column; gap: 14px; }
.page-hero a { color: #fff; }
.page-hero-title { font-family: var(--font-condensed); font-weight: 800; font-size: clamp(36px, 9vw, 52px); line-height: .95; text-transform: uppercase; }
/* Compartir: arriba a la derecha, debajo del menú. */
.match-hero { position: relative; }
.share-button { position: absolute; top: 12px; right: max(16px, calc(50vw - 544px)); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.16); color: #fff; }
.page-hero .share-button:hover { background: rgba(255,255,255,.28); color: #fff; }
.match-hero .page-hero-title { padding-right: 52px; }
.page-hero-subtitle { font-size: 19px; font-weight: 600; opacity: .92; }
.page-hero-meta { font-size: 13px; opacity: .8; }
.page-hero form { margin: 0; }
.section-title { font-family: var(--font-condensed); font-weight: 700; font-size: 26px; text-transform: uppercase; margin: 26px 0 10px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }

/* Ficha de partido */
/* Ficha de partido: categoría algo menor y equipos más grandes; en móvil uno sobre otro y
   centrados, en escritorio en una línea. */
.match-hero .page-hero-title { font-size: clamp(28px, 7vw, 40px); }
.match-when { display: flex; align-items: baseline; gap: 10px; align-self: flex-start; background: rgba(0,0,0,.18); border-radius: 12px; padding: 8px 16px; font-family: var(--font-condensed); font-weight: 800; font-size: 28px; line-height: 1.1; }
.match-when-sep { opacity: .6; }
.match-when-time.pending { color: #FFD38A; font-size: 21px; }
.match-when.is-done { background: none; padding: 0; font-size: 18px; opacity: .85; }
.match-round { font-size: 13px; opacity: .8; }
@media (max-width: 799px) {
  .match-hero .page-hero-title, .match-hero > .badge, .match-when, .match-round { text-align: center; align-self: center; }
  .match-hero .scoreboard { align-self: center; width: 100%; }
  .match-hero .page-hero-title { padding-inline: 52px; }
  .match-hero .scoreboard-label { align-self: center; }
}
.match-body-grid { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 800px) { .match-body-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.where-card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.where-row { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.where-row .location-icon { width: 20px; height: 20px; }
.where-venue .venue { font-size: 18px; gap: 10px; }
.change-notice { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.change-notice.is-warning { background: #FDF0E6; border-left: 4px solid #E0A040; }
.change-notice summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.change-notice summary::-webkit-details-marker { display: none; }
.change-notice-title { font-weight: 700; font-size: 16px; }
.change-notice-when { font-size: 13px; color: var(--muted); }
.change-notice-before { font-size: 15px; }
.change-notice-toggle { font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; margin-top: 4px; }
.change-notice[open] .change-notice-toggle { display: none; }
.period-scores { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.period-scores summary { cursor: pointer; font-size: 15px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.period-scores table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.period-scores th, .period-scores td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.period-scores thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.period-scores th:first-child { text-align: left; padding-left: 0; }
.period-scores tbody th { font-weight: 700; }
.period-scores .total { font-weight: 800; }
.change-detail { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.link-list { margin-top: 22px; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.link-list a:last-child { border-bottom: 0; }
.link-list a:hover { background: var(--bg); color: var(--ink); }
.versus { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.versus .team-name { font-size: 28px; font-weight: 500; line-height: 1.15; }
.versus .team-name.ours { font-weight: 700; }
.versus .versus-word { font-size: 14px; opacity: .7; }
@media (min-width: 800px) {
  .versus { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 16px; text-align: left; }
  .versus .team-name { font-size: 32px; }
}
.versus .score { font-family: var(--font-condensed); font-weight: 800; font-size: 28px; margin-left: 8px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.fact { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.fact-wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; }
.fact-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact-value { font-family: var(--font-condensed); font-weight: 800; font-size: 26px; line-height: 1.05; }
.fact-value.text { font-family: var(--font); font-size: 18px; font-weight: 700; }
.fact-value.pending { color: var(--pending-strong); font-size: 20px; }
.change-card { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.change-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.change-kind { font-weight: 700; font-size: 16px; }
.change-when { font-size: 13px; color: var(--muted); }
.change-rows { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 15px; }
.change-rows dt { color: var(--muted); }
.change-rows dd { margin: 0; }
.change-rows del { color: #8a8385; }
.nav-card { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); margin-bottom: 10px; }
.nav-card:hover { color: var(--ink); box-shadow: 0 2px 8px rgba(60,20,30,.12); }

/* Listas y formularios en tarjetas */
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.card + .card { margin-top: 10px; }
.card-padded { padding: 14px; }
.check-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid #F1ECEA; font-size: 16px; min-height: 48px; }
.check-row:first-child { border-top: 0; }
.check-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.check-row .grow { flex-grow: 1; display: flex; flex-direction: column; }
.card-title { padding: 14px 14px 6px; font-family: var(--font-condensed); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; }
.category-check { font-family: var(--font-condensed); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.options { display: flex; gap: 6px; }
.options input { position: absolute; opacity: 0; pointer-events: none; }
.options label { flex: 1 1 auto; padding: 0 6px; white-space: nowrap; height: 44px; border-radius: 10px; border: 1px solid #DDD5D3; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; }
.options input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.options input:focus-visible + label { outline: 3px solid var(--accent-soft); }
@media (max-width: 400px) { .options { gap: 4px; } .options label { padding: 0 3px; font-size: 14px; } }
.form-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.inline-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field label { font-weight: 600; }
input[type=email], input[type=text], input[type=search], input[type=date], input[type=number], select { font: inherit; min-height: 44px; padding: 0 12px; border: 1px solid #DDD5D3; border-radius: 10px; background: #fff; width: 100%; max-width: 24rem; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #C98A9A; outline-offset: 2px; }
.quiet-hours { display: flex; align-items: center; gap: 10px; padding: 0 14px 14px; flex-wrap: wrap; }
.quiet-hours select { width: auto; }
.test-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.test-buttons form { margin: 0; }
.test-results { font-size: 14px; padding-left: 18px; }
.auth { max-width: 26rem; margin: 0 auto; }
.auth-note { background: var(--card); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 15px; margin: 0 0 14px; }
.auth h1 { font-family: var(--font-condensed); font-weight: 800; font-size: 34px; text-transform: uppercase; margin-top: 28px; }
.code-input { font-family: var(--font-condensed); font-size: 30px; letter-spacing: .3em; max-width: 12rem; }
.team-list a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); }

/* Administración */
.container-wide { max-width: 80rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.admin-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0; }
.admin-filters input, .admin-filters select { width: auto; }
.table-wrap { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; font-size: .8rem; background: var(--card); }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: .3rem .4rem; text-align: left; vertical-align: top; }
.admin-table .is-failed td { background: #fdecec; }
.admin-table form { display: inline; }
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.health-check { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #2e7d32; border-radius: .4rem; padding: .5rem .7rem; display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.health-check.is-warning { border-left-color: #c77700; background: #fff8ec; }
.status-failed, .status-skipped { background: #fde2c8; }
.status-sent, .status-succeeded, .status-dispatched { background: #dff3e1; }
.inline-form { display: flex; gap: .3rem; }
.inline-form input[type=text] { max-width: 14rem; min-height: 36px; }
.mail-preview { width: 100%; height: 26rem; border: 1px solid var(--line); background: #fff; }
pre.json { font-size: .75rem; background: var(--card); border: 1px solid var(--line); padding: .5rem; overflow-x: auto; }
.simulation { background: #fffbea; border: 1px solid #f0e2a8; border-radius: .5rem; padding: .6rem .8rem; margin: 1rem 0; }
.simulation-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; margin: .6rem 0; }
.simulation-fields label { display: flex; flex-direction: column; font-size: .85rem; gap: .2rem; }
.match-details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; background: var(--card); border-radius: var(--radius); padding: .75rem 1rem; }
.match-details dt { color: var(--muted); }
.match-details dd { margin: 0; }
.container-wide h1 { font-size: 1.5rem; margin: 1rem 0 .25rem; }
.container-wide h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Marcador de un partido terminado */
.scoreboard { display: flex; flex-direction: column; gap: 6px; max-width: 30rem; }
.scoreboard-label { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: rgba(0,0,0,.22); padding: 3px 10px; border-radius: 6px; }
.scoreboard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 22px; opacity: .72; }
.scoreboard-row.win { opacity: 1; font-weight: 700; }
.scoreboard-row .score { font-family: var(--font-condensed); font-weight: 800; font-size: 44px; line-height: 1; }
.external-icon { flex-shrink: 0; }

/* Notificaciones flotantes (flash) */
.toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: 84px; width: min(560px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-radius: 14px; background: #241c1e; color: #fff; box-shadow: 0 10px 30px rgba(30,10,15,.28); border-left: 6px solid #3fa45b; animation: toast-in .25s ease-out; }
.toast-alert { border-left-color: #f0a32c; }
.toast-icon { flex-shrink: 0; color: #7fd197; }
.toast-alert .toast-icon { color: #f6c26b; }
.toast-message { margin: 0; flex-grow: 1; font-size: 16px; font-weight: 600; line-height: 1.35; }
.toast-close { flex-shrink: 0; min-height: 40px; width: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #cfc6c8; }
.toast-close:hover { background: rgba(255,255,255,.1); color: #fff; border: 0; }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation: none; transition: none; } }
@media (max-width: 640px) { .toasts { top: calc(12px + env(safe-area-inset-top)); } }
.auth input[type=email], .auth input[type=text] { max-width: none; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .field { margin: 0; }
.auth h1 + .hint { margin: 6px 0 20px; }

/* Pie */
.app-footer { max-width: 1120px; margin: 0 auto; padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.app-footer a { color: var(--accent); font-weight: 800; }
.button[aria-busy="true"] { opacity: .6; cursor: progress; }
.venue.is-away .location-icon { color: var(--accent); }
.home-away { display: inline-flex; align-items: center; gap: 6px; }
.home-away .location-icon { width: 20px; height: 20px; }
.home-away.is-away .location-icon { color: var(--accent); }
.fact .venue { align-items: flex-start; }
.fact .venue .location-icon { margin-top: 4px; }

/* Avisar de un fallo */
.feedback-form { margin-top: 16px; }
.feedback-form textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }

/* Pabellón sin confirmar: icono esperado con "?"; en ámbar si la hora ya está confirmada. */
.venue.is-pending { color: var(--muted); font-style: italic; }
.venue.is-pending .venue-question { font-weight: 800; font-style: normal; margin-left: -2px; }
.venue.is-urgent { color: var(--pending-strong); font-weight: 600; }
.where-venue .venue a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Conflictos de pabellón (solo coordinadores): en amarillo. */
.match-card.is-conflict { background: #FFF6CC; box-shadow: inset 4px 0 0 #E8B500, 0 1px 2px rgba(60,20,30,.08); }
.badge-conflict { background: #FFE27A; color: #5C4400; }
.flash-conflict { background: #FFF6CC; border-left: 4px solid #E8B500; color: #5C4400; }
.flash-conflict a { color: inherit; font-weight: 600; }

/* Autoguardado de "Mis avisos": indicador fijo abajo, visible aunque el formulario sea largo. */
.autosave-status { position: fixed; z-index: 50; left: 50%; bottom: 20px; transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 999px;
                   background: #241c1e; color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 8px 24px rgba(30,10,15,.25); white-space: nowrap; }
.autosave-status.is-saved { background: #1E4D2B; }
.autosave-status.is-error { background: #7A3E00; white-space: normal; width: max-content; max-width: calc(100% - 32px); }

/* Convocatorias: una fila por día con una columna por partido y equipo (scroll lateral) */
.squads-hero { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-nav-label { font-family: var(--font-condensed); font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; min-width: 8ch; text-align: center; }
.page-hero .week-nav-arrow { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); text-decoration: none; font-size: 24px; line-height: 1; }
.page-hero .week-nav-arrow:hover { background: rgba(255,255,255,.26); }
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.day-chips a { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.day-chips a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.squads-help { margin-top: 10px; }
.empty-state { margin-top: 24px; color: var(--muted); }
.squad-day { margin-top: 22px; }
/* Móvil: un partido debajo de otro. Escritorio: tantas columnas como quepan. */
.squad-row { display: grid; align-items: start; gap: 12px; padding-bottom: 12px; }
.squad-col { min-width: 0; background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(60,20,30,.08); display: flex; flex-direction: column; }
@media (min-width: 700px) {
  .squad-row { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
.squad-col-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.squad-col-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.squad-col-top .match-category { font-size: 19px; text-decoration: none; }
.squad-number { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.squad-rival { font-weight: 600; line-height: 1.25; }
.squad-rival a { color: inherit; }
.squad-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.squad-time { font-family: var(--font-condensed); font-weight: 800; font-size: 22px; color: var(--ink); line-height: 1; }
.squad-meta .pending-label { font-size: 13px; font-weight: 700; color: var(--pending); }
.squad-coaches { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--muted); }
.squad-coach { display: inline-flex; align-items: center; }
.squad-coach strong { color: var(--ink); font-weight: 600; }
.squad-coach .squad-remove { width: 24px; height: 24px; font-size: 17px; color: var(--muted); }
.squad-coach-add { padding: 0; flex: 1 1 120px; min-width: 120px; }
.squad-coach-add input[type=text] { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.squad-coach-add .squad-suggest { left: 0; right: auto; min-width: 220px; top: 100%; font-size: 14px; }
.squad-players { list-style: none; margin: 0; padding: 4px 6px; }
.squad-player { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 2px 8px; border-radius: 9px; }
.squad-player + .squad-player { border-top: 1px solid var(--line); }
.squad-player.is-added:not(.is-out) { background: #E2F1EA; }
.squad-toggle-form, .squad-remove-form { display: contents; }
.squad-toggle { all: unset; flex: 1; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px; }
.squad-toggle:focus-visible, .squad-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.squad-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goalkeeper-icon { flex-shrink: 0; color: var(--accent); }
.squad-player.is-out .squad-name { text-decoration: line-through; color: #A39B9D; font-weight: 500; }
.squad-player.is-out .goalkeeper-icon { color: #A39B9D; }
.squad-tag { font-size: 12px; font-weight: 700; color: var(--muted); }
.squad-player.is-added:not(.is-out) .squad-tag { color: #1F6B4A; }
.squad-remove { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; font-size: 20px; color: #1F6B4A; }
.squad-remove:hover { background: rgba(0,0,0,.06); color: #1F6B4A; }
.squad-toggle:hover { background: none; color: inherit; }
.squad-toggle:hover .squad-name { text-decoration: underline; text-underline-offset: 3px; }
.squad-player.is-out .squad-toggle:hover .squad-name { text-decoration: line-through; }
.squad-clash { flex-basis: 100%; font-size: 12px; color: #B3261E; font-weight: 600; padding-bottom: 4px; }
.squad-add { position: relative; padding: 6px 12px; margin: 0; }
.squad-add input[type=text] { max-width: none; min-height: 40px; border-style: dashed; background: transparent; }
.squad-add input[type=text]:focus { border-style: solid; border-color: var(--accent); outline: none; }
.squad-suggest { position: absolute; z-index: 5; left: 12px; right: 12px; top: calc(100% - 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(40,10,20,.16); max-height: 280px; overflow-y: auto; }
.squad-suggest li { display: flex; flex-direction: column; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.squad-suggest li[aria-selected="true"] { background: var(--accent-soft); }
.squad-suggest li span { font-size: 12px; color: var(--muted); }
.squad-readonly { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 10px; }
.squad-col.is-readonly .squad-toggle { cursor: default; }
.squad-col.is-readonly .squad-toggle:hover .squad-name { text-decoration: none; }
.squad-col.is-readonly .squad-player.is-out .squad-toggle:hover .squad-name { text-decoration: line-through; }
.squad-optional { padding: 4px 14px 8px; }
.squad-optional-title { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 0 2px; }
.squad-optional ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.squad-optional-add { all: unset; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; font-weight: 600; }
button.squad-optional-add { cursor: pointer; }
button.squad-optional-add:hover, button.squad-optional-add:focus-visible { border-style: solid; border-color: var(--accent); color: var(--accent); background: none; }
.squad-history { padding: 4px 14px 0; font-size: 13px; color: var(--muted); }
.squad-history summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.squad-history ol { list-style: none; margin: 0; padding: 0 0 6px; display: flex; flex-direction: column; gap: 4px; }
.squad-history li { color: var(--ink); line-height: 1.3; }
.squad-history-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.squad-col-foot { margin-top: auto; padding: 6px 12px 12px; }

/* Clasificación. Móvil: Pts, PJ y DG (el resto al tocar); desde 460px también PG, PE y PP; escritorio, todo. */
.standings-chips { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding: 2px 16px; scrollbar-width: none; }
.standings-chips::-webkit-scrollbar { display: none; }
.page-hero .standings-chips a { flex: none; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.14); text-decoration: none; font-weight: 600; font-size: 14px; }
.page-hero .standings-chips a.is-active { background: var(--card); color: var(--accent); }
.standings-groups { display: flex; gap: 4px; margin-top: 16px; padding: 4px; background: var(--card); border-radius: 12px; }
.standings-groups a { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; text-align: center; text-wrap: balance; padding: 8px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; }
.standings-groups a.is-active { background: var(--accent); color: #fff; }
.standings { margin-top: 14px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.standings-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px 32px 42px; align-items: center; column-gap: 6px; padding: 11px 14px 11px 12px; }
.standings-row .mid, .standings-row .wide { display: none; }
.standings-head { padding-block: 10px 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.standings .num { text-align: right; font-variant-numeric: tabular-nums; }
.standings .soft { color: var(--muted); }
.standings-entry + .standings-entry { border-top: 1px solid var(--line); }
.standings-entry summary { list-style: none; cursor: pointer; position: relative; }
.standings-entry summary::-webkit-details-marker { display: none; }
.standings-entry.is-zone summary::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #1F8A4C; }
.standings-entry.is-ours { background: var(--accent-soft); }
.standings-entry.is-ours .standings-team { color: var(--accent); font-weight: 700; }
.standings-pos { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.standings-team { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.standings-team a { color: inherit; }
.standings-points { font-family: var(--font-condensed); font-weight: 800; font-size: 20px; }
.standings .is-plus { color: #1F8A4C; }
.standings .is-minus { color: #B3261E; }
.standings-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 14px 12px 44px; font-size: 14px; color: var(--muted); }
.standings-form { display: inline-flex; gap: 4px; color: var(--muted); }
.standings-form svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.standings-form .form-W { color: var(--ink); }
.standings-form .form-W circle { fill: currentColor; stroke: none; }
.standings-form .form-W path { stroke: var(--card); }
.standings-form .form-D circle, .standings-form .form-L circle { stroke-width: 1.4; }
.standings-form-head, .standings-form-cell { justify-self: end; }
.standings-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.standings-legend::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: #1F8A4C; }
.standings-meta { margin-top: 12px; }
@media (min-width: 460px) {
  .standings-row { grid-template-columns: 26px minmax(0, 1fr) 40px 32px 42px repeat(3, 28px); }
  .standings-row .mid { display: block; }
}
@media (min-width: 760px) {
  .standings-row { grid-template-columns: 34px minmax(0, 1fr) 48px repeat(4, 40px) repeat(3, 40px) 116px; column-gap: 10px; padding-inline: 16px 20px; }
  .standings-row .wide { display: block; }
  .standings-chips { flex-wrap: wrap; overflow: visible; }
  .standings-row .standings-form-cell { display: inline-flex; }
  .standings-entry summary { cursor: default; pointer-events: none; }
  .standings-entry summary a { pointer-events: auto; }
  .standings-detail { display: none; }
}

/* Página de equipo en el móvil: los 4 próximos y los 4 últimos resultados (TeamsHelper::MOBILE_MATCHES);
   el resto con «Ver más» / «Ver anteriores». Los resultados, en orden cronológico: el botón va arriba. */
.match-list-more { display: none; }
.team-standings-links { margin-top: 18px; }
@media (max-width: 699px) {
  .match-list-more { display: block; width: 100%; }
  .match-list.keep-first .match-list-more { margin-top: 10px; }
  .match-list.keep-last .match-list-more { margin-bottom: 10px; }
  .match-list.keep-first:not(.is-expanded) .match-card:nth-child(n+5),
  .match-list.keep-last:not(.is-expanded) .match-card:nth-last-child(n+5) { display: none; }
}

/* Desarrollo: sesión simulada con FAKE_LOG_AS_USER_EMAIL */
.fake-login-bar { background: #1b1718; color: #fff; text-align: center; font-size: 13px; padding: 6px 16px; }
