:root {
  --night: #071b33;
  --deep: #0b2b4f;
  --blue: #0d7bd8;
  --cream: #f5f0d7;
  --yellow: #f5df3b;
  --ink: #061425;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overscroll-behavior: none; }
body { overflow: hidden; background: var(--night); color: var(--cream); font-family: "Trebuchet MS", "Avenir Next", sans-serif; }
button { font: inherit; }
[hidden] { display: none !important; }

.app { min-height: 100svh; }
.start-screen {
  position: relative;
  min-height: 100svh;
  padding: clamp(28px, 6vw, 84px);
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(320px, .65fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(13, 123, 216, .42), transparent 32%),
    linear-gradient(145deg, #071b33 0%, #092846 62%, #06182c 100%);
}
.start-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.5px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.moon { position: absolute; width: 36vw; aspect-ratio: 1; right: -10vw; top: -17vw; border-radius: 50%; border: 1px solid rgba(245, 223, 59, .28); box-shadow: 0 0 0 7vw rgba(245, 223, 59, .03), 0 0 0 14vw rgba(245, 223, 59, .02); }
.intro { position: relative; z-index: 2; max-width: 660px; }
.eyebrow { margin: 0 0 18px; color: var(--yellow); font-size: 11px; font-weight: 900; letter-spacing: .24em; }
h1 { margin: 0; font-size: clamp(72px, 10vw, 148px); line-height: .73; letter-spacing: -.09em; font-weight: 1000; }
h1 span { color: var(--yellow); text-shadow: 5px 5px 0 var(--blue); }
.lead { max-width: 520px; margin: 32px 0; color: #c8d6e5; font-size: clamp(16px, 1.6vw, 22px); line-height: 1.55; }
.setting-group { margin-top: 20px; }
.setting-group > p { margin: 0 0 9px; color: #8daac5; font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.segmented { display: flex; flex-wrap: wrap; width: min(100%, 520px); gap: 8px; }
.segmented button { flex: 1 1 92px; min-height: 44px; padding-inline: 14px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: transparent; color: #c8d6e5; font-size: 12px; font-weight: 800; cursor: pointer; }
.segmented button.active { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }
.prey-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prey-grid button { width: 100%; position: relative; padding-left: 34px; text-align: left; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.prey-grid button::before { content: "+"; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; display: grid; place-items: center; transform: translateY(-50%); border: 1px solid currentColor; border-radius: 50%; font-size: 12px; line-height: 1; }
.prey-grid button.active::before { content: "✓"; border-color: var(--ink); background: var(--ink); color: var(--yellow); }
.prey-grid button:active { transform: scale(.96); }
.selection-status { margin: 9px 0 0 !important; color: var(--yellow) !important; font-size: 9px !important; letter-spacing: .12em !important; }
.selection-status.empty { color: #ff8c6b !important; }
.start-button { width: min(100%, 520px); min-height: 68px; margin-top: 30px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 8px; background: var(--yellow); color: var(--ink); box-shadow: 8px 8px 0 var(--blue); font-weight: 1000; letter-spacing: .04em; cursor: pointer; }
.start-button:active { transform: translate(4px, 4px); box-shadow: 4px 4px 0 var(--blue); }
.start-button:disabled { background: #506274; color: #98a6b2; box-shadow: 8px 8px 0 #233e58; cursor: not-allowed; }
.start-button b { font-size: 26px; }
.safety { margin: 20px 0 0; color: #7994ae; font-size: 11px; }
.safety a { display: inline-block; margin-top: 6px; color: #91abc2; text-underline-offset: 3px; }
.preview { position: relative; z-index: 1; min-height: min(65vw, 620px); display: grid; place-items: center; border: 2px solid rgba(255,255,255,.18); border-radius: 50%; background: radial-gradient(circle, rgba(13,123,216,.55), rgba(6,20,37,.5) 58%, transparent 59%); }
.preview::before, .preview::after { content: ""; position: absolute; inset: 18%; border: 1px dashed rgba(245,223,59,.35); border-radius: 50%; animation: orbit 18s linear infinite; }
.preview::after { inset: 31%; animation-direction: reverse; animation-duration: 11s; }
.preview-fish { position: relative; z-index: 2; display: block; width: clamp(130px, 18vw, 230px); filter: drop-shadow(0 16px 0 rgba(2,12,23,.3)); animation: preview-drift 2.8s ease-in-out infinite; }
.preview i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 18px var(--yellow); }
.preview i:nth-of-type(1) { left: 18%; top: 42%; }
.preview i:nth-of-type(2) { right: 20%; top: 31%; }
.preview i:nth-of-type(3) { right: 28%; bottom: 20%; }
.preview p { position: absolute; bottom: 9%; margin: 0; color: #8daac5; font-size: 10px; font-weight: 900; letter-spacing: .25em; }

.arena { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: none; user-select: none; background: radial-gradient(circle at 50% 46%, #154f7e 0%, #0a3157 44%, #05182c 100%); }
.arena::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 80px 80px; }
.water-rings { position: absolute; inset: 0; pointer-events: none; background: repeating-radial-gradient(circle at 50% 50%, transparent 0 70px, rgba(127,201,255,.04) 72px 73px); animation: breathe 6s ease-in-out infinite; }
.score { position: absolute; right: max(22px, env(safe-area-inset-right)); top: max(18px, env(safe-area-inset-top)); color: rgba(255,255,255,.18); font-size: clamp(56px, 9vw, 120px); font-weight: 1000; line-height: 1; }
.target { position: absolute; width: clamp(112px, 15vw, 178px); aspect-ratio: 1; display: grid; place-items: center; transform-origin: center; will-change: transform, left, top; filter: drop-shadow(0 14px 8px rgba(0,0,0,.42)); }
.target.bug, .target.butterfly { width: clamp(104px, 13vw, 154px); }
.target.lizard { width: clamp(120px, 16vw, 190px); }
.lottie-stage, .lottie-stage svg { width: 100% !important; height: 100% !important; overflow: visible !important; }
.target .lottie-stage { pointer-events: none; }
.target.is-hit { z-index: 5; animation: caught .32s cubic-bezier(.2,1.8,.3,1); }
.target::after { content: ""; position: absolute; inset: -28%; border: 5px solid transparent; border-radius: 50%; pointer-events: none; }
.target.is-hit::after { border-color: #fff; box-shadow: 0 0 26px var(--yellow), inset 0 0 20px var(--yellow); animation: ring .6s ease-out; }
.impact-flash { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--hit-x, 50%) var(--hit-y, 50%), rgba(255,255,255,.95) 0 2%, rgba(245,223,59,.48) 4%, transparent 34%); }
.impact-flash.active { animation: flash .34s ease-out; }
.arena.impact { animation: arena-kick .2s ease-out; }
.score.is-hit { color: var(--yellow); animation: score-kick .38s cubic-bezier(.2,1.7,.3,1); }
.exit-zone { position: absolute; z-index: 10; left: max(14px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); width: 86px; height: 86px; display: grid; place-items: center; border: 1px solid rgba(245,223,59,.52); border-radius: 50%; background: rgba(3,18,34,.72); box-shadow: 0 8px 28px rgba(0,0,0,.36), inset 0 0 18px rgba(13,123,216,.22); opacity: .88; cursor: pointer; backdrop-filter: blur(6px); animation: exit-breathe 2.8s ease-in-out infinite; }
.exit-zone svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.exit-zone circle { fill: none; stroke: var(--yellow); stroke-width: 2.6; stroke-dasharray: 114; stroke-dashoffset: 0; filter: drop-shadow(0 0 3px var(--yellow)); }
.exit-zone.holding { opacity: 1; animation: none; background: rgba(7,27,51,.96); transform: scale(1.05); }
.exit-zone.holding circle { stroke-dashoffset: 114; animation: hold 1.5s linear forwards; }
.exit-zone span { width: 62px; text-align: center; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.8); font-size: 9px; line-height: 1.35; font-weight: 1000; letter-spacing: .06em; }
.hint { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; transform: translateX(-50%); color: rgba(255,255,255,.25); font-size: 11px; font-weight: 900; letter-spacing: .18em; transition: opacity .6s; }
.splash { position: absolute; z-index: 6; width: var(--particle-size, 12px); height: var(--particle-size, 12px); border-radius: var(--particle-radius, 50%); background: var(--particle-color, var(--yellow)); box-shadow: 0 0 14px var(--particle-color, var(--yellow)); pointer-events: none; animation: splash .72s cubic-bezier(.15,.75,.3,1) forwards; }
.score-pop { position: absolute; z-index: 8; pointer-events: none; color: #fff; font-size: clamp(42px, 8vw, 92px); font-weight: 1000; line-height: 1; text-shadow: 0 5px 0 var(--blue), 0 0 24px var(--yellow); animation: score-pop .72s cubic-bezier(.14,.85,.25,1) forwards; }

.result-screen { min-height: 100svh; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle, #154f7e, var(--night) 70%); }
.result-screen h2 { margin: 0; color: var(--yellow); font-size: clamp(82px, 18vw, 190px); line-height: .9; letter-spacing: -.08em; }
.result-screen > p:not(.eyebrow) { margin: 24px 0 0; color: #b8cce0; }
.result-screen .start-button { margin-top: 40px; }
.text-button { margin-top: 26px; padding: 10px 20px; border: 0; background: transparent; color: #90abc4; cursor: pointer; }

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes preview-drift { 50% { transform: translateY(-18px) rotate(-8deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .6; } }
@keyframes caught { 35% { transform: scale(.5) rotate(22deg); filter: brightness(3) saturate(1.8); } 75% { transform: scale(1.35) rotate(-10deg); } }
@keyframes ring { from { transform: scale(.18); opacity: 1; } to { transform: scale(2.25); opacity: 0; } }
@keyframes hold { to { stroke-dashoffset: 0; } }
@keyframes splash { 45% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--spin, 160deg)) scale(.05); opacity: 0; } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes arena-kick { 25% { transform: translate(-3px, 2px); } 55% { transform: translate(3px, -2px); } }
@keyframes score-kick { 45% { transform: scale(1.35) rotate(-5deg); text-shadow: 0 0 28px var(--yellow); } }
@keyframes score-pop { from { transform: translate(-50%, -25%) scale(.45) rotate(-8deg); opacity: 1; } 50% { transform: translate(-50%, -95%) scale(1.15) rotate(4deg); opacity: 1; } to { transform: translate(-50%, -150%) scale(.8); opacity: 0; } }
@keyframes exit-breathe { 50% { opacity: 1; box-shadow: 0 8px 28px rgba(0,0,0,.36), 0 0 16px rgba(245,223,59,.18), inset 0 0 18px rgba(13,123,216,.3); } }

@media (max-width: 760px) {
  .start-screen { min-height: 100svh; padding: 28px 20px 50px; grid-template-columns: 1fr; overflow-y: auto; }
  h1 { font-size: clamp(68px, 24vw, 108px); }
  .lead { margin-block: 24px; }
  .preview { display: none; }
  .moon { width: 80vw; right: -36vw; top: -28vw; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-fish, .preview::before, .preview::after { animation: none; }
}
