:root {
  --lavender: #d9d4f2;
  --lavender-strong: #bcaef3;
  --sky: #aecff6;
  --sky-strong: #90c8ef;
  --black-sesame: #17181c;
  --stone: #f3efe9;
  --ice-grey: #dfe4ea;
  --snow: #ffffff;
  --slate: #5b6170;
  --field-green: #dfeadf;
  --field-line: rgba(23, 24, 28, 0.22);
  --bonus-pink: #f6d7e5;
  --shadow: rgba(18, 21, 25, 0.15);
  --goal-shadow: rgba(69, 75, 92, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f1f3f8 0%, #e5f0f7 100%);
  color: var(--black-sesame);
  font-family: 'Segoe UI', Arial, sans-serif;
}

button,
a {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.site-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 136px;
  padding: 12px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  background: linear-gradient(112deg, #635078 0%, #8b79a8 47%, #c5bfd7 100%);
  box-shadow: 0 12px 28px rgba(64, 57, 81, 0.15);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.brand-kicker {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--snow);
  font-weight: 600;
}

.brand-caption {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.brand-visual {
  width: clamp(110px, 22vw, 180px);
  min-width: 90px;
  display: flex;
  justify-content: flex-end;
}

.brand-visual img {
  max-height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(39, 31, 52, 0.22));
}

.is-playing .site-header {
  min-height: 78px;
  padding: 4px 18px;
}

.is-playing .brand-kicker {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.is-playing .brand-caption {
  display: none;
}

.is-playing .brand-visual {
  width: 96px;
}

.is-playing .brand-visual img {
  max-height: 76px;
}

.app-shell {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  width: min(100%, 860px);
  background: rgba(248, 247, 251, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 18px 36px rgba(14, 19, 29, 0.28);
  overflow: hidden;
}

.intro-panel,
.end-panel {
  padding: 28px 20px 26px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: none;
}

h1,
h2 {
  margin: 0;
  color: var(--black-sesame);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 0.95;
}

h1 {
  font-size: clamp(2.9rem, 7vw, 6rem);
}

.subhead {
  margin: 16px 0 6px;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  font-weight: 600;
  color: var(--black-sesame);
}

.description {
  max-width: 440px;
  margin: 0 auto 18px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--slate);
  line-height: 1.5;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.primary-btn,
.secondary-btn,
.watch-party-link {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  touch-action: manipulation;
}

.primary-btn {
  background: linear-gradient(135deg, var(--lavender-strong), var(--sky));
  color: var(--black-sesame);
  box-shadow: 0 12px 22px rgba(125, 144, 193, 0.25);
}

.secondary-btn,
.watch-party-link {
  background: rgba(255, 255, 255, 0.68);
  color: var(--black-sesame);
  border: 1px solid rgba(23, 24, 28, 0.14);
}

.primary-btn:hover,
.secondary-btn:hover,
.watch-party-link:hover,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.watch-party-link:focus-visible {
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(120, 168, 255, 0.9);
  outline-offset: 2px;
}

.game-panel {
  padding: 18px 16px 16px;
  background: rgba(248, 247, 251, 0.96);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.score-card,
.summary-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(220, 228, 239, 0.74));
  border: 1px solid rgba(23, 24, 28, 0.08);
  border-radius: 18px;
  padding: 10px 12px;
  text-align: center;
}

.label {
  display: block;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-card strong,
.summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--black-sesame);
  font-size: clamp(1.3rem, 3vw, 2.2rem);
}

.field-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1.2 / 1;
  min-height: 420px;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #eaf4ff 0%, #c5e3fa 42%, #647fab 43%, #344b73 58%, #5b8d92 58%, #a7c9c4 100%);
  border: 1px solid rgba(23,24,28,0.08);
  touch-action: pan-y;
  user-select: none;
}

.field-container::after {
  position: absolute;
  z-index: 9;
  left: 78%;
  top: 34%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.9) 0deg 2deg,
    transparent 2deg 18deg
  );
  content: '';
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.3);
  mask: radial-gradient(circle, transparent 0 34%, #000 38% 67%, transparent 72%);
}

.field-container.is-scoring::after {
  animation: score-rays 620ms ease-out both;
}

