/* =========================================================
   ¿QUIÉN DE AQUÍ? · Hoja de estilos principal
   Mobile-first, sin fuentes ni imágenes externas.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #08071a;
  --bg-2: #0f0c2a;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f6f3ff;
  --muted: #a7a1c7;
  --muted-2: #7d779c;
  --lime: #c8ff4d;
  --lime-2: #a8f02e;
  --coral: #ff5c7a;
  --cyan: #58e6ff;
  --violet: #9b6cff;
  --yellow: #ffd166;
  --green: #7cf29c;
  --radius: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 50% at 12% 0%, rgba(255, 92, 122, 0.16), transparent 62%),
    radial-gradient(52% 45% at 100% 18%, rgba(155, 108, 255, 0.2), transparent 62%),
    radial-gradient(50% 45% at 50% 102%, rgba(88, 230, 255, 0.1), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--lime);
  color: #08071a;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- Estructura ---------------- */

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(20px + var(--safe-top))
    clamp(16px, 4.5vw, 32px)
    calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: clamp(18px, 3vh, 28px);
  animation: screen-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.screen--game {
  animation: fade-in 0.24s ease both;
  gap: 12px;
}

/* ---------------- Tipografía ---------------- */

.eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.tiny {
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.45;
}

.accent {
  color: var(--lime);
}

/* ---------------- Botones ---------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, filter 0.2s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.4;
  box-shadow: none;
  transform: none;
}

.btn--xl {
  min-height: 64px;
  width: 100%;
  border-radius: 22px;
  font-size: 1.02rem;
}

.btn--primary {
  background: linear-gradient(135deg, var(--lime) 0%, var(--lime-2) 100%);
  color: #070612;
  box-shadow: 0 16px 36px -16px rgba(200, 255, 77, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: scale(0.975);
}

.btn--glass {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}

.btn--glass:hover {
  background: var(--card-2);
  border-color: var(--line-strong);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-strong);
}

.btn--danger {
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.32);
  color: #ff9db0;
}

.btn--danger:hover {
  background: rgba(255, 92, 122, 0.16);
}

.btn--resume {
  justify-content: flex-start;
  min-height: 64px;
  padding: 10px 16px;
  text-align: left;
}

.btn__resume-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.2rem;
}

.btn__stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.btn__stack strong {
  font-size: 0.95rem;
}

.btn__stack small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.btn__arrow {
  margin-left: auto;
  flex: 0 0 auto;
}

.btn--xl .btn__arrow {
  margin-left: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}

.icon-btn:hover {
  background: var(--card-2);
  border-color: var(--line-strong);
}

.icon-btn:active {
  transform: scale(0.95);
}

.link-btn {
  display: inline;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--text);
}

/* ---------------- Etiquetas ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8d2f0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--cat {
  border-color: rgba(200, 255, 77, 0.3);
  background: rgba(200, 255, 77, 0.08);
  color: var(--lime);
}

.tag--soft {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------------- Inicio ---------------- */

.screen--home {
  position: relative;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 6vh, 58px);
  text-align: center;
  padding: 20px 0;
}

.brand {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.brand__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.brand__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.logo {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: clamp(3.2rem, 15vw, 6.6rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.82;
  text-transform: uppercase;
}

.logo span {
  display: block;
}

.logo__accent {
  color: var(--lime);
  text-shadow: 0 0 60px rgba(200, 255, 77, 0.32);
}

.tagline {
  max-width: 24ch;
  color: var(--muted);
  font-size: clamp(0.9rem, 3.4vw, 1.05rem);
  line-height: 1.45;
}

.home__actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: min(100%, 360px);
}

.home__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.home__meta strong {
  color: var(--text);
  font-weight: 800;
}

.home__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
  animation: float 7s ease-in-out infinite;
}

.deco--1 {
  top: 12%;
  left: 3%;
  --rot: -14deg;
  color: var(--coral);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 900;
  transform: rotate(var(--rot));
}

.deco--2 {
  right: 5%;
  bottom: 27%;
  --rot: 11deg;
  color: var(--cyan);
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  font-weight: 900;
  transform: rotate(var(--rot));
  animation-delay: -2.4s;
}

.deco--3 {
  top: 21%;
  right: 7%;
  --rot: 10deg;
  font-size: clamp(1.4rem, 5vw, 2rem);
  transform: rotate(var(--rot));
  animation-delay: -4s;
}

