:root { color-scheme: light; --ink: #134a6b; --muted: #4f7f97; --pink: #ff5c8a; --cream: #fffdf3; --focus: #ff4f7a; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #e4f6ff; background-image: radial-gradient(circle at 8% 4%, #fffbd7, transparent 32%), radial-gradient(circle at 94% 96%, #c4ecff, transparent 34%); color: var(--ink); font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, canvas:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; }
.game-shell { max-width: 1450px; margin: auto; padding: 18px 28px 12px; }
.topbar { margin-bottom: 16px; }
.eyebrow { margin: 0 0 5px; font-size: 10px; font-weight: 900; letter-spacing: 1.8px; color: var(--muted); }
h1 { margin: 0; font-size: clamp(24px, 2.6vw, 34px); font-weight: 900; letter-spacing: -1.2px; line-height: 1.05; }
.bucket-tag { padding: 11px 16px; border-radius: 999px; background: #ffffffc9; font-size: 14px; font-weight: 900; white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 20px; align-items: start; }
.pond-card { overflow: hidden; border: 1px solid #1b6f9433; border-radius: 24px; background: var(--cream); box-shadow: 0 7px 0 #13506d12; }
.play-area { position: relative; width: 100%; aspect-ratio: 1100 / 640; max-height: calc(100dvh - 190px); background: #7fdcf5; overflow: hidden; isolation: isolate; }
canvas#game { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0b5e8a33; }
.overlay.hidden { display: none; }
.welcome-card { width: 340px; padding: 26px 24px 20px; border: 3px solid #fff; border-radius: 25px; background: var(--cream); text-align: center; box-shadow: 0 12px 0 #0b5e8a26, 0 20px 35px #0b5e8a1f; transform: rotate(-1.2deg); }
.card-badge { font-size: 10px; font-weight: 900; letter-spacing: 1.4px; color: var(--pink); }
.welcome-card h2 { margin: 8px 0 10px; font-size: 32px; line-height: 1.05; letter-spacing: -1px; color: #0f5577; }
.welcome-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: #4a7488; }
.primary-button { width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: linear-gradient(#ff7aa2, #f0507f); color: #fff; font-size: 18px; font-weight: 900; box-shadow: 0 5px 0 #c23a64; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #c23a64; }
.welcome-tip { display: block; margin-top: 12px; font-size: 11px; font-weight: 700; color: #6c93a5; }
.toast { position: absolute; left: 50%; top: 30%; transform: translate(-50%, 10px); font-size: 28px; font-weight: 900; color: #fff8cc; text-shadow: 0 3px #d4436e; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; white-space: nowrap; }
.toast.visible { opacity: 1; transform: translate(-50%, -8px); }
.status-bar { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 18px; }
.status-bar > span { font-size: 22px; color: #f0a52c; }
.status-bar p { margin: 0; font-size: 13px; font-weight: 800; color: #245d7a; }
.rail { display: flex; flex-direction: column; padding: 20px 18px 16px; border: 1px solid #1b6f9433; border-radius: 24px; background: var(--cream); box-shadow: 0 7px 0 #13506d12; }
.rail h2 { margin: 0; font-size: 24px; letter-spacing: -.6px; }
.rail-copy { margin: 4px 0 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.progress-heading { display: flex; align-items: baseline; justify-content: space-between; font-size: 10px; font-weight: 900; letter-spacing: 1.2px; color: var(--muted); }
.progress-heading strong { font-size: 28px; color: var(--ink); letter-spacing: 0; }
.progress-heading small { font-size: 14px; color: var(--muted); }
.bucket { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.slot { width: 100%; height: auto; aspect-ratio: 44 / 26; border-radius: 10px; background: #eef7fb; }
.slot.found { background: #fff3c4; }
.progress-track { height: 12px; border-radius: 99px; background: #dcecf3; overflow: hidden; margin-bottom: 14px; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5fe0b0, #ffc23d, #ff7d8e); transition: width .35s cubic-bezier(.3, 1.4, .5, 1); }
.how-to { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.step { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #d4f0ff; color: #1b77a8; font-size: 13px; font-weight: 900; }
.how-to p { margin: 0; font-size: 11px; line-height: 1.5; color: #5f8799; }
.how-to strong { font-size: 13px; color: var(--ink); }
.tail-tip { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; padding: 8px 10px; border-radius: 16px; background: #fff0f5; }
.tail-tip canvas { width: 66px; height: 35px; flex: none; }
.tail-tip p { margin: 0; font-size: 12px; line-height: 1.45; font-weight: 700; color: #a8446a; }
.slow-swim { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font-size: 14px; font-weight: 800; cursor: pointer; }
.slow-swim input { width: 20px; height: 20px; accent-color: #1b6582; }
.restart-button { min-height: 48px; border: 2px solid #fff; border-radius: 15px; background: #d9f1ff; color: #1b5f82; font-size: 15px; font-weight: 900; box-shadow: 0 4px 0 #b3d6e8; }
.restart-button:active:enabled { transform: translateY(3px); box-shadow: 0 1px 0 #b3d6e8; }
.key-hint { margin: 12px 0 0; font-size: 11px; color: #56809a; }
.key-hint span { padding: 0 5px; color: #8fb0c0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .rail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .rail .eyebrow, .rail h2, .rail-copy, .bucket, .progress-track { grid-column: 1 / -1; }
  .bucket { grid-template-columns: repeat(10, 1fr); }
  .restart-button { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .game-shell { padding: 12px; }
  .play-area { aspect-ratio: 1100 / 640; }
  .welcome-card { width: 280px; padding: 20px 18px 16px; }
  .welcome-card h2 { font-size: 26px; }
  .how-to, .tail-tip { display: none; }
  .bucket-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
