/* =========================================================================
   SISTEMA BAR · estilo "pizarra de bar + pizarra táctica"
   Rústico a propósito: tiza, madera, cinta, sellos y cerveza.
   ========================================================================= */
@font-face { font-family: 'Rubik Dirt'; src: url('fonts/rubik-dirt.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Permanent Marker'; src: url('fonts/permanent-marker.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --slate: #1b1f1c;
  --slate-2: #232825;
  --chalk: #efe8d8;
  --chalk-dim: #b8b2a2;
  --chalk-faint: rgba(239, 232, 216, .18);
  --amber: #f5b82e;
  --amber-dark: #c98a0c;
  --foam: #fff7e2;
  --red: #e04a3a;
  --green: #5fbf6a;
  --wood: #6b4527;
  --wood-dark: #3f2815;
  --paper: #efe3c6;
  --ink: #26201a;
  --display: 'Rubik Dirt', Impact, 'Arial Black', sans-serif;
  --hand: 'Permanent Marker', 'Comic Sans MS', cursive;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--chalk);
  background-color: var(--slate);
  background-image:
    var(--noise),
    radial-gradient(ellipse at 20% 0%, rgba(239,232,216,.07), transparent 55%),
    radial-gradient(ellipse at 90% 40%, rgba(239,232,216,.05), transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(245,184,46,.05), transparent 50%);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--amber); }
::selection { background: var(--amber); color: var(--ink); }

