:root {
  --green: #46895a;
  --green-dark: #2f6a40;
  --blue: #4677ad;
  --blue-deep: #1f4f9a;
  --gray: #7a7578;
  --gray-dark: #4f4b4d;
  --yellow: #f6e600;
  --red: #c8102e;
  --ink: #111;
  --paper: #f6f3ec;
  --white: #fff;
  --slab: "Alfa Slab One", "Rockwell", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --line: 4px solid var(--white);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1100px, 92vw); margin: 0 auto; }

/* Textura desgastada del cartel */
.grunge {
  padding-top: .18em; margin-top: -.18em;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -7 4.6'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -7 4.6'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================= TOP BAR ================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 4vw; background: var(--ink); color: var(--white);
  border-bottom: 3px solid var(--yellow);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--slab); font-size: 1.3rem; letter-spacing: .04em; }
.brand img { background: var(--white); border-radius: 50%; padding: 2px; }
#nav { display: flex; gap: 1.2rem; align-items: center; }
#nav a { text-decoration: none; font-weight: 600; font-size: .92rem; opacity: .9; }
#nav a:hover { color: var(--yellow); opacity: 1; }
#nav a.cta { background: var(--yellow); color: var(--ink); padding: .4rem .9rem; border-radius: 4px; font-weight: 800; }
#nav a.cta:hover { background: var(--white); }
.menu-btn { display: none; background: none; border: 2px solid var(--white); color: var(--white); font-size: 1.3rem; border-radius: 4px; padding: .1rem .6rem; cursor: pointer; }

/* ================= HERO ================= */
.hero {
  position: relative; overflow: hidden;
  background: var(--green);
  color: var(--white);
  padding: 3rem 0 0;
  min-height: 88vh;
  display: flex; flex-direction: column;
}
/* triángulo azul superior y suelo gris, como el cartel */
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 46%;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 20%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: var(--gray);
  clip-path: polygon(0 100%, 0 70%, 42% 0, 100% 0, 100% 100%);
  border-top: var(--line);
}
.hero-inner { position: relative; z-index: 2; width: min(1100px, 92vw); margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; flex: 1; }
.hero-title { position: relative; }
.edicion { font-family: var(--slab); color: var(--ink); font-size: clamp(1.4rem, 3vw, 2.2rem); margin: 0 0 .3rem; transform: rotate(-6deg); display: inline-block; }
.hero h1 { margin: 0; font-family: var(--slab); font-weight: 400; line-height: .88; text-transform: uppercase; }
.hero h1 span { display: block; }
.gran { color: var(--white); font-size: clamp(2.5rem, 7vw, 5.5rem); transform: rotate(-4deg); transform-origin: left; }
.torneo, .palero { color: var(--ink); font-size: clamp(3.4rem, 11vw, 8.5rem); letter-spacing: -.01em; }
.palero { color: var(--ink); }

