/* =========================================================
   KERPLUNK · coming soon
   Brand colors live here. Change them once, they update everywhere.
   ========================================================= */
:root {
  --ocean-950: #051726;
  --ocean-900: #071f33;
  --ocean-800: #0a2a43;
  --ocean-700: #0f3a5c;
  --ocean-500: #1b5e85;
  --sand-50:  #fbf6ec;
  --sand-100: #f4ead5;
  --sand-200: #eadbbd;
  --sand-400: #c9b083;
  --turq-300: #7fe6dd;
  --turq-400: #3fd6cc;
  --turq-500: #1fb8b3;
  --turq-700: #0f7f86;

  --sun: #ffe3a8;
  --sunset-1: #0b3352;
  --sunset-2: #1d5d82;
  --sunset-3: #4f8fa3;
  --sunset-4: #e8a77a;
  --sunset-5: #f6c98e;
  --ink: var(--ocean-800);
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mark: "Rock Salt", "Marker Felt", cursive;
  --font-hand: "Nothing You Could Do", "Bradley Hand", cursive;

  --gutter: 16px;
  --radius: 999px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ocean-900);
  color: var(--sand-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }

.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Wordmark (placeholder lettering; set CONFIG.logo in script.js to use the real logo) ---------- */
.wordmark {
  display: inline-block;
  font-family: var(--font-mark);
  font-weight: 400;
  letter-spacing: .14em;
  margin-right: -.14em;          /* balances trailing letter-spacing so it centers */
  line-height: 1.5;
  white-space: nowrap;
  color: var(--sand-100);
}
.wordmark.has-logo { display: block; margin: 0 auto; letter-spacing: 0; }
.wordmark.has-logo img { display: block; width: 100%; height: auto; }

/* ---------- Palm silhouettes ---------- */
.palm { position: absolute; pointer-events: none; user-select: none; transform-origin: 0 0; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  padding: 15px 26px;
  min-height: 52px;
  font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, a:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--turq-400);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--turq-400);
  color: var(--ocean-900);
  box-shadow: 0 8px 24px -10px rgba(63, 214, 204, .7);
}
.btn-primary:hover { background: var(--turq-300); }
.btn-primary[disabled] { opacity: .65; cursor: progress; }
.btn-ghost {
  background: transparent;
  color: var(--sand-100);
  box-shadow: inset 0 0 0 1.5px rgba(244, 234, 213, .5);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--sand-100); }

/* =========================================================
   AGE GATE
   ========================================================= */
.age-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px var(--gutter);
  overflow: hidden;
  background:
    radial-gradient(70% 40% at 70% 100%, rgba(255, 210, 150, .45), transparent 70%),
    linear-gradient(180deg, var(--sunset-1) 0%, var(--sunset-2) 55%, #6b8f9a 85%, var(--sunset-4) 100%);
  transition: opacity .6s var(--ease), visibility .6s;
}
.age-ok .age-gate { opacity: 0; visibility: hidden; pointer-events: none; }
html:not(.age-ok) body { overflow: hidden; }

