/* App del participante — mobile-first, una columna. */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(1rem, env(safe-area-inset-top)) 1.1rem calc(1.5rem + env(safe-area-inset-bottom));
}

.brandbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem 0 1.1rem;
}
.brandbar .rose { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brandbar .titles { line-height: 1.1; }
.brandbar .kicker {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--text-muted); font-weight: 800;
}
.brandbar .name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }

.screen { flex: 1; display: flex; flex-direction: column; }
.screen__center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; }

.hero-title { font-size: var(--step-2); }
.hero-sub { color: var(--text-muted); }

/* --- registro --- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.3rem; box-shadow: var(--shadow); }
.code-feedback { min-height: 1.2em; font-size: var(--step--1); font-weight: 600; }
.code-feedback.ok { color: var(--sage); }
.code-feedback.bad { color: var(--danger); }

/* --- sala de espera / marcador --- */
.flower-count {
  text-align: center;
  padding: 1.6rem 1rem 1.4rem;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.flower-count .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-muted); font-weight: 800; }
.flower-count .value {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1;
  margin: .1em 0;
  display: flex; align-items: center; justify-content: center; gap: .2em;
}
.flower-count .value .rose { width: .8em; height: .8em; color: var(--accent); }
.flower-count .table-tag { font-size: var(--step--1); color: var(--text-muted); }
.flower-count .w-position {
  margin-top: .5rem;
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .2em .8em;
  border-radius: 999px;
}
.flower-count .w-position:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .flower-count.flash .value { animation: flr-pop .5s ease; }
}
@keyframes flr-pop { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.16); } }

.status-line {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px dashed var(--border);
  font-size: var(--step--1); font-weight: 600; color: var(--text-muted);
  text-align: center;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* --- leaderboard --- */
.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.board h3 { padding: .9rem 1rem .5rem; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-family: var(--font-text); font-weight: 800; }
.board ol { list-style: none; padding: 0 .5rem .5rem; margin: 0; }
.board li {
  display: grid; grid-template-columns: 1.7rem 1fr auto; align-items: center; gap: .6rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
}
.board li + li { border-top: 1px solid var(--border); }
.board li.is-me { background: var(--sage-soft); border-top-color: transparent; font-weight: 700; }
.board li.podium { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.board li.podium.is-me { background: var(--sage-soft); }
.board li .rank { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 700; text-align: center; }
.board li.podium .rank { font-size: 1.05rem; }
.board li .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .who small { color: var(--text-muted); font-weight: 500; }
.board li .flr { font-variant-numeric: tabular-nums; font-weight: 800; display: flex; align-items: center; gap: .25em; }
.board li .flr .rose { width: .85em; height: .85em; color: var(--accent); }
.board li.out .who { color: var(--text-muted); text-decoration: line-through; }
.board li.board-gap { grid-template-columns: 1fr; text-align: center; color: var(--text-muted); letter-spacing: .3em; padding: .2rem 0; border-top: none; }
.board li.board-empty { grid-template-columns: 1fr; }

/* --- eliminada --- */
.eliminated-card { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: var(--radius-lg); padding: 1.4rem; text-align: center; }
.eliminated-card h2 { color: var(--danger); }

/* --- votación (Actividad 1) --- */
.vote-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.2rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s ease, transform .08s ease;
}
.vote-option:hover { border-color: var(--accent); }
.vote-option:active { transform: translateY(1px); }
.vote-option .t { display: block; font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.2; }
.vote-option .a { display: block; color: var(--text-muted); font-size: var(--step--1); margin-top: .15rem; }

.vote-bar {
  position: relative;
  padding: .95rem 1.05rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.vote-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--surface-2);
  z-index: 0;
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.vote-bar.is-mine { border-color: var(--sage); }
.vote-bar.is-mine .vote-bar__fill { background: var(--sage-soft); }
.vote-bar.is-winner { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); }
.vote-bar.is-winner .vote-bar__fill { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.vote-bar__row { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.vote-bar__t { font-weight: 700; }
.vote-bar__n { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }

.vote-result {
  text-align: center;
  padding: 1.4rem 1.2rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
  border-radius: var(--radius-lg);
  display: grid;
  gap: .35rem;
}

/* --- trivia (Actividad 2) --- */
.trivia-vs {
  text-align: center;
  font-weight: 800;
  font-size: var(--step--1);
  color: var(--accent);
  background: var(--accent-soft);
  padding: .55rem .8rem;
  border-radius: 999px;
}
.countdown {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1;
}
.countdown.is-up {
  color: var(--danger);
  font-size: var(--step-1);
}

/* --- "Sigo yo" (Actividad 3) --- */
.buzzer {
  width: 100%;
  min-height: 46vh;
  border: none;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 35%, var(--accent), var(--accent-strong));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1rem + 8vw, 3.4rem);
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 0 var(--accent-strong), var(--shadow);
  transition: transform .06s ease, box-shadow .06s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.buzzer:active {
  transform: translateY(8px);
  box-shadow: 0 2px 0 var(--accent-strong), var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .buzzer { animation: buzzer-pulse 1.4s ease-in-out infinite; }
}
@keyframes buzzer-pulse {
  0%, 100% { box-shadow: 0 10px 0 var(--accent-strong), 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 10px 0 var(--accent-strong), 0 0 0 14px transparent; }
}

/* --- cierre --- */
.winner-card {
  text-align: center; padding: 1.8rem 1.2rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 18%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.winner-card .crown { font-size: 2.4rem; line-height: 1; }
.winner-card .winner-name { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.15; }
.winner-card #final-winners > * + * { margin-top: .35rem; }

.your-standing {
  text-align: center; padding: 1rem 1.2rem;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
}
.your-standing.is-winner { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.your-standing__pos { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; }

.final-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fstat { background: var(--surface); padding: .8rem .5rem; text-align: center; }
.fstat__v { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.fstat__l { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin-top: .1rem; }

.footer-note { margin-top: auto; padding-top: 1.4rem; text-align: center; font-size: .7rem; color: var(--text-muted); }