.hero-wall { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.logo-badge {
  width: clamp(150px, 20vw, 230px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden; background: var(--white);
  border: 6px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(4deg);
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.hero-meta { text-align: center; text-transform: uppercase; line-height: .9; }
.mes { font-weight: 900; font-size: clamp(1.8rem, 4vw, 3rem); margin: 0; letter-spacing: .02em; }
.anio { font-weight: 900; font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 0; letter-spacing: .12em; }
.lugar { font-family: var(--slab); color: var(--blue-deep); font-size: clamp(1.6rem, 3.5vw, 2.6rem); margin: .4rem 0 0; -webkit-text-stroke: 1px var(--white); }

.hero-actions { position: relative; z-index: 3; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; padding: 2rem 0 2.4rem; }
.btn { display: inline-block; padding: .85rem 1.5rem; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .03em; border-radius: 4px; border: 3px solid var(--ink); cursor: pointer; font-family: var(--sans); font-size: .95rem; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: var(--white); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--yellow); }

/* ================= MARQUEE ================= */
.marquee { background: var(--ink); color: var(--yellow); overflow: hidden; border-block: 4px solid var(--white); }
.marquee-track { display: flex; width: max-content; animation: scroll 28s linear infinite; }
.marquee span { font-family: var(--slab); font-size: 1.6rem; padding: .45rem 0; white-space: pre; }
@keyframes scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ================= SECTIONS ================= */
.section { padding: 4.5rem 0; }
.section.green { background: var(--green); color: var(--white); }
.section.gray { background: var(--gray); color: var(--white); }
.section.blue { background: var(--blue); color: var(--white); }
.section.yellow { background: var(--yellow); }
.section.dark-bg { background: var(--ink); color: var(--white); }
.sec-title { font-family: var(--slab); font-weight: 400; text-transform: uppercase; font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 1.5rem; line-height: 1; color: var(--white); }
.sec-title.dark { color: var(--ink); }

.intro { padding: 3.5rem 0; }
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 60ch; margin: 0 auto 2.5rem; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stats div { background: var(--white); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); text-align: center; padding: 1.2rem .5rem; }
.stats b { display: block; font-family: var(--slab); font-size: 2.2rem; font-weight: 400; color: var(--green-dark); }
.stats span { font-weight: 600; text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; }

/* Formato */
.fases { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.fases li { border: var(--line); padding: 1.6rem 1.4rem 1.4rem; position: relative; background: rgba(0,0,0,.08); }
.fase-num { position: absolute; top: -1.4rem; left: 1rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--white); color: var(--green-dark); display: grid; place-items: center; font-family: var(--slab); font-size: 1.4rem; border: 3px solid var(--white); outline: 3px solid var(--ink); }
.fases h3 { margin: .6rem 0 .5rem; font-size: 1.25rem; text-transform: uppercase; font-weight: 900; }
.fases p { margin: 0; }

.puntos { background: var(--ink); padding: 1.8rem; border: var(--line); }
.puntos h3 { margin: 0 0 1rem; text-transform: uppercase; font-weight: 900; color: var(--yellow); }
.puntos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.pt { background: var(--white); color: var(--ink); text-align: center; padding: 1rem .5rem; }
.pt b { display: block; font-family: var(--slab); font-weight: 400; font-size: 2.8rem; line-height: 1; }
.pt span { font-weight: 800; text-transform: uppercase; font-size: .8rem; }
.pt.big { background: var(--yellow); }
.pt.muted { background: #d8d4d5; }
.desempate { margin: 1rem 0 0; font-size: .9rem; opacity: .85; }

/* Clasificación */
.leyenda { display: flex; gap: 1.4rem; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; flex-wrap: wrap; }
.dot { display: inline-block; width: .9rem; height: .9rem; border-radius: 2px; margin-right: .4rem; vertical-align: -2px; }
.dot.ff { background: var(--green); }
.dot.po { background: var(--blue); }
.table-wrap { overflow-x: auto; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: var(--white); }
.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th { background: var(--ink); color: var(--white); padding: .7rem .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.tabla th.left { text-align: left; }
.tabla td { padding: .6rem .5rem; text-align: center; border-bottom: 1px solid #e4e0e1; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td.pos { font-family: var(--slab); font-size: 1.1rem; width: 3rem; border-left: 6px solid transparent; }
.tabla tr.z-ff td.pos { border-left-color: var(--green); color: var(--green-dark); }
.tabla tr.z-po td.pos { border-left-color: var(--blue); color: var(--blue-deep); }
.tabla tr.z-po:nth-child(6) td { border-bottom: 2px dashed var(--ink); }
.tabla tr.z-ff:nth-child(2) td { border-bottom: 2px dashed var(--ink); }
.tabla td.pareja { text-align: left; }
.tabla td.pareja span { display: block; font-size: .78rem; color: #666; }
.tabla td.pts { font-family: var(--slab); font-size: 1.25rem; background: #fbf7c9; }

[hidden] { display: none !important; }
.tabla tr.z-out td { color: #777; }
.tabla tr.z-out td.pos { border-left-color: #ccc; }
.dot.out { background: #ccc; }
.leyenda.light { color: var(--white); }
.progreso { font-size: 1.05rem; margin: -.6rem 0 1.2rem; }
.progreso.light { color: var(--white); }
.page { min-height: calc(100vh - 220px); }
.puntos { margin-top: 2.5rem; }
.puntos-grid { grid-template-columns: repeat(3, 1fr); }
#nav a[aria-current] { color: var(--yellow); opacity: 1; box-shadow: inset 0 -3px 0 var(--yellow); }
.fase-link { display: inline-block; margin-top: .9rem; font-weight: 800; color: var(--yellow); text-decoration: none; }
.fase-link:hover { text-decoration: underline; }
.normas.margin { margin-top: 2rem; }
.btn-danger { background: var(--white); color: var(--red); border-color: var(--red); }

/* Calendario */
.aviso { background: rgba(0,0,0,.25); padding: .9rem 1.1rem; border-left: 5px solid var(--yellow); max-width: 75ch; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.6rem 0 1rem; }
.tabs button { font-family: var(--sans); font-weight: 800; text-transform: uppercase; font-size: .85rem; padding: .55rem 1rem; border: 3px solid var(--white); background: transparent; color: var(--white); cursor: pointer; border-radius: 4px; }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); }
.tabs button[data-tab="PO"], .tabs button[data-tab="FF"] { border-color: var(--yellow); color: var(--yellow); }
.tabs button[data-tab="PO"][aria-selected="true"], .tabs button[data-tab="FF"][aria-selected="true"] { background: var(--yellow); color: var(--ink); }
.plazo { margin: 0 0 1rem; }
.partidos { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.partido { background: var(--white); color: var(--ink); border: 3px solid var(--ink); display: flex; flex-direction: column; }
.partido.jugado { box-shadow: 5px 5px 0 var(--ink); }
.p-tit { background: var(--ink); color: var(--white); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: .35rem .8rem; }
.p-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; padding: .9rem 1rem .5rem; flex: 1; }
.p-foot { padding: 0 1rem .8rem; text-align: center; }
.eq strong { display: block; line-height: 1.25; }
.eq strong.tbd { color: #888; font-weight: 600; }
.eq span { font-size: .75rem; color: #666; }
.eq.der { text-align: right; }
.eq.win strong { color: var(--green-dark); }
.eq.lose { opacity: .5; }
.centro { text-align: center; min-width: 4.5rem; }
.pendiente { font-family: var(--slab); color: var(--gray); font-size: 1.1rem; }
.score { font-family: var(--slab); font-size: 1.6rem; white-space: nowrap; }
.sets { font-size: .74rem; color: #666; font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-res { font-family: var(--sans); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--yellow); border: 2px solid var(--ink); padding: .35rem .8rem; border-radius: 4px; cursor: pointer; }
.partido.jugado .btn-res { background: transparent; border-color: #bbb; color: #666; }
.btn-res:hover { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.bloqueado { font-size: .78rem; color: #888; }
.gestion { margin-top: 2.5rem; background: rgba(0,0,0,.2); padding: .9rem 1.1rem; }
.gestion summary { cursor: pointer; font-weight: 800; text-transform: uppercase; font-size: .85rem; }
.gestion-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.gestion .btn { font-size: .78rem; padding: .5rem .9rem; }
.gestion code { background: rgba(0,0,0,.3); padding: 0 .3rem; }

/* Editor de resultado */
.editor { border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: 0; max-width: 520px; width: 94vw; }
.editor::backdrop { background: rgba(0,0,0,.6); }
.editor form { padding: 1.4rem; }
.editor h3 { margin: 0 0 1rem; font-family: var(--slab); font-weight: 400; text-transform: uppercase; font-size: 1.5rem; }
.editor-grid { display: grid; grid-template-columns: 1fr repeat(3, 4.2rem); gap: .5rem; align-items: center; }
.ed-h { text-align: center; font-size: .75rem; font-weight: 800; text-transform: uppercase; color: #666; }
.ed-name { font-weight: 800; line-height: 1.2; }
.editor input { width: 100%; font: 700 1.3rem var(--sans); text-align: center; padding: .4rem .2rem; border: 3px solid var(--ink); border-radius: 4px; }
.editor input:focus { outline: 3px solid var(--yellow); }
.ed-hint { font-size: .8rem; color: #666; margin: .8rem 0 0; }
.ed-error { color: var(--red); font-weight: 700; min-height: 1.3em; margin: .4rem 0; }
.ed-btns { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ed-btns span { flex: 1; }
.ed-btns .btn { font-size: .8rem; padding: .55rem 1rem; }

/* Final Four: cuadro */
.bracket {
  --g: 3rem; --rg: 2.2rem;
  display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--g); row-gap: var(--rg);
  grid-template-areas: "h1 h2 h3" "pot sft fin" "pob sfb fin";
  margin-top: 1.5rem;
}
.col-h { color: var(--white); font-weight: 900; text-transform: uppercase; font-size: 1.15rem; border-bottom: 3px solid var(--white); padding-bottom: .3rem; }
.col-h small { display: block; font-weight: 600; text-transform: none; font-size: .8rem; opacity: .85; }
.c1 { grid-area: h1; } .c2 { grid-area: h2; } .c3 { grid-area: h3; }
.b-po.top { grid-area: pot; } .b-po.bot { grid-area: pob; }
.b-sf.top { grid-area: sft; } .b-sf.bot { grid-area: sfb; }
.b-fin { grid-area: fin; }
.b-po, .b-sf, .b-fin { position: relative; display: flex; align-items: center; }
.b-po > .cruce, .b-sf > .cruce, .b-fin > .cruce { width: 100%; margin: 0; }
/* conectores */
.b-po::after { content: ""; position: absolute; left: 100%; top: 50%; width: var(--g); border-top: 3px solid var(--white); }
.b-sf.top::after, .b-sf.bot::after { content: ""; position: absolute; left: 100%; width: calc(var(--g) / 2); height: calc(50% + var(--rg) / 2); border-right: 3px solid var(--white); }
.b-sf.top::after { top: 50%; border-top: 3px solid var(--white); }
.b-sf.bot::after { bottom: 50%; border-bottom: 3px solid var(--white); }
.b-fin::before { content: ""; position: absolute; right: 100%; top: 50%; width: calc(var(--g) / 2); border-top: 3px solid var(--white); }

.cruce { background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); cursor: pointer; transition: transform .12s; }
.cruce:hover { transform: translate(-2px, -2px); }
.cruce h4 { margin: 0; background: var(--ink); color: var(--white); padding: .35rem .7rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.cruce .slot { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-bottom: 1px solid #ddd; min-height: 3rem; }
.cruce .slot:last-of-type { border-bottom: 0; }
.cruce .nm { flex: 1; line-height: 1.2; }
.cruce .nm strong { font-size: .92rem; }
.cruce .nm small { display: block; font-size: .68rem; color: #888; text-transform: uppercase; letter-spacing: .04em; }
.cruce .nm em { color: #777; font-style: normal; font-size: .9rem; }
.cruce .slot b { font-family: var(--slab); font-weight: 400; font-size: 1.2rem; }
.cruce .slot.win { background: #eaf5ec; }
.cruce .slot.win strong { color: var(--green-dark); }
.cruce .slot.lose { opacity: .5; }
.cruce .sets { padding: .3rem .7rem; border-top: 1px solid #ddd; }
.seed { font-style: normal; font-family: var(--slab); font-size: .85rem; min-width: 2.3rem; text-align: center; padding: .2rem .3rem; border-radius: 3px; color: var(--white); }
.seed.ff { background: var(--green); }
.seed.po { background: var(--blue-deep); }
.seed.empty { background: #e4e0e1; color: #999; }
.cruce.sf { border-width: 4px; }
.cruce.gran-final { border-color: var(--ink); box-shadow: 7px 7px 0 var(--yellow); }
.cruce.gran-final h4 { background: var(--yellow); color: var(--ink); font-size: .85rem; }
.tercer { max-width: calc((100% - 6rem) / 3); margin: 2.5rem 0 0 auto; }
.tercer .cruce h4 { background: var(--gray-dark); }
.campeon { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); padding: 1rem 1.4rem; font-size: 1.3rem; margin-bottom: 2rem; text-align: center; box-shadow: 6px 6px 0 var(--ink); }
.campeon span { display: block; font-size: .9rem; }

/* Parejas */
.parejas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.pareja-card { background: var(--white); border: 3px solid var(--ink); padding: 1rem 1.1rem; position: relative; box-shadow: 4px 4px 0 var(--ink); }
.pareja-card .num { position: absolute; top: .4rem; right: .7rem; font-family: var(--slab); font-size: 1.8rem; color: var(--green); opacity: .35; }
.pareja-card ul { list-style: none; padding: 0; margin: 0; }
.pareja-card li { margin-bottom: .4rem; }
.pareja-card li strong { text-transform: uppercase; font-size: 1.02rem; }
.pareja-card li strong::before { content: "✱ "; color: var(--green); }
.pareja-card li span { display: block; font-size: .8rem; color: #666; padding-left: 1.1rem; }
.pareja-card .alias { margin: .3rem 0 0; font-size: .8rem; font-style: italic; color: var(--blue-deep); }

/* Normativa */
.normas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.normas div { border: var(--line); padding: 1.3rem; background: rgba(0,0,0,.08); }
.normas h3 { margin: 0 0 .4rem; text-transform: uppercase; font-weight: 900; color: var(--yellow); }
.normas p { margin: 0; }

/* Historia */
.historia { display: grid; grid-template-columns: 340px 1fr; gap: 3rem; align-items: center; }
.historia img { border: 4px solid var(--white); transform: rotate(-3deg); box-shadow: 10px 10px 0 var(--green); }

/* Footer */
.footer { background: var(--ink); color: var(--white); text-align: center; padding: 2.5rem 1rem; border-top: 4px solid var(--yellow); }
.footer img { margin: 0 auto .8rem; background: var(--white); border-radius: 50%; }
.footer p { margin: .2rem 0; }
.footer .small { opacity: .6; font-size: .85rem; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  /* Barra de navegación inferior tipo app */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { justify-content: center; padding-top: calc(.5rem + env(safe-area-inset-top)); }
  #nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    background: var(--ink); border-top: 3px solid var(--yellow);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; opacity: .75; }
  #nav a svg { width: 24px; height: 24px; }
  #nav a[aria-current] { box-shadow: inset 0 3px 0 var(--yellow); opacity: 1; }
  .section { padding: 3rem 0; }
  .page { padding-top: 2rem; }
  .hero { min-height: auto; padding-top: 1.5rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 1rem; }
  .gran { transform-origin: center; }
  .hero::after { height: 18%; }
  .fases { grid-template-columns: 1fr; }
  .partidos { grid-template-columns: 1fr; }
  .historia { grid-template-columns: 1fr; }
  .historia img { max-width: 300px; margin: 0 auto; }
  .bracket { grid-template-columns: 1fr; grid-template-areas: "h1" "pot" "pob" "h2" "sft" "sfb" "h3" "fin"; row-gap: 1.2rem; }
  .b-po::after, .b-sf.top::after, .b-sf.bot::after, .b-fin::before { display: none; }
  .tercer { max-width: none; margin-top: 1.2rem; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .normas { grid-template-columns: 1fr; }
  .num-hide { display: none; }
  .tabla td, .tabla th { padding: .5rem .3rem; font-size: .85rem; }
  .editor-grid { grid-template-columns: 1fr repeat(3, 3.3rem); }
  .ed-btns span { display: none; }
}

/* ================= NAV ICONOS ================= */
#nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: .3rem; }
@media (max-width: 900px) { #nav a svg { margin: 0; } }
#nav a { -webkit-tap-highlight-color: transparent; }

/* Estado del servidor */
.estado { position: sticky; top: 59px; z-index: 40; text-align: center; padding: .55rem 1rem; font-weight: 700; font-size: .9rem; }
.estado.cargando { background: var(--yellow); color: var(--ink); }
.estado.error { background: var(--red); color: var(--white); }
.estado button { margin-left: .5rem; font: inherit; background: var(--white); color: var(--ink); border: 0; border-radius: 4px; padding: .2rem .7rem; cursor: pointer; }

/* PIN en el editor */
.ed-pin { margin-top: 1rem; padding: .8rem; background: #f3efe2; border: 2px dashed var(--ink); }
.ed-pin label { display: block; font-weight: 800; text-transform: uppercase; font-size: .8rem; margin-bottom: .35rem; }
.ed-pin input { width: 100%; font: 700 1.2rem var(--sans); padding: .45rem .6rem; border: 3px solid var(--ink); border-radius: 4px; letter-spacing: .3em; }
.ed-pin small { display: block; color: #666; margin-top: .3rem; }

/* Táctil: objetivos grandes */
@media (pointer: coarse) {
  .btn-res { padding: .6rem 1.1rem; font-size: .85rem; }
  .tabs button { padding: .7rem 1rem; }
  .editor input[type=number] { font-size: 1.5rem; padding: .55rem .2rem; }
}
@media (max-width: 640px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -4vw; padding: 0 4vw .4rem; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; }
  .editor { margin: auto auto 0; width: 100vw; max-width: 100vw; border-width: 4px 0 0; box-shadow: none; }
  .editor form { padding: 1.2rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); }
  .ed-btns .btn { flex: 1; }
  .ed-btns #ed-borrar { flex-basis: 100%; order: 3; }
  .p-row { gap: .5rem; padding: .8rem .7rem .4rem; }
  .eq strong { font-size: .92rem; }
  .hero h1 .torneo, .hero h1 .palero { font-size: clamp(3rem, 16vw, 5rem); }
  .sec-title { font-size: 2.3rem; }
  .estado { top: 55px; }
}
.leyenda.light .dot { outline: 2px solid var(--white); }
.leyenda.light .dot.po { background: var(--blue-deep); }
