:root{--ink:#315d59;--muted:#799995;--sea:#55b8a9;--line:#dcefe8;--cream:#f8fffa}*{box-sizing:border-box}body{margin:0;min-width:300px;background:radial-gradient(circle at 9% 18%,#fff4d9 0,transparent 23%),radial-gradient(circle at 90% 38%,#d5f6ef 0,transparent 30%),#effaf7;color:var(--ink);font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}.page-shell{max-width:1080px;margin:auto}button,select{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible{outline:3px solid #178779;outline-offset:3px}.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(16px,5vw,42px)}.brand{display:flex;align-items:center;gap:9px;color:#31645e;text-decoration:none;font-size:23px;font-weight:900;letter-spacing:3px}.brand small{display:block;font-size:8px;letter-spacing:1.3px;color:#7dab9e}.brand-fish{display:grid;place-items:center;width:43px;height:43px;border-radius:15px;background:#d6f5e7;font-size:24px}.top-actions{display:flex;gap:8px}.round-btn{border:1px solid #d4ebe2;width:37px;height:37px;border-radius:50%;background:#fff;color:#538f80;font-weight:900;font-size:18px}.round-btn[aria-pressed="false"]{opacity:.48}.game-layout{padding:6px 16px 25px}.heading{text-align:center;margin:0 auto 17px}.eyebrow{font-size:10px;color:#61a995;font-weight:900;letter-spacing:2px}.heading h1{font-size:clamp(23px,4vw,34px);margin:6px 0;color:#315c55;letter-spacing:1px}.heading h1 span{color:#5ebca9}.heading p{margin:0;color:#819e93;font-size:12px}.game-panel{max-width:710px;margin:auto;padding:20px clamp(14px,4vw,28px);background:#fffefd;border:1px solid #e1f0e6;border-radius:25px;box-shadow:0 18px 55px #4a9b8724}.level-row{display:flex;gap:9px;align-items:stretch;justify-content:center;margin-bottom:15px}.level-picker,.lives-box{border:1px solid #e1eee6;background:#f5fbf6;border-radius:14px;padding:8px 12px;min-width:0}.level-picker span,.lives-box span{display:block;font-size:10px;color:#78a093;font-weight:800}.level-picker select{border:0;background:transparent;color:#3a7968;font-weight:900;font-size:14px;padding:3px 15px 0 0;cursor:pointer}.lives-box b{display:block;color:#ed8990;font-size:18px;letter-spacing:2px}.new-btn{border:1px solid #cdebe0;background:#e6f8ee;color:#4b9b7d;font-size:12px;font-weight:900;padding:8px 13px;border-radius:14px;white-space:nowrap}.rule-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid #e2efe7;background:#f8fcf8;border-radius:18px;padding:11px 5px;margin-bottom:14px}.rule-item{display:flex;align-items:center;justify-content:center;gap:9px;padding:4px 8px;min-width:0}.rule-item+.rule-item{border-left:1px solid #dcebe3}.rule-item p{margin:0;min-width:0;line-height:1.45}.rule-item b,.rule-item span{display:block}.rule-item b{font-size:12px;color:#466c61}.rule-item span{font-size:10px;color:#819c8d}.mini-grid{display:grid;grid-template-columns:repeat(3,15px);grid-template-rows:repeat(3,15px);gap:2px;flex:none}.mini-grid i{display:grid;place-items:center;border-radius:3px;background:#b1d5ca;color:white;font-size:14px;line-height:1;font-style:normal;font-weight:900}.mini-colors i{background:#95d4bc}.mini-colors i:nth-child(3n){background:#ead19f}.mini-colors i:nth-child(n+7){background:#a4c5df}.mini-lines i{background:#d2e4dc}.mini-lines i:nth-child(2),.mini-lines i:nth-child(4),.mini-lines i:nth-child(6),.mini-lines i:nth-child(8){background:#82b8aa}.mini-neighbor i{background:#90c8bd}.mini-grid i:nth-child(5){font-size:12px;background:#ffe0a6}.status-row{display:flex;justify-content:center;gap:12px;margin:0 auto 12px}.status-chip{display:flex;align-items:center;justify-content:center;gap:6px;background:#f3faf6;border:1px solid #dfefe6;border-radius:999px;padding:8px 16px;font-size:12px;color:#648b7c;font-weight:800;min-width:150px}.status-chip>span:first-child{font-size:20px}.status-chip b{font-size:16px;color:#3b8e79;font-variant-numeric:tabular-nums}.status-chip small{font-size:10px}.board-wrap{max-width:570px;margin:auto}.board{--size:7;display:grid;grid-template-columns:repeat(var(--size),minmax(0,1fr));grid-template-rows:repeat(var(--size),minmax(0,1fr));aspect-ratio:1;width:100%;padding:7px;gap:5px;border-radius:18px;background:#e7f3ec;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:inset 0 2px 8px #7dbca521}.cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;aspect-ratio:1;padding:0;border:1px solid #ffffff78;border-radius:10px;line-height:1;touch-action:none;-webkit-touch-callout:none;transition:filter .15s,box-shadow .15s}.cell:hover{filter:brightness(.96)}.cell.selected{box-shadow:inset 0 0 0 3px #fff9,0 0 0 2px #499f90}.cell.wrong{animation:shake .4s ease both;box-shadow:inset 0 0 0 3px #e26c77}.cell.region-0{background:#edb6c6}.cell.region-1{background:#aad996}.cell.region-2{background:#78c8e1}.cell.region-3{background:#b7a7e2}.cell.region-4{background:#f1cf71}.cell.region-5{background:#79c5bc}.cell.region-6{background:#a3c3df}.cell.region-7{background:#f3a984}.cell.region-8{background:#c597b2}.cell .marker{display:block;pointer-events:none;font-size:clamp(22px,5vw,38px);font-weight:1000;line-height:1}.cell.cross .marker{color:#fff;text-shadow:0 2px 0 #ffffff45}.cell.fish .marker{animation:fish-pop .35s ease-out both}.board-meta{max-width:570px;margin:9px auto 0;display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#8aa99b}.board-meta b{color:#4d9a81}.text-btn{border:0;background:transparent;color:#58a58b;padding:0;font-size:12px;font-weight:900}.key-tip{min-height:22px;text-align:center;color:#729989;font-size:12px;line-height:1.5;margin:9px 0}.action-grid{display:flex;gap:10px;justify-content:center}.tool-btn{display:flex;align-items:center;gap:7px;justify-content:center;min-width:115px;border:1px solid #e0eee3;border-radius:13px;background:#f8fcf7;padding:10px 12px;color:#699483;font-size:12px}.tool-btn span{font-size:19px}.tool-btn.highlight{background:#fff8e5;border-color:#f4e7c1;color:#9b8957}.gesture-note{text-align:center;color:#92b0a2;font-size:10px;margin-top:12px}.gesture-note span{margin:0 5px}footer{text-align:center;color:#8fb2a2;font-size:11px;margin:16px 0}dialog{border:0;border-radius:24px;padding:24px;width:min(470px,calc(100vw - 30px));box-shadow:0 25px 70px #183d3040;color:#49695b}dialog::backdrop{background:#243e36a8}.dialog-head{display:flex;align-items:center;justify-content:space-between}dialog h2{margin:0;color:#416454}dialog p,dialog li{font-size:13px;line-height:1.8;color:#718c7d}dialog li{margin:8px 0}dialog ol{padding-left:20px}.hint{background:#eef9ee;padding:10px 12px;border-radius:10px}.primary{border:0;background:#69b695;color:#fff;width:100%;padding:13px;border-radius:12px;font-weight:900}.result-content{text-align:center}.result-icon{font-size:60px}.result-content .text-btn{margin-top:16px}@keyframes fish-pop{0%{transform:scale(.35) rotate(-18deg)}65%{transform:scale(1.2) rotate(8deg)}100%{transform:scale(1) rotate(0)}}@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
@media(max-width:600px){.topbar{height:58px;padding:0 14px}.brand{font-size:20px}.brand-fish{width:38px;height:38px}.game-layout{padding:3px 9px 20px}.heading{margin-bottom:12px}.heading h1{font-size:23px}.heading p{font-size:11px}.game-panel{padding:13px 10px 16px;border-radius:20px}.level-row{gap:5px;margin-bottom:11px}.level-picker,.lives-box{padding:7px 8px}.lives-box b{font-size:16px}.new-btn{font-size:11px;padding:7px}.rule-panel{padding:8px 2px;margin-bottom:10px}.rule-item{flex-direction:column;gap:4px;text-align:center;padding:3px 2px}.rule-item b{font-size:10px}.rule-item span{font-size:9px}.mini-grid{grid-template-columns:repeat(3,13px);grid-template-rows:repeat(3,13px);gap:1px}.mini-grid i{font-size:12px}.mini-grid i:nth-child(5){font-size:10px}.status-row{gap:6px;margin-bottom:9px}.status-chip{min-width:0;flex:1;padding:6px 8px;font-size:10px}.status-chip b{font-size:14px}.status-chip>span:first-child{font-size:17px}.board{gap:3px;padding:5px;border-radius:14px}.cell{border-radius:6px}.cell .marker{font-size:clamp(20px,6vw,30px)}.tool-btn{min-width:0;flex:1;padding:9px 5px;font-size:11px}.gesture-note{font-size:9px}.gesture-note span{margin:0 2px}}
@media(prefers-reduced-motion:reduce){.cell.fish .marker,.cell.wrong{animation:none}.cell{transition:none}}
.cell.cross .marker{position:relative;display:block;width:55%;height:55%;font-size:0;line-height:0;text-shadow:none}
.cell.cross .marker::before,.cell.cross .marker::after{content:"";position:absolute;left:5%;top:40%;width:90%;height:20%;min-height:3px;border-radius:99px;background:#fff}
.cell.cross .marker::before{transform:rotate(45deg)}
.cell.cross .marker::after{transform:rotate(-45deg)}
.cell.region-9{background:#b99870}
/* Compact the frame rather than forcing a horizontal swipe across the board. */
@media(max-width:430px){
  .game-layout{padding-left:4px;padding-right:4px}
  .game-panel{padding-left:6px;padding-right:6px}
  .board{padding:3px;gap:2px}
  .cell{border-radius:5px}
  .board[data-size="10"] .cell .marker{font-size:clamp(15px,4.6vw,24px)}
}

/* Keep the real native select for keyboard and screen-reader support. */
.level-picker{position:relative;display:flex;flex-direction:column;justify-content:center;padding-right:34px;min-width:130px;background:#e8f8ef;border:1px solid #bde9d6}
.level-picker::after{content:"⌄";position:absolute;right:12px;bottom:8px;color:#419b7f;font-size:20px;font-weight:900;line-height:1;pointer-events:none}
.level-picker select{appearance:none;-webkit-appearance:none;min-height:24px;padding:0 4px 0 0;width:100%;outline-offset:3px}
.key-tip{max-height:3em;overflow-y:auto;overflow-wrap:anywhere;overscroll-behavior:contain}
.cell.hint-target{outline:3px solid #345b50;outline-offset:-4px;box-shadow:inset 0 0 0 2px #fff}
.cell.hint-evidence{outline:2px dashed #345b50;outline-offset:-3px}
.cell.hint-target.hint-evidence{outline:3px solid #186b58;outline-offset:-4px;box-shadow:inset 0 0 0 2px #fff}
.cell.hint-evidence.hint-target{outline:3px solid #315d59;outline-offset:-4px;box-shadow:inset 0 0 0 2px #fff}

/* Fit the complete play area on normal-height displays without clipping controls. */
@media(min-height:650px){
 .page-shell{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
 .topbar{height:52px;flex:none}
 .game-layout{flex:1;padding:0 12px 8px;display:flex;flex-direction:column}
 .heading{margin:0 auto 8px}
 .heading h1{font-size:clamp(21px,3.2vw,28px);margin:2px 0}
 .heading p{font-size:11px}
 .game-panel{width:100%;padding:11px 16px 12px}
 .level-row{margin-bottom:8px;gap:7px}
 .level-picker,.lives-box{padding-top:5px;padding-bottom:5px}
 .rule-panel{padding:6px 4px;margin-bottom:8px}
 .rule-item{padding:2px 6px}
 .mini-grid{grid-template-columns:repeat(3,13px);grid-template-rows:repeat(3,13px);gap:1px}
 .mini-grid i{font-size:12px}
 .mini-grid i:nth-child(5){font-size:10px}
 .status-row{margin-bottom:8px;gap:8px}
 .status-chip{padding:5px 12px}
 .board-wrap{width:min(100%,max(220px,calc(100vh - 395px)));width:min(100%,max(220px,calc(100dvh - 395px)))}
 .board-meta{margin-top:5px}
 .key-tip{min-height:18px;margin:5px 0;font-size:11px}
 .action-grid{gap:8px}
 .tool-btn{padding:6px 10px}
 .gesture-note{margin-top:6px}
 footer{display:none}
}
@media(min-height:650px) and (max-width:600px){
 .topbar{height:48px}
 .brand-fish{width:34px;height:34px;font-size:20px}
 .brand{font-size:19px}
 .round-btn{width:34px;height:34px}
 .game-layout{padding:0 6px 8px}
 .heading{margin-bottom:6px}
 .heading h1{font-size:21px}
 .eyebrow{font-size:9px}
 .game-panel{padding:8px 7px 10px;border-radius:18px}
 .level-row{gap:5px;margin-bottom:6px}
 .level-picker{min-width:128px;padding-right:30px}
 .lives-box b{font-size:15px}
 .new-btn{padding:6px}
 .rule-panel{margin-bottom:6px;padding:5px 2px}
 .rule-item{gap:3px}
 .status-row{margin-bottom:6px}
 .status-chip{padding:5px 7px}
 .board-wrap{width:min(100%,max(220px,calc(100vh - 365px)));width:min(100%,max(220px,calc(100dvh - 365px)))}
 .board-meta{margin-top:4px}
 .key-tip{font-size:10px;margin:3px 0}
 .tool-btn{min-height:40px;padding:5px}
 .gesture-note{display:none}
}

/* Economy: three compact counters and clear per-round prop limits. */
.status-chip{flex:1;min-width:0;max-width:190px}
.balance-chip{background:#fff9e8;border-color:#f7e8b9;color:#a18a51}
.balance-chip b{color:#a87723}
.action-grid{max-width:570px;margin-inline:auto}
.tool-btn{min-width:0;flex:1;gap:4px;padding:7px 4px}
.tool-btn .tool-copy{display:flex;flex-direction:column;align-items:flex-start;font-size:12px;line-height:1.25}
.tool-copy small{font-size:10px;font-weight:700;white-space:nowrap;opacity:.86}
.tool-copy strong{font:inherit}
.tool-btn.locate{background:#eaf8f9;border-color:#ceeae9;color:#468e8b}
.tool-btn[disabled]{opacity:.52;cursor:not-allowed}

/* The result dialog remains useful when decorative motion is reduced. */
dialog#result{position:fixed;overflow:visible;isolation:isolate}
#retryReward:not([hidden]){display:block;margin:0 auto 12px;padding:9px 14px;border:1px solid #c5e6d8;border-radius:10px;background:#edf9f1}
#result .result-content{position:relative;z-index:1}
#result .celebration{display:none;position:absolute;inset:-12px;pointer-events:none;overflow:visible}
#result.win{background:linear-gradient(160deg,#fffef4,#e5fbf3);box-shadow:0 22px 70px #287e6860,0 0 0 5px #fce7ad}
#result.win .celebration{display:block}
#result.win .result-icon{animation:celebrate-bounce .7s ease-out both}
#result.loss{background:linear-gradient(160deg,#fffdfa,#eaf7fa)}
#result.loss .result-icon{animation:gentle-float 1.6s ease-in-out 2}
.celebration span{position:absolute;left:50%;top:35%;font-size:24px;color:#efba52;opacity:0;animation:confetti-burst .9s ease-out both;--dx:0px;--dy:0px}
.celebration span:nth-child(1){--dx:-155px;--dy:-105px;color:#f6be53}
.celebration span:nth-child(2){--dx:-115px;--dy:-145px;color:#f29bac;animation-delay:.08s}
.celebration span:nth-child(3){--dx:-50px;--dy:-170px;color:#69c2b0;animation-delay:.15s}
.celebration span:nth-child(4){--dx:45px;--dy:-170px;color:#edbe56;animation-delay:.05s}
.celebration span:nth-child(5){--dx:115px;--dy:-145px;color:#a8a1df;animation-delay:.12s}
.celebration span:nth-child(6){--dx:155px;--dy:-95px;color:#f3949f}
.celebration span:nth-child(7){--dx:-155px;--dy:40px;color:#7acbb8;animation-delay:.15s}
.celebration span:nth-child(8){--dx:155px;--dy:40px;color:#e7bf5a;animation-delay:.1s}
@keyframes confetti-burst{0%{opacity:0;transform:translate(-50%,0) scale(.2) rotate(0)}20%{opacity:1}85%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1.15) rotate(70deg)}}
@keyframes celebrate-bounce{0%{transform:scale(.35) rotate(-18deg)}60%{transform:scale(1.2) rotate(8deg)}100%{transform:scale(1) rotate(0)}}
@keyframes gentle-float{50%{transform:translateY(-7px)}}
@media(max-width:600px){
 .status-row{gap:4px}.status-chip{gap:3px;padding:5px 3px;font-size:10px}
 .status-chip>span:first-child{font-size:15px}.status-chip b{font-size:13px}
 .action-grid{gap:4px}.tool-btn{gap:3px;min-height:40px;padding:4px 2px;font-size:10px}
 .tool-btn span{font-size:15px}.tool-btn .tool-copy{font-size:10px}.tool-copy small{font-size:9px}
 .celebration span:nth-child(1),.celebration span:nth-child(7){--dx:-115px}
 .celebration span:nth-child(6),.celebration span:nth-child(8){--dx:115px}
}
@media(prefers-reduced-motion:reduce){#result.win .result-icon,#result.loss .result-icon,.celebration span{animation:none}.celebration span{opacity:1;transform:translate(var(--dx),var(--dy))}}

/* Fish species occupies the existing subtitle line and does not enlarge the game area. */
.heading .species-line{display:flex;align-items:center;justify-content:center;gap:5px;max-width:90vw;margin:0 auto;min-width:0;line-height:1.3}
.species-line>span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.species-line b{color:#458a78}.species-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:25px;height:20px}
.species-icon svg{display:block;width:100%;height:100%;object-fit:contain}
/* Separate modal layer prevents a closing tap from falling through to the board. */
.hint-dialog,.settings-dialog{max-height:calc(100vh - 30px);max-height:calc(100dvh - 30px);overflow-y:auto}
.hint-dialog{border:2px solid #bde9d4;background:linear-gradient(155deg,#fffef7,#e9faf4);box-shadow:0 25px 75px #174b3c55,0 0 0 5px #d8f6e3}
.hint-dialog h2{font-size:22px;color:#2d745f}.hint-dialog-body{margin:16px 0 8px;padding:14px 16px;border-radius:14px;background:#fff;box-shadow:inset 0 0 0 1px #e1efe8;max-height:45vh;max-height:45dvh;overflow-y:auto;overscroll-behavior:contain}
.hint-dialog-body p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:#315b4f;font-size:15px;line-height:1.75}
.hint-footnote{font-size:12px;color:#5b8f79;margin:8px 0 14px}
.settings-dialog h2{font-size:21px}.audio-settings{margin:12px 0 20px}
.audio-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0 8px;border-top:1px solid #e9f2e9}.audio-row b,.audio-row small{display:block}.audio-row b{color:#477b68;font-size:14px}.audio-row small{font-size:11px;color:#789789;margin-top:3px}
.switch{display:inline-flex;align-items:center;position:relative;flex:none;width:46px;height:28px}.switch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.switch span{pointer-events:none;width:46px;height:28px;border-radius:20px;background:#c6d7ce;transition:background .15s}.switch span::after{content:"";display:block;width:22px;height:22px;margin:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #346b4433;transition:transform .15s}.switch input:checked+span{background:#65bd99}.switch input:checked+span::after{transform:translateX(18px)}.switch input:focus-visible+span{outline:3px solid #178779;outline-offset:3px}
.volume-row{display:flex;align-items:center;gap:12px;color:#648a76;font-size:12px;padding:4px 0 10px}.volume-row span{white-space:nowrap}.volume-row input{flex:1;min-width:0;accent-color:#68b99a;cursor:pointer}
@media(max-width:600px){.heading .species-line{font-size:10px}.species-icon{width:22px;height:18px}.hint-dialog,.settings-dialog{padding:19px}.hint-dialog-body p{font-size:14px}.top-actions{gap:5px}}
@media(prefers-reduced-motion:reduce){.switch span,.switch span::after{transition:none}}

/* Given fish and a free, non-spoiler next step are distinct from paid props. */
.cell.given{box-shadow:inset 0 0 0 2px #fff4ad}
.cell.given::after{content:"✦";position:absolute;right:1px;top:1px;display:grid;place-items:center;width:11px;height:11px;border-radius:50%;background:#fff4bd;color:#98681a;font-size:8px;line-height:1;pointer-events:none}
.board-meta-actions{display:flex;align-items:center;gap:9px}
.free-hint-btn{border:1px solid #c9eadc;border-radius:999px;background:#edf9f1;color:#328b6d;padding:5px 9px;font-size:11px;font-weight:900;white-space:nowrap}
.free-hint-btn small{font-size:9px;color:#55a883}
.apply-hint-btn:not([hidden]){display:block;width:100%;margin:0 0 9px;border:1px solid #cce9db;border-radius:12px;background:#f2fbf4;color:#4b987c;padding:11px;font-size:13px;font-weight:900}
@media(max-width:600px){.board-meta-actions{gap:7px}.free-hint-btn{padding:4px 7px;font-size:10px}.cell.given::after{width:9px;height:9px;font-size:7px}}

/* Difficulty menu uses buttons for keyboard navigation; the select remains the state source. */
.level-row{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1fr);align-items:stretch;gap:8px;width:100%}
.level-row .level-picker,.level-row .lives-box,.level-row .new-btn{width:100%;min-width:0;min-height:48px}
.level-row .level-picker{position:relative;padding:5px 10px;z-index:15;overflow:visible}
.level-row .level-picker::after{content:none}
.level-picker .level-caption{display:block;font-size:10px;font-weight:800;color:#78a093;line-height:1.2}
.difficulty-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:3px;border:0;padding:2px 0 0;background:transparent;color:#3a7968;font-weight:900;text-align:left;cursor:pointer}
.level-picker .difficulty-trigger #difficultyLabel{font-size:13px;color:#347864;line-height:1.3;white-space:nowrap}
.level-picker .difficulty-trigger .difficulty-arrow{font-size:19px;line-height:.7;color:#419b7f;transition:transform .2s}
.difficulty-trigger[aria-expanded="true"] .difficulty-arrow{transform:rotate(180deg)}
.difficulty-menu{position:absolute;z-index:30;top:calc(100% + 7px);left:0;width:max(100%,220px);padding:6px;border:1px solid #d5eee1;border-radius:16px;background:#fffefb;box-shadow:0 12px 32px #3e8d7040}
.difficulty-menu[hidden]{display:none}
.difficulty-menu button{display:flex;align-items:center;gap:9px;width:100%;padding:8px;border:0;border-radius:11px;background:transparent;color:#3f7060;text-align:left;cursor:pointer}
.difficulty-menu button:hover,.difficulty-menu button:focus-visible{background:#edf9f1}
.difficulty-menu button[aria-selected="true"]{background:#e5f8ea}
.level-picker .option-icon{display:grid;place-items:center;flex:none;width:31px;height:31px;border-radius:10px;background:#eef8e9;font-size:16px}
.level-picker .option-icon.normal{background:#e4f5f2}.level-picker .option-icon.hard{background:#fff1d7}
.level-picker .option-label{display:block;flex:1;color:#4a7665;font-size:12px;line-height:1.25}
.option-label b,.option-label small{display:block}
.option-label small{margin-top:2px;color:#91ad9e;font-size:10px}
.level-picker .option-check{visibility:hidden;color:#4da889;font-size:16px}
.difficulty-menu button[aria-selected="true"] .option-check{visibility:visible}
.level-row .lives-box{display:flex;flex-direction:column;justify-content:center}
.level-row .new-btn{padding-inline:5px}
@media(max-width:600px){.level-row{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1fr);gap:5px}.level-row .level-picker,.level-row .lives-box,.level-row .new-btn{min-height:44px}.level-row .level-picker{padding:4px 7px}.level-picker .difficulty-trigger #difficultyLabel{font-size:12px}.difficulty-menu{width:max(100%,200px)}.difficulty-menu button{padding:7px}}
@media(prefers-reduced-motion:reduce){.difficulty-arrow{transition:none}}

/* A compact underwater specimen card, with the current fish as the hero. */
.heading{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:space-between;width:100%;max-width:710px;min-height:76px;padding:7px 18px;text-align:left;overflow:hidden;border:1px solid #d2eee3;border-radius:18px;background:linear-gradient(90deg,#f1fff8f5 0%,#e9faf1ed 58%,#d6f5ebc9 100%),url("assets/hero.png") center/cover;box-shadow:0 5px 20px #59a88c16}
.heading::after{content:"";position:absolute;z-index:-1;right:-28px;bottom:-54px;width:220px;height:115px;border-radius:50%;border:2px solid #a6dfd66b;box-shadow:0 0 0 13px #fff4,0 0 0 26px #bceade46;pointer-events:none}
.hero-copy{min-width:0;position:relative;z-index:1}.heading .species-line{justify-content:flex-start;max-width:100%;color:#577f70}.species-line>span:last-child{display:block}.heading h1{margin:2px 0}.fish-showcase{position:relative;display:grid;place-items:center;flex:none;width:106px;height:60px;margin-left:8px;border-radius:50%;background:radial-gradient(ellipse,#ffffffd9 5%,#c4f0de80 50%,transparent 72%)}
.heading .species-icon{position:relative;z-index:1;display:flex;width:94px;height:58px;align-items:center;justify-content:center;font-size:40px;filter:drop-shadow(0 5px 5px #448c7750);animation:showcase-swim 3.4s ease-in-out infinite}.heading .species-icon svg{width:100%;height:100%;object-fit:contain}
.heading .species-icon .fish-illustration{width:100%!important;max-width:none!important}
.fish-bubble{position:absolute;display:block;width:9px;height:9px;border:1.5px solid #fff;border-radius:50%;background:#ffffff72;animation:showcase-bubble 3s ease-in-out infinite}.bubble-one{top:7px;right:12px}.bubble-two{width:5px;height:5px;left:7px;bottom:8px;animation-delay:-1.5s}
@keyframes showcase-swim{50%{transform:translateY(-4px) rotate(-3deg)}}@keyframes showcase-bubble{50%{transform:translateY(-5px);opacity:.55}}
/* Give the chevron a stable centered box; only the box rotates. */
.level-picker .difficulty-trigger .difficulty-arrow{display:inline-flex;flex:none;width:18px;height:18px;align-items:center;justify-content:center;font-size:0;line-height:1;transform-origin:50% 50%}
.difficulty-arrow::before{content:"";width:7px;height:7px;border-right:2px solid #419b7f;border-bottom:2px solid #419b7f;transform:translateY(-2px) rotate(45deg)}
@media(max-width:600px){.heading{min-height:68px;padding:5px 12px;border-radius:15px}.heading .species-line{font-size:10px}.fish-showcase{width:84px;height:54px}.heading .species-icon{width:77px;height:50px;font-size:34px}}
@media(prefers-reduced-motion:reduce){.heading .species-icon,.fish-bubble{animation:none}}

/* Current species is the illustrated focus; board markers retain their own size. */
.heading{min-height:92px}.fish-showcase{width:142px;height:82px}.heading .species-icon{width:130px;height:82px}.heading .species-icon>.fish-illustration{width:100%!important;height:100%!important;max-width:none!important}.heading .species-icon>.fish-illustration svg{width:100%;height:100%}
/* Equal icon boxes within each group keep controls visually aligned. */
.top-actions .round-btn{display:inline-grid;place-items:center;line-height:1;font-size:18px}
.status-chip>span:first-child,.tool-btn>span:first-child{display:inline-grid;place-items:center;flex:none;width:22px;height:22px;font-size:18px;line-height:1}
.rule-item .mini-grid{flex:none}
@media(max-width:600px){.heading{min-height:78px}.fish-showcase{width:112px;height:68px}.heading .species-icon{width:105px;height:68px}.status-chip>span:first-child,.tool-btn>span:first-child{width:20px;height:20px;font-size:16px}.top-actions .round-btn{font-size:17px}}

/* Level progress and optional, non-interactive coordinates. */
.level-row{grid-template-columns:minmax(0,2fr) minmax(0,.9fr) minmax(0,1fr)}
.level-progress{min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;border:1px solid #bde9d6;background:#eaf8ef;border-radius:14px;padding:4px 3px;text-align:center}
.level-progress>div+div{border-left:1px solid #d1eadc}.level-progress span,.level-progress b{display:block;white-space:nowrap}.level-progress span{font-size:10px;font-weight:800;color:#78a093}.level-progress b{font-size:16px;line-height:1.2;color:#3a8c72;font-variant-numeric:tabular-nums}
.board-wrap{position:relative}.ruler{--size:8;display:none;position:absolute;pointer-events:none;color:#599883;font-size:10px;font-weight:800;line-height:1;text-align:center}.rulers-on .ruler{display:grid}.ruler span{display:grid;place-items:center}.ruler-rows{top:0;bottom:0;right:100%;width:17px;padding:7px 0;gap:5px;grid-template-rows:repeat(var(--size),minmax(0,1fr))}.ruler-cols{top:100%;left:0;right:0;height:17px;padding:0 7px;gap:5px;grid-template-columns:repeat(var(--size),minmax(0,1fr))}.board-wrap{margin-bottom:17px}
@media(max-width:600px){.level-row{grid-template-columns:minmax(0,2fr) minmax(0,.9fr) minmax(0,1fr)}.level-progress span{font-size:9px}.level-progress b{font-size:14px}.ruler-rows{padding:5px 0;gap:3px}.ruler-cols{padding:0 5px;gap:3px}}
@media(max-width:430px){.ruler-rows{padding:3px 0;gap:2px}.ruler-cols{padding:0 3px;gap:2px}}
/* Full-screen celebrations preserve readable controls and work with reduced motion. */
dialog#result[open]{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;border-radius:0;padding:24px;overflow:hidden;display:grid;place-items:center}
#result.win{background:radial-gradient(circle at 50% 30%,#fff8c8,#e7fbef 55%,#b9e8e2);box-shadow:none}
#result.loss{background:radial-gradient(circle at 50% 35%,#fff8f8,#e8f5f7 70%,#cde8ef);box-shadow:none}
#result .result-content{width:min(390px,100%);padding:24px;border-radius:25px;background:#ffffffc9;box-shadow:0 18px 50px #3b8a7840;backdrop-filter:blur(8px)}
#result .celebration{position:fixed;inset:0;overflow:hidden;z-index:0}
#result.win .celebration span{left:var(--x);top:-10%;font-size:var(--s);opacity:0;animation:confetti-fall var(--duration) linear infinite;animation-delay:var(--delay);transform:none}
#result .celebration span:nth-child(8n+1){--x:5%;--s:26px;--duration:4s;--delay:-.4s}
#result .celebration span:nth-child(8n+2){--x:17%;--s:18px;--duration:5s;--delay:-3.1s}
#result .celebration span:nth-child(8n+3){--x:29%;--s:28px;--duration:4.6s;--delay:-1.4s}
#result .celebration span:nth-child(8n+4){--x:41%;--s:20px;--duration:5.2s;--delay:-2.6s}
#result .celebration span:nth-child(8n+5){--x:53%;--s:24px;--duration:4.2s;--delay:-3.7s}
#result .celebration span:nth-child(8n+6){--x:65%;--s:18px;--duration:5.1s;--delay:-1.8s}
#result .celebration span:nth-child(8n+7){--x:78%;--s:26px;--duration:4.7s;--delay:-.7s}
#result .celebration span:nth-child(8n){--x:91%;--s:20px;--duration:5.4s;--delay:-4.3s}
#result .celebration span:nth-child(n+9){animation-delay:-2.3s}
@keyframes confetti-fall{0%{opacity:0;transform:translateY(-5vh) rotate(0)}10%{opacity:1}90%{opacity:1}100%{opacity:0;transform:translateY(115vh) rotate(360deg)}}
.result-fish-scene,.result-broken-heart{display:none}.win .result-fish-scene{position:relative;display:grid;place-items:center;height:150px;animation:royal-swim 2.8s ease-in-out infinite}.result-fish{display:grid;place-items:center;width:180px;height:120px;filter:drop-shadow(0 8px 8px #3a91744d)}.result-fish>.fish-illustration{width:100%!important;max-width:none!important}.result-fish svg{width:100%;height:100%}.result-crown{position:absolute;z-index:1;top:0;left:50%;font-size:42px;transform:translateX(-50%) rotate(-9deg)}.loss .result-broken-heart{display:block;font-size:70px;line-height:1.3;animation:heart-break 1.1s ease-in-out both}.win #resultIcon,.loss #resultIcon{display:none}
@keyframes royal-swim{50%{transform:translateY(-9px) rotate(-3deg)}}@keyframes heart-break{0%{transform:scale(.5)}40%{transform:scale(1.2)}65%{transform:rotate(-12deg)}85%{transform:rotate(8deg)}100%{transform:scale(1)}}
@media(max-height:600px){#result .result-content{padding:12px 20px}.win .result-fish-scene{height:105px}.result-fish{height:85px}.result-crown{font-size:30px}.loss .result-broken-heart{font-size:50px}}
@media(prefers-reduced-motion:reduce){#result.win .celebration span{animation:none;opacity:.6;top:var(--x);transform:none}.win .result-fish-scene,.loss .result-broken-heart{animation:none}}

/* Reserve room for row coordinates when the board fills a narrow screen. */
.board-wrap{max-width:min(570px,calc(100% - 34px))}

/* Round-start reminder: text remains in the accessibility tree throughout. */
.rule-panel.rule-intro{animation:rule-glow .8s ease 2.1s both;transform-origin:center}
.rule-intro .rule-item p{animation:rule-type .65s steps(12,end) both}
.rule-intro .rule-item:nth-child(2) p{animation-delay:.7s}.rule-intro .rule-item:nth-child(3) p{animation-delay:1.4s}
.rule-intro .rule-item{animation:rule-wiggle .4s ease 2.9s both}.rule-intro .rule-item:nth-child(2){animation-delay:3.1s}.rule-intro .rule-item:nth-child(3){animation-delay:3.3s}
@keyframes rule-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}@keyframes rule-glow{50%{transform:scale(1.025);box-shadow:0 0 0 4px #e4f8de,0 0 22px #98e5b199}}@keyframes rule-wiggle{25%{transform:scale(1.09) rotate(-4deg)}75%{transform:scale(1.09) rotate(4deg)}}
.cell.fish-pop-active .marker{animation:single-fish-celebrate .6s ease both}.cell.fish-victory-active .marker{animation:single-fish-celebrate .7s ease both}@keyframes single-fish-celebrate{30%{transform:translateY(-20%) scale(1.25) rotate(-8deg)}65%{transform:translateY(-8%) scale(1.1) rotate(6deg)}100%{transform:none}}
.onboarding-dialog{width:min(430px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;padding:22px;background:linear-gradient(145deg,#fffef6,#e9faf4);border:2px solid #c7eddd;color:#315d59}.onboarding-dialog::backdrop{background:#153f3999}.onboarding-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.onboarding-badge{font-size:12px;font-weight:900;color:#4f9d80}.onboarding-skip,.onboarding-back{border:0;background:transparent;color:#568e7a;font-weight:800;padding:8px;border-radius:10px}.onboarding-picture{text-align:center;font-size:35px;padding:12px;border-radius:16px;background:radial-gradient(circle,#fafffc,#d7f3e6)}.onboarding-step{margin:15px 0 5px!important;color:#63a990!important;font-size:11px!important;font-weight:900}.onboarding-dialog h2{font-size:22px;color:#315f52}.onboarding-text{font-size:15px!important;line-height:1.7!important;min-height:4.9em;margin:10px 0!important;color:#527e70!important}.onboarding-error{min-height:0;color:#b44c52!important;margin:0 0 8px!important}.onboarding-error:empty{display:none}.onboarding-actions{display:flex;align-items:center;gap:8px}.onboarding-actions .primary{flex:1}.onboarding-back[hidden]{display:none}
@media(max-width:600px){.onboarding-dialog{padding:18px}.onboarding-picture{padding:8px}.onboarding-text{font-size:14px!important;min-height:0}}
@media(prefers-reduced-motion:reduce){.rule-panel.rule-intro,.rule-intro .rule-item,.rule-intro .rule-item p,.cell.fish-pop-active .marker,.cell.fish-victory-active .marker{animation:none!important}}

/* Keep rule reminders in view when dialogs or identity loading interrupt them. */
.rule-panel.rule-paused,.rule-paused .rule-item,.rule-paused .rule-item p{animation-play-state:paused!important}
.onboarding-picture{animation:guide-fish-float 2.2s ease-in-out infinite}
.guide-step-enter h2,.guide-step-enter .onboarding-text,.guide-step-enter .onboarding-step{animation:guide-step-arrive .38s ease both}
@keyframes guide-fish-float{50%{transform:translateY(-5px)}}@keyframes guide-step-arrive{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.onboarding-picture,.guide-step-enter h2,.guide-step-enter .onboarding-text,.guide-step-enter .onboarding-step{animation:none!important}}
.level-title{text-align:center;margin:0 0 10px;color:#3a796d;font-size:clamp(22px,4.8vw,30px);line-height:1.15;font-weight:900;letter-spacing:.08em}
.level-title b{font-size:1.2em;color:#43a88f;font-variant-numeric:tabular-nums}
.level-progress{grid-template-columns:repeat(2,minmax(0,1fr))}
.prop-reminder-text{max-width:570px;margin:0 auto 7px;text-align:center;color:#bc8124;font-size:12px;font-weight:800}
.prop-reminder-text[hidden]{display:none}
.action-grid .tool-btn{position:relative}
.action-grid .prop-reminder-active{z-index:2;box-shadow:0 0 0 3px #fff3bd,0 0 20px #f9c64fa8;animation:prop-pulse .8s ease-in-out infinite alternate}
.action-grid .prop-reminder-active::after{content:'👆';position:absolute;left:50%;top:50%;right:auto;z-index:0;font-size:24px;line-height:1;opacity:.6;pointer-events:none;transform:translate(-50%,-50%);animation:prop-point .7s ease-in-out infinite alternate}
.action-grid .prop-reminder-active>span,.action-grid .prop-reminder-active>b{position:relative;z-index:1;text-shadow:0 0 3px #fff,0 0 5px #fff}
@keyframes prop-pulse{from{transform:scale(1)}to{transform:scale(1.055)}}
@keyframes prop-point{from{transform:translate(-50%,-50%) scale(.92)}to{transform:translate(-50%,-50%) scale(1.08)}}
@media(max-width:600px){.level-title{font-size:21px;margin-bottom:6px}.prop-reminder-text{font-size:11px;margin-bottom:4px}}
@media(prefers-reduced-motion:reduce){.action-grid .prop-reminder-active,.action-grid .prop-reminder-active::after{animation:none}}

/* The fish swims directly in the surrounding sea, without a card outline. */
.heading{border:0;border-radius:0;box-shadow:none;background:radial-gradient(ellipse at 82% 52%,#b6ebe17a 0%,#d9f5e99c 34%,transparent 73%)}
.heading::after{right:-14px;bottom:-65px;width:205px;height:115px;border:0;box-shadow:none;background:radial-gradient(ellipse,#b0e8de30 10%,#b0e8de38 45%,transparent 72%)}
.fish-showcase{background:radial-gradient(ellipse,#c8f2e488 0%,#d4f4e533 55%,transparent 76%)}

/* Keep each diagram beside its wording at every screen width. */
.rule-panel{padding:10px 4px}
.rule-item{flex-direction:row;justify-content:center;text-align:left;gap:8px;padding:4px 7px}
.rule-item p{flex:0 1 auto}
.rule-item b,.rule-item span{overflow-wrap:anywhere}
.level-row{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
@media(max-width:600px){
 .rule-panel{padding:8px 2px}
 .rule-item{flex-direction:row;gap:4px;padding:3px 3px;text-align:left}
 .rule-item .mini-grid{grid-template-columns:repeat(3,10px);grid-template-rows:repeat(3,10px);gap:1px}
 .rule-item .mini-grid i{font-size:9px}.rule-item .mini-grid i:nth-child(5){font-size:8px}
 .rule-item b{font-size:10px;line-height:1.3}.rule-item span{font-size:9px;line-height:1.3}
 .level-row{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
}
@media(max-width:360px){.rule-item{gap:3px;padding-inline:2px}.rule-item .mini-grid{grid-template-columns:repeat(3,8px);grid-template-rows:repeat(3,8px)}.rule-item .mini-grid i{font-size:8px}.rule-item .mini-grid i:nth-child(5){font-size:7px}.rule-item b,.rule-item span{font-size:9px}}
/* Progress and lives frame the current level on a single line. */
.level-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);align-items:center;gap:6px}
.level-row .level-title{margin:0;white-space:nowrap;text-align:center}
.streak-box{display:flex;align-items:center;justify-content:flex-start;gap:.25em;min-width:0;white-space:nowrap;color:#72988a;font-size:clamp(11px,2vw,14px);font-weight:800}
.streak-box b{color:#388f78;font-variant-numeric:tabular-nums}
.level-row .lives-box{display:flex;align-items:center;justify-content:flex-end;padding:0;border:0;background:transparent;min-height:0}
.level-row .lives-box b{color:#f0747f;white-space:nowrap;letter-spacing:1px;font-size:clamp(16px,3vw,22px);line-height:1}
.status-chip #progress{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:600px){.level-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.level-row .level-title{font-size:clamp(16px,5vw,21px)}.streak-box{font-size:11px;gap:.15em}.level-row .lives-box b{font-size:clamp(15px,5vw,20px);letter-spacing:0}.status-chip #progress{font-size:clamp(11px,3.5vw,14px)}}
/* Separate the level from the card and give the rule illustrations more room. */
.game-layout>.level-title{margin:4px auto 12px;text-align:center;line-height:1.2}
.game-layout>.game-panel{margin:0 auto}
.level-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin-bottom:12px}
.rule-panel{padding:14px 5px;margin-bottom:14px}
.rule-item{gap:9px;padding:5px 8px}
.rule-item .mini-grid{grid-template-columns:repeat(3,15px);grid-template-rows:repeat(3,15px);gap:2px}
.rule-item .mini-grid i{font-size:13px}.rule-item .mini-grid i:nth-child(5){font-size:11px}
.rule-item b{font-size:13px;line-height:1.35}.rule-item span{font-size:11px;line-height:1.4}
@media(max-width:600px){
 .game-layout>.level-title{font-size:clamp(19px,5vw,23px);margin:3px auto 9px}
 .level-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin-bottom:9px}
 .rule-panel{padding:11px 2px;margin-bottom:10px}
 .rule-item{gap:4px;padding:4px 3px}
 .rule-item .mini-grid{grid-template-columns:repeat(3,11px);grid-template-rows:repeat(3,11px);gap:1px}
 .rule-item .mini-grid i{font-size:10px}.rule-item .mini-grid i:nth-child(5){font-size:9px}
 .rule-item b{font-size:11px;line-height:1.35}.rule-item span{font-size:10px;line-height:1.35}
 .board-wrap{width:min(100%,max(210px,calc(100vh - 405px)));width:min(100%,max(210px,calc(100dvh - 405px)))}
}
@media(max-width:360px){.rule-item{gap:3px;padding-inline:2px}.rule-item .mini-grid{grid-template-columns:repeat(3,9px);grid-template-rows:repeat(3,9px)}.rule-item .mini-grid i{font-size:9px}.rule-item .mini-grid i:nth-child(5){font-size:8px}.rule-item b{font-size:10px}.rule-item span{font-size:9.5px}}
/* Use the generous space on large portrait displays without affecting phones or short screens. */
@media (orientation:portrait) and (min-width:760px) and (min-height:1200px){
 .heading{max-width:970px;min-height:122px;padding:12px 24px}
 .heading h1{font-size:36px}.heading .species-line{font-size:15px}.eyebrow{font-size:13px}
 .fish-showcase{width:200px;height:110px}.heading .species-icon{width:185px;height:108px}
 .game-layout>.level-title{font-size:34px;margin:8px auto 16px}
 .game-layout>.game-panel{max-width:970px;padding:24px 26px 26px}
 .level-row{margin-bottom:18px}.streak-box{font-size:18px}.level-row .lives-box b{font-size:27px}
 .rule-panel{padding:20px 8px;margin-bottom:18px}
 .rule-item{gap:12px;padding:6px 10px}
 .rule-item .mini-grid{grid-template-columns:repeat(3,20px);grid-template-rows:repeat(3,20px);gap:2px}
 .rule-item .mini-grid i{font-size:18px}.rule-item .mini-grid i:nth-child(5){font-size:15px}
 .rule-item b{font-size:18px}.rule-item span{font-size:16px}
 .status-row{max-width:900px;gap:12px;margin-bottom:16px}.status-chip{max-width:none;padding:10px 16px;font-size:16px}.status-chip b{font-size:20px}.status-chip small{font-size:13px}
 .board-wrap{width:min(100%,calc(100vh - 660px));width:min(100%,calc(100dvh - 660px));max-width:min(900px,calc(100% - 34px))}
 .ruler{font-size:14px}.cell .marker{font-size:clamp(32px,5vw,60px)}
 .key-tip{font-size:15px;margin:10px 0}.action-grid{max-width:900px;gap:12px}.tool-btn{min-height:58px;font-size:16px}.tool-btn .tool-copy{font-size:15px}.tool-copy small{font-size:12px}
 .gesture-note{font-size:13px;margin-top:12px}
}
/* A hypothesis is a reversible note, not a confirmed catch. */
.cell.assumed-fish .marker{opacity:.62;transform:scale(.83);filter:saturate(.8);animation:none}
.cell.assumed-fish::after{content:'?';position:absolute;top:3%;right:3%;z-index:1;display:grid;place-items:center;width:27%;aspect-ratio:1;border-radius:50%;background:#fff9d3;color:#956a21;border:1px solid #fff;font-size:clamp(8px,2vw,15px);font-weight:900;line-height:1;pointer-events:none}
@media(pointer:coarse){.mouse-assumption-note{display:none}}

/* An optional same-level alternative preserves the original retry action. */
.alternate-puzzle{display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;margin-top:10px;padding:10px 12px;border:1px solid #a9dfce;border-radius:12px;background:#effaf5;color:#3b8a70;font-weight:800}.alternate-puzzle small{font-size:11px;color:#6c9b8c;font-weight:500}.alternate-puzzle[hidden]{display:none}
