:root {
  color-scheme: dark;
  font-family: system-ui,sans-serif;
  line-height: 1.49;
  background: #10282d; color: #edf6ee;
  --panel: #15363c; --edge: #729b8b75; --muted: #c0d1c8; --mint: #a8eac9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse 65rem 44rem at 50% -15rem,#36635b,transparent),#10282d; }
a { color: #b7f0d8; text-underline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1,h2 { line-height: 1.08; font: 500 clamp(1.9rem,4.5vw,3.2rem)/1.08 Georgia,serif; }
.shell { width: min(64rem,calc(100% - 2rem)); margin-inline: auto; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .22rem .62rem; min-height: 55px; }
.bar a { display: inline-flex; align-items: center; min-height: 44px; font-size: .86rem; font-weight: 650; }
button { min-height: 44px; font: inherit; font-weight: 670; border: 1px solid #8aa89c; border-radius: .55rem; padding: .48rem .78rem; color: #eef9f1; background: #284d52; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: #396567; }
button:disabled { opacity: .72; cursor: default; }
button.primary { background: #a8eac9; border-color: #d0fbe5; color: #103431; }
button.primary:hover:not(:disabled) { background: #c6f4db; }
button:focus-visible,a:focus-visible { outline: 3px solid #fff1ae; outline-offset: 3px; }
button[aria-pressed="true"] { box-shadow: inset 0 -3px #ffc694; border-color: #ffd49e; }
.eyebrow { color: var(--chapter,var(--mint)); font-size: .82rem; font-weight: 750; letter-spacing: .06em; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end; min-height: clamp(22rem,46vw,30rem); background: #234f53; border: 1px solid var(--edge); border-radius: 1rem; box-shadow: 0 1rem 3rem #061a1aaa; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 49%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg,#10282d 0%,#10282dbb 37%,transparent 87%),linear-gradient(90deg,#10282da6,transparent 78%); }
.hero-copy { padding: clamp(1.05rem,4vw,2.65rem); }
.hero h1 { font-size: clamp(3rem,10.5vw,6rem); margin-block: .22rem .43rem; }
.hero-copy p:not(.eyebrow) { max-width: 29rem; margin-bottom: .9rem; }
.board,.card { padding: clamp(.68rem,2.35vw,1.34rem); border: 1px solid var(--edge); border-radius: .9rem; background: var(--panel); }
.board-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; margin-bottom: .72rem; }
.board-heading h2 { margin-top: .2rem; }
.score { display: flex; align-items: center; gap: .65rem; }
.score span { white-space: nowrap; color: #ffe4a9; font-weight: 760; }
.play-area { display: grid; grid-template-columns: 1.35fr minmax(14.5rem,1fr); gap: 1rem; align-items: start; }
.pond {
  padding: clamp(.33rem,2vw,1rem);
  border: 1px solid #8eb6aa; border-radius: .72rem; overflow: hidden; isolation: isolate;
  background: linear-gradient(#122e35cb,#1e3941e7),url(cover.webp) 55% 50%/cover;
}
#grid {
  display: grid; width: min(100%,calc(var(--columns) * 4.1rem + 1rem)); margin-inline: auto;
  grid-template-columns: repeat(var(--columns),minmax(0,1fr)); gap: clamp(.19rem,1vw,.35rem);
}
.tile {
  display: grid; place-items: center; min-width: 0; min-height: 0; aspect-ratio: 1;
  position: relative; border: 1px solid #829b93; border-radius: clamp(.21rem,.8vw,.48rem); padding: 0;
  font-weight: 820; font-size: clamp(.87rem,3.9vw,1.57rem); line-height: 1; color: #f5f3dd;
  background: linear-gradient(135deg,#324d55,#263e48);
}
button.tile:focus-visible { outline-offset: 0; z-index: 2; }
button.tile:hover:not(:disabled) { filter: brightness(1.13); background: #466e69; }
.tile.reed { background: repeating-linear-gradient(122deg,#1c3934 0 6px,#274843 6px 9px); border-color: #577a65; }
.tile.lily { background: radial-gradient(circle at 54% 45%,#5b455e,#2d424f 70%); color: #f4abc9; border-color: #b684a0; }
.tile[data-glow="yes"] { background: radial-gradient(ellipse at 50% 44%,#8b8564,#496263 81%); border-color: #eee4a5; }
.tile.lily[data-glow="yes"] { color: #411c34; background: radial-gradient(circle,#ffcfdb,#df8fac); }
.tile[data-state="light"] { background: radial-gradient(circle,#fff2a9,#f8c670 81%); border-color: #fff7d6; color: #342438; box-shadow: 0 0 .68rem #ffc871b8; }
.tile[data-over="yes"] { color: #281c28; background: #f38f86; border-color: #ffdcd3; }
.tile.reed[data-match="yes"] { color: #bef9bd; border-color: #9bc2a2; }
.tile[data-hint="yes"] { box-shadow: 0 0 0 2px #f6d795,0 0 1rem #ffe1a985; z-index: 1; }
.tile[data-state="mark"] { color: #f9d2ab; }
.tile .badge { font-size: clamp(.61rem,1.9vw,.83rem); position: absolute; right: 5%; top: 4%; }
.tile[data-state="light"]:disabled { opacity: 1; }
.ledger { display: grid; align-content: start; gap: .67rem; }
#brief { color: #e3f1e8; }
.counters { margin: 0; display: grid; gap: .3rem; }
.counters div { display: flex; align-items: baseline; justify-content: space-between; gap: .45rem; padding: .31rem .48rem; border-radius: .33rem; background: #23464e; }
.counters dd { margin: 0; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counters dt { font-size: .83rem; }
.controls { display: flex; flex-wrap: wrap; gap: .39rem; }
#feedback { min-height: 2.65em; color: #cfe5dc; font-size: .88rem; font-weight: 640; }
#feedback[data-kind="warn"] { color: #ffd1b9; }
#feedback[data-kind="win"] { color: #bcf6b6; }
#next { justify-self: start; }
.lower { display: grid; grid-template-columns: 1.1fr 1fr; gap: .72rem; margin-top: .72rem; }
.card h2 { font-size: 1.6rem; margin-bottom: .65rem; }
.card ol { padding-left: 1.22rem; margin: 0 0 .65rem; }
.card li + li { margin-top: .33rem; }
.muted,footer { color: var(--muted); font-size: .85rem; }
.map { display: grid; gap: .5rem; margin-bottom: .53rem; }
.cluster h3 { font-size: .83rem; color: var(--cluster); margin-bottom: .22rem; }
.tiles { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .32rem; }
.tiles button { padding: .24rem; font-variant-numeric: tabular-nums; }
.tiles button.done { background: #315d4e; }
.tiles button[aria-current="step"] { border-color: var(--cluster); box-shadow: inset 0 -3px var(--cluster); }
footer { padding-block: 1rem; }
@media(max-width:735px) {
  .shell { width: calc(100% - 1.05rem); }
  .play-area,.lower { grid-template-columns: 1fr; }
  .play-area { gap: .6rem; }
  .ledger { gap: .47rem; }
  .controls button { flex: 1 1 auto; }
}
@media(max-width:360px) {
  .bar a { font-size: .76rem; }
}