/* ------------------------------ Header ------------------------------ */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(var(--wood), var(--wood-dark));
  border-bottom: 3px solid #2a1a0d;
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.wordmark { font-family: var(--display); font-size: 24px; line-height: 1; color: var(--foam); letter-spacing: 1px; text-shadow: 2px 2px 0 rgba(0,0,0,.45); white-space: nowrap; }
.tag { font-family: var(--hand); font-size: 12px; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; }
.lang {
  font-family: var(--display); font-size: 15px; text-decoration: none; color: var(--ink);
  background: var(--paper); padding: 5px 9px; border-radius: 6px; box-shadow: 2px 2px 0 #000; transform: rotate(-3deg);
}
.lang:hover { transform: rotate(0); }
.status { font-size: 11px; padding: 5px 9px; border-radius: 99px; background: rgba(0,0,0,.35); color: #ffb4ae; white-space: nowrap; border: 1px solid rgba(255,255,255,.12); }
.status.ok { color: var(--green); }
@media (max-width: 420px) {
  .status { display: none; }
  body[data-screen="s-panel"] .status, body[data-screen="s-camera"] .status { display: block; }
  .wordmark { font-size: 20px; }
}

main { max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .5px; }
h2 { font-size: clamp(26px, 5vw, 38px); margin: 0 0 12px; }
h3 { margin: 0 0 8px; }
.muted { color: var(--chalk-dim); }
.small { font-size: 13px; }
.hand { font-family: var(--hand); }

/* ------------------------------- Hero ------------------------------- */
.hero { display: grid; gap: 34px; align-items: center; padding: 10px 0 26px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr 1fr; } }
.kicker { font-family: var(--hand); color: var(--amber); font-size: 18px; transform: rotate(-2deg); display: inline-block; }
h1 { font-size: clamp(34px, 7.4vw, 62px); line-height: 1.04; margin: 6px 0 14px; text-shadow: 3px 3px 0 rgba(0,0,0,.35); }
h1 .hl { color: var(--amber); position: relative; white-space: nowrap; }
h1 .hl::after { content: ''; position: absolute; left: -2%; right: -2%; bottom: -2px; height: 10px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2 8 C 50 2, 120 12, 198 4' stroke='%23e04a3a' stroke-width='4' fill='none' stroke-linecap='round'/></svg>") no-repeat center/100% 100%; }
.lead { color: var(--chalk-dim); font-size: 17px; line-height: 1.55; max-width: 560px; }
.hand-note { font-family: var(--hand); color: var(--chalk-dim); font-size: 15px; margin: 6px 0 0 10px; transform: rotate(-1.5deg); }
.hero-art { position: relative; margin: 10px 8px 20px; }
.board { width: 100%; height: auto; display: block; background: var(--slate-2); border: 10px solid var(--wood); border-radius: 6px; box-shadow: inset 0 0 40px rgba(0,0,0,.6), 0 8px 0 rgba(0,0,0,.4); outline: 3px solid var(--wood-dark); }
.hero-logo { position: absolute; width: 34%; aspect-ratio: 1; right: -14px; bottom: -34px; transform: rotate(10deg); filter: drop-shadow(4px 6px 0 rgba(0,0,0,.45)); }
.stamp {
  position: absolute; top: -16px; left: -12px; z-index: 2;
  font-family: var(--display); font-size: 26px; color: var(--red); padding: 6px 16px;
  border: 4px solid var(--red); border-radius: 10px; transform: rotate(-12deg);
  background: rgba(27,31,28,.9); letter-spacing: 2px;
}

/* ------------------------------ Botones ----------------------------- */
.btn {
  appearance: none; border: 2px solid var(--chalk); background: transparent; color: var(--chalk);
  border-radius: 10px; padding: 12px 16px; font-weight: 800; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.55);
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
  -webkit-tap-highlight-color: transparent; user-select: none; text-align: center;
}
.btn:hover { background: rgba(239,232,216,.06); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,.55); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn small { font-weight: 600; font-size: 12px; opacity: .8; }
.btn.primary { background: var(--amber); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 #000; }
.btn.primary:hover { background: #ffc94a; }
.btn.ghost { border-style: dashed; border-color: var(--chalk-faint); box-shadow: none; }
.btn.ok { background: var(--green); color: #0b2410; border-color: #0b2410; }
.btn.warn { background: var(--red); color: #fff; border-color: #3a0a05; }
.btn.small { padding: 8px 12px; font-size: 14px; box-shadow: 2px 2px 0 rgba(0,0,0,.5); }
.btn.xl { padding: 16px 18px; font-size: 20px; width: 100%; font-family: var(--display); font-weight: 400; letter-spacing: .5px; }
.btn.xl small { font-family: var(--body); letter-spacing: 0; }
.big-buttons { display: grid; gap: 14px; margin: 18px 0 8px; }
@media (min-width: 560px) { .big-buttons { grid-template-columns: 1fr 1fr; } }
.install { width: 100%; margin-top: 4px; }

/* ------------------------------ Ticker ------------------------------ */
.ticker {
  overflow: hidden; margin: 30px -16px; background: var(--amber); color: var(--ink);
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-1.5deg);
  box-shadow: 0 6px 0 rgba(0,0,0,.35);
}
.ticker-track { display: flex; width: max-content; animation: tick 38s linear infinite; }
.ticker-track span { font-family: var(--display); font-size: 22px; padding: 10px 0; white-space: nowrap; }
.ticker-track span::after { content: '⚽'; margin: 0 22px; font-size: 18px; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---------------------------- Menú del BAR -------------------------- */
.menu-board {
  margin: 40px 0; padding: 26px 22px 20px; background: var(--slate-2) var(--noise);
  border: 14px solid var(--wood); outline: 3px solid var(--wood-dark); border-radius: 6px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.55), 0 10px 0 rgba(0,0,0,.4);
}
.menu-head { text-align: center; margin-bottom: 14px; }
.menu-head h2 { margin: 0; font-size: clamp(32px, 6vw, 48px); }
.menu-head .hand { color: var(--amber); font-size: 18px; margin: 4px 0 0; }
.menu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px 34px; }
@media (min-width: 760px) { .menu-list { grid-template-columns: 1fr 1fr; } }
.menu-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--chalk-faint); }
.mi-ico { font-size: 26px; line-height: 1.2; }
.mi-body { flex: 1; min-width: 0; }
.mi-row { display: flex; align-items: baseline; gap: 8px; }
.mi-row b { font-family: var(--hand); font-weight: 400; font-size: 20px; color: var(--foam); }
.mi-row i { flex: 1; border-bottom: 3px dotted var(--chalk-faint); transform: translateY(-4px); }
.price { font-family: var(--display); color: var(--amber); font-size: 22px; }
.mi-body p { margin: 4px 0 0; color: var(--chalk-dim); font-size: 14px; line-height: 1.45; }

