:root {
  color-scheme: dark;
  --ink: #eef8f5;
  --muted: #b7cfcc;
  --line: #31575a;
  --accent: #8fe4dd;
  --deep: #0b2228;
  --panel: #122f35;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 65% 0%, #194952 0%, var(--deep) 52%);
  color: var(--ink);
  font: 1rem/1.55 system-ui, sans-serif;
}
.wrap { width: min(1320px, calc(100% - 72px)); margin-inline: auto; }
a { color: inherit; text-underline-offset: .22em; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
[hidden] { display: none !important; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: .38em; text-decoration: none; letter-spacing: .1em; font-weight: 820; }
.brand b { color: var(--accent); }
.drop {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: .6em;
  border-radius: 1px 70% 70%;
  rotate: 45deg;
  background: linear-gradient(133deg, #a1efe8, #42adcf 82%);
}
nav { display: flex; gap: 22px; color: var(--muted); }
nav a { text-decoration: none; }
nav a:hover { color: var(--ink); }
.play-layout {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) minmax(0, 1.6fr);
  gap: clamp(36px, 5vw, 88px);
  padding-block: 45px 54px;
  align-items: center;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 22px;
  font: 400 clamp(4rem, 7.2vw, 8rem)/.89 Georgia, serif;
  letter-spacing: -.065em;
}
h1 span { color: var(--accent); }
.intro p, .project p { color: var(--muted); }
.intro > p { max-width: 32ch; margin-bottom: 23px; }
.primary {
  background: var(--accent);
  color: #103238;
  font-weight: 780;
  border: 0;
  border-radius: 4px;
  min-height: 48px;
  padding-inline: 20px;
}
.primary:hover { background: #b9f6ef; }
.primary:disabled { opacity: .66; cursor: default; }
.help {
  margin-top: 27px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  max-width: 36ch;
}
.help h2 { font-size: 1rem; margin-bottom: 5px; }
.help p { font-size: .92rem; margin-bottom: 8px; }
.help strong { color: var(--ink); }
.help .keyboard { font-size: .86rem; }
.game {
  min-width: 0;
  border: 1px solid #47757a;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 28px 66px #02131891;
}
.indicators {
  display: grid;
  grid-template-columns: .64fr 1fr 1fr;
  padding: 12px 16px;
  gap: clamp(9px, 2vw, 28px);
}
.indicator { min-width: 0; display: grid; gap: 2px; color: var(--muted); font-size: .86rem; }
.indicator strong { color: var(--ink); font-size: 1.19rem; font-variant-numeric: tabular-nums; line-height: 1.18; }
progress { width: 100%; height: 7px; accent-color: #81d6e9; }
#garden-bar { accent-color: #a5d59e; }
.board {
  isolation: isolate;
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  background: #d5d9cc url('../acqua_img/piazza.webp') center / cover no-repeat;
}
canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
canvas:focus-visible { outline-offset: -4px; outline-color: #143e51; }
.board.playing canvas { touch-action: none; cursor: crosshair; }
.map-tag {
  position: absolute;
  pointer-events: none;
  translate: -50% 0;
  padding: 2px 7px;
  border-radius: 3px;
  background: #163338;
  color: #f5fbfa;
  letter-spacing: .01em;
  font-size: clamp(.65rem, 1.5vw, .86rem);
  white-space: nowrap;
}
.source { top: 3%; }
.ground { left: 19%; background: #67442d; }
.air { left: 50%; background: #3c4a63; }
.outside { left: 81%; background: #46345a; }
.drain { top: 62%; }
.west { left: 9%; }
.east { left: 91%; }
.garden { bottom: 3%; left: 50%; background: #294d38; }
.board-message {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: max-content;
  max-width: 86%;
  padding: .64em .9em;
  text-align: center;
  color: #fff;
  background: #0c303b;
  border-radius: 5px;
  box-shadow: 0 2px 10px #142a3964;
  pointer-events: none;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 12px 14px 6px; }
.modes { display: flex; gap: 7px; }
.toolbar button {
  min-height: 42px;
  padding: 5px 13px;
  border: 1px solid #4a7478;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  font-size: .92rem;
}
.toolbar button:hover { border-color: var(--accent); }
.modes [aria-pressed="true"] { color: #0c3038; background: var(--accent); border-color: var(--accent); font-weight: 740; }
.audio[aria-pressed="false"] { color: var(--muted); }
.status, .result { margin: 0; padding: 5px 15px 12px; color: var(--muted); font-size: .9rem; }
.result { border-top: 1px solid var(--line); padding-top: 12px; }
.result h2 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.result p { margin: 0; }
.project {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(25px, 5vw, 85px);
  padding: 30px 0;
}
.project h2 { margin-bottom: 10px; font: 400 2.25rem/1.1 Georgia, serif; }
.project h3 { margin-bottom: 8px; font-size: 1rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 18px; font-size: .87rem; }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 36px); }
  .play-layout, .project { grid-template-columns: 1fr; gap: 24px; }
  .play-layout { padding-block: 30px; }
  h1 { font-size: clamp(3.45rem, 11vw, 5.3rem); }
  h1 br { display: none; }
  .help { margin-top: 16px; max-width: none; }
  .intro > p { max-width: 48ch; }
}
@media (max-width: 460px) {
  .wrap { width: calc(100% - 26px); }
  nav { gap: 10px; font-size: .83rem; }
  .brand { letter-spacing: .05em; font-size: .91rem; }
  .drop { width: 15px; height: 15px; }
  .indicators { padding: 9px 10px; }
  .indicator { font-size: .77rem; }
  .toolbar button { padding-inline: 9px; }
}
