/* Self-hosted so the game works offline and behind school web filters.
   Baloo 2 is a variable font (SIL Open Font License), latin subset. */
@font-face {
  font-family: 'Baloo 2';
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo2.woff2) format('woff2');
}

:root {
  --ink: #1f2a2c;
  --water: #2f7f8c;
  --wood: #a0682f;
  --paper: #fff7e4;
  --panel: rgba(18, 52, 58, 0.72);
  font-family: 'Baloo 2', 'Comic Sans MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe3f2; color: #fff; }
button, textarea { font: inherit; }
button { cursor: pointer; }
kbd {
  font: 700 0.85em/1 ui-monospace, monospace;
  padding: 0.15em 0.4em;
  border-radius: 0.3em;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }

#pond { position: fixed; inset: 0; }
#pond canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }

/* ---------- HUD ---------- */
#hud-top, #hud-bottom {
  position: fixed; left: 0; right: 0;
  display: flex; align-items: center;
  padding: 1.6vh 2vh;
  pointer-events: none;
}
#hud-top { top: 0; }
#hud-bottom { bottom: 0; justify-content: center; gap: 2vh; }
#hud-top > *, #hud-bottom > * { pointer-events: auto; }

#toolbar { display: flex; gap: 1vh; }
#toolbar button {
  width: 6.4vh; height: 6.4vh; min-width: 40px; min-height: 40px;
  display: grid; place-items: center;
  border: none; border-radius: 1.6vh;
  background: var(--panel); color: #fff;
  font-size: 3vh;
}
#toolbar button:hover { background: rgba(18, 52, 58, 0.9); }

#message {
  position: absolute; left: 50%; top: 1.6vh;
  transform: translateX(-50%);
  padding: 0.6vh 2.4vh;
  border-radius: 99px;
  background: var(--panel);
  font-size: max(16px, 2.8vh); font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
#message:empty { display: none; }

#counts {
  position: absolute; left: 2vh; bottom: 2vh;
  padding: 0.6vh 2vh;
  border-radius: 1.6vh;
  background: var(--panel);
  font-size: max(15px, 2.5vh); font-weight: 700; line-height: 1.25;
}
#counts b { font-size: 1.2em; }

.big, #throw-back, .primary, .panel button {
  border: 0.45vh solid var(--ink);
  border-radius: 1.6vh;
  box-shadow: 0 0.6vh 0 var(--ink);
  font-weight: 800;
}
.big {
  padding: 1.2vh 4vh;
  background: #ffcf4a; color: var(--ink);
  font-size: max(20px, 4.2vh);
}
.big:hover, #throw-back:hover, .primary:hover { filter: brightness(1.06); }
.big:active, #throw-back:active, .primary:active, .panel button:active { transform: translateY(0.4vh); box-shadow: 0 0.2vh 0 var(--ink); }
.big:disabled { opacity: 0.55; cursor: default; }
#throw-back {
  position: absolute; right: 2vh; bottom: 2.4vh;
  padding: 0.8vh 2.4vh;
  background: var(--paper); color: var(--ink);
  font-size: max(16px, 2.6vh);
}

/* ---------- Menu and cards ---------- */
.overlay {
  position: fixed; inset: 0;
  display: flex;
  padding: 3vh;
  background: rgba(16, 44, 50, 0.45);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.panel, .card {
  width: min(640px, 100%);
  margin: auto;
  padding: 24px 32px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 0 var(--ink);
}
.card { text-align: center; width: min(520px, 100%); }
.card h1 { margin: 0 0 6px; font-size: 2.2rem; line-height: 1.1; }
.card p { margin: 0 0 20px; font-size: 1.2rem; }

.logo { margin: 0; font-size: 3rem; line-height: 1; color: var(--water); }
.tagline { margin: 8px 0 16px; font-size: 1.15rem; line-height: 1.35; }
.label { display: block; font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: #fff; color: var(--ink);
  font-size: 1.15rem; line-height: 1.35;
  resize: vertical;
}
textarea:focus { outline: 3px solid #ffcf4a; outline-offset: 2px; }
.hint { margin: 4px 2px 10px; color: #5b5546; font-size: 1rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 1.1rem; line-height: 1.3; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--water); flex: none; }
.buttons { display: flex; gap: 12px; margin: 18px 0 4px; }
.primary { padding: 10px 28px; background: #ffcf4a; color: var(--ink); font-size: 1.4rem; }
.panel button:not(.primary) { padding: 6px 16px; background: #fff; color: var(--ink); font-size: 1rem; }
#bucket-list h2 { margin: 14px 0 2px; font-size: 1.1rem; }
#bucket-names { margin: 0 0 10px; line-height: 1.4; }
.help { margin-top: 14px; font-size: 1rem; line-height: 1.4; }
.help summary { cursor: pointer; font-weight: 800; }
.help ul { padding-left: 1.2em; margin: 8px 0 0; }
.help li { margin-bottom: 4px; }
