:root {
  --orange: #ff7a00;
  --red: #e84012;
  --yellow: #ffd11a;
  --green: #79bd27;
  --blue: #1677d2;
  --ink: #241710;
  --paper: #fffaf0;
  --glass: rgba(255, 255, 255, 0.74);
  --line: rgba(36, 23, 16, 0.1);
  --shadow: 0 26px 80px rgba(91, 38, 0, 0.24);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #ffbf3d url("/assets/hero-bg.webp") center / cover fixed no-repeat;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.88), rgba(255, 250, 240, 0.78) 48%, rgba(255, 250, 240, 0.72)),
    radial-gradient(circle at 16% 14%, rgba(255, 209, 26, 0.22), transparent 26%),
    radial-gradient(circle at 84% 8%, rgba(22, 119, 210, 0.1), transparent 20%);
}

body::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255, 122, 0, 0.45) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(121, 189, 39, 0.45) 0 2px, transparent 3px);
  background-size: 160px 160px, 220px 220px, 190px 190px;
  background-position: 18px 20px, 70px 120px, 150px 40px;
  opacity: 0.14;
  animation: drift 16s linear infinite;
}

button, input, select { font: inherit; }

.shell {
  position: relative;
  min-height: 100vh;
  padding: clamp(12px, 1.8vw, 24px);
}

.experience {
  min-height: calc(100vh - clamp(28px, 4.4vw, 56px));
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: clamp(8px, 1.4vw, 14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(72px, 8vw, 92px);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 34px rgba(60, 30, 0, 0.12);
  backdrop-filter: blur(14px);
}

.logo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.18));
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
}

.intro {
  display: none;
}

.mascot-wrap {
  position: absolute;
  right: clamp(-30px, -2vw, -12px);
  bottom: 2px;
  width: clamp(160px, 18vw, 245px);
  pointer-events: none;
  z-index: 0;
}

.mascot-wrap::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 12%;
  bottom: 2%;
  height: 18%;
  border-radius: 50%;
  background: rgba(36, 23, 16, 0.18);
  filter: blur(16px);
}

.mascot {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 26px 28px rgba(60, 30, 0, 0.25));
  animation: mascotFloat 4.8s ease-in-out infinite;
}

.coach {
  position: absolute;
  top: 18%;
  right: -4%;
  z-index: 2;
  max-width: 138px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(60, 30, 0, 0.14);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.15;
}

.eyebrow,
.screen-kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  position: relative;
  z-index: 1;
  max-width: 11.6ch;
  margin-bottom: 12px;
  font-size: clamp(2.75rem, 5.2vw, 4.65rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 360px;
  margin-bottom: 18px;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  font-weight: 780;
  line-height: 1.34;
  color: rgba(36, 23, 16, 0.84);
}

.compact {
  color: rgba(36, 23, 16, 0.72);
  font-weight: 760;
  line-height: 1.42;
}

.progress {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 4px;
}

.progress span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(36, 23, 16, 0.12);
  font-weight: 950;
  box-shadow: inset 0 -3px 0 rgba(36, 23, 16, 0.05);
}

.progress .active {
  background: linear-gradient(135deg, var(--yellow), #ff9818);
  border-color: rgba(36, 23, 16, 0.72);
  box-shadow: 0 8px 0 rgba(36, 23, 16, 0.16);
}

.game-panel {
  position: relative;
  width: min(640px, 100%);
  min-height: auto;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 224, 0.72)),
    rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.game-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 122, 0, 0.12), transparent 28%, rgba(22, 119, 210, 0.11)),
    radial-gradient(circle at 15% 8%, rgba(255, 209, 26, 0.32), transparent 22%);
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 1;
  display: none;
  min-height: auto;
  padding: clamp(22px, 3vw, 36px);
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: screenIn 0.32s ease both;
}

.lead-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
  margin-top: 4px;
}

body[data-screen="register"] .game-panel {
  margin-block: clamp(10px, 5vh, 44px);
}

body[data-screen="play"] .game-panel,
body[data-screen="prize"] .game-panel,
body[data-screen="result"] .game-panel {
  width: min(800px, 100%);
  min-height: min(640px, calc(100vh - 126px));
}

body[data-screen="play"] .screen,
body[data-screen="prize"] .screen,
body[data-screen="result"] .screen {
  min-height: min(640px, calc(100vh - 126px));
}