/* ---------------- Cabeceras de pantalla ---------------- */

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.step-chip {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.screen-title {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.screen-title h1 {
  font-size: clamp(2rem, 7.2vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.screen-title .muted {
  max-width: 48ch;
  font-size: 0.9rem;
}

.screen-foot {
  max-width: 60ch;
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.5;
}

.screen-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin-top: 6px;
}

@media (max-width: 719px) {
  .screen-actions {
    margin-top: auto;
  }
}

/* ---------------- Elección de modo / grupo ---------------- */

.choice-list {
  display: grid;
  gap: 13px;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  min-height: 148px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.choice::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(170px 130px at 100% 0%, var(--glow, rgba(255, 255, 255, 0.1)), transparent 70%);
}

.choice:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--card-2);
}

.choice:active {
  transform: scale(0.99);
}

.choice.is-selected {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime), 0 22px 46px -26px rgba(200, 255, 77, 0.55);
}

.choice--normal {
  --glow: rgba(255, 92, 122, 0.18);
}

.choice--theater {
  --glow: rgba(155, 108, 255, 0.22);
}

.choice--friends {
  --glow: rgba(88, 230, 255, 0.16);
}

.choice--family {
  --glow: rgba(255, 209, 102, 0.16);
}

.choice__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.75rem;
}

.choice--normal .choice__icon {
  border-color: rgba(255, 92, 122, 0.25);
  background: rgba(255, 92, 122, 0.09);
}

.choice--theater .choice__icon {
  border-color: rgba(155, 108, 255, 0.3);
  background: rgba(155, 108, 255, 0.1);
}

.choice--friends .choice__icon {
  border-color: rgba(88, 230, 255, 0.25);
  background: rgba(88, 230, 255, 0.08);
}

.choice--family .choice__icon {
  border-color: rgba(255, 209, 102, 0.25);
  background: rgba(255, 209, 102, 0.08);
}

