:root {
  background: #faf1df;
  color: #29264a;
  font: 16px system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.fish { background: #f4efdc; color: #153c43; }
main { width: min(calc(100% - 1.5rem), 30rem); margin: auto; padding-block: .75rem; }
.game-heading, .tools, .level-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem .75rem; }
.game-heading h1 { margin: 0; font-size: clamp(1.45rem, 6vw, 2rem); line-height: 1.1; }
.level-heading { margin: .6rem 0 .4rem; }
.level-heading h2 { margin: 0; font-size: 1rem; }
.level-heading span, .tools output { font-size: .85rem; font-weight: 650; }
canvas { display: block; width: 100%; height: auto; touch-action: none; border: 2px solid currentColor; border-radius: 1rem; background: #d7e78b; }
body.fish canvas { background: #123f48; }
button, select { min-height: 2.75rem; font: inherit; }
button { border: 0; border-radius: .65rem; padding: .45rem .85rem; background: #e8def5; color: #30265a; font-weight: 700; cursor: pointer; touch-action: manipulation; }
body.fish button { background: #d7e9db; color: #153c43; }
.tools .advance:not([hidden]) { background: #126253; color: #fff; }
button:focus-visible, select:focus-visible { outline: 2px solid #2452c4; outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.hint { min-height: 1.55rem; margin: .45rem 0; font-size: .9rem; }
.game-meter { display: flex; align-items: center; gap: .45rem; }
progress { accent-color: #087f76; width: 4rem; }
dialog { width: min(27rem, calc(100% - 1.5rem)); max-height: 85vh; border: 0; border-radius: 1rem; background: #fff9eb; color: inherit; padding: 1rem; }
dialog::backdrop { background: #151d2b85; }
dialog h2 { margin: 0 0 .75rem; }
.level-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.level-options button { text-align: left; }
.level-options [aria-current="true"] { box-shadow: inset 0 0 0 2px #087f76; }
@media (min-width: 30rem) and (max-height: 44rem) {
  main { width: min(calc(100% - 1.5rem), 25rem); }
}