/* --------------------------- Reglas y pasos ------------------------- */
.two-col { display: grid; gap: 30px; margin: 40px 0; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }
.rules-note {
  position: relative; background-color: var(--paper); color: var(--ink); padding: 30px 24px 22px;
  transform: rotate(-1.2deg); box-shadow: 6px 8px 0 rgba(0,0,0,.45);
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(38,32,26,.12) 31px 32px);
}
.rules-note h2 { color: var(--red); margin-bottom: 0; }
.rules-note .pin { font-family: var(--hand); color: #7a6a52; margin: 0 0 10px; font-size: 14px; }
.rules-note ol { margin: 0; padding-left: 26px; font-family: var(--hand); font-size: 18px; line-height: 1.5; }
.rules-note li { margin-bottom: 6px; }
.tape { position: absolute; top: -14px; left: 50%; width: 120px; height: 30px; transform: translateX(-50%) rotate(3deg); background: rgba(245,236,200,.75); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.how h2 { margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .num {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-size: 22px; color: var(--ink); background: var(--amber); box-shadow: 3px 3px 0 #000;
}
.steps b { font-family: var(--hand); font-weight: 400; font-size: 20px; }
.steps p { margin: 2px 0 0; color: var(--chalk-dim); line-height: 1.45; }

/* -------------------------------- FAQ ------------------------------- */
.faq-wrap { margin: 40px 0; }
.faq { border: 2px dashed var(--chalk-faint); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: rgba(0,0,0,.12); }
.faq summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--display); color: var(--amber); font-size: 22px; line-height: 1; }
.faq[open] summary::after { content: '−'; }
.faq p { color: var(--chalk-dim); margin: 10px 0 0; line-height: 1.5; }
.cta-end { max-width: 460px; margin: 30px auto; }
.foot { text-align: center; color: var(--chalk-dim); font-size: 14px; padding: 20px 0 10px; border-top: 2px dashed var(--chalk-faint); margin-top: 30px; }
.foot-logo { width: 74px; height: 74px; opacity: .9; }

/* ------------------------- Formularios / cards ---------------------- */
.screen-title { margin-top: 6px; }
.card {
  background: var(--slate-2) var(--noise); border: 2px solid var(--chalk-faint); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: 4px 4px 0 rgba(0,0,0,.35);
}
.form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--chalk-dim); font-weight: 600; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
input, select {
  background: rgba(0,0,0,.3); color: var(--chalk); border: 2px solid var(--chalk-faint);
  border-radius: 10px; padding: 11px 12px; font-size: 16px;
}
input:focus, select:focus { outline: none; border-color: var(--amber); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-input { font-family: var(--display); font-size: 30px; letter-spacing: 8px; text-transform: uppercase; text-align: center; color: var(--amber); }

/* ------------------------------ Cámara ------------------------------ */
.cam-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 14px; border: 8px solid var(--wood); outline: 2px solid var(--wood-dark); }
.cam-wrap video { width: 100%; display: block; max-height: 62vh; object-fit: contain; }
.rec { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.65); padding: 6px 10px; border-radius: 99px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.cam-label { position: absolute; bottom: 10px; left: 10px; background: var(--paper); color: var(--ink); padding: 4px 10px; border-radius: 4px; font-family: var(--hand); transform: rotate(-2deg); }
.challenge { font-size: 24px; }
.controls { display: flex; flex-direction: column; gap: 12px; }

