:root {
  --bg: #161e2d;
  --surface: #232f3e;
  --text: #ffffff;
  --muted: #b8c4d6;
  --accent: #ff9900;
  --good: #17703a;
  --bad: #9f2330;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% -20%, #2f4260, var(--bg) 65%) fixed var(--bg);
  color: var(--text);
  font: 1rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.lockup { --logo: 2.5rem; display: flex; align-items: center; gap: calc(var(--logo) * .4); }
.lockup img { display: block; width: auto; }
.lockup .asimov { height: var(--logo); }
/* La sonrisa de AWS baja el centro visual: se compensa el tamaño. */
.lockup .aws { height: calc(var(--logo) * .9); }
.lockup span { width: 2px; height: calc(var(--logo) * 1.1); background: #ffffff55; }
header output { margin-left: auto; font-weight: 700; color: var(--accent); }
main {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  text-align: center;
}
#offline { background: var(--accent); color: #111; text-align: center; padding: .25rem; font-weight: 600; }
h1 { font-size: 1.75rem; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 1.1rem; }
.step { color: var(--muted); font-weight: 600; }

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}
.card.good { background: var(--good); }
.card.bad { background: var(--bad); }
label { font-weight: 600; text-align: left; }
input {
  font: inherit;
  font-size: 1.15rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 2px solid #5a6b85;
  background: #fff;
  color: #111;
}
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.primary {
  background: var(--accent);
  color: #111;
  font-weight: 800;
  font-size: 1.15rem;
  padding: .9rem 1.5rem;
  border-radius: 12px;
}
.ghost { background: transparent; color: var(--muted); padding: .5rem .75rem; border-radius: 8px; }
.error { color: #ffc2c7; font-weight: 600; min-height: 1.4em; }

.timer { display: flex; align-items: center; gap: .75rem; }
.seconds { font-size: 1.75rem; font-weight: 800; min-width: 2ch; }
.track { flex: 1; height: 12px; border-radius: 6px; background: #ffffff22; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--accent); }

.options { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding: .9rem 1.1rem;
  border-radius: 14px;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 700;
}
.option b { font-size: 1.5rem; }
.option span { flex: 1; }
.option em { font-style: normal; background: #0005; border-radius: 99px; padding: .1rem .8rem; }
.o0 { background: #c3182f; }
.o1 { background: #1259b8; }
.o2 { background: #8a5a00; }
.o3 { background: #216b16; }
.option.dim { opacity: .3; }
.option.right { outline: 6px solid #fff; }

/* Pantalla del anfitrión (proyector) */
.host { font-size: clamp(1rem, 1.5vw, 1.75rem); }
.host header { font-size: 1.2em; padding: 1.25rem 2.5rem; }
.host .lockup { --logo: clamp(3.5rem, 9vh, 7rem); }
.host main { max-width: 80rem; }
.host h1 { font-size: 2.4em; }
.host .question.big { font-size: 3.4em; }
.host .options { grid-template-columns: 1fr 1fr; }
.host .option { font-size: 1.5em; min-height: 5rem; }
.host .seconds { font-size: 2.5em; }
footer { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; padding: 1rem 2rem; }
footer .primary { min-width: 14rem; }
footer #reset { margin-right: auto; }

.lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 3rem; align-items: center; text-align: left; }
.join { text-align: center; display: grid; gap: 1rem; justify-items: center; }
.qr { display: block; width: min(100%, 46vh); height: auto; border-radius: 20px; }
.url { font-size: 1.6em; font-weight: 800; color: var(--accent); overflow-wrap: anywhere; }
.prizes { list-style: none; margin: .5rem 0 1.5rem; font-size: 1.4em; }
.prizes b { color: var(--accent); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; max-height: 35vh; overflow: auto; }
.chips button { background: var(--surface); border-radius: 99px; padding: .35rem .9rem; font-weight: 600; }

.ranking { list-style: none; display: grid; gap: .6rem; width: 100%; max-width: 50rem; margin: 0 auto; }
.ranking li { display: flex; gap: 1.25rem; background: var(--surface); border-radius: 14px; padding: .8rem 1.5rem; font-size: 1.5em; text-align: left; }
.ranking b { color: var(--accent); }
.ranking span { flex: 1; overflow-wrap: anywhere; }
.ranking em { font-style: normal; font-weight: 800; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.place { display: flex; flex-direction: column; gap: .4rem; overflow-wrap: anywhere; }
.place h2 { font-size: 1.8em; }
.step-block { background: var(--surface); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; padding: 1rem; }
.step-block b { font-size: 2.5em; }
.step-block span { font-size: 1.4em; font-weight: 700; }
.p1 .step-block { height: 32vh; background: var(--accent); color: #111; }
.p2 .step-block { height: 24vh; }
.p3 .step-block { height: 18vh; }
.place.shown h2 { animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .place.shown h2 { animation: none; } }
@media (max-width: 700px) {
  .host .options, .lobby { grid-template-columns: 1fr; }
}