#registerScreen h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

#registerScreen .compact {
  max-width: 420px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: rgba(36, 23, 16, 0.72);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(36, 23, 16, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 11px 14px;
  color: var(--ink);
  outline: none;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.16);
  transform: translateY(-1px);
}

.terms-check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.terms-check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--orange);
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.primary-button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 13px 20px;
  color: #241710;
  background: linear-gradient(135deg, var(--yellow), #ff8a00 66%, #ff6b00);
  box-shadow: 0 10px 0 #b84e00, 0 22px 34px rgba(232, 64, 18, 0.24);
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: translateX(-120%);
  transition: transform 0.42s ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.primary-button:hover::after { transform: translateX(120%); }

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 7px 0 #b84e00, 0 16px 24px rgba(232, 64, 18, 0.22);
}

.ghost-button {
  min-height: 42px;
  padding: 10px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 23, 16, 0.12);
  box-shadow: 0 10px 24px rgba(60, 30, 0, 0.08);
}

.form-note {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--red);
  font-weight: 850;
}

.game-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.attempts {
  margin: -4px 0 0;
  color: rgba(36, 23, 16, 0.58);
  font-weight: 850;
  font-size: 0.92rem;
}

.timer {
  --p: 1;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--orange) calc(var(--p) * 1turn), rgba(36, 23, 16, 0.1) 0),
    var(--ink);
  color: var(--yellow);
  font-size: 1.35rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 7px var(--ink), 0 12px 24px rgba(36, 23, 16, 0.16);
}

.arena {
  position: relative;
  flex: 1;
  min-height: 370px;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 241, 205, 0.46)),
    radial-gradient(circle at 20% 18%, rgba(255, 209, 26, 0.44), transparent 26%),
    radial-gradient(circle at 84% 78%, rgba(22, 119, 210, 0.16), transparent 25%);
  border: 1px solid rgba(255, 122, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), inset 0 -40px 70px rgba(255, 122, 0, 0.08);
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}

.arena.counting {
  animation: arenaPulse 1.2s ease-in-out infinite;
}

.arena.answering {
  flex: 0 0 min(280px, 40vh);
  min-height: 230px;
}

.gift {
  --gift-a: #ff8a00;
  --gift-b: #ffd11a;
  position: absolute;
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%) rotate(var(--rotate));
  display: block;
  filter: drop-shadow(0 8px 7px rgba(92, 38, 0, 0.24));
  animation: pop 0.35s ease both;
}

.gift::before,
.gift::after {
  content: "";
  position: absolute;
  border-radius: 3px;
}

.gift::before {
  inset: 20% 6% 8%;
  background:
    linear-gradient(90deg, transparent 41%, var(--gift-b) 42% 58%, transparent 59%),
    linear-gradient(180deg, transparent 44%, rgba(255, 255, 255, 0.18) 45% 47%, transparent 48%),
    var(--gift-a);
  box-shadow: inset 0 -5px 0 rgba(36, 23, 16, 0.12), inset 5px 0 0 rgba(255, 255, 255, 0.14);
}

.gift::after {
  left: 2%;
  right: 2%;
  top: 9%;
  height: 24%;
  background:
    linear-gradient(90deg, transparent 41%, var(--gift-b) 42% 58%, transparent 59%),
    var(--gift-a);
  box-shadow: inset 0 -4px 0 rgba(36, 23, 16, 0.12);
}

.gift i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 42%;
  height: 26%;
  transform: translateX(-50%);
}

.gift i::before,
.gift i::after {
  content: "";
  position: absolute;
  width: 48%;
  height: 80%;
  border: calc(var(--size) * 0.055) solid var(--gift-b);
  border-radius: 50% 50% 20% 50%;
}

.gift i::before {
  right: 48%;
  transform: rotate(-24deg);
}

.gift i::after {
  left: 48%;
  transform: rotate(24deg) scaleX(-1);
}

.gift.moving {
  transition: left 0.68s ease, top 0.68s ease, transform 0.68s ease;
}