@keyframes score-rays {
  15% { opacity: 0.75; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.field-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 76% 15%, rgba(255, 255, 255, 0.65) 0 3%, transparent 3.5%),
    radial-gradient(ellipse at 20% 24%, rgba(255, 255, 255, 0.5) 0 2%, transparent 2.5%),
    linear-gradient(180deg, rgba(255,255,255,0.2), transparent 45%);
  pointer-events: none;
}

.goal-posts {
  position: absolute;
  left: 50%;
  top: 15%;
  width: 18%;
  height: 30%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 8;
}

.goal-upright,
.goal-crossbar,
.goal-support {
  position: absolute;
  display: block;
}

.goal-upright {
  top: 0;
  width: 5px;
  height: 69%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e58b31, #ffd279 48%, #ca682a);
  box-shadow: 1px 2px 3px rgba(28, 32, 52, 0.35);
}

.goal-upright-left { left: 0; }
.goal-upright-right { right: 0; }

.goal-crossbar {
  left: 0;
  right: 0;
  top: 65%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffda83, #d5792e);
  box-shadow: 1px 3px 4px rgba(28, 32, 52, 0.4);
}

.goal-support {
  left: calc(50% - 3px);
  top: 68%;
  height: 31%;
  width: 6px;
  background: linear-gradient(90deg, #64738e, #ced5df, #64738e);
  box-shadow: 2px 4px 5px rgba(23, 24, 28, 0.25);
}

.stadium-bowl {
  position: absolute;
  z-index: 3;
  left: -4%;
  right: -4%;
  top: 37%;
  height: 27%;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 0 12%, #273755 13% 17%, #8190a7 18% 20%, #405578 21% 73%, #293a5d 74% 100%);
  clip-path: polygon(0 0, 100% 0, 96% 88%, 83% 100%, 17% 100%, 4% 88%);
  box-shadow: 0 12px 20px rgba(27, 40, 69, 0.35);
}

.stadium-crowd {
  position: absolute;
  inset: 18% 2% 19%;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(218, 225, 242, 0.88) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(32, 40, 67, 0.8) 0 1.3px, transparent 2px);
  background-size: 11px 9px, 15px 12px, 18px 13px;
  background-position: 0 0, 5px 3px, 2px 6px;
  opacity: 0.82;
}

.stadium-snow {
  position: absolute;
  z-index: 2;
  top: 13%;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(180deg, #fff 0 45%, #d9e7f3 100%);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(225, 239, 250, 0.7);
}

.football-field {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: 43%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(235, 247, 250, 0.96) 0 5%, rgba(78, 144, 145, 0.98) 13%, #4a868a 100%);
  border-top: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 12px 18px rgba(230, 244, 248, 0.3);
}

.yard-lines {
  position: absolute;
  inset: 15% 0 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent calc(20% - 1px),
    rgba(245, 252, 255, 0.58) calc(20% - 1px),
    rgba(245, 252, 255, 0.58) 20%
  );
}

.yard-hash {
  position: absolute;
  top: 18%;
  bottom: 0;
  width: 2px;
  opacity: 0.32;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 17px,
    rgba(255, 255, 255, 0.92) 17px 20px,
    transparent 20px 34px
  );
}

.yard-hash-left { left: 24%; }
.yard-hash-right { right: 24%; }

.aim-target {
  position: absolute;
  z-index: 9;
  top: 25%;
  left: 50%;
  width: var(--aim-target-size, 58px);
  height: var(--aim-target-size, 58px);
  border: 2px dashed rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: rgba(34, 54, 78, 0.18);
  box-shadow: 0 0 12px rgba(20, 34, 50, 0.65), inset 0 0 8px rgba(20, 34, 50, 0.24);
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, border-color 120ms ease, box-shadow 120ms ease;
  pointer-events: none;
}

.aim-target::before,
.aim-target::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: '';
  transform: translate(-50%, -50%);
}

.aim-target::before {
  width: 145%;
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
}

.aim-target::after {
  width: 1px;
  height: 145%;
  background: rgba(255, 255, 255, 0.8);
}

.aim-target-center {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #f4bd62;
  box-shadow: 0 0 5px rgba(20, 34, 50, 0.8);
  transform: translate(-50%, -50%);
}

