:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --surface: #ffffff;
  --surface-strong: #fff8ed;
  --ink: #1c2024;
  --muted: #667085;
  --line: #ded6c9;
  --brand: #eb5324;
  --brand-dark: #d9431d;
  --accent: #9a3412;
  --brand-soft: #fff2ec;
  --shadow: 0 18px 50px rgba(36, 31, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(235, 83, 36, 0.14), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(199, 100, 59, 0.10), transparent 24rem),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.game-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.section-heading,
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 14px;
}

.brand-logo {
  display: block;
  width: min(230px, 58vw);
  height: auto;
  margin-bottom: 12px;
  mix-blend-mode: multiply;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.campaign-box,
.hud > div,
#couponBadge {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(36, 31, 24, 0.08);
}

.campaign-box span,
.hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.campaign-box strong,
.hud strong {
  display: block;
  min-width: 72px;
  font-size: 22px;
}

.panel,
.leaderboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
  padding: 22px;
}

.panel-copy p,
.result-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.participation-note {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  border: 1px solid #ffd0bd;
  border-radius: 8px;
  background: var(--brand-soft);
  padding: 14px;
  color: #7c2d12;
  line-height: 1.45;
}

.participation-note strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.participation-note span {
  font-size: 14px;
  font-weight: 650;
}

.participation-note a {
  color: var(--brand-dark);
  font-weight: 900;
}

.player-form {
  display: grid;
  gap: 12px;
}

.player-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.player-form input[type="text"],
.player-form input[type="tel"],
.player-form input[type="email"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfc7bb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.checkbox-row {
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.checkbox-row a {
  color: var(--brand);
  font-weight: 900;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.play-area {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.95), transparent 16rem),
    radial-gradient(circle at 80% 18%, rgba(231, 220, 205, 0.78), transparent 18rem),
    linear-gradient(180deg, #fffaf2 0%, #f1e5d4 72%, #d9c7b2 100%);
  box-shadow: var(--shadow);
}

.play-area::before {
  content: "";
  position: absolute;
  inset: 92px 0 auto;
  height: 52%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(235, 83, 36, 0.05), rgba(255, 255, 255, 0.16));
  clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
  pointer-events: none;
}

.play-area::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 34%;
  background:
    radial-gradient(ellipse at center, rgba(99, 75, 51, 0.16), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(133, 103, 76, 0.16));
  pointer-events: none;
}

.hud {
  position: relative;
  z-index: 3;
  padding: 12px;
}

.hud > div {
  flex: 1;
  backdrop-filter: blur(10px);
}

.falling-stage {
  position: relative;
  z-index: 2;
  height: min(68vh, 620px);
  min-height: 460px;
  overflow: hidden;
  touch-action: manipulation;
}

.falling-item {
  position: absolute;
  top: -120px;
  width: clamp(70px, 12vw, 112px);
  height: clamp(70px, 12vw, 112px);
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 12px 13px rgba(48, 38, 27, 0.25));
  cursor: pointer;
  transform: translate3d(0, -120px, 0);
  transition: filter 140ms ease, scale 140ms ease;
  will-change: transform;
}

.falling-item:hover {
  filter: drop-shadow(0 16px 15px rgba(48, 38, 27, 0.30));
  scale: 1.04;
}

.falling-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  pointer-events: none;
}

.falling-item.bonus {
  filter:
    drop-shadow(0 0 10px rgba(235, 83, 36, 0.42))
    drop-shadow(0 12px 13px rgba(48, 38, 27, 0.24));
}

.falling-item.bad {
  filter:
    drop-shadow(0 0 8px rgba(190, 18, 60, 0.25))
    drop-shadow(0 12px 13px rgba(48, 38, 27, 0.22));
  opacity: 0.94;
}

.score-pop {
  position: absolute;
  z-index: 4;
  color: var(--accent);
  font-weight: 900;
  pointer-events: none;
  animation: pop 700ms ease-out forwards;
}

.score-pop.penalty {
  color: #be123c;
}

@keyframes pop {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-28px) scale(1.12);
  }
}

.result-panel {
  align-items: center;
  margin-top: 14px;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.leaderboard-section {
  margin-top: 14px;
  padding: 18px;
}

#couponBadge {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.leaderboard {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaf3;
}

.leaderboard .rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

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

.leaderboard .points {
  font-weight: 900;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .game-shell {
    padding: 12px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .hud {
    gap: 8px;
  }

  .campaign-box strong,
  .hud strong {
    min-width: 0;
    font-size: 20px;
  }

  .falling-stage {
    height: 62vh;
    min-height: 430px;
  }

  .leaderboard li {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }
}
