:root {
  --bg: #f2e3ca;
  --bg-dark: #d9b687;
  --surface: rgba(255, 250, 242, 0.95);
  --surface-strong: #fff8ed;
  --ink: #20130d;
  --muted: #6e5546;
  --brand-red: #b11d1a;
  --brand-red-dark: #7c1313;
  --brand-green: #2f9445;
  --brand-gold: #d69a2d;
  --line: rgba(32, 19, 13, 0.12);
  --shadow: 0 16px 30px rgba(78, 33, 18, 0.12);
  --display-font: "Arial Black", "Franklin Gothic Heavy", Impact, sans-serif;
  --body-font: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.45), transparent 36%),
    linear-gradient(180deg, #ffe7c5 0%, var(--bg) 50%, var(--bg-dark) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(177, 29, 26, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(177, 29, 26, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(177, 29, 26, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(177, 29, 26, 0.04) 75%);
  background-size: 30px 30px;
  background-position: 0 0, 0 15px, 15px -15px, -15px 0;
  pointer-events: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 22px 14px 30px;
}

.screen {
  display: none;
  width: min(100%, 470px);
  margin: 0 auto;
}

.screen--active {
  display: block;
}

.brand-stack,
.hero-card,
.play-card,
.result-card {
  position: relative;
  z-index: 1;
}

.brand-stack {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-align: center;
}

.brand-logo {
  width: min(100%, 160px);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.1));
}

.brand-name,
.hero-title,
.play-title,
.result-title,
.reward-title,
.hud-value,
.score-badge__value,
.reward-detail h4 {
  font-family: var(--display-font);
  letter-spacing: 0.02em;
}

.brand-name {
  margin: 0;
  font-size: clamp(1.55rem, 6vw, 2.1rem);
  line-height: 0.92;
}

.hero-card,
.play-card,
.result-card {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.97), rgba(255, 243, 223, 0.97));
  border: 1px solid rgba(124, 19, 19, 0.12);
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card,
.result-card {
  padding: 24px 18px;
}

.play-card {
  padding: 18px 14px 16px;
}

.eyebrow,
.hud-label,
.score-badge__label,
.reward-code-box__label,
.share-feedback,
.page-copyright {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title,
.play-title,
.result-title {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: 0.92;
}

.hero-subtitle {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-red-dark);
}

.hero-copy,
.result-copy,
.score-summary__text,
.status-pill,
.play-tip,
.instruction-card p,
.reward-detail p,
.reward-lock__copy {
  line-height: 1.45;
}

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

.instruction-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.instruction-card--wide {
  grid-column: 1 / -1;
}

.instruction-icon {
  font-size: 2rem;
}

.instruction-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.instruction-card p {
  margin: 0;
  color: var(--muted);
}

.glow-text {
  color: var(--brand-red);
  font-weight: 800;
  text-shadow:
    0 0 8px rgba(214, 154, 45, 0.4),
    0 0 18px rgba(214, 154, 45, 0.32);
  animation: glow-pulse 1.8s ease-in-out infinite;
}

.cta-button,
.ghost-button {
  appearance: none;
  border: 0;
  width: 100%;
  border-radius: 999px;
  padding: 16px 18px;
  font-family: var(--display-font);
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.cta-button {
  color: #fff8eb;
  background: linear-gradient(180deg, var(--brand-red), var(--brand-red-dark));
  box-shadow: 0 14px 24px rgba(124, 19, 19, 0.24);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-red-dark);
  border: 1px solid rgba(124, 19, 19, 0.16);
}

.ghost-button--compact {
  width: auto;
  min-width: 180px;
  padding-inline: 20px;
}

.play-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.play-header > div {
  padding: 12px 10px;
  background: rgba(255, 250, 242, 0.84);
  border: 1px solid rgba(124, 19, 19, 0.12);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(82, 28, 16, 0.08);
}

.hud-value {
  margin: 4px 0 0;
  font-size: 1.6rem;
}

.play-card__top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.play-title {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
}

.play-tip {
  margin: 0;
  max-width: 128px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}

.playfield-frame {
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(124, 19, 19, 0.14);
  background: linear-gradient(180deg, #f0d09d, #cf8750 82%, #7b4632 100%);
}

.playfield {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(320px, 50vh, 430px);
  background: linear-gradient(180deg, #efd5aa 0%, #e2b677 58%, #c17f53 100%);
}

.floor-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62px;
  border-top: 2px solid rgba(43, 24, 20, 0.4);
  background: linear-gradient(180deg, #4a3128, #211714);
}

.times-up-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(28, 18, 14, 0.74);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.times-up-overlay--visible {
  opacity: 1;
}

.times-up-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2rem, 10vw, 3rem);
  color: #fff6e8;
}

.falling-item {
  position: absolute;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  pointer-events: none;
  box-shadow: 0 8px 14px rgba(73, 32, 20, 0.14);
}

.falling-item span {
  font-size: 2rem;
  line-height: 1;
}

