/* Cruise Ducks: public pages. Phones first; the home page is a night party on deck, the duck
   pages a sunny one (readable outside on a bright deck). */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --night: #12082f;
  --pink: #ff4fd8;
  --hot: #ff5c8a;
  --violet: #7b2ff7;
  --cyan: #35e0ff;
  --yellow: #ffd23f;
  --duck: #ffd23f;
  --duck-dark: #f2b400;
  --beak: #ff8c1a;
  --ink: #24123f;
  --muted: #6d6488;
  --paper: #fff8ec;
  --ok: #0f9d58;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { line-height: 1.1; }
a { color: inherit; }
img { max-width: 100%; }
.nowrap { white-space: nowrap; }
.visually-hidden, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- The duck and the ship (inline SVG) ------------------------------------------------- */

.rubber-duck { display: block; width: 100%; height: auto; overflow: visible; }
.duck-body { fill: var(--duck); }
.duck-shine { fill: #fff; opacity: .55; }
.duck-wing { fill: var(--duck-dark); }
.duck-beak { fill: var(--beak); }
.duck-mouth { fill: none; stroke: #c25a00; stroke-width: 1.3; stroke-linecap: round; }
.duck-cheek { fill: #ff7aa8; opacity: .5; }
.duck-eye { fill: #1d1530; }
.duck-glint { fill: #fff; }
.hat { fill: var(--pink); }
.hat-stripe { fill: none; stroke: var(--yellow); stroke-width: 3.4; stroke-linecap: round; }
.hat-pompom { fill: var(--cyan); }
.silhouette .duck-body, .silhouette .duck-wing, .silhouette .duck-beak { fill: #d9d0ee; }
.silhouette .duck-shine, .silhouette .duck-mouth, .silhouette .duck-cheek,
.silhouette .duck-eye, .silhouette .duck-glint { display: none; }

.cruise-ship { display: block; width: 100%; height: auto; overflow: visible; }
.ship-hull, .ship-funnel-top { fill: #14235e; }
.ship-stripe, .ship-funnel { fill: #e8364f; }
.ship-deck { fill: #f6f3ff; }
.ship-porthole { fill: #ffe08a; }
.ship-garland { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: .8; }
.bulb { animation: blink 1.6s ease-in-out infinite; }
.bulb.b0 { fill: var(--pink); }
.bulb.b1 { fill: var(--yellow); animation-delay: -.4s; }
.bulb.b2 { fill: var(--cyan); animation-delay: -.8s; }
.bulb.b3 { fill: #7dff6b; animation-delay: -1.2s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* --- Buttons, cards, meter ---------------------------------------------------------------- */

.button, .cta, .code-form button, .message-form button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  box-shadow: 0 6px 18px rgba(123, 47, 247, .35);
}
.button:active, .cta:active, button:active { transform: translateY(1px); }

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(60, 20, 90, .10);
}
.center { text-align: center; }

.meter {
  position: relative;
  height: 16px;
  margin: 22px 6px 8px;
  border-radius: 999px;
  background: rgba(36, 18, 63, .10);
}
.meter-fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--yellow));
}
.meter-duck {
  position: absolute; top: 50%;
  width: 40px;
  transform: translate(-50%, -64%);
  filter: drop-shadow(0 2px 3px rgba(40, 10, 70, .3));
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  background: rgba(123, 47, 247, .12);
  color: var(--violet);
}
.badge.sailing { background: #d8f8e6; color: #08743f; }
.badge.ended { background: rgba(36, 18, 63, .08); color: var(--muted); }

.code-form { display: flex; gap: 8px; margin-top: 12px; }
.code-form input {
  flex: 1; min-width: 0;
  border: 2px solid rgba(123, 47, 247, .35);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit; font-size: 18px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  background: #fff;
}
.code-form input::placeholder { color: #b9b0cf; }

/* --- Home: the night party ------------------------------------------------------------------ */

.home { background: var(--night); color: #fff; }

.hero {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(158, 60, 255, .55), transparent 70%),
    linear-gradient(180deg, #0c0424 0%, #220a52 38%, #3f137a 62%, #0d3a6b 100%);
}
.stars {
  position: absolute; inset: 0 0 35% 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 30%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 47% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 63% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 6%, #cdf6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 14% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 44%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 46%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 4% 58%, #fff 50%, transparent 51%);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }

.beam {
  position: absolute; top: 60px; left: 50%;
  width: 70vmax; height: 120vh;
  margin-left: -35vmax;
  transform-origin: 50% 0;
  clip-path: polygon(49% 0, 51% 0, 78% 100%, 22% 100%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.beam-pink {
  background: linear-gradient(to bottom, rgba(255, 79, 216, .5), rgba(255, 79, 216, 0) 70%);
  animation: sweep 6s ease-in-out infinite alternate;
}
.beam-cyan {
  background: linear-gradient(to bottom, rgba(53, 224, 255, .42), rgba(53, 224, 255, 0) 70%);
  animation: sweep 7.5s ease-in-out infinite alternate-reverse;
}
@keyframes sweep { from { transform: rotate(-38deg); } to { transform: rotate(38deg); } }

.disco {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  z-index: 2;
}
.disco-string { width: 2px; height: 22px; background: rgba(255, 255, 255, .55); }
.disco-ball {
  position: relative;
  width: 66px; height: 66px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 7%, transparent 8%),
    repeating-linear-gradient(90deg, rgba(30, 14, 70, .38) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(30, 14, 70, .38) 0 1px, transparent 1px 8px),
    radial-gradient(circle at 40% 35%, #fff, #c3c7ee 42%, #585c96 100%);
  box-shadow: 0 0 26px rgba(255, 255, 255, .45), 0 0 70px rgba(255, 79, 216, .5);
  animation: disco-spin 1.4s linear infinite;
}
.disco-ball::before, .disco-ball::after {
  content: "✦";
  position: absolute;
  color: #fff;
  text-shadow: 0 0 8px #fff, 0 0 14px var(--cyan);
  animation: sparkle 1.8s ease-in-out infinite;
}
.disco-ball::before { top: 6px; left: -22px; font-size: 16px; }
.disco-ball::after { bottom: -4px; right: -24px; font-size: 22px; animation-delay: -.9s; }
@keyframes disco-spin {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 16px 0, 0 0, 0 0; }
}
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

.hero-text {
  position: relative; z-index: 3;
  padding: 104px 20px 12px;
  text-align: center;
}
.kicker { margin: 0; font-size: 1.1rem; font-weight: 500; opacity: .9; }
.neon {
  margin: .12em 0 .25em;
  font-size: clamp(3.3rem, 17vw, 6.6rem);
  font-weight: 700;
  line-height: .92;
  letter-spacing: .01em;
}
.neon span { display: block; }
.neon-pink { color: #fff; text-shadow: 0 0 4px #fff, 0 0 12px var(--pink), 0 0 28px var(--pink), 0 0 52px var(--pink); }
.neon-yellow {
  color: #fff6bf;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--yellow), 0 0 28px #ffb300, 0 0 52px #ff9100;
  animation: flicker 5s linear infinite;
}
.neon-cyan { color: #eafcff; text-shadow: 0 0 4px #fff, 0 0 12px var(--cyan), 0 0 28px var(--cyan), 0 0 52px #00a6ff; }
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .55; }
}
.tagline { max-width: 26em; margin: 0 auto 22px; font-size: 1.12rem; opacity: .92; }
.cta {
  color: var(--ink);
  background: var(--yellow);
  font-size: 1.15rem;
  padding: 14px 28px;
  box-shadow: 0 0 0 4px rgba(255, 210, 63, .25), 0 0 30px rgba(255, 210, 63, .55);
}

.sea { position: relative; z-index: 2; margin-top: auto; height: 240px; flex: none; }
.ship-wrap {
  position: absolute; left: 50%; bottom: 96px;
  width: min(76vw, 430px);
  margin-left: max(-38vw, -215px);
  animation: ship-bob 5s ease-in-out infinite;
}
.cruise-ship { filter: drop-shadow(0 0 14px rgba(255, 210, 63, .28)); }
@keyframes ship-bob { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(5px) rotate(.6deg); } }

.wave { position: absolute; left: 0; bottom: 0; width: 200%; height: 120px; animation: wave-move 14s linear infinite; }
.wave-back { bottom: 44px; height: 110px; animation-duration: 22s; }
.wave-back path { fill: #1d6db3; }
.wave-front path { fill: #0b3b6e; }
@keyframes wave-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.floaters { position: absolute; left: 0; right: 0; bottom: 64px; height: 80px; }
.floater { position: absolute; bottom: 0; width: 56px; animation: bob 3.2s ease-in-out infinite; }
.floater .rubber-duck { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.f0 { left: 4%; width: 50px; animation-delay: -.4s; }
.f1 { left: 22%; width: 42px; animation-delay: -1.3s; }
.f2 { left: 50%; width: 72px; margin-left: -36px; animation-delay: -2.1s; }
.f3 { left: 70%; width: 44px; animation-delay: -.8s; }
.f3 .rubber-duck { transform: scaleX(-1); }
.f4 { left: 85%; width: 52px; animation-delay: -1.7s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-10px) rotate(5deg); } }

.home-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  display: grid;
  gap: 22px;
}
.glass {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.home-main h2 { margin: 0 0 8px; font-size: 1.6rem; }
.home-main p { margin: 0; }
.found-card { border-color: rgba(255, 210, 63, .45); box-shadow: 0 0 40px rgba(255, 210, 63, .18); }
.home .code-form input { border-color: transparent; }
.home .code-form button { background: var(--yellow); color: var(--ink); box-shadow: none; }
.hunt-card .badge { background: rgba(53, 224, 255, .18); color: #bff4ff; }
.hunt-card .badge.sailing { background: rgba(125, 255, 107, .18); color: #c9ffbf; }
.hunt-card .badge.ended { background: rgba(255, 255, 255, .12); color: #ddd5f5; }
.hunt-card h2 { margin-top: 12px; }
.dates { opacity: .8; }
.home .meter { background: rgba(255, 255, 255, .16); }
.hunt-count { margin: 6px 0 16px !important; }
.how h2 { text-align: center; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { text-align: center; }
.steps h3 { margin: 8px 0 6px; font-size: 1.25rem; }
.steps p { opacity: .85; }
.step-icon { font-size: 2.6rem; display: block; }
.hunt-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.hunt-list a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; padding: 14px 18px; }
.hunt-ship { font-weight: 600; }
.hunt-meta { font-size: .92rem; opacity: .8; }
.home-footer { text-align: center; padding: 10px 16px 36px; opacity: .7; }
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* --- Duck pages: the sunny party ----------------------------------------------------------- */

.duckpage { background: var(--paper) linear-gradient(180deg, #ffeaf3 0, var(--paper) 340px) no-repeat; }
.duckpage > .confetti { position: fixed; z-index: 40; }
.preview-banner {
  position: sticky; top: 0; z-index: 30;
  margin: 0; padding: 8px 16px;
  text-align: center; font-weight: 600; font-size: .95rem;
  background: var(--yellow);
}
.party-header {
  padding: 10px 16px 30px;
  background: linear-gradient(120deg, var(--violet), var(--pink) 55%, #ff9a3c);
  border-radius: 0 0 50% 50% / 0 0 26px 26px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-size: 1.3rem; font-weight: 700;
  text-shadow: 0 2px 8px rgba(80, 0, 80, .3);
}
.brand-duck { width: 46px; }
.duck-main { max-width: 640px; margin: 0 auto; padding: 0 16px 24px; }
.duck-main.narrow { max-width: 480px; padding-top: 28px; }
.found-hero { text-align: center; padding-top: 6px; }
.found-hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(2.1rem, 10vw, 3rem);
  background: linear-gradient(90deg, var(--violet), var(--pink), #ff8a00);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.found-hero .badge { margin-top: 14px; }
.found-hero .dates { color: var(--muted); margin: 0; }
.polaroid {
  margin: 0 auto;
  max-width: 440px;
  padding: 10px 10px 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(70, 20, 100, .22);
  transform: rotate(-2deg);
}
.polaroid img { display: block; width: 100%; height: auto; border-radius: 3px; }
.polaroid figcaption { padding: 10px 0 12px; font-size: 1.15rem; font-weight: 600; }
.no-photo {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #c9f1ff, #fff1c1);
  border-radius: 3px;
}
.no-photo .rubber-duck { width: 58%; }
.rank { margin: 20px 0 4px; font-size: 1.12rem; font-weight: 600; }
.hint { margin: 6px auto 0; max-width: 30em; color: var(--muted); }

.note { margin: 24px 0; }
.note-ship { margin: 0 0 10px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.note-text { margin: 0 0 14px; white-space: pre-line; font-size: 1.12rem; line-height: 1.45; }
.message-form textarea {
  display: block;
  width: 100%;
  min-height: 3.4em;
  padding: 12px 14px;
  border: 2px solid #eadcff;
  border-radius: 16px;
  font: inherit; font-size: 17px;
  color: var(--ink);
  background: #fdfbff;
  resize: none;
}
.message-form textarea:focus, .code-form input:focus { outline: none; border-color: var(--pink); }
.message-form button { width: 100%; margin-top: 10px; font-size: 1.1rem; }
.message-form button[disabled] { opacity: .6; }
.form-status { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; color: var(--ok); text-align: center; }
.form-status.error { color: #d0342c; }

.score { margin: 24px 0 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  margin: 0; padding: 14px 10px;
  text-align: center; font-weight: 600;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(60, 20, 90, .08);
}
.tile strong { display: block; font-size: 2.5rem; line-height: 1; }
.tile-found strong { color: var(--ok); }
.tile-hiding strong { color: var(--violet); }

.flock h2 { margin: 28px 0 12px; font-size: 1.45rem; }
.ducks {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  align-items: start;
}
.duck-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(60, 20, 90, .10);
}
.duck-card.current { box-shadow: 0 0 0 4px var(--pink), 0 8px 20px rgba(255, 79, 216, .35); }
.duck-card.mine { box-shadow: 0 0 0 3px var(--yellow), 0 6px 16px rgba(60, 20, 90, .10); }
.frame { position: relative; overflow: hidden; }
.pic { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: #f1ecfb; }
button.pic { cursor: zoom-in; }
.pic img { display: block; width: 100%; height: auto; }
.pic img.blurred { filter: blur(10px) saturate(1.25); transform: scale(1.3); }
.placeholder { display: grid; place-items: center; aspect-ratio: 3 / 4; }
.placeholder .rubber-duck { width: 72%; }
.num {
  position: absolute; top: 8px; left: 8px;
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  font-weight: 700;
}
.question {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 3.6rem; font-weight: 700;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 2px 12px rgba(60, 20, 90, .5);
  pointer-events: none;
}
.status { display: block; padding: 8px 10px 10px; font-size: .92rem; font-weight: 600; color: var(--muted); }
.found .status, .current .status, .mine .status { color: var(--ok); }
.current .status { color: #c4129e; }

.viewer {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(15, 5, 35, .92);
}
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 92vh; border-radius: 10px; }
.viewer-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  font-size: 30px; line-height: 1;
  background: #fff; color: var(--ink);
}
.site-footer { padding: 16px 16px 40px; text-align: center; }
.site-footer a { color: var(--muted); }
.lost-duck { width: 120px; margin: 0 auto 6px; animation: bob 3.2s ease-in-out infinite; }
.duck-main.narrow h1 { font-size: 1.6rem; }

@media (min-width: 560px) {
  .ducks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
