:root {
  --ink: #07110c;
  --lime: #82f741;
  --lime-2: #c8ff9a;
  --paper: #f3f6f0;
  --card: #111a14;
  --line: rgba(255, 255, 255, 0.08);
  --muted: rgba(243, 246, 240, 0.62);
  --danger: #ff5a36;
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
}

@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

#app { min-height: 100%; }

@media (orientation: landscape) and (max-height: 520px) {
  html { overflow: hidden; background: var(--ink); }
  body {
    position: fixed;
    width: 100dvh;
    height: 100dvw;
    overflow: hidden;
    background: var(--ink);
    top: 0;
    left: 100dvw;
    transform: rotate(90deg);
    transform-origin: top left;
  }
  html.forzar-270 body {
    top: 100dvh;
    left: 0;
    transform: rotate(-90deg);
  }
}

.screen {
  min-height: 100dvh;
  padding: calc(1.1rem + env(safe-area-inset-top)) 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.lead { margin: 0 0 1.2rem; color: var(--muted); line-height: 1.45; max-width: 36rem; }

.list { display: grid; gap: 0.75rem; }
.card {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #152018, #101712);
  color: var(--paper);
  border-radius: 1.2rem;
  padding: 1rem 1rem 0.95rem;
}
.card strong { display: block; font-size: 1.2rem; letter-spacing: -0.03em; }
.card span { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-lime { background: var(--lime); color: #111; }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid rgba(255,255,255,0.2); }
.btn-dark { background: #111; color: var(--lime); }
.btn-danger { background: var(--danger); color: white; }
.btn-orange { background: #ff8a1a; color: #1a0d00; }
.btn:disabled { opacity: 0.45; }

.field { display: grid; gap: 0.35rem; margin-bottom: 0.8rem; }
.field label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #0c140f;
  color: white;
  border-radius: 0.9rem;
  padding: 0.85rem 0.9rem;
}
.row { display: flex; gap: 0.6rem; }
.row .btn { width: auto; flex: 1; }

.err { color: #ffb4a8; font-weight: 700; margin: 0 0 0.8rem; }
.top-link { color: var(--muted); font-size: 0.85rem; font-weight: 700; text-decoration: none; }
button.top-link { background: none; border: 0; padding: 0; }

.rank { margin-top: 1.4rem; }
.rank ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.rank li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.rank b { font-variant-numeric: tabular-nums; }

.run {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: #0b120e;
}
#map { position: absolute; inset: 0; }
.leaflet-control-attribution { font-size: 10px !important; }

.centrar {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  transform: translate(-50%, calc(-100% - 0.6rem));
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 0.62rem 1rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}
.hud {
  position: absolute;
  z-index: 500;
  left: 0.75rem;
  right: 0.75rem;
  top: calc(0.7rem + env(safe-area-inset-top));
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.salir {
  pointer-events: auto;
  margin-right: auto;
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill {
  pointer-events: auto;
  background: rgba(7, 17, 12, 0.82);
  color: white;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.pill a { color: var(--lime-2); text-decoration: none; }
.pill.ok { color: var(--lime); }
.pill.bad { color: #ffb4a8; }

.sheet {
  position: absolute;
  z-index: 500;
  left: 0.65rem;
  right: 0.65rem;
  bottom: calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(7, 17, 12, 0.92);
  border: 1px solid rgba(130, 247, 65, 0.25);
  border-radius: 1.25rem;
  padding: 0.75rem 0.8rem 0.7rem;
  backdrop-filter: blur(12px);
}
.sheet .btn { padding: 0.78rem 1rem; }
@font-face {
  font-family: 'Reloj';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-700.woff2') format('woff2');
}
.clock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.04em;
  margin: 0.15rem 0 0;
  font-family: Reloj, Outfit, sans-serif;
  font-size: clamp(3.4rem, 18vw, 4.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 0.9;
  text-align: center;
}
.clock span { min-width: 2ch; text-align: center; }
.clock i {
  font-style: normal;
  font-weight: 600;
  opacity: 0.72;
  transform: translateY(-0.06em);
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  margin: 0.55rem 0 0.65rem;
  text-align: center;
}
.stats div { min-width: 0; }
.stats strong {
  display: block;
  font-family: Reloj, Outfit, sans-serif;
  font-size: clamp(1.7rem, 8vw, 2.15rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  line-height: 0.9;
}
.stats small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.live {
  margin: 0.1rem 0 0.15rem;
  text-align: center;
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.live::before {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--lime);
  vertical-align: 0.05rem;
  animation: pulso 1.4s ease-out infinite;
}
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(130, 247, 65, 0.7); }
  100% { box-shadow: 0 0 0 8px rgba(130, 247, 65, 0); }
}
@media (max-height: 700px) {
  .clock { font-size: clamp(2.8rem, 16vw, 3.4rem); }
  .stats { margin: 0.35rem 0 0.45rem; }
  .stats strong { font-size: 1.45rem; }
  .sheet { padding: 0.6rem 0.7rem 0.55rem; }
  .sheet .btn { padding: 0.68rem 0.85rem; }
}
.dists { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dist {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: white;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-weight: 800;
}
.dist.on { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.reset-slot { margin-top: 0.45rem; }
.ask {
  margin-top: 0.75rem;
  padding: 0.85rem 0.85rem 0.8rem;
  border-radius: 1rem;
  background: rgba(255, 90, 54, 0.1);
  border: 1px solid rgba(255, 90, 54, 0.4);
}
.ask > p { margin: 0; font-weight: 800; }
.ask .note { margin: 0.3rem 0 0; }
.ask .row { margin-top: 0.75rem; }
.note { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
form .note { margin: 0 0 0.8rem; }
.who {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}
.who span {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.who .evento { color: var(--lime); }
.who .persona { color: var(--paper); text-align: right; }

.gate {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 42% at 100% 16%, rgba(130, 247, 65, 0.45), transparent 58%),
    linear-gradient(180deg, #e7f3df 0%, #f4f7f1 38%, #f7f8f4 100%);
  color: #142018;
}
.gate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #10261b;
  padding: calc(0.65rem + env(safe-area-inset-top)) 1rem 0.65rem;
  border-bottom: 3px solid #82f741;
}
.logo-wens { height: 34px; width: auto; }
.logo-fc { height: 52px; width: auto; }
.gate-body { padding: 1.35rem 1.15rem calc(1.4rem + env(safe-area-inset-bottom)); }
.gate-kicker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
  color: #5f8a62;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gate-kicker svg, .gate-input svg, .gate-lock svg, .gate-help svg, .gate-go svg { width: 1.05rem; height: 1.05rem; flex: none; }
.gate h1 {
  margin: 0 0 0.7rem;
  color: #121814;
  font-size: clamp(2.35rem, 10vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: none;
  font-weight: 800;
}
.gate h1 span { color: #1c7a34; }
.gate-lead { margin: 0 0 1.15rem; color: #5d675f; line-height: 1.4; font-size: 0.98rem; }
.gate-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.05rem 1rem 0.95rem;
  box-shadow: 0 16px 40px rgba(16, 38, 27, 0.08);
}
.gate .field { margin-bottom: 0.85rem; }
.gate .field label {
  color: #1b2620;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.92rem;
  font-weight: 700;
}
.gate-input { position: relative; }
.gate-input svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: #7d8a80; }
.gate-input input {
  width: 100%;
  border: 0;
  background: #eef2ea;
  color: #142018;
  border-radius: 0.85rem;
  padding: 0.95rem 0.9rem 0.95rem 2.7rem;
}
.gate-input input::placeholder { color: #9aa59c; }
.gate-hint { margin: 0.4rem 0 0; color: #8b968c; font-size: 0.78rem; }
.gate .err { color: #c2412d; }
.gate-go { display: flex; justify-content: space-between; margin-top: 0.35rem; text-transform: none; letter-spacing: 0; white-space: nowrap; font-size: 1.02rem; }
.gate-lock, .gate-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.gate-lock { margin: 0.8rem 0 0; color: #8b968c; font-size: 0.78rem; }
.gate-help {
  margin: 1.35rem 0 0;
  color: #1c7a34;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
}
.gate-foot { margin: 1.35rem 0 0; text-align: center; color: #8b968c; font-size: 0.78rem; }