.falling-item--slice {
  background: linear-gradient(180deg, #fff2cd, #f6c665);
  border: 2px solid rgba(123, 58, 21, 0.18);
}

.falling-item--anchovy {
  background: linear-gradient(180deg, #d8eef1, #8dbdc3);
  border: 2px solid rgba(25, 79, 89, 0.18);
}

.falling-item--caught {
  animation: item-caught 180ms ease-out forwards;
}

.falling-item--missed {
  animation: item-missed 200ms ease-out forwards;
}

.floating-score {
  position: absolute;
  font-family: var(--display-font);
  font-size: 1rem;
  pointer-events: none;
  animation: float-up 720ms ease-out forwards;
}

.floating-score--good {
  color: var(--brand-green);
}

.floating-score--bad {
  color: var(--brand-red);
}

.status-row {
  margin-top: 12px;
}

.status-pill {
  margin: 0;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  text-align: center;
}

.result-title {
  margin-top: 0;
}

.result-copy {
  margin: 0 0 18px;
}

.reward-panel {
  position: relative;
  margin-bottom: 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.99), rgba(255, 239, 213, 0.97));
  border: 1px solid rgba(124, 19, 19, 0.14);
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(177, 29, 26, 0.12);
}

.reward-content {
  display: grid;
  gap: 14px;
  padding: 18px 16px;
}

.reward-title {
  margin: 0;
  font-size: clamp(1.9rem, 7.5vw, 2.7rem);
  line-height: 0.92;
}

.reward-code-box {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 22px;
  color: #fffdf8;
  background: linear-gradient(180deg, #d3312d, #971c19);
  box-shadow: 0 10px 22px rgba(177, 29, 26, 0.22);
  animation: reward-pulse 1.9s ease-in-out infinite;
}

.reward-code-box__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reward-code-box__label {
  color: rgba(255, 248, 235, 0.86);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

.reward-copy-button {
  appearance: none;
  border: 1px solid rgba(255, 248, 235, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #fffdf8;
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--display-font);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.reward-code-box__value {
  font-family: var(--display-font);
  font-size: clamp(1.7rem, 8.5vw, 2.5rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
}

.cta-button--order {
  padding-block: 18px;
  font-size: 1.08rem;
  box-shadow: 0 16px 28px rgba(124, 19, 19, 0.28);
}

.reward-action-feedback {
  min-height: 1.1em;
  margin: -2px 0 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-red-dark);
}

.reward-detail {
  display: grid;
  gap: 6px;
}

.reward-detail h4 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.reward-detail p {
  margin: 0;
  color: var(--muted);
}

.reward-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.score-summary {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.score-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff6e5, #f6d58e);
  border: 1px solid rgba(214, 154, 45, 0.3);
}

.score-badge__value {
  font-size: 2rem;
}

.score-summary__actions {
  display: grid;
  gap: 10px;
}

.score-summary__text {
  margin: 0;
  color: var(--muted);
}

.share-feedback {
  min-height: 1.1em;
  margin: 0 0 14px;
}

.reward-steps li + li {
  margin-top: 6px;
}

.reward-lock {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: rgba(36, 20, 14, 0.56);
  z-index: 2;
}

.reward-lock__title {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.5rem;
  color: #fffaf0;
}

.reward-lock__copy {
  margin: 0;
  color: #fff4df;
}

.reward-panel--locked .reward-content {
  filter: blur(5px);
  opacity: 0.5;
  pointer-events: none;
}

.reward-panel:not(.reward-panel--locked) .reward-lock {
  display: none;
}

.result-footer-actions {
  display: flex;
  justify-content: center;
}

.home-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand-red-dark);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}

.cta-button--compact,
.ghost-button--compactwide {
  padding-block: 14px;
}

.page-copyright {
  margin-top: 12px;
  text-align: center;
}

.screen-shake {
  animation: shake 180ms linear;
}

@keyframes glow-pulse {
  0%,
  100% {
    text-shadow:
      0 0 8px rgba(214, 154, 45, 0.4),
      0 0 18px rgba(214, 154, 45, 0.32);
  }

  50% {
    text-shadow:
      0 0 10px rgba(214, 154, 45, 0.62),
      0 0 24px rgba(214, 154, 45, 0.46);
  }
}

@keyframes item-caught {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: scale(0.84) rotate(10deg);
  }
}

@keyframes item-missed {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translateY(10px) scale(1.03) rotate(-8deg);
  }
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.94);
  }

  100% {
    opacity: 0;
    transform: translateY(-34px) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  50% {
    transform: translateX(4px);
  }

  75% {
    transform: translateX(-3px);
  }
}

@keyframes reward-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 10px 22px rgba(177, 29, 26, 0.22);
  }

  50% {
    transform: scale(1.015);
    box-shadow: 0 14px 26px rgba(177, 29, 26, 0.28);
  }
}

@media (min-width: 700px) {
  .page-shell {
    display: grid;
    place-items: center;
    padding: 30px 18px 44px;
  }

  .brand-logo {
    width: min(100%, 180px);
  }
}