.choice__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.choice__title {
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.choice__desc {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.choice__tag {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 7, 26, 0.55);
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------------- Jugadores ---------------- */

.name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.name-input {
  width: 100%;
  height: 54px;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.name-input::placeholder {
  color: var(--muted-2);
  font-weight: 500;
}

.name-input:focus {
  outline: none;
  border-color: var(--lime);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(200, 255, 77, 0.16);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  animation: pop-in 0.2s ease both;
}

.chip__avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--pc, var(--line));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

.chip__name {
  overflow: hidden;
  max-width: 18ch;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip__remove {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.chip__remove::before {
  content: "";
  position: absolute;
  inset: -9px;
}

.chip__remove:hover {
  background: rgba(255, 92, 122, 0.2);
  color: #ffb3c1;
}

.empty-state {
  width: 100%;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: var(--muted-2);
  font-size: 0.8rem;
  text-align: center;
}

.name-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.hint--vote {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.7rem;
}

.counter {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------- Duración ---------------- */

.screen--duration .duration-card,
.screen--duration .duration-note,
.screen--duration .screen-actions,
.screen--duration .screen-foot {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.duration-card {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.duration-value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.duration-value {
  color: var(--lime);
  font-size: clamp(4rem, 18vw, 6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.duration-unit {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.duration-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.step-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--card-2);
}

.step-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.duration-range {
  flex: 1;
  min-width: 0;
  height: 36px;
  accent-color: var(--lime);
  cursor: pointer;
}

.duration-range-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.screen--duration .screen-foot {
  text-align: center;
}

/* ---------------- Reglas ---------------- */

.steps {
  display: grid;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.steps__num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  color: #08071a;
  font-size: 0.85rem;
  font-weight: 900;
}

.steps strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.steps p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.callout {
  padding: 13px 15px;
  border-left: 3px solid var(--lime);
  border-radius: 12px;
  background: rgba(200, 255, 77, 0.055);
  color: #ded9f0;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---------------- Configuración ---------------- */

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.settings-group__title {
  padding-left: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  transition: background 0.16s ease;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.setting-row:disabled {
  opacity: 0.45;
}

.setting-row__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.setting-row__text strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.setting-row__text small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.setting-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.switch {
  display: flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease;
}

.switch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e9e5f7;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch.is-on {
  background: var(--lime);
}

.switch.is-on span {
  background: #08071a;
  transform: translateX(20px);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.segmented button {
  min-height: 44px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  background: var(--lime);
  color: #08071a;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
}

.stat strong {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.settings-group--danger .btn {
  width: 100%;
}

.settings-group--danger .screen-foot {
  margin-top: 4px;
}

/* ---------------- Juego: barra y estructura ---------------- */

.gamebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.gamebar__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.gamebar__mode {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamebar__sub {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamebar__right {
  display: flex;
  justify-content: flex-end;
}

.gamebar__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-size: 1.15rem;
}

.phase-steps {
  display: flex;
  gap: 5px;
  padding: 2px 0;
}

.phase-steps span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  transition: background 0.25s ease;
}

.phase-steps span.is-done {
  background: var(--lime);
}

.phase-steps span.is-active {
  background: var(--coral);
  box-shadow: 0 0 16px rgba(255, 92, 122, 0.45);
}

.game-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

/* ---------------- Pregunta ---------------- */

.question-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 5.5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.032));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.question-card::after {
  content: "";
  position: absolute;
  top: -95px;
  right: -75px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 255, 77, 0.16), transparent 68%);
  pointer-events: none;
}

.question-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.question-text {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: clamp(1.42rem, 5.3vw, 2.12rem);
  font-weight: 850;
  letter-spacing: -0.028em;
  line-height: 1.16;
  overflow-wrap: break-word;
}

.timer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer__track {
  height: 8px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.timer__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--yellow));
  transition: width 0.16s linear;
}

.timer__num {
  min-width: 2.2ch;
  color: var(--text);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: right;
}

.timer.is-up .timer__fill {
  background: var(--coral);
}

.timer.is-up .timer__num {
  color: var(--coral);
  animation: buzz 0.32s ease;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.counter {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.voters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease,
    opacity 0.2s ease, box-shadow 0.16s ease;
}

.voter:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--card-2);
  transform: translateY(-1px);
}

.voter:active:not(:disabled) {
  transform: scale(0.98);
}

.voter.is-chosen {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.1);
  box-shadow: 0 0 0 1px var(--lime), 0 12px 30px -20px rgba(200, 255, 77, 0.65);
  animation: pop-in 0.24s ease both;
}

.voter.is-muted {
  opacity: 0.38;
}

.voter:disabled {
  cursor: default;
}

.voter__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--pc, var(--line));
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 1.08rem;
}

.voter__name {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  font-size: 0.79rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voter__score {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--lime);
  color: #08071a;
  font-size: 0.68rem;
  font-weight: 900;
}

.voter__check {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--lime);
  color: #08071a;
  font-size: 0.66rem;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.game-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 14px 0 calc(6px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 32%);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: right;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.result-line__strong {
  color: var(--lime);
  font-weight: 800;
}

/* ---------------- Modo Teatro ---------------- */

.screen--theater .game-body {
  gap: 18px;
}

.pass {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: 100%;
  max-width: 480px;
  min-height: 58vh;
  margin: 0 auto;
  text-align: center;
}

.pass__avatar {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 2px solid var(--pc, var(--line));
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 2.3rem;
  box-shadow: 0 22px 46px -26px var(--pc, transparent);
}

.pass__title {
  max-width: 20ch;
  font-size: clamp(1.65rem, 6.3vw, 2.45rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.pass__title span {
  color: var(--lime);
}

.pass__hint {
  max-width: 34ch;
  font-size: 0.84rem;
}

.secret-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 168px;
  overflow: hidden;
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.032);
}

.secret-card.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.045) 48%, transparent 66%);
  background-size: 240% 100%;
  animation: shimmer 3.4s linear infinite;
}

.secret-card.is-revealed {
  border-style: solid;
  border-color: rgba(200, 255, 77, 0.5);
  background: rgba(200, 255, 77, 0.06);
  animation: pop-in 0.28s ease both;
}

.secret-card__lock {
  font-size: 2.2rem;
  line-height: 1;
  opacity: 0.85;
}