.palm--gate { top: -10px; left: -10px; width: clamp(200px, 60vw, 460px); opacity: .9; animation: sway 9s ease-in-out infinite; }
.age-card { position: relative; width: 100%; max-width: 420px; text-align: center; }
.age-card .wordmark { font-size: clamp(1.5rem, 7.4vw, 2.3rem); margin-bottom: 40px; }
.age-card .wordmark.has-logo { width: min(86%, 340px); }
.age-card h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 7.5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 28px;
}
.age-buttons { display: flex; gap: 12px; justify-content: center; }
.age-buttons .btn { flex: 1; max-width: 160px; }
.fine { margin-top: 22px; font-size: .82rem; letter-spacing: .04em; color: rgba(244, 234, 213, .6); }
.age-denied h2 { margin-bottom: 0; }
.age-ask, .age-denied { animation: fade-up .6s var(--ease) both; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sunset-1);
}
.hero::after {                 /* fine film grain for a premium, printed feel */
  content: "";
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.corner-tag {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: var(--gutter);
  z-index: 5;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--sand-100);
  text-shadow: 0 1px 10px rgba(5, 23, 38, .5);
  transform: rotate(-3deg);
  transform-origin: right center;
}
.corner-tag span { color: var(--turq-300); position: relative; white-space: nowrap; }
.corner-tag span::after {     /* little hand-drawn underline */
  content: "";
  position: absolute; left: -2px; right: -2px; bottom: -4px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 15 1 30 6 59 2' fill='none' stroke='%237fe6dd' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* Sky: golden-hour sunset over the islands */
.hero-top {
  --sun-x: 70%;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;                   /* keeps the Canteen sitting in the water */
  padding: calc(96px + env(safe-area-inset-top)) var(--gutter) 0;
  text-align: center;
  background:
    radial-gradient(60% 45% at var(--sun-x) 100%, rgba(255, 214, 150, .75), rgba(246, 201, 142, 0) 70%),
    linear-gradient(180deg, var(--sunset-1) 0%, var(--sunset-2) 38%, var(--sunset-3) 62%, var(--sunset-4) 86%, var(--sunset-5) 100%);
}
.scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sun {
  position: absolute;
  left: var(--sun-x);
  bottom: 14px;
  width: clamp(80px, 24vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #fff6df 0%, var(--sun) 55%, #ffc98a 100%);
  box-shadow: 0 0 60px 20px rgba(255, 215, 150, .55), 0 0 140px 60px rgba(255, 190, 130, .3);
  animation: sun-glow 6s ease-in-out infinite;
}
.ridge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(70px, 16vh, 150px); }
.ridge--far  { fill: #6f7f99; opacity: .75; }
.ridge--near { fill: #24405e; }
.palm-trees {
  position: absolute;
  left: max(-60px, -14vw);
  bottom: clamp(18px, 4vh, 40px);
  height: clamp(190px, 42%, 520px);
  width: auto;
  transform-origin: 40% 100%;
  animation: sway 12s ease-in-out infinite;
}
.palm--left  { top: -12px; left: -12px; width: clamp(190px, 58vw, 520px); animation: sway 9s ease-in-out infinite; }
.palm--right {
  top: -14px; right: -14px; width: clamp(140px, 40vw, 400px); opacity: .95;
  transform-origin: 50% 0;
  transform: scaleX(-1);
  animation: sway-r 11s ease-in-out infinite;
}

.hero-title { position: relative; z-index: 1; line-height: 1; }
.wordmark--hero.has-logo { width: min(92vw, 820px); }
.wordmark--hero {
  font-size: clamp(1.75rem, 8.4vw, 5.6rem);
  text-shadow: 0 4px 22px rgba(5, 23, 38, .5);
  animation: fade-up 1.1s var(--ease) both;
}

.canteen-wrap {
  position: relative;
  z-index: 2;                                  /* floats in front of the wordmark */
  width: clamp(120px, min(34vw, 30svh), 230px);
  margin-top: clamp(-34px, -4vw, -14px);
  animation: bob 5.5s ease-in-out infinite;
  will-change: transform;
}
.canteen {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(3, 18, 30, .4));
  animation: fade-in 1.4s .25s var(--ease) both;
}

/* Water */
.hero-water {
  position: relative;
  z-index: 3;                                  /* water sits over the bottom of the Canteen */
  display: flex;
  flex-direction: column;
  margin-top: clamp(-90px, -16vw, -60px);
}
.waves { width: 100%; height: 64px; overflow: hidden; }
.wave { animation: drift 14s linear infinite; }
.wave--back  { fill: rgba(127, 230, 221, .45); animation-duration: 19s; animation-direction: reverse; }
.wave--front { fill: #2a8aa0; }
.water-body {
  position: relative;
  min-height: max(170px, 32svh);
  margin-top: -1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #2a8aa0 0%, #18678a 30%, var(--ocean-700) 65%, var(--ocean-800) 100%);
  overflow: hidden;
}
/* The sun's reflection shimmering on the water */
.glitter {
  position: absolute;
  top: -40px; bottom: 0;
  left: 70%;
  width: clamp(90px, 30vw, 220px);
  transform: translateX(-50%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.7) 45%, transparent 95%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.7) 45%, transparent 95%);
}
.glitter::before, .glitter::after {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 233, 186, .95) 0 2px, transparent 2px 9px),
    radial-gradient(50% 100% at 50% 0%, rgba(255, 220, 160, .35), transparent 80%);
  -webkit-mask-image: radial-gradient(45% 100% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(45% 100% at 50% 0%, #000 30%, transparent 75%);
  animation: shimmer 2.6s ease-in-out infinite;
}
.glitter::after {
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 245, 220, .9) 5px 6px, transparent 6px 13px);
  animation: shimmer 3.4s ease-in-out -1.3s infinite reverse;
}
.tagline {
  position: relative;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  letter-spacing: .01em;
  color: var(--sand-100);
  text-shadow: 0 2px 16px rgba(5, 23, 38, .45);
  animation: fade-up 1.2s .5s var(--ease) both;
}
.scroll-cue {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  color: rgba(244, 234, 213, .7);
  animation: nudge 2.8s ease-in-out infinite;
}

