/* Bitrir. Oscuro, con el amarillo y el rojo del logotipo como acentos. Titulares condensados y en cursiva,
   pegatinas ligeramente giradas y textura de trama: más tienda de zapatillas que patio de colegio. */
@font-face { font-family: Anton; src: url(/fonts/anton-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 400; src: url(/fonts/barlow-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 600; src: url(/fonts/barlow-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 800; src: url(/fonts/barlow-latin-800-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; src: url(/fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: italic; src: url(/fonts/barlow-condensed-latin-800-italic.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 900; font-style: italic; src: url(/fonts/barlow-condensed-latin-900-italic.woff2) format('woff2'); font-display: swap; }

:root {
  --ink: #0b0b0f; --ink-2: #131319; --ink-3: #1c1c25; --ink-4: #262632; --line: #2e2e3b;
  --text: #f6f2e7; --muted: #a3a0ad; --dim: #6f6c7a;
  --yellow: #f5d60a; --yellow-2: #ffe94d; --red: #e1352b; --red-2: #ff4a3d; --green: #3ddc84;
  --display: Anton, 'Barlow Condensed', Impact, sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Barlow, system-ui, sans-serif;
  --r: 14px; --gutter: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1.2px); background-size: 6px 6px; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img, svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px var(--gutter);
  background: rgba(11,11,15,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; text-decoration: none; gap: 1px; }
.brand img { width: 40px; height: 40px; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.brand:hover img:first-child { transform: rotate(-14deg) scale(1.06); }
.brand { gap: 10px; }
.brand img.wordmark { width: auto; height: 22px; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { position: relative; text-decoration: none; font: 800 15px/1 var(--cond); text-transform: uppercase; letter-spacing: .6px;
  padding: 10px 12px; border-radius: 10px; color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--ink-3); }
.nav a.on { color: var(--ink); background: var(--yellow); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #fff; font: 800 11px/18px var(--body); text-align: center; }
.me-chip { margin-left: auto; display: flex; align-items: center; gap: 9px; text-decoration: none; padding: 5px 12px 5px 5px;
  border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); font-weight: 800; }
.me-chip:hover { border-color: var(--yellow); }

/* ---------- avatar (iniciales sobre color derivado del alias) ---------- */
.av { --h: 40; width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: hsl(var(--h) 85% 55%); color: var(--ink); font: 900 italic 16px/1 var(--cond); text-transform: uppercase; position: relative; }
.av.big { width: 72px; height: 72px; font-size: 34px; }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--dim); }
.av .dot.on { background: var(--green); }
.av .dot.play { background: var(--yellow); }

/* ---------- maquetación ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 22px var(--gutter) 110px; }
.h-display { font: 400 clamp(46px, 9vw, 104px)/.9 var(--display); text-transform: uppercase; letter-spacing: .5px; margin: 0; }
.h-section { display: flex; align-items: baseline; gap: 12px; font: italic 900 30px/1 var(--cond); text-transform: uppercase; margin: 38px 0 14px; letter-spacing: .3px; }
.h-section small { font: 600 14px var(--body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* pegatinas */
.sticker { display: inline-block; font: italic 900 15px/1 var(--cond); text-transform: uppercase; letter-spacing: .5px;
  padding: 7px 11px 6px; border-radius: 6px; background: var(--red); color: #fff; transform: rotate(-3deg); box-shadow: 3px 3px 0 var(--ink); }
.sticker.y { background: var(--yellow); color: var(--ink); transform: rotate(2deg); }
.sticker.k { background: var(--text); color: var(--ink); transform: rotate(-1.5deg); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px;
  cursor: pointer; text-decoration: none; font: italic 900 19px/1 var(--cond); text-transform: uppercase; letter-spacing: .6px;
  background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 #a88f00; transition: transform .08s, box-shadow .08s, background .15s; }
.btn:hover { background: var(--yellow-2); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a88f00; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 #8f1d16; }
.btn.red:hover { background: var(--red-2); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--text); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 16px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }

/* ---------- portada ---------- */
.hero { position: relative; border-radius: 22px; overflow: hidden; padding: clamp(26px, 5vw, 56px); min-height: 420px; display: grid; align-content: end;
  background: linear-gradient(115deg, rgba(11,11,15,.96) 30%, rgba(11,11,15,.35)), url(/juegos/once-football/portada.svg) center/cover, var(--ink-3);
  border: 1px solid var(--line); isolation: isolate; }
.hero::after { content: ''; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(225,53,43,.45), transparent); z-index: -1; }
.hero .kicker { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.hero .h-display span { color: var(--yellow); display: block; }
.hero p { max-width: 520px; font-size: 18px; color: #d9d5ca; margin: 18px 0 24px; }
.ticker { margin: 18px calc(var(--gutter) * -1) 0; overflow: hidden; white-space: nowrap; background: var(--yellow); color: var(--ink);
  font: italic 900 20px/1 var(--cond); text-transform: uppercase; padding: 10px 0; transform: rotate(-1.2deg); }
.ticker div { display: inline-block; animation: tick 28s linear infinite; }
.ticker span { margin: 0 18px; }
.ticker b { color: var(--red); }
@keyframes tick { to { transform: translateX(-50%); } }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { position: relative; display: block; text-decoration: none; border-radius: var(--r); overflow: hidden; background: var(--ink-2); border: 1px solid var(--line);
  transition: transform .18s, border-color .18s; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--yellow); }
.card .cover { aspect-ratio: 16/10; background: var(--ink-3) center/cover; }
.card .body { padding: 14px 16px 16px; }
.card h3 { margin: 0; font: italic 900 26px/1 var(--cond); text-transform: uppercase; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font: 800 12px/1 var(--body); text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; border-radius: 6px; background: var(--ink-4); color: var(--muted); }
.tag.hot { background: rgba(225,53,43,.18); color: var(--red-2); }
.tag.y { background: rgba(245,214,10,.14); color: var(--yellow); }
.card .corner { position: absolute; top: 12px; left: 12px; }
.soon { display: grid; place-items: center; text-align: center; min-height: 260px; border-style: dashed; color: var(--muted); padding: 24px; }
.soon b { display: block; font: italic 900 24px/1.05 var(--cond); text-transform: uppercase; color: var(--text); margin-bottom: 8px; }

.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.friend-pill { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); }
.friend-pill small { display: block; color: var(--muted); font-size: 12px; line-height: 1.1; }

/* ---------- formularios ---------- */
.auth { min-height: calc(100dvh - 160px); display: grid; place-items: center; }
.panel { width: min(440px, 100%); background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; padding: 28px; position: relative; }
.panel h1 { font: italic 900 40px/1 var(--cond); text-transform: uppercase; margin: 6px 0 6px; }
.field { display: grid; gap: 6px; margin: 16px 0; }
.field label { font: 800 13px var(--body); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.field input { height: 50px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--ink); outline: none; font-size: 17px; }
.field input:focus { border-color: var(--yellow); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--yellow); flex: none; }
.check a { color: var(--text); }
.field input.code-input { font: 400 34px/1 var(--display); letter-spacing: 10px; text-align: center; height: 62px; }
.panel a { color: var(--yellow); }
.err { color: var(--red-2); font-weight: 600; min-height: 22px; margin: 4px 0; }
.eco { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--ink-3); font-size: 14px; color: var(--muted); }

/* ---------- amigos ---------- */
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px;
  background: var(--yellow); color: var(--ink); }
.code-box .code { font: 400 clamp(40px, 8vw, 64px)/1 var(--display); letter-spacing: 3px; }
.code-box p { margin: 0; font-weight: 600; }
.add { display: flex; gap: 10px; margin-top: 14px; }
.add input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--ink-2); text-transform: uppercase;
  font: 800 20px var(--cond); letter-spacing: 2px; outline: none; }
.add input:focus { border-color: var(--yellow); }
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.item .who { flex: 1; min-width: 0; }
.item .who b { display: block; font-size: 17px; }
.item .who small { color: var(--muted); }
.empty { padding: 26px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

/* ---------- página de juego ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.stage { position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.stage-bar h1 { font: italic 900 32px/1 var(--cond); text-transform: uppercase; margin: 0 auto 0 0; }
body.full .top, body.full .bottom-nav, body.full .side, body.full .stage-bar, body.full .game-info { display: none !important; }
body.full main { padding: 0; max-width: none; }
body.full .stage { position: fixed; inset: 0; aspect-ratio: auto; border-radius: 0; border: 0; z-index: 50; }
.exit-full { display: none; position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 60; }
body.full .exit-full { display: inline-flex; }
.side { display: grid; gap: 14px; }
.box { background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.box h2 { margin: 0 0 12px; font: italic 900 22px/1 var(--cond); text-transform: uppercase; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ach:first-of-type { border-top: 0; }
.ach .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ink-4); color: var(--dim); font: 900 18px var(--cond); flex: none; }
.ach.got .ico { background: var(--yellow); color: var(--ink); transform: rotate(-6deg); }
.ach small { display: block; color: var(--muted); line-height: 1.2; }
.game-info { margin-top: 18px; }
.game-info p { color: #d9d5ca; max-width: 720px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.fact { background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fact small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; letter-spacing: .4px; }

/* ---------- perfil ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head h1 { font: italic 900 48px/1 var(--cond); margin: 0; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font: 400 40px/1 var(--display); color: var(--yellow); }

/* ---------- avisos y retos ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 84px; transform: translateX(-50%); display: grid; gap: 10px; width: min(460px, calc(100% - 24px)); }
.toast { padding: 14px 16px; border-radius: 14px; background: var(--ink-3); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: pop .3s cubic-bezier(.3,1.5,.5,1); }
.toast.ach-t { background: var(--yellow); color: var(--ink); border: 0; font-weight: 800; }
.challenge { position: relative; overflow: hidden; padding: 16px; border-radius: 18px; background: var(--red); color: #fff; box-shadow: 0 16px 50px rgba(225,53,43,.45); animation: pop .35s cubic-bezier(.3,1.5,.5,1); }
.challenge .kick { font: italic 900 14px var(--cond); text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.challenge h3 { margin: 2px 0 12px; font: italic 900 28px/1 var(--cond); text-transform: uppercase; }
.challenge .timer { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--yellow); animation: shrink linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
@keyframes pop { from { transform: translateY(20px) scale(.96); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: var(--gutter); }
.modal { width: min(440px, 100%); max-height: 80vh; overflow: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.modal h2 { margin: 0 0 4px; font: italic 900 30px/1 var(--cond); text-transform: uppercase; }

/* ---------- navegación del móvil ---------- */
.bottom-nav { display: none; }
footer { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 120px; color: var(--dim); font-size: 13px; }

@media (max-width: 860px) {
  .game-layout { grid-template-columns: 1fr; }
  .nav, .me-chip > span:last-child { display: none; }
  .me-chip { padding: 4px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: rgba(11,11,15,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .bottom-nav a { position: relative; flex: 1; display: grid; place-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--muted);
    font: 800 12px/1 var(--cond); text-transform: uppercase; letter-spacing: .5px; border-radius: 10px; }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.on { color: var(--yellow); }
  .bottom-nav .badge { right: 28%; }
  .hero { min-height: 380px; }
  .brand img.wordmark { height: 19px; }
}
@media (prefers-reduced-motion: reduce) { .ticker div { animation: none; } * { transition: none !important; } }