.secret-card__label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.secret-card__hint {
  max-width: 34ch;
  color: var(--muted-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.secret-name {
  color: var(--lime);
  font-size: clamp(2.1rem, 9vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: break-word;
}

.hold-btn {
  width: 100%;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.hold-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #ffffff;
  opacity: 0.2;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.hold-btn.is-holding::after {
  animation: hold-fill 0.85s linear forwards;
}

.hold-btn__label {
  position: relative;
  z-index: 1;
}

.pass__actions {
  width: 100%;
}

.pass__actions .btn {
  width: 100%;
}

.theater-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 570px;
  margin: 0 auto;
}

.stage-title {
  font-size: clamp(1.55rem, 5.6vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stage-title--small {
  font-size: clamp(1.35rem, 4.8vw, 1.8rem);
}

.order-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.order-card__label {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.order-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--pc, var(--line));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 1rem;
}

.order-card strong {
  font-size: 0.9rem;
}

.order-card__hint {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.guess-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.guess-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.guess-option:hover {
  border-color: var(--line-strong);
  background: var(--card-2);
  transform: translateY(-1px);
}

.guess-option.is-selected {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.1);
  box-shadow: 0 0 0 1px var(--lime);
}

.guess-option__check {
  margin-left: auto;
  color: var(--lime);
  font-size: 0.85rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.guess-option.is-selected .guess-option__check {
  opacity: 1;
}

.reveal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.reveal-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--pc, var(--line));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.reveal-person__avatar {
  font-size: 1.9rem;
  line-height: 1.15;
}

.reveal-person__name {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.94rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-person__role {
  color: var(--muted-2);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reveal-person--target {
  border-color: rgba(200, 255, 77, 0.55);
  background: rgba(200, 255, 77, 0.075);
}

.reveal-arrow {
  color: var(--muted-2);
  font-size: 1.1rem;
}

.verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.verdict__icon {
  font-size: 1.5rem;
  line-height: 1.2;
}

.verdict strong {
  font-size: 1rem;
  font-weight: 900;
}

.verdict__detail {
  max-width: 38ch;
  color: #ded9f0;
  font-size: 0.77rem;
  line-height: 1.45;
}

.verdict.is-correct {
  border-color: rgba(124, 242, 156, 0.4);
  background: rgba(124, 242, 156, 0.07);
}

.verdict.is-wrong {
  border-color: rgba(255, 92, 122, 0.38);
  background: rgba(255, 92, 122, 0.07);
}

.round-progress {
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.round-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 7vw, 38px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.round-score__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.round-score__label {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.round-score__item strong {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.round-score__unit {
  color: var(--muted-2);
  font-size: 0.65rem;
}

.round-score__divider {
  width: 1px;
  height: 46px;
  background: var(--line);
}

.round-results {
  display: grid;
  gap: 7px;
}

.round-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-size: 0.77rem;
}

.round-result__player {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-result__arrow {
  color: var(--muted-2);
}

.round-result__target {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-result__status {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-result__status.is-correct {
  background: rgba(124, 242, 156, 0.12);
  color: var(--green);
}

.round-result__status.is-wrong {
  background: rgba(255, 92, 122, 0.12);
  color: #ff9db0;
}

/* ---------------- Resumen ---------------- */

.screen--summary {
  gap: 20px;
}

.summary-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
}

.summary-title {
  max-width: 18ch;
  font-size: clamp(2rem, 7.5vw, 3.35rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.winner-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 580px;
}

.winner-card {
  position: relative;
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: 230px;
  padding: 18px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.winner-card__crown {
  font-size: 1.2rem;
  line-height: 1;
}

.winner-card__avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 3px 0;
  border: 2px solid var(--pc, var(--lime));
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 1.9rem;
  box-shadow: 0 16px 34px -22px var(--pc, transparent);
}

.winner-card__name {
  overflow: hidden;
  max-width: 100%;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-card__score {
  color: var(--pc, var(--lime));
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.winner-card__score small {
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0;
}

.winner-card__title {
  color: var(--lime);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.winner-card--empty {
  flex: 1 1 100%;
  max-width: 580px;
  gap: 4px;
  padding: 26px 18px;
  text-align: center;
}

.winner-card__emoji {
  font-size: 2rem;
  line-height: 1.2;
}

.winner-card--empty strong {
  font-size: 1.05rem;
}

.winner-card--empty small {
  max-width: 38ch;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.summary-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-list {
  display: grid;
  gap: 7px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.rank-row.is-winner {
  border-color: rgba(200, 255, 77, 0.34);
  background: rgba(200, 255, 77, 0.055);
}

.rank-row__num {
  width: 22px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.rank-row__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--pc, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.05rem;
}

.rank-row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.rank-row__body strong {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row__body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.05;
}

.rank-row__score small {
  color: var(--muted-2);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rank-row__score.is-muted {
  color: var(--muted-2);
}

/* ---------------- Modales ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(4, 3, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease both;
}

.modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 520px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(165deg, #181433, #110e26);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  animation: slide-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal h2 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.modal__sub {
  margin-top: -8px;
  font-size: 0.76rem;
}

.modal__settings {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---------------- Avisos y confeti ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: #08071a;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 46px -16px rgba(0, 0, 0, 0.8);
  transform: translateX(-50%);
  animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.is-leaving {
  animation: toast-out 0.24s ease forwards;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

/* ---------------- Animaciones ---------------- */

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rot, -10deg));
  }
  50% {
    transform: translateY(-12px) rotate(var(--rot, -10deg));
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.8);
  }
}

@keyframes hold-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes shimmer {
  from {
    background-position: 160% 0;
  }
  to {
    background-position: -60% 0;
  }
}

@keyframes buzz {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ---------------- Responsive ---------------- */

@media (min-width: 560px) {
  .voters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guess-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .app {
    padding-top: calc(28px + var(--safe-top));
    padding-bottom: calc(28px + var(--safe-bottom));
  }

  .screen {
    gap: 26px;
  }

  .choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice {
    min-height: 170px;
    padding: 22px;
  }

  .voters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .modal-backdrop {
    align-items: center;
  }

  .screen--home {
    gap: 48px;
  }

  .home__actions {
    width: 380px;
  }

  .question-text {
    letter-spacing: -0.032em;
  }

  .pass {
    min-height: 52vh;
  }
}

@media (max-width: 390px) {
  .home__meta {
    gap: 7px;
    font-size: 0.66rem;
  }

  .deco--3 {
    display: none;
  }

  .choice {
    min-height: 138px;
    padding: 16px;
    gap: 12px;
  }

  .choice__icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .choice__title {
    font-size: 1.12rem;
  }

  .choice__desc {
    font-size: 0.75rem;
  }

  .btn {
    padding: 12px 16px;
  }

  .chip__name {
    max-width: 13ch;
  }

  .summary-title {
    max-width: 15ch;
  }
}

@media (max-width: 360px) {
  .choice__tag {
    display: none;
  }

  .name-form {
    grid-template-columns: 1fr;
  }

  .name-form .btn {
    min-height: 48px;
  }

  .footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-hint {
    text-align: center;
  }

  .round-result {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .round-result__status {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 1px;
  }

  .modal__row {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 620px) {
  .screen--game .game-body {
    gap: 11px;
  }

  .question-card {
    padding: 16px 18px;
  }

  .question-text {
    font-size: clamp(1.2rem, 4.8vw, 1.6rem);
    line-height: 1.14;
  }

  .voter {
    min-height: 52px;
    padding: 7px 9px;
  }

  .voter__avatar {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }

  .game-footer {
    padding-top: 8px;
    padding-bottom: calc(2px + var(--safe-bottom));
  }
}

@media (max-width: 719px), (max-height: 620px) {
  .screen--game:not(.screen--theater) .game-body {
    padding-bottom: 116px;
  }

  .screen--game .game-footer {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 20;
    width: min(calc(100% - 2 * clamp(16px, 4.5vw, 32px)), 756px);
    margin: 0;
    padding: 10px 0 calc(8px + var(--safe-bottom));
    transform: translateX(-50%);
  }
}

@media (max-height: 640px) and (orientation: portrait) {
  .screen--duration {
    gap: 14px;
  }

  .screen--duration .screen-title h1 {
    font-size: 1.85rem;
  }

  .screen--duration .duration-card {
    gap: 10px;
    padding: 16px;
  }

  .screen--duration .duration-value {
    font-size: clamp(3.2rem, 16vw, 4.4rem);
  }

  .screen--duration .duration-stepper {
    gap: 9px;
  }

  .screen--duration .step-btn {
    width: 44px;
    height: 44px;
  }

  .screen--duration .duration-note {
    padding: 10px 12px;
    font-size: 0.76rem;
  }

  .screen--duration .screen-actions {
    margin-top: 6px;
  }

  .pass {
    justify-content: flex-start;
    gap: 10px;
    min-height: auto;
    padding-top: 2px;
  }

  .pass__avatar {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    font-size: 1.8rem;
  }

  .pass__title {
    font-size: clamp(1.4rem, 5.6vw, 1.9rem);
  }

  .pass__hint {
    font-size: 0.78rem;
  }

  .secret-card {
    min-height: 132px;
    padding: 16px;
  }

  .hold-btn {
    min-height: 56px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .screen--home {
    gap: 22px;
    padding: 6px 0;
  }

  .logo {
    font-size: clamp(2.6rem, 11vh, 4.4rem);
  }

  .deco {
    display: none;
  }

  .pass {
    justify-content: flex-start;
    gap: 6px;
    min-height: auto;
    padding: 0;
  }

  .pass__avatar {
    display: none;
  }

  .pass__hint,
  .pass .tiny {
    display: none;
  }

  .pass__title {
    font-size: 1.3rem;
    line-height: 1.06;
  }

  .secret-card {
    min-height: 92px;
    padding: 12px;
  }

  .secret-name {
    font-size: 1.8rem;
  }

  .secret-card__lock {
    font-size: 1.5rem;
  }

  .hold-btn {
    min-height: 48px;
  }

  .pass__actions .btn {
    min-height: 48px;
  }
}

/* ---------------- Accesibilidad ---------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .deco {
    animation: none;
  }
}