/* =========================================================
   INTRO
   ========================================================= */
.intro {
  position: relative;
  overflow: hidden;
  background: var(--sand-100);
  color: var(--ink);
  text-align: center;
  padding: 80px var(--gutter) 72px;
}
.intro::before {               /* soft palm shadow falling across the sand */
  content: "";
  position: absolute; top: -30px; right: -40px;
  width: min(80vw, 520px); aspect-ratio: 1;
  background: url("assets/palm.svg") no-repeat top right / contain;
  transform: scaleX(-1);
  opacity: .07;
  filter: blur(2px);
  pointer-events: none;
}
.intro > * { position: relative; }
.eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--turq-700);
  margin-bottom: 20px;
}
.intro-text {
  max-width: 30ch;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 6.4vw, 2.5rem);
  line-height: 1.25;
}
.coming {
  margin-top: 28px;
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--turq-700);
}

/* =========================================================
   THE LINEUP (flavor carousel)
   ========================================================= */
.lineup {
  background: var(--sand-100);
  color: var(--ink);
  padding: 8px 0 72px;
  text-align: center;
}
.lineup-head { padding: 0 var(--gutter); }
.lineup h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 9vw, 3.2rem);
  line-height: 1.05;
}
.carousel { --card: min(80vw, 460px); position: relative; margin: 28px auto 0; }
.flavors {
  display: flex;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px calc((100% - var(--card)) / 2) 26px;   /* lets the first and last cards sit centered */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.flavors::-webkit-scrollbar { display: none; }

.flavor {
  --fg: var(--sand-50);
  position: relative;
  flex: 0 0 var(--card);
  min-height: min(118vw, 540px);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 28px 18px 24px;
  border-radius: 26px;
  color: var(--fg);
  text-align: center;
  overflow: hidden;
  box-shadow: 0 22px 40px -24px rgba(10, 42, 67, .55);
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.flavor::before {               /* soft light, like sun through glass */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 30% 0%, rgba(255, 255, 255, .28), transparent 60%);
  pointer-events: none;
}
.flavor:not(.is-active) { transform: scale(.9); opacity: .55; cursor: pointer; }
.flavor h3 {
  position: relative;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.1;
}
.mini-canteen {
  position: relative;
  width: 74px;
  height: 133px;
  color: var(--fg);
  margin-bottom: auto;
  animation: bob 5.5s ease-in-out infinite;
}
.flavor h3 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
.flavor .mini-canteen { width: clamp(96px, 26vw, 128px); height: auto; aspect-ratio: 200 / 360; margin-top: 18px; }
.flavor-text { position: relative; }
.flavor-notes { margin-top: 6px; font-size: .82rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; opacity: .9; }
.flavor-tag {
  position: absolute; top: 16px; left: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Flavor colors */
.flavor--daydrinker {
  background: linear-gradient(160deg, #1d63a8 0%, #3a9fd0 35%, #b57fd0 70%, #f27fae 100%);
  background-size: 160% 160%;
  animation: day-shift 9s ease-in-out infinite;
}
.flavor--cherry     { background: linear-gradient(160deg, #a51f35, #6e0f20); }
.flavor--peach      { --fg: #4a2205; background: linear-gradient(160deg, #ffc35a, #f0902a); }
.flavor--strawberry { --fg: #5a1420; background: linear-gradient(160deg, #ffb3b8, #f2727f); }

.car-btn {
  display: none;
  position: absolute; top: 50%; z-index: 2;
  width: 46px; height: 46px;
  margin-top: -34px;
  border: 0; border-radius: 50%;
  background: var(--sand-50);
  color: var(--ink);
  box-shadow: 0 8px 22px -8px rgba(10, 42, 67, .45);
  cursor: pointer;
  place-items: center;
  transition: opacity .2s, transform .2s;
}
.car-btn:hover { transform: scale(1.06); }
.car-btn--prev { left: calc(50% - var(--card) / 2 - 64px); }
.car-btn--next { right: calc(50% - var(--card) / 2 - 64px); }

.car-dots { display: flex; justify-content: center; gap: 8px; margin-top: 2px; }
.car-dots button {
  width: 8px; height: 8px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(10, 42, 67, .22);
  cursor: pointer;
  transition: width .35s var(--ease), background-color .35s;
}
.car-dots button.on { width: 26px; background: var(--turq-700); }
.lineup-note {
  margin-top: 26px;
  padding: 0 var(--gutter);
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.4;
  color: var(--turq-700);
}

@media (min-width: 760px) {
  .car-btn { display: grid; }
}

/* =========================================================
   WAITLIST
   ========================================================= */
.waitlist {
  background: linear-gradient(180deg, var(--sand-100), var(--sand-50));
  color: var(--ink);
  padding: 8px var(--gutter) 88px;
}
.waitlist-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 36px 22px 30px;
  border-radius: 28px;
  background: var(--ocean-800);
  color: var(--sand-100);
  text-align: center;
  box-shadow: 0 30px 60px -30px rgba(10, 42, 67, .55);
}
.waitlist h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1.1;
}
.lede { margin-top: 8px; color: rgba(244, 234, 213, .75); }

.signup { margin-top: 24px; }
.flavor-pick { border: 0; padding: 0; margin: 0 0 22px; }
.flavor-pick legend { padding: 0; margin: 0 auto 12px; font-size: .95rem; color: var(--sand-100); }
.pick-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1.5px solid rgba(244, 234, 213, .22);
  background: rgba(244, 234, 213, .05);
  font-size: .86rem;
  line-height: 1.2;
  color: var(--sand-100);
  transition: background-color .2s, border-color .2s, transform .15s;
}
.pick span::before {           /* little color swatch for each flavor */
  content: "";
  flex: 0 0 auto;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--swatch);
}
.pick--daydrinker { --swatch: linear-gradient(135deg, #3a9fd0, #f27fae); }
.pick--cherry     { --swatch: #a51f35; }
.pick--peach      { --swatch: #f7a83c; }
.pick--strawberry { --swatch: #f58d97; }
.pick:active span { transform: scale(.97); }
.pick input:checked + span {
  border-color: var(--turq-400);
  background: rgba(63, 214, 204, .16);
  box-shadow: inset 0 0 0 1px var(--turq-400);
}
.pick input:focus-visible + span { outline: 2px solid var(--turq-400); outline-offset: 2px; }
.signup-row { display: flex; flex-direction: column; gap: 10px; }
.signup input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(244, 234, 213, .28);
  background: rgba(244, 234, 213, .07);
  color: var(--sand-100);
  font-size: 16px;                 /* 16px stops iPhone from zooming on focus */
}
.signup input::placeholder { color: rgba(244, 234, 213, .45); }
.signup input:focus { border-color: var(--turq-400); outline: none; }
.form-msg:empty { display: none; }
.form-msg { margin-top: 10px; font-size: .88rem; color: #ffc9a8; }
.form-note { margin-top: 14px; font-size: .78rem; letter-spacing: .04em; color: rgba(244, 234, 213, .5); }
.thanks { margin-top: 24px; animation: fade-up .6s var(--ease) both; }
.thanks-title {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--turq-400);
}

@media (min-width: 560px) {
  .signup-row {
    flex-direction: row;
    padding: 5px;
    border-radius: var(--radius);
    background: rgba(244, 234, 213, .07);
    border: 1.5px solid rgba(244, 234, 213, .28);
  }
  .signup-row:focus-within { border-color: var(--turq-400); }
  .signup input[type="email"] { border: 0; background: transparent; min-height: 48px; }
  .signup-row .btn { min-height: 48px; white-space: nowrap; }
  .waitlist-inner { padding: 48px 44px 40px; }
}

/* =========================================================
   MINI GAME
   ========================================================= */
.game {
  background: var(--ocean-800);
  padding: 72px var(--gutter) 56px;
  text-align: center;
}
.game-head h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 8.5vw, 2.8rem);
  line-height: 1.1;
}
.game-head p { margin-top: 6px; color: rgba(244, 234, 213, .7); }

.game-hud {
  max-width: 520px;
  margin: 24px auto 10px;
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(244, 234, 213, .65);
}
.game-hud b {
  margin-left: 6px;
  font-size: 1.15rem;
  letter-spacing: 0;
  color: var(--sand-100);
  font-variant-numeric: tabular-nums;
}

.game-stage {
  position: relative;
  max-width: 520px;
  height: min(130vw, 74svh, 640px);
  min-height: 420px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: var(--ocean-900);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(244, 234, 213, .08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.game-stage.shake { animation: shake .35s ease-out; }
.game-stage canvas { width: 100%; height: 100%; cursor: pointer; }

.game-pop {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 3;
  font-family: var(--font-mark);
  font-size: clamp(1.2rem, 6vw, 1.9rem);
  letter-spacing: .04em;
  color: var(--sand-100);
  text-shadow: 0 3px 0 var(--turq-700), 0 0 16px rgba(5, 23, 38, .55), 0 10px 24px rgba(0, 0, 0, .35);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.game-pop.show { animation: pop 1s var(--ease) both; }

.game-overlay {
  position: absolute; inset: 0; z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 20px;
  background: rgba(5, 23, 38, .45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in .4s var(--ease) both;
}
.game-overlay[hidden] { display: none; }
.game-overlay p { font-size: .9rem; color: rgba(244, 234, 213, .75); }
#game-play { min-width: 160px; }
.game-over {
  background: rgba(5, 23, 38, .86);
  overflow-y: auto;
  justify-content: flex-start;   /* with the auto margins below: centered, but scrollable when tall */
  gap: 10px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.game-over > :first-child { margin-top: auto; }
.game-over > :last-child { margin-bottom: auto; }
.go-title { font-family: var(--font-hand); font-size: clamp(1.6rem, 7vw, 2.1rem) !important; text-align: center; line-height: 1; color: var(--sand-100) !important; }
.go-sub { margin-top: -6px; max-width: 300px; font-size: .95rem !important; color: rgba(244, 234, 213, .85) !important; }
.game-level {
  position: absolute; top: 18px; left: 50%; z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(5, 23, 38, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--sand-100);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
}
.game-level.show { animation: level-in 2.6s var(--ease) both; }
@keyframes level-in {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  15%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}
.go-score { font-size: .8rem !important; letter-spacing: .2em; text-transform: uppercase; }
.go-score b { font-size: 1.3rem; letter-spacing: 0; color: var(--sand-100); margin-left: 4px; }
.go-score .dot { margin: 0 12px; }
.go-signup {
  width: 100%;
  max-width: 380px;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 234, 213, .15);
}
.go-cta { font-family: var(--font-serif); font-style: italic; font-size: 1.5rem !important; color: var(--sand-100) !important; }
.go-priority { margin-top: 4px; font-size: .85rem !important; color: var(--turq-300) !important; }
.signup--compact { margin-top: 12px; }
.go-signup .thanks-title { font-size: 1.35rem; }
.link-btn {
  margin-top: 10px;
  padding: 10px 4px;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--sand-100);
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--turq-400);
  cursor: pointer;
}
.link-btn[hidden] { display: none; }
.go-signup .thanks { margin-top: 12px; }

/* ---------- Leaderboard ---------- */
.leaderboard {
  max-width: 520px;
  margin: 28px auto 0;
  padding: 24px 20px 18px;
  border-radius: 24px;
  background: rgba(244, 234, 213, .05);
  box-shadow: inset 0 0 0 1px rgba(244, 234, 213, .1);
  text-align: left;
}
.leaderboard h3 {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.7rem;
}
.lb-list { list-style: none; margin: 0; padding: 0; counter-reset: lb; }
.lb-list li {
  counter-increment: lb;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid rgba(244, 234, 213, .08);
  font-variant-numeric: tabular-nums;
}
.lb-list li:last-child { border-bottom: 0; }
.lb-list li::before {
  content: counter(lb);
  width: 26px; height: 26px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: .8rem; font-weight: 700;
  background: rgba(244, 234, 213, .1);
}
.lb-list li:nth-child(1)::before { background: linear-gradient(135deg, #3a9fd0, #f27fae); color: #fff; }
.lb-list li:nth-child(2)::before { background: #a51f35; color: #fff; }
.lb-list li:nth-child(3)::before { background: #f7a83c; color: var(--ocean-900); }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 700; font-size: 1.05rem; }
.lb-list li.me { background: rgba(63, 214, 204, .12); border-radius: 12px; }
.lb-empty { margin: 4px 0 6px; text-align: center; font-size: .9rem; color: rgba(244, 234, 213, .6); }
.lb-empty[hidden] { display: none; }

.lb-post { width: 100%; max-width: 360px; }
.lb-post[hidden], .lb-placed[hidden] { display: none; }
.lb-row { display: flex; gap: 8px; }
.lb-row input {
  flex: 1; min-width: 0;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(244, 234, 213, .28);
  background: rgba(244, 234, 213, .07);
  color: var(--sand-100);
  font-size: 16px;
}
.lb-row input:focus { outline: none; border-color: var(--turq-400); }
.lb-row .btn { min-height: 48px; padding: 10px 18px; white-space: nowrap; }
.lb-placed { font-family: var(--font-hand); font-size: 1.3rem !important; color: var(--turq-300) !important; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--ocean-950);
  text-align: center;
  padding: 56px var(--gutter) calc(40px + env(safe-area-inset-bottom));
}
.wordmark--small { font-size: 1.15rem; opacity: .9; }
.wordmark--small.has-logo { width: 170px; }
.responsibly { margin-top: 18px; font-size: .9rem; color: rgba(244, 234, 213, .8); }
.social { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.social a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  font-size: .9rem;
  text-decoration: none;
  color: var(--sand-100);
  opacity: .8;
  transition: opacity .2s, color .2s;
}
.social a:hover { opacity: 1; color: var(--turq-400); }
.copyright { margin-top: 18px; font-size: .75rem; letter-spacing: .06em; color: rgba(244, 234, 213, .4); }

/* ---------- Gentle reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2.2deg); }
  50%      { transform: translateY(12px) rotate(2deg); }
}
@keyframes sway   { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(2.2deg); } }
@keyframes sway-r { 0%, 100% { transform: scaleX(-1) rotate(0deg); } 50% { transform: scaleX(-1) rotate(1.8deg); } }
@keyframes sun-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }
@keyframes shimmer {
  0%, 100% { opacity: .55; transform: scaleX(.92) translateY(0); }
  50%      { opacity: 1;   transform: scaleX(1.08) translateY(2px); }
}
@keyframes day-shift { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
@keyframes drift { to { transform: translateX(-1440px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(6px); opacity: 1; } }
@keyframes pop {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(.6) rotate(-6deg); }
  25%  { opacity: 1; transform: translate(-50%, -60%) scale(1.08) rotate(-3deg); }
  70%  { opacity: 1; transform: translate(-50%, -80%) scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(.96) rotate(-3deg); }
}
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

/* ---------- Larger screens ---------- */
@media (min-width: 900px) {
  .corner-tag { top: 28px; right: 36px; font-size: 1.35rem; }
  .hero-top { padding-top: 120px; }
  .intro { padding: 120px var(--gutter) 100px; }
  .game { padding: 100px var(--gutter) 80px; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