.aim-target.is-aligned {
  border-color: #a8f0c4;
  background: rgba(70, 174, 120, 0.22);
  box-shadow: 0 0 18px rgba(101, 244, 165, 0.9), inset 0 0 10px rgba(101, 244, 165, 0.35);
}

.mountain {
  position: absolute;
  z-index: 2;
  bottom: 52%;
  background: rgba(219, 231, 244, 0.78);
  clip-path: polygon(0% 100%, 18% 66%, 31% 78%, 52% 40%, 75% 88%, 100% 100%);
}

.mountain::after {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  clip-path: polygon(43% 57%, 52% 40%, 61% 59%, 56% 54%, 52% 61%, 49% 53%);
  content: '';
}

.mountain-back {
  left: -6%;
  width: 52%;
  height: 26%;
  opacity: 0.66;
}

.mountain-front {
  right: -8%;
  width: 58%;
  height: 35%;
  opacity: 0.9;
}

.wind-indicator {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 80px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(23,24,28,0.08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  z-index: 5;
}

.wind-indicator::before {
  content: 'WIND';
  position: absolute;
  left: 12px;
  top: -18px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.wind-arrow {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-left: 3px solid var(--black-sesame);
  border-top: 3px solid var(--black-sesame);
  transform: rotate(45deg);
  transition: transform 200ms ease;
}

.football {
  position: absolute;
  left: 50%;
  bottom: auto;
  width: 58px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 7px 6px rgba(15, 21, 25, 0.3));
  transform: translate(-50%, -50%);
  transition: transform 180ms ease;
  pointer-events: none;
  z-index: 10;
  user-select: none;
  -webkit-user-drag: none;
}

.kick-instructions {
  margin: 14px 0;
  color: rgba(23,24,28,0.75);
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.result-banner {
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  min-width: 190px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.8);
  text-align: center;
  color: var(--black-sesame);
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
  box-shadow: 0 10px 18px rgba(22,26,35,0.12);
  z-index: 20;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.bonus-item {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bonus-pink), rgba(255,255,255,0.8));
  border: 1px solid rgba(23,24,28,0.08);
  box-shadow: 0 10px 16px rgba(94, 79, 89, 0.14);
  font-size: 1.5rem;
  z-index: 12;
}

.play-actions {
  display: block;
  width: 50%;
  max-width: 300px;
  margin: 0 auto;
}

.kick-btn {
  width: 100%;
  min-height: 60px;
  font-size: 1.08rem;
  letter-spacing: 0.18em;
}

.kick-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.play-actions > .primary-btn:not(.kick-btn) {
  width: 100%;
}

.final-score {
  margin: 12px 0 16px;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800;
  color: var(--black-sesame);
}

.personal-best {
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--slate);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}

.end-cta {
  margin-top: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.56);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 40;
}

.modal-panel {
  width: min(100%, 500px);
  background: rgba(249, 248, 252, 0.98);
  border: 1px solid rgba(23,24,28,0.08);
  border-radius: 26px;
  padding: 26px 20px 20px;
  box-shadow: 0 22px 48px rgba(16, 18, 24, 0.28);
  text-align: center;
}

.modal-panel h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 14px;
}

.modal-copy {
  margin: 0 auto 18px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--slate);
  max-width: 380px;
}

@media (max-width: 560px) {
  .site-header {
    min-height: 112px;
    padding: 10px 16px;
  }

  .brand-caption {
    font-size: 0.56rem;
    letter-spacing: 0.17em;
  }

  .brand-visual {
    width: 108px;
  }

  .brand-visual img {
    max-height: 106px;
  }

  .is-playing .site-header {
    min-height: 68px;
  }

  .is-playing .brand-visual img {
    max-height: 64px;
  }

  .app-shell {
    min-height: 620px;
  }

  .score-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .score-card {
    padding: 9px 4px;
  }

  .score-card .label {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .field-container {
    min-height: 360px;
    aspect-ratio: 4 / 5;
  }

  .kick-instructions {
    padding: 0 8px;
  }

  .primary-btn,
  .secondary-btn,
  .watch-party-link {
    width: 100%;
  }

  .cta-group {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
