:root {
  color-scheme: light;
  font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  color: #243e43;
  background: #e9f7f3;
  font-synthesis: none;
  --ink: #243e43;
  --muted: #536e72;
  --teal: #267d79;
  --teal-dark: #1c625f;
  --coral: #ef987f;
  --cream: #fffdf7;
  --line: #d4e9e3;
  --lake: #b8e4dc;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #f9fffb 0, #e9f7f3 62%, #dff1ed 100%); }
button { font: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #ef987f; outline-offset: 3px; }
.app { width: min(100% - 28px, 900px); min-height: 100vh; margin: auto; padding: 26px 0 42px; }
.card, .game-card { background: var(--cream); border: 1px solid #dcece7; border-radius: 28px; box-shadow: 0 16px 45px #316e6412; }
.intro, .summary { width: min(100%, 580px); margin: clamp(28px, 9vh, 90px) auto; padding: clamp(26px, 6vw, 52px); text-align: center; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: #e4f5ee; color: var(--teal); font-size: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; color: var(--ink); font-size: clamp(1.65rem, 4vw, 2.25rem); line-height: 1.15; }
.intro > p:not(.eyebrow), .summary > p:not(.eyebrow) { color: var(--muted); font-size: 1.03rem; line-height: 1.6; }
.brief-box { margin: 26px 0; padding: 20px 22px; border-radius: 18px; background: #f0f8f4; text-align: left; }
.brief-box strong { color: var(--teal-dark); }
.brief-box ol { margin: 10px 0 0; padding-left: 21px; color: #4f696c; line-height: 1.65; }
.primary, .secondary { min-height: 46px; border: 0; border-radius: 14px; padding: 0 22px; cursor: pointer; font-weight: 800; transition: transform .16s ease, background .16s ease; }
.primary { background: var(--teal); color: white; box-shadow: 0 5px 0 #1b625e; }
.primary:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.secondary { background: #e4f2ee; color: var(--teal-dark); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 16px; }
.wordmark { color: var(--teal-dark); text-decoration: none; font-weight: 800; }
.progress { padding: 7px 12px; border-radius: 99px; background: #e1f2ed; color: var(--teal-dark); font-size: .85rem; font-weight: 800; }
.score { padding: 7px 12px; border: 1px solid #e3c78f; border-radius: 99px; color: #75592c; background: #fff3cd; font-size: .85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.game-card { overflow: hidden; padding: clamp(20px, 4vw, 38px); }
.challenge-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.subnet-badge { display: grid; gap: 2px; min-width: max-content; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f6fbf8; }
.subnet-badge span { color: var(--muted); font-size: .72rem; }
.subnet-badge strong { font-size: .95rem; }
.instruction { margin: 15px 0 12px; color: var(--muted); line-height: 1.5; }
.basket { position: relative; width: min(100%, 580px); margin: 27px auto 22px; padding-top: 25px; }
.basket-handle { position: absolute; z-index: 0; top: 0; left: 50%; width: 58%; height: 64px; border: 8px solid #a97448; border-bottom: 0; border-radius: 80px 80px 0 0; transform: translateX(-50%); }
.address-board { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; gap: clamp(5px, 1.5vw, 14px); margin: 0 auto; padding: 20px 10px 25px; width: 100%; min-height: 98px; border: 5px solid #a97448; border-radius: 12px 12px 34px 34px; clip-path: polygon(0 0, 100% 0, 91% 100%, 9% 100%); background-color: #d9a66f; background-image: repeating-linear-gradient(0deg, transparent 0 11px, #bd8957 11px 15px), repeating-linear-gradient(90deg, #0000 0 24px, #c49260 24px 29px); box-shadow: inset 0 4px #f0d1a7, 0 6px 0 #8e613e; font-variant-numeric: tabular-nums; }
.octet { min-width: clamp(48px, 12vw, 84px); padding: 9px 4px; border-radius: 11px; text-align: center; font-size: clamp(1.12rem, 4vw, 1.7rem); font-weight: 800; }
.octet-blank { color: var(--teal-dark); background: #fffdf6; border: 2px dashed #9ccbc0; }
.caught-fish { display: inline-flex; align-items: center; justify-content: center; width: clamp(50px, 12vw, 78px); height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer; transition: transform .15s; }
.caught-fish:hover { transform: translateY(-3px) rotate(-3deg); }
.caught-fish .fish-icon { width: 100%; height: 100%; }
.fish-icon { display: block; width: 100%; height: 100%; overflow: visible; }
.fish-shapes { transform-box: fill-box; transform-origin: center; }
.fish.swim-reverse .fish-shapes { transform: scaleX(-1); }
.fish-body-shape { fill: #ffd49a; stroke: #b8754c; stroke-width: 2.5; }
.fish-tail-shape, .fish-fin-shape { fill: #e3a068; stroke: #b8754c; stroke-width: 2; stroke-linejoin: round; }
.fish-gill-shape { fill: none; stroke: #bb7955; stroke-width: 2; stroke-linecap: round; }
.fish-eye-shape { fill: #302f2c; }
.fish-number { fill: #493d32; font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; font-size: 18px; font-weight: 800; }
.basket.sashimi .caught-fish { position: relative; pointer-events: none; }
.basket.sashimi .caught-fish .fish-icon { animation: fish-to-sashimi .62s ease-in forwards; }
.sashimi-pieces { position: absolute; inset: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.sashimi-pieces i { width: 13px; height: 8px; border: 1px solid #c97e6b; border-radius: 7px 7px 3px 3px; background: linear-gradient(#f4a38d 0 54%, #fff8e9 55%); opacity: 0; transform: translateY(-8px) rotate(-14deg) scale(.4); animation: sashimi-appear .45s .3s ease-out forwards; }
.sashimi-pieces i:nth-child(2) { animation-delay: .38s; }
.sashimi-pieces i:nth-child(3) { animation-delay: .46s; }
.dot { color: #8ba9a4; font-size: 1.3rem; }
.lake-wrap { position: relative; overflow: hidden; height: clamp(235px, 38vw, 315px); border: 5px solid #d2e9df; border-radius: 24px; background: linear-gradient(#dff3ee 0 23%, #c2e8df 23% 33%, #9dd8d0 33%, #8ecdc8 100%); touch-action: none; cursor: crosshair; }
.shoreline { position: absolute; inset: 19% 0 auto; height: 15%; background: linear-gradient(180deg, #a5d6be 0 25%, #c5e6cc 25% 52%, #9ad3ce 52%); }
.sky-label { position: absolute; z-index: 3; top: 9px; left: 12px; color: #587876; font-size: .72rem; pointer-events: none; }
.fish-layer { position: absolute; inset: 0; }
.fish { position: absolute; z-index: 2; display: block; width: clamp(80px, 11vw, 112px); height: 60px; padding: 2px; border: 0; background: transparent; cursor: pointer; animation-name: swim-across; animation-duration: var(--swim-duration, 9s); animation-timing-function: linear; animation-iteration-count: 1; animation-fill-mode: both; transition: filter .15s; }
.fish .fish-icon { overflow: visible; filter: drop-shadow(0 3px 1px #4a817133); }
.fish:nth-child(4n + 2) .fish-body-shape { fill: #ffc9bc; stroke: #ae6c64; }
.fish:nth-child(4n + 2) .fish-tail-shape, .fish:nth-child(4n + 2) .fish-fin-shape { fill: #e98e86; stroke: #ae6c64; }
.fish:nth-child(4n + 3) .fish-body-shape { fill: #a9d9d0; stroke: #528e83; }
.fish:nth-child(4n + 3) .fish-tail-shape, .fish:nth-child(4n + 3) .fish-fin-shape { fill: #6fb2a8; stroke: #528e83; }
.fish:nth-child(4n) .fish-body-shape { fill: #f8df9b; stroke: #a78a4c; }
.fish:nth-child(4n) .fish-tail-shape, .fish:nth-child(4n) .fish-fin-shape { fill: #d7b863; stroke: #a78a4c; }
.fish:hover, .fish:focus-visible { z-index: 4; filter: brightness(1.06); }
.fish:focus-visible { animation-play-state: paused; left: var(--rest-x) !important; top: var(--rest-y) !important; }
.fish.hooked { z-index: 5; outline: 3px solid white; border-radius: 50%; }
.released-fish { position: absolute; z-index: 5; top: -18%; display: block; width: 76px; height: 44px; animation: release-into-water .9s cubic-bezier(.2,.7,.3,1) forwards; }
.released-fish .fish-icon { width: 100%; height: 100%; }
.release-ripple { position: absolute; left: 50%; bottom: -5px; width: 7px; height: 3px; border: 1px solid #e8fffc; border-radius: 50%; opacity: 0; animation: ripple .38s .55s ease-out forwards; }
.fishing-line { position: absolute; z-index: 6; top: 0; width: 2px; height: 0; background: #517b70; opacity: 0; pointer-events: none; transform-origin: top; }
.fishing-line.visible { opacity: .85; }
.bobber { position: absolute; z-index: 7; width: 16px; height: 16px; display: none; color: #e48d73; font-size: 18px; line-height: 12px; pointer-events: none; transform: translate(-50%, -50%); }
.bobber.visible { display: block; }
.lake-hint { position: absolute; right: 22px; bottom: 13px; color: #e8fff2; font-size: 28px; pointer-events: none; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 15px; }
.caught-count { margin: 0; color: var(--muted); font-size: .9rem; }
.help-row { display: flex; align-items: center; gap: 14px; min-height: 40px; color: var(--muted); font-size: .85rem; }
.help-row span { margin-left: auto; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-weight: 800; cursor: pointer; }
.inline-hint { margin: 8px 0; padding: 12px 14px; border-radius: 12px; color: #5e5c39; background: #fcf4d9; line-height: 1.45; }
.answer-reveal { color: #315d54; background: #e5f4eb; }
.feedback { margin-top: 14px; padding: 16px 18px; border-radius: 16px; line-height: 1.5; }
.feedback p { margin: 0 0 12px; }
.try-again { color: #704b37; background: #fff0e2; }
.success { color: #285a4e; background: #e5f5e9; }
.feedback-actions { display: flex; align-items: center; gap: 14px; }
.how-to { margin-top: 16px; color: var(--muted); font-size: .84rem; }
.how-to summary { width: fit-content; cursor: pointer; font-weight: 700; }
.summary-stat { padding: 10px; border-radius: 12px; background: #f0f8f4; font-weight: 700; }
.celebration-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; background: #183e3bdd; backdrop-filter: blur(5px); animation: overlay-in .22s ease-out both; }
.celebration { width: min(100%, 520px); padding: clamp(24px, 6vw, 42px); border: 2px solid #fff4d7; border-radius: 30px; background: #fffdf7; box-shadow: 0 25px 80px #102e2b66; text-align: center; }
.answer-dialog { width: min(100%, 510px); padding: clamp(26px, 6vw, 44px); border: 2px solid #fff4d7; border-radius: 28px; background: #fffdf7; box-shadow: 0 25px 80px #102e2b66; text-align: center; animation: overlay-in .2s ease-out both; }
.answer-dialog h2 { color: #234b46; font-size: clamp(1.5rem, 5vw, 2.2rem); }
.answer-dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.revealed-address { margin: 20px 0; padding: 18px 12px; border: 2px solid #d5e8dd; border-radius: 16px; color: #1e635d !important; background: #edf8f2; font-size: clamp(1.55rem, 6vw, 2.4rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.celebration h2 { margin: 0; color: #234b46; font-size: clamp(1.8rem, 6vw, 2.6rem); }
.celebration > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.celebration-stage { position: relative; width: min(100%, 330px); height: 190px; margin: 14px auto; overflow: hidden; border-radius: 20px; background: radial-gradient(ellipse at 50% 100%, #d7eee7 0 30%, transparent 31%), #f2f8f2; }
.celebration-fish { position: absolute; z-index: 2; left: 28%; top: 36%; width: 150px; height: 90px; animation: celebration-cut 1.3s .2s ease-in forwards; }
.celebration-fish .fish-icon { width: 100%; height: 100%; filter: drop-shadow(0 5px 4px #4a817133); }
.celebration-platter { position: absolute; left: 50%; bottom: 24px; display: flex; align-items: end; justify-content: center; gap: 8px; width: 190px; height: 65px; padding-bottom: 17px; border-radius: 50%; background: #f8f4e8; box-shadow: 0 5px 0 #d8d0bb, inset 0 -5px #ece5d4; transform: translateX(-50%) scale(.2); opacity: 0; animation: platter-in .5s .75s ease-out forwards; }
.celebration-platter i { display: block; width: 24px; height: 29px; border: 2px solid #c27d6d; border-radius: 14px 14px 7px 7px; background: linear-gradient(160deg, #f7ad98 0 52%, #fff8e8 53%); transform: rotate(-13deg); }
.celebration-platter i:nth-child(even) { transform: rotate(12deg) translateY(4px); }
.celebration-knife { position: absolute; z-index: 3; left: 58%; top: 3%; width: 9px; height: 115px; border-radius: 8px 8px 2px 2px; background: linear-gradient(90deg, #c6d2d0, #fff 46%, #aab8b4); opacity: 0; transform: rotate(38deg) translateY(-30px); animation: knife-slice .45s .55s ease-in forwards; }
.celebration-continue { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes swim-across { from { left: -20%; } to { left: 120%; } }
@keyframes fish-to-sashimi { 0% { opacity: 1; transform: scale(1) rotate(0); } 45% { opacity: 1; transform: scale(.7) rotate(-12deg); } 100% { opacity: 0; transform: scale(.25) rotate(30deg); } }
@keyframes sashimi-appear { to { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }
@keyframes release-into-water { 0% { top: -18%; opacity: .2; transform: translateY(-20px) rotate(-8deg) scale(.65); } 55% { top: 50%; opacity: 1; transform: translateY(0) rotate(4deg) scale(1); } 75% { top: 48%; transform: translateY(0) rotate(-3deg) scale(1.08); } 100% { top: 60%; opacity: 0; transform: translateY(25px) scale(.8); } }
@keyframes ripple { to { width: 54px; height: 12px; left: calc(50% - 27px); opacity: .9; } }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes celebration-cut { 0% { opacity: 1; transform: translateY(0) rotate(0) scale(1); } 42% { transform: translateY(-5px) rotate(-8deg) scale(1.08); } 57% { transform: translateY(14px) rotate(5deg) scale(.92); } 100% { opacity: 0; transform: translateY(20px) rotate(12deg) scale(.35); } }
@keyframes knife-slice { 0% { opacity: 0; transform: rotate(38deg) translateY(-30px); } 35% { opacity: 1; } 100% { opacity: 0; transform: rotate(38deg) translateY(38px); } }
@keyframes platter-in { to { opacity: 1; transform: translateX(-50%) scale(1); } }
@media (max-width: 560px) {
  .app { width: min(100% - 18px, 900px); padding-top: 12px; }
  .game-card { padding: 16px 13px; border-radius: 20px; }
  .challenge-head { align-items: flex-start; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .subnet-badge { padding: 8px 10px; }
  .instruction { font-size: .92rem; }
  .lake-wrap { height: 250px; }
  .fish { width: 82px; height: 49px; }
  .basket-handle { width: 68%; height: 50px; border-width: 6px; }
  .address-board { gap: 3px; padding-inline: 5px; }
  .octet { min-width: clamp(40px, 10vw, 60px); }
  .caught-fish { width: clamp(42px, 10vw, 58px); height: 42px; }
  .help-row { flex-wrap: wrap; gap: 7px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fish { animation: none !important; left: var(--rest-x) !important; top: var(--rest-y) !important; }
}