.gift.counted-out {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(var(--rotate));
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.answer-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(36, 23, 16, 0.08);
  box-shadow: 0 16px 32px rgba(60, 30, 0, 0.08);
  animation: answerIn 0.24s ease both;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.answer-option {
  min-height: 50px;
  border: 1px solid rgba(36, 23, 16, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(36, 23, 16, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.answer-option:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 119, 210, 0.38);
}

.answer-option.selected {
  border-color: var(--blue);
  background: rgba(22, 119, 210, 0.12);
  box-shadow: 0 0 0 4px rgba(22, 119, 210, 0.1);
}

#numberAnswer { display: none; margin: 12px 0; }

.prize-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 18px);
  margin-top: auto;
  padding-top: 30px;
}

.prize-box {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background:
    linear-gradient(90deg, transparent 42%, var(--yellow) 43% 57%, transparent 58%),
    linear-gradient(145deg, #ff9418, #e84012);
  box-shadow: 0 14px 0 #982f08, 0 24px 38px rgba(36, 23, 16, 0.2);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.prize-box::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 10%;
  height: 24%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 42%, var(--yellow) 43% 57%, transparent 58%),
    linear-gradient(145deg, #ffd850, #ff8a00);
  box-shadow: inset 0 -5px 0 rgba(36, 23, 16, 0.12);
}

.prize-box span::before,
.prize-box span::after {
  content: "";
  position: absolute;
  top: -2%;
  width: 24%;
  height: 24%;
  border: 8px solid var(--yellow);
  border-radius: 50% 50% 20% 50%;
}

.prize-box span::before {
  left: 28%;
  transform: rotate(-24deg);
}

.prize-box span::after {
  right: 28%;
  transform: rotate(24deg) scaleX(-1);
}

.prize-box:hover {
  transform: translateY(-7px) rotate(-1deg);
  filter: saturate(1.08);
}

.prize-box:disabled { cursor: wait; opacity: 0.72; }

.code-box {
  margin: 22px 0;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(145deg, #241710, #3b2417);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.code-box span {
  display: block;
  margin-bottom: 7px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.code-box strong {
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  overflow-wrap: anywhere;
}

.whatsapp {
  color: #07220e;
  background: linear-gradient(135deg, #5df185, #1fa84b 72%);
  box-shadow: 0 10px 0 #147535, 0 20px 34px rgba(31, 168, 75, 0.24);
}

dialog {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(36, 23, 16, 0.48); }

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(36, 23, 16, 0.08);
  cursor: pointer;
  font-size: 1.4rem;
}

.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.celebration span {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: var(--yellow);
  animation: confetti 1.1s ease-in forwards;
}

@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(var(--rotate)); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(var(--rotate)); }
}

@keyframes answerIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes arenaPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), inset 0 -40px 70px rgba(255, 122, 0, 0.08); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 -40px 70px rgba(255, 122, 0, 0.16), 0 0 0 5px rgba(255, 209, 26, 0.18); }
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(80px); }
}

@keyframes confetti {
  to {
    transform: translateY(105vh) rotate(640deg);
    opacity: 0;
  }
}

@media (max-width: 920px) {
  body { background-attachment: scroll; }

  .stage {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .intro {
    min-height: auto;
    padding: 6px 0 0;
  }

  .mascot-wrap {
    right: 0;
    bottom: -20px;
    width: clamp(150px, 35vw, 230px);
    opacity: 0.98;
  }

  .coach {
    left: auto;
    right: 70%;
    top: 8%;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.65rem, 10vw, 4.6rem);
  }

  .lede { max-width: min(540px, calc(100% - 120px)); }
  .progress { margin-bottom: 10px; }
  .game-panel, .screen { min-height: 600px; }
}

@media (max-width: 560px) {
  .shell { padding: 10px; }
  .brand { width: 88px; padding: 8px; }
  .ghost-button { min-height: 38px; padding: 8px 12px; }
  .mascot-wrap { width: 142px; right: -10px; bottom: -12px; }
  .coach { display: none; }
  .lede { max-width: calc(100% - 88px); font-size: 1rem; }
  .game-panel, .screen { min-height: 570px; }
  .screen { padding: 18px; }
  .arena { min-height: 310px; }
  .arena.answering { flex-basis: 238px; min-height: 218px; }
  .answers { grid-template-columns: 1fr; }
  .prize-boxes { grid-template-columns: 1fr; }
  .prize-box { aspect-ratio: 2.8 / 1; }
}
