/* Celular: la mecánica es tap rápido, así que todo el CSS defiende el gesto
   (sin zoom por doble tap, sin selección, sin scroll accidental). */

.play {
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  z-index: 0;
}

.play::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(80vw 60vh at 50% -10%, color-mix(in srgb, var(--brand-primary) 38%, transparent), transparent 70%),
    linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--brand-secondary) 40%, transparent));
  pointer-events: none;
}

.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.view.active {
  display: block;
}

.pane {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: max(1.1rem, env(safe-area-inset-top)) 1.1rem max(1.4rem, env(safe-area-inset-bottom));
}

.pane.center {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.pane h1 {
  font-size: clamp(1.5rem, 7vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.logo {
  height: 2.6rem;
  width: auto;
  object-fit: contain;
  justify-self: start;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-accent);
}

.label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.big {
  padding: 1.05em 1.2em;
  font-size: 1.05rem;
  width: 100%;
}

.small {
  padding: 0.45em 0.8em;
  font-size: 0.8rem;
}

.error {
  color: #ff9a8f;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

#gate-code {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ─────────────────────────────── registro ─────────────────────────────── */
.char-picker .char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr));
  gap: 0.5rem;
}

.char {
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  gap: 0.1rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  font-size: 1.7rem;
  line-height: 1;
}

.char small {
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.char.on {
  border-color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

.fields {
  display: grid;
  gap: 0.7rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.field .req {
  color: var(--brand-primary);
}

.field .err {
  font-size: 0.72rem;
  color: #ff9a8f;
  margin-top: 0.2rem;
}

.consents {
  display: grid;
  gap: 0.5rem;
}

.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.35;
}

.consent input {
  margin-top: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.privacy {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.privacy summary {
  cursor: pointer;
  color: var(--text);
}

.privacy p {
  margin-top: 0.5rem;
  line-height: 1.45;
}

.legal {
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ───────────────────────────────── sala ──────────────────────────────── */
.me-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.me-glyph {
  font-size: 4.5rem;
  line-height: 1;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}

.me-alias {
  font-size: 1.3rem;
  font-weight: 800;
}

.stat-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stat {
  display: grid;
  justify-items: center;
  min-width: 5.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.stat span {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat small {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.big-emoji {
  font-size: 4.5rem;
  line-height: 1;
}

/* ────────────────────────────── countdown ────────────────────────────── */
.cd-number {
  font-size: 42vh;
  font-weight: 900;
  line-height: 0.85;
  color: var(--brand-accent);
}

.cd-number.tick {
  animation: cdpop 0.5s cubic-bezier(0.15, 1.5, 0.4, 1) both;
}

.cd-number.go {
  font-size: 22vh;
  color: #fff;
}

@keyframes cdpop {
  from {
    transform: scale(0.4);
    opacity: 0.2;
  }
}

/* ─────────────────────────────── tap zone ───────────────────────────── */
.tap-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.6rem;
  padding: max(0.7rem, env(safe-area-inset-top)) 0.8rem max(0.7rem, env(safe-area-inset-bottom));
}

.tap-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  padding: 0.35em 0.75em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.progress {
  flex: 1;
  height: 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: width 90ms linear;
}

.tap-zone {
  position: relative;
  border-radius: 26px;
  border: 2px solid color-mix(in srgb, var(--brand-accent) 45%, transparent);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brand-primary) 40%, transparent), transparent 70%),
    var(--surface);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.2rem;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
}

.tap-zone.hit {
  animation: hit 90ms ease-out;
}

@keyframes hit {
  50% {
    transform: scale(0.985);
  }
}

.tap-glyph {
  font-size: 22vh;
  line-height: 1;
  pointer-events: none;
}

.tap-glyph.hit {
  animation: glyphhit 110ms ease-out;
}

@keyframes glyphhit {
  50% {
    transform: scale(1.12) rotate(-3deg);
  }
}

.tap-count {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.tap-label {
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  font-weight: 800;
  color: var(--brand-accent);
  pointer-events: none;
}

.tap-tps {
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.ripples {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ripple {
  position: absolute;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand-accent) 70%, transparent);
  animation: ripple 420ms ease-out forwards;
}

@keyframes ripple {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

.tap-foot {
  min-height: 1.4rem;
  text-align: center;
}

.notice {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-accent);
}

.pos-badge {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--brand-accent);
}

.conn {
  position: fixed;
  left: 50%;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.5em 1em;
  border-radius: 999px;
  background: #b3261e;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