/* ----------------------------- Marcador ----------------------------- */
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.team {
  background: var(--slate-2) var(--noise); border: 8px solid var(--wood); outline: 2px solid var(--wood-dark);
  border-radius: 6px; padding: 10px; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.4);
}
.team.mine { border-color: var(--amber-dark); }
.team.banned { border-color: #6a1d16; }
.team-name { font-family: var(--hand); font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goals { font-family: var(--display); font-size: 46px; line-height: 1.05; color: var(--foam); }
.pints { font-size: 22px; letter-spacing: 2px; min-height: 30px; }
.pint.gone { filter: grayscale(1); opacity: .25; }
.pints-label { font-size: 11px; color: var(--chalk-dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.goal-btns { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }

.share { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.code { font-family: var(--display); font-size: 40px; letter-spacing: 6px; color: var(--amber); }
.share-btns { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.share img { background: #fff; border-radius: 8px; padding: 6px; transform: rotate(2deg); box-shadow: 3px 3px 0 #000; }

/* ------------------------------ En vivo ----------------------------- */
.sec-title { margin: 24px 0 10px; font-family: var(--hand); font-weight: 400; font-size: 20px; color: var(--chalk); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tile { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; cursor: pointer; border: 3px solid var(--chalk-faint); }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .lbl { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.7); padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 800; }
.tile.big { grid-column: 1 / -1; }
.empty { color: var(--chalk-dim); padding: 24px; border: 2px dashed var(--chalk-faint); border-radius: 12px; text-align: center; grid-column: 1 / -1; font-family: var(--hand); }

/* ----------------------------- Revisión ----------------------------- */
.review { border: 3px solid var(--amber); box-shadow: 0 0 0 4px rgba(245,184,46,.15), 6px 6px 0 #000; }
.rv-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.rv-title { font-family: var(--display); font-size: 20px; }
.rv-phrase { color: var(--amber); font-family: var(--hand); font-size: 16px; margin-top: 2px; }
.rv-live { background: var(--red); color: #fff; font-weight: 800; font-size: 11px; padding: 5px 9px; border-radius: 4px; animation: blink 1.4s infinite; white-space: nowrap; transform: rotate(3deg); }
.rv-angles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.rv-angles .tile.nodata video { opacity: .25; }
.rv-angles .tile .prog { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.rv-wait { color: var(--chalk-dim); padding: 30px; text-align: center; grid-column: 1 / -1; font-family: var(--hand); font-size: 18px; }
.rv-timeline { margin: 12px 0 6px; }
.rv-timeline input { width: 100%; padding: 0; accent-color: var(--amber); }
.rv-time { font-size: 13px; color: var(--chalk-dim); text-align: center; }
.rv-ctrls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.rv-ctrls select { padding: 7px 8px; }
.rv-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.rv-verdict .wide { grid-column: 1 / -1; }

.history, .people { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.history li, .people li { background: rgba(0,0,0,.2); border: 1px dashed var(--chalk-faint); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.saved-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ------------------------------- Chat ------------------------------- */
.chat { margin-top: 22px; }
.chat-log { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.msg b { color: var(--amber); }
.msg.sys { color: var(--chalk-dim); font-family: var(--hand); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.ptt-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ptt { flex: 1; min-width: 200px; touch-action: none; }
.ptt.on { background: var(--red); border-color: var(--red); color: #fff; }

/* -------------------------- Toasts y veredicto ---------------------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(92vw, 460px); }
.toast { background: var(--paper); color: var(--ink); padding: 12px 14px; border-radius: 6px; box-shadow: 4px 4px 0 #000; font-weight: 700; display: flex; gap: 10px; align-items: center; justify-content: space-between; animation: pop .2s ease; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.verdict-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(10,12,11,.9); padding: 24px; }
.v-card { text-align: center; animation: slam .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes slam { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }
.v-emoji { font-size: 80px; }
.v-title {
  display: inline-block; font-family: var(--display); font-size: clamp(34px, 10vw, 72px); padding: 6px 22px;
  border: 6px solid currentColor; border-radius: 14px; transform: rotate(-6deg); margin: 10px 0 16px;
}
.v-keep .v-title { color: var(--green); }
.v-change .v-title { color: var(--red); }
.v-phrase { font-family: var(--hand); font-size: 24px; color: var(--foam); }
.v-note { color: var(--chalk-dim); margin-top: 12px; }

/* ----------------------------- Publicidad --------------------------- */
.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot.on { min-height: 100px; }
.ad-slot.on::before { content: attr(data-label); display: block; font-size: 10px; color: var(--chalk-dim); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }

/* --------------------------- Página legal --------------------------- */
.legal { max-width: 760px; margin: 16px auto; line-height: 1.6; }
.legal h2 { color: var(--amber); }
