/* Klask Stats — estructura de liga.madridpatina.org (titulos de bloque enormes con una palabra en caligrafia,
   fotos tintadas en franjas inclinadas, menu en mayusculas), colores de klaskranking.com (azul marino y oro). */
:root {
  --ink: #0d1626;
  --navy: #13213b;
  --navy-2: #1c2d4f;
  --navy-3: #26395f;
  --page: #eceff4;
  --paper: #ffffff;
  --line: #d9dee7;
  --line-soft: #e8ebf1;
  --muted: #576072;
  --cream: #f4f1ea;
  --gold: #d29b1e;
  --gold-hi: #f0bf45;
  --gold-text: #8c6209;
  --blue: #2f5bd3;
  --teal: #24998a;
  --loss: #13213b;
  --slab: 'Alfa Slab One', 'Rockwell', Georgia, serif;
  --script: 'Mr Dafoe', 'Brush Script MT', cursive;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.5 var(--sans); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cabecera */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gut); background: var(--ink); color: #f5f1e8;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand__mark { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; transform: rotate(-12deg); }
.brand__mark svg { width: 24px; height: 24px; fill: var(--ink); }
.brand__txt { display: flex; flex-direction: column; line-height: 1; }
.brand__txt b { font: 400 26px/1 var(--slab); letter-spacing: .5px; }
.brand__txt small { font: 700 9.5px/1.3 var(--sans); letter-spacing: 1.6px; color: var(--gold-hi); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  font: 400 21px/1 var(--slab); text-transform: uppercase; text-decoration: none; letter-spacing: .5px;
  padding: 9px 12px 7px; color: #c9cfdb; position: relative; isolation: isolate; transition: color .15s;
}
.nav a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--gold); transform: skewX(-12deg) scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav a:hover { color: #fff; }
.nav a.is-on { color: var(--ink); }
.nav a.is-on::before { transform: skewX(-12deg) scaleX(1); }
.ext {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #f5f1e8; color: var(--ink);
  text-decoration: none; font: 700 12px/1 var(--sans); letter-spacing: .3px; transform: skewX(-8deg); flex-shrink: 0;
}
.ext > * { transform: skewX(8deg); }
.ext svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ext:hover { background: var(--gold-hi); }

.band { background: var(--cream); color: var(--ink); padding: 10px var(--gut); font-size: 14px; border-bottom: 1px solid var(--line); }
.band b { font-family: var(--slab); font-weight: 400; letter-spacing: .3px; }

/* ---------- cabecera de cada seccion (hero) */
.hero { background: var(--ink); color: #f5f1e8; overflow: hidden; position: relative; }
.hero__in { max-width: var(--wrap); margin: 0 auto; padding: clamp(36px, 7vw, 90px) var(--gut) clamp(40px, 7vw, 96px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center; min-height: 460px; }
.hero__title { position: relative; margin: 0; line-height: .82; }
.hero__big { display: block; font: 400 clamp(76px, 13vw, 190px)/.82 var(--slab); text-transform: uppercase; letter-spacing: -1px; color: #f5f1e8; }
.hero__big.is-long { font-size: clamp(54px, 8.6vw, 128px); }
.hero__title:has(.is-long) .hero__script { top: 14%; }
.hero__script {
  position: absolute; left: 18%; top: 34%; font: 400 clamp(52px, 8vw, 118px)/1 var(--script); color: var(--gold-hi);
  transform: rotate(-9deg); white-space: nowrap; text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(13,22,38,.55); pointer-events: none;
}
.hero__sub { margin: 26px 0 0; font: 400 clamp(15px, 1.6vw, 20px)/1.25 var(--slab); text-transform: uppercase; letter-spacing: .6px; color: #c9cfdb; }
.hero__sub em { font-style: normal; color: var(--gold-hi); }
.hero__sub .flag { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.hero__sub a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.hero__media { position: relative; aspect-ratio: 1.05; width: 100%; max-width: 640px; justify-self: end; }
.hero__strips {
  position: absolute; inset: 0; clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  -webkit-mask-image: repeating-linear-gradient(100deg, #000 0 11.2%, transparent 11.2% 12.3%);
  mask-image: repeating-linear-gradient(100deg, #000 0 11.2%, transparent 11.2% 12.3%);
  background: var(--navy-2);
}
.hero__strips img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(1.05); mix-blend-mode: luminosity; }
.hero__strips::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(240,191,69,.92), rgba(210,155,30,.72) 45%, rgba(47,91,211,.55)); mix-blend-mode: multiply; }
.hero__glow { position: absolute; inset: -10%; background: radial-gradient(closest-side, rgba(240,191,69,.18), transparent); z-index: -1; }

/* ---------- contenido */
.sec { max-width: var(--wrap); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gut); }
.sec--dark { max-width: none; background: var(--ink); color: #f5f1e8; }
.sec--dark > .sec__in { max-width: var(--wrap); margin: 0 auto; }
.h2 { font: 400 clamp(30px, 4.4vw, 54px)/1 var(--slab); text-transform: uppercase; margin: 0 0 18px; letter-spacing: -.3px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.h2 small { font: 600 14px/1.2 var(--sans); text-transform: none; letter-spacing: 0; color: var(--muted); }
.sec--dark .h2 small { color: #aab3c4; }
.lead { color: var(--muted); max-width: 70ch; margin: -6px 0 22px; }
.note { color: var(--muted); font-size: 13.5px; margin-top: 16px; max-width: 80ch; }
.note b { color: var(--ink); }

.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.field { height: 44px; border: 2px solid var(--ink); background: var(--paper); padding: 0 14px; min-width: 0; border-radius: 0; }
.field:focus { outline: none; box-shadow: 4px 4px 0 var(--gold); }
input.field { flex: 1 1 240px; }
.ac { position: relative; }
.tools .ac { flex: 1 1 240px; }
.ac input.field { width: 100%; }
.ac__list {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 0; list-style: none;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--gold);
  max-height: 320px; overflow-y: auto;
}
.ac__list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font: 600 14.5px/1.2 var(--sans); border-bottom: 1px solid var(--line-soft); }
.ac__list li:last-child { border-bottom: 0; }
.ac__list li:hover, .ac__list li.is-hi { background: var(--cream); }
.ac__list li b { margin-left: auto; font: 700 11.5px/1 var(--sans); color: var(--muted); flex-shrink: 0; }
.ac__list .ac__empty { color: var(--muted); cursor: default; justify-content: center; }
.ac__list .ac__empty:hover { background: none; }
select.field { flex: 0 0 auto; padding-right: 30px; }
.btn { height: 44px; padding: 0 18px; border: 2px solid var(--ink); background: var(--ink); color: #f5f1e8; font: 400 15px/1 var(--slab); text-transform: uppercase; letter-spacing: .4px; cursor: pointer; }
.btn:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; background: var(--ink); color: #f5f1e8; }

/* ---------- tabla de ranking (como la clasificacion de la liga) */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font: 400 12px/1 var(--slab); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); text-align: right; padding: 12px 10px; border-bottom: 3px solid var(--ink); white-space: nowrap; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: rgba(210,155,30,.08); }
.tbl .pos { font: 400 clamp(26px, 3.2vw, 40px)/1 var(--slab); text-align: left; width: 64px; color: var(--ink); }
.tbl tr.top1 .pos, .tbl tr.top2 .pos, .tbl tr.top3 .pos { color: var(--gold); }
.tbl .lvl { font: 400 clamp(24px, 3vw, 38px)/1 var(--slab); }
.tbl tr.top1 .lvl { color: var(--gold-text); }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.who__name { font: 400 clamp(17px, 2vw, 25px)/1.05 var(--slab); text-transform: uppercase; letter-spacing: .2px; display: block; }
.who__team { display: block; font: 500 12.5px/1.3 var(--sans); color: var(--muted); margin-top: 3px; }
.cc { display: inline-flex; align-items: center; gap: 7px; font: 700 13px/1 var(--sans); }
.flag { width: 24px; height: 16px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

/* avatar cuadrado tipo escudo de la liga */
.av { width: 58px; height: 58px; flex-shrink: 0; border: 3px solid var(--ink); background: var(--navy); color: var(--gold-hi); display: grid; place-items: center; font: 400 22px/1 var(--slab); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av--s { width: 42px; height: 42px; font-size: 16px; border-width: 2px; }
.av--l { width: 120px; height: 120px; font-size: 44px; border-width: 4px; border-color: var(--gold); }

/* forma: ultimos resultados */
.form { display: inline-flex; gap: 3px; }
.form i { width: 20px; height: 20px; display: grid; place-items: center; font: 400 11px/1 var(--slab); font-style: normal; border: 2px solid var(--ink); }
.form .W { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.form .L { background: var(--ink); color: #f5f1e8; }
.form .D { background: transparent; color: var(--ink); }
.sec--dark .form .L { background: #f5f1e8; color: var(--ink); border-color: #f5f1e8; }
.sec--dark .form .D { color: #f5f1e8; border-color: #f5f1e8; }

.more { display: flex; justify-content: center; margin-top: 20px; }
.unranked { margin-top: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; background: var(--paper); border: 2px solid var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip:hover { background: var(--cream); }
.chip .flag { width: 18px; height: 12px; }
.chip b { font-family: var(--slab); font-weight: 400; color: var(--gold-text); }
.chip--x { padding-right: 6px; }
.chip--x button { border: 0; background: var(--ink); color: #fff; width: 22px; height: 22px; cursor: pointer; font-weight: 800; line-height: 1; }

/* ---------- jugadores (rejilla) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--paper); border: 2px solid var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--gold); }
.card .who__name { font-size: 17px; }
.card__meta { font: 600 12.5px/1.3 var(--sans); color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.card__meta .flag { width: 18px; height: 12px; }

/* ---------- ficha */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 3px solid currentColor; }
.stat { padding: 18px 14px 6px 0; }
.stat b { display: block; font: 400 clamp(30px, 4.4vw, 58px)/1 var(--slab); }
.stat span { display: block; font: 400 12px/1.2 var(--slab); text-transform: uppercase; letter-spacing: .6px; color: #aab3c4; margin-top: 8px; }
.stat b.gold { color: var(--gold-hi); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.cols--2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list .n { font: 400 20px/1 var(--slab); color: var(--muted); width: 30px; flex-shrink: 0; }
.list .nm { font: 400 16px/1.15 var(--slab); text-transform: uppercase; flex: 1; min-width: 0; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list a.nm:hover { color: var(--gold-text); }
.list .v { font: 400 24px/1 var(--slab); flex-shrink: 0; }
.list .sub { font: 500 12px/1.3 var(--sans); color: var(--muted); display: block; text-transform: none; margin-top: 2px; }
.lhead { font: 400 clamp(24px, 2.6vw, 32px)/1 var(--slab); text-transform: uppercase; margin: 0; padding-bottom: 10px; border-bottom: 3px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lhead small { font: 600 12px/1 var(--sans); text-transform: none; color: var(--muted); }

.mlist { margin: 0; padding: 0; list-style: none; }
.mlist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mlist .res { width: 26px; height: 26px; display: grid; place-items: center; font: 400 13px/1 var(--slab); border: 2px solid var(--ink); }
.mlist .res.W { background: var(--gold); border-color: var(--gold); }
.mlist .res.L { background: var(--ink); color: #f5f1e8; }
.mlist .t { font: 500 12.5px/1.3 var(--sans); color: var(--muted); display: block; }
.mlist .o { font: 400 15px/1.2 var(--slab); text-transform: uppercase; text-decoration: none; }
.mlist .sc { font: 700 14px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }

.chart { width: 100%; height: auto; display: block; }
.chart .ln { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: url(#cg); }
.chart .gd { stroke: var(--line); stroke-width: 1; }
.chart text { font: 600 11px var(--sans); fill: var(--muted); }
.chart .dot { fill: var(--ink); stroke: var(--gold); stroke-width: 2.5; }

/* ---------- cara a cara */
.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 26px; }
.pick .vs { font: 400 28px/1 var(--script); color: var(--gold-text); font-size: 44px; }
.h2h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(12px, 3vw, 40px); align-items: center; }
.h2h__p { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; text-decoration: none; }
.h2h__p .who__name { font-size: clamp(20px, 3vw, 36px); }
.h2h__score { font: 400 clamp(64px, 11vw, 150px)/.9 var(--slab); display: flex; gap: 14px; align-items: center; }
.h2h__score span:nth-child(2) { color: var(--gold-hi); font-size: .5em; }
.odds { margin-top: 30px; }
.odds__bar { display: flex; height: 46px; border: 3px solid #f5f1e8; }
.odds__bar div { display: flex; align-items: center; padding: 0 14px; font: 400 20px/1 var(--slab); white-space: nowrap; overflow: hidden; }
.odds__bar .a { background: var(--gold); color: var(--ink); }
.odds__bar .b { background: #f5f1e8; color: var(--ink); justify-content: flex-end; }
.odds__lbl { display: flex; justify-content: space-between; margin-top: 8px; font: 400 12px/1 var(--slab); text-transform: uppercase; letter-spacing: .6px; color: #aab3c4; }
.cmp { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cmp td { padding: 10px 0; border-bottom: 1px solid var(--line); font: 400 20px/1 var(--slab); width: 38%; }
.cmp td:nth-child(2) { text-align: center; font: 400 12px/1 var(--slab); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); width: 24%; }
.cmp td:last-child { text-align: right; }
.cmp .better { color: var(--gold-text); }

/* ---------- prediccion */
.bars td { font-weight: 700; }
.bar { position: relative; height: 26px; background: var(--line-soft); min-width: 120px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--gold); }
.bar span { position: relative; padding: 0 8px; font: 400 14px/26px var(--slab); }
.tbl td.barcell { width: 26%; }
.bars .who__name { font-size: clamp(15px, 1.5vw, 19px); }

.empty { padding: 40px 0; color: var(--muted); text-align: center; font-size: 16px; }
.loading { padding: 120px var(--gut); text-align: center; font: 400 24px var(--slab); color: var(--muted); }

/* ---------- pie */
.foot { background: var(--ink); color: #aab3c4; border-top: 6px solid var(--gold); }
.foot__in { max-width: var(--wrap); margin: 0 auto; padding: 36px var(--gut) 44px; display: grid; gap: 10px; }
.foot__brand b { font: 400 30px/1 var(--slab); color: #f5f1e8; display: block; }
.foot__brand span { font: 400 30px/1.2 var(--script); color: var(--gold-hi); }
.foot p { margin: 0; max-width: 75ch; font-size: 14px; }
.foot a { color: #f5f1e8; }
.foot__small { font-size: 12.5px; opacity: .8; }

/* ---------- responsive (tambien anchos intermedios) */
@media (max-width: 1100px) {
  .nav a { font-size: 18px; padding: 8px 9px 6px; }
  .ext span { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 10px 16px; padding-top: 10px; padding-bottom: 0; }
  .nav { order: 3; width: 100%; margin: 0 calc(var(--gut) * -1); padding: 4px var(--gut) 10px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .ext { margin-left: auto; }
  .hero__in { grid-template-columns: 1fr; min-height: 0; }
  .hero__media { position: absolute; right: -8%; top: 8%; width: 62%; max-width: none; opacity: .5; z-index: 0; }
  .hero__title, .hero__sub { position: relative; z-index: 1; }
  .cols { grid-template-columns: 1fr; }
  .cols--2 { grid-template-columns: 1fr; }
  .tbl .hide-m { display: none; }
}
@media (max-width: 640px) {
  .tbl .hide-s { display: none; }
  .tbl .who__team { display: none; }
  .tbl .who__name { font-size: 14px; overflow-wrap: break-word; }
  .tbl .lvl { font-size: 22px; }
  .tbl .pos { font-size: 22px; }
  .tbl .av { width: 36px; height: 36px; font-size: 14px; border-width: 2px; }
  .tbl td, .tbl th { padding: 9px 6px; }
  .tbl .pos { width: 40px; }
  .av { width: 44px; height: 44px; font-size: 17px; }
  .who { gap: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick { grid-template-columns: 1fr; }
  .pick .vs { text-align: center; }
  .h2h__p .av--l { width: 76px; height: 76px; font-size: 28px; }
  .hero__script { left: 8%; }
  .brand__txt small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
