/* Nunito (SIL OFL 1.1, see vendor/nunito/OFL.txt) */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap; src: url(vendor/nunito/nunito-latin.woff2) format('woff2'); }
:root {
  --cream: rgba(255, 249, 236, 0.92);
  --wood: #c99b6b;
  --wood-dark: #9b6d43;
  --ink: #5b3a1e;
  --ink-soft: #8a6646;
  --accent: #e35b4f;
  --accent-dark: #b9443a;
  --gold: #f2b53a;
  --shadow: 0 3px 0 rgba(120, 80, 40, 0.22), 0 10px 24px rgba(60, 40, 20, 0.16);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #8cc35c; color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'PingFang TC', sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { z-index: 2; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.card {
  background: var(--cream);
  border: 2px solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 6px; border: 1.5px solid var(--wood);
  background: #fffdf6; box-shadow: 0 2px 0 var(--wood);
  font: 800 12px/1 'Nunito', sans-serif; color: var(--ink);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px;
  pointer-events: none;
  padding-right: 148px; /* room for the corner buttons */
}
#hud > .card { padding: 6px 14px; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.hud-left { justify-self: start; }
.hud-mid { justify-self: center; font-size: 20px; }
.hud-mid small { font-size: 13px; color: var(--ink-soft); margin-left: 3px; font-weight: 800; }
.hud-right { justify-self: end; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 22px; }
.stat svg { width: 28px; height: 28px; }
.chip {
  background: var(--gold); color: #fff; font-weight: 900; font-size: 15px;
  padding: 2px 9px; border-radius: 999px; box-shadow: 0 2px 0 #c98d1c;
}
.chip.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }

.corner {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 16px;
  display: flex; gap: 8px; z-index: 15; /* above the title, pause and end cards (sound can be switched there too), below the leaderboard */
}
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--cream); border: 2px solid var(--wood); border-radius: 12px;
  box-shadow: 0 3px 0 rgba(120, 80, 40, 0.25); color: var(--ink); padding: 0;
}
.icon-btn:hover { background: #fffdf6; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 80, 40, 0.25); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .off { display: none; }
.icon-btn[aria-pressed="false"] { color: var(--ink-soft); opacity: 0.8; }
.icon-btn[aria-pressed="false"] .off { display: inline; }

.hint {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%); padding: 10px 18px; font-size: 16px; font-weight: 800;
  pointer-events: none; text-align: center; max-width: calc(100vw - 32px);
  animation: hintIn 0.35s ease-out;
}
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } }

#popups { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.popup {
  position: absolute; left: 0; top: 0; font-weight: 900; font-size: 22px; white-space: nowrap;
  color: #fff; text-shadow: 0 2px 0 rgba(90, 55, 20, 0.45), 0 0 10px rgba(255, 200, 80, 0.6);
}
.popup.gold { color: #fff3c4; }
.popup.grey { color: #eef0f5; font-size: 16px; text-shadow: 0 2px 0 rgba(40, 40, 60, 0.4); }
.popup.green { color: #e7ffd0; text-shadow: 0 2px 0 rgba(40, 80, 20, 0.5), 0 0 10px rgba(160, 255, 120, 0.6); }

/* ---------- screens ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(70, 50, 20, 0.12), rgba(50, 35, 15, 0.42));
  z-index: 10; animation: fade 0.3s ease-out; overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(460px, 100%); padding: 26px 28px 22px; text-align: center;
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  animation: rise 0.35s cubic-bezier(.2, 1.3, .5, 1);
}
.panel.small { width: min(340px, 100%); }
@keyframes rise { from { transform: translateY(16px) scale(0.97); } }
h1 { margin: 0 0 4px; font-size: 38px; font-weight: 900; letter-spacing: 0; color: var(--ink); white-space: nowrap; }
h1::after { content: ''; display: block; width: 64px; height: 4px; margin: 6px auto 0; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, #fdf8ee 10px 20px); box-shadow: 0 0 0 1px rgba(155, 109, 67, 0.35); }
h2 { margin: 0 0 12px; font-size: 26px; font-weight: 900; }
.tag { margin: 8px 0 16px; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.how { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; display: grid; gap: 9px; font-weight: 700; font-size: 14.5px; }
.how li { display: flex; align-items: center; gap: 10px; }
.keys { display: inline-flex; gap: 4px; flex: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; margin: 0 4px; }
.dot.gold { background: #ffd86a; box-shadow: 0 0 10px #ffc94a; }
.dot.warm { background: #ffe7a6; box-shadow: 0 0 10px #ffdf8a; border: 1.5px solid #e8c468; }
.dot.red { background: var(--accent); }
.big-btn {
  min-height: 48px; padding: 10px 34px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 4px 0 var(--accent-dark);
}
.big-btn:hover { filter: brightness(1.05); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.big-btn.ghost { background: #fffdf6; color: var(--ink); border: 2px solid var(--wood); box-shadow: 0 4px 0 var(--wood); }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.best { margin: 14px 0 0; color: var(--ink-soft); font-weight: 800; font-size: 14px; min-height: 1em; }
.sub { margin: 14px 0 0; color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.newbest { margin: -4px 0 10px; color: var(--accent); font-weight: 900; font-size: 18px; animation: pop 0.6s ease-out; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.stats div { background: #fffdf6; border: 1.5px solid #ecdcc3; border-radius: 12px; padding: 8px; }
.stats dt { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 900; }
.score { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.score b { font-size: 30px; color: var(--accent); margin-left: 6px; }

@media (max-width: 640px) {
  #hud { left: 10px; right: 10px; padding-right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 52px); gap: 6px; }
  #hud > .card { padding: 4px 10px; min-height: 40px; }
  .corner { right: 10px; }
  .hud-mid { font-size: 17px; }
  .stat { font-size: 19px; }
  h1 { font-size: clamp(26px, 8.4vw, 34px); }
  .panel { padding: 20px 18px 18px; }
  .how { font-size: 13.5px; }
}

/* ---------- online leaderboard ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.row-btns .big-btn { padding-left: 24px; padding-right: 24px; }
.post { margin: 12px 0 0; padding: 12px 12px 10px; border-radius: 12px; background: rgba(255, 253, 246, 0.8); border: 1.5px dashed var(--wood); }
.post-rank { margin: 0 0 8px; font-weight: 800; font-size: 15px; }
.post-form { display: flex; gap: 8px; justify-content: center; }
.post-form[hidden] { display: none; }
.post-form input {
  flex: 1; min-width: 0; max-width: 180px; min-height: 44px; padding: 6px 12px; border-radius: 12px;
  border: 2px solid var(--wood); background: #fffdf6; color: var(--ink); font-weight: 800; font-size: 16px; line-height: 1.2; font-family: inherit; text-align: center;
}
.post-form input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.mid-btn {
  min-height: 44px; padding: 6px 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 900; font-size: 16px; line-height: 1; font-family: inherit; box-shadow: 0 3px 0 var(--accent-dark);
}
.mid-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }
.mid-btn:disabled { opacity: 0.6; cursor: default; }
.post-msg { margin: 8px 0 0; min-height: 1.2em; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.post-msg:empty { display: none; }
.post-msg.bad { color: var(--accent-dark); }
.overlay.top { z-index: 20; background: rgba(50, 35, 15, 0.5); }
/* solid, not see-through like the other cards: the end card is right behind it */
.board-panel { display: flex; flex-direction: column; padding-bottom: 20px; background: #fff9ec; }
.board-panel .big-btn { align-self: center; }
.board-panel h2 { margin: 0 0 8px; }
.board-state { margin: 0; min-height: 1.4em; color: var(--ink-soft); font-weight: 700; font-size: 14.5px; }
.board-state:empty { display: none; }
.board-list { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; max-height: min(46dvh, 380px); overflow: auto; overscroll-behavior: contain; border-radius: 10px; }
.board-list:empty { display: none; }
.board-list li { display: grid; grid-template-columns: 36px 30px 1fr auto; gap: 8px; align-items: center; padding: 7px 12px; font-weight: 800; font-size: 15px; border-bottom: 1px dashed rgba(155, 109, 67, 0.35); }
.board-list li:last-child { border-bottom: 0; }
.board-list .rk { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .sc { font-variant-numeric: tabular-nums; }
.board-list li.me { background: rgba(242, 181, 58, 0.28); border-radius: 8px; }
.board-me { margin: 8px 0 0; padding: 7px 12px; border-radius: 8px; background: rgba(242, 181, 58, 0.28); font-weight: 800; font-size: 14.5px; }
.board-account { margin: 14px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.board-account small { font-size: 12.5px; }
/* Google's sign-in button, light theme, as its branding guide asks */
.g-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 22px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; text-decoration: none; font: 500 14px/20px Roboto, Arial, sans-serif;
}
.g-btn:hover { background: #f6f8fa; }
.g-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.g-btn svg { width: 18px; height: 18px; flex: none; }
.link-btn { min-height: 32px; padding: 2px 6px; border: 0; background: none; cursor: pointer; color: var(--accent-dark); font-weight: 800; font-size: 14px; line-height: 1; font-family: inherit; text-decoration: underline; }
.plain-link { color: var(--ink-soft); font-weight: 800; }
.plain-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.post-who { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.post-who[hidden] { display: none; }
.post-who .or { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 13px; }
.post-who .or::before, .post-who .or::after { content: ''; flex: 1; border-top: 1.5px dashed var(--wood); }
.av { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--wood); object-fit: cover; background: #fffdf6; flex: none; display: block; }
.av.dflt { display: grid; place-items: center; }
.av.dflt svg { width: 17px; height: 17px; }
.who { display: inline-flex; align-items: center; gap: 8px; }


/* ---------- Little Rain Cloud ---------- */
:root { --sky: #7fc6f2; --sky-dark: #3f86b8; --leaf: #58b368; }
.panel.card { background: rgba(255, 249, 236, 0.97); }
.board-panel.card { background: #fff9ec; }
button, a { -webkit-tap-highlight-color: transparent; }
h1::after { background: repeating-linear-gradient(90deg, var(--sky) 0 10px, #fdf8ee 10px 20px); box-shadow: 0 0 0 1px rgba(63, 134, 184, 0.4); }
#hud-score { font-variant-numeric: tabular-nums; }
.stat svg { width: 26px; height: 26px; }
/* the clock: a little arc the sun climbs over, and the time beside it */
.hud-mid { gap: 8px; }
.dial { width: 64px; height: 34px; display: block; overflow: visible; }
.clock { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 4.6em; text-align: left; white-space: nowrap; }
.clock.late { color: var(--accent-dark); }
/* the water in the cloud */
.water { display: flex; align-items: center; gap: 6px; }
.water svg { width: 24px; height: 24px; flex: none; }
.gauge { position: relative; width: 120px; height: 16px; border-radius: 999px; background: #f3e7d2; border: 2px solid var(--wood); overflow: hidden; }
#hud-water-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #5fb0e6, #a9dcff); transition: width 0.15s; }
.gauge.empty { animation: lowPulse 0.9s ease-in-out infinite; }
.gauge.full #hud-water-fill { background: linear-gradient(90deg, #4a9ad6, #7fc6f2); }
@keyframes lowPulse { 50% { box-shadow: 0 0 0 3px rgba(63, 134, 184, 0.4); } }
.popup.big { font-size: 27px; }
.popup.gold { color: #fff3c4; text-shadow: 0 2px 0 rgba(120, 70, 20, 0.6), 0 0 12px rgba(255, 190, 70, 0.8); }
.popup.soft { color: #ffffff; font-size: 17px; text-shadow: 0 2px 0 rgba(60, 90, 30, 0.6), 0 0 8px rgba(80, 120, 40, 0.5); }
.popup.bad { color: #fff0e6; font-size: 18px; text-shadow: 0 2px 0 rgba(150, 60, 20, 0.75), 0 0 8px rgba(200, 90, 40, 0.6); }
.popup.grey { color: #f4f6fa; font-size: 15px; text-shadow: 0 2px 0 rgba(40, 50, 70, 0.6); }
.dot.pond { background: var(--sky); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--sky-dark); }
.dot.bloom { background: #f27ea9; box-shadow: 0 0 0 3px #ffd35a; }
.how li { align-items: flex-start; line-height: 1.35; }
.how .keys, .how .dot { margin-top: 1px; }
.how .keys { min-width: 176px; }
.how .dot { margin-left: 8px; margin-right: 8px; }
.col-btns { display: grid; gap: 10px; }
.big-btn, .mid-btn, .icon-btn, .link-btn { touch-action: manipulation; }
.link-btn { min-height: 44px; }
.board-account .plain-link { display: inline-block; padding: 13px 6px; margin: -13px 0; }
.board-state .link-btn { min-height: 44px; }

/* sunrise and sunset: a warm wash over the garden */
/* sunrise and sunset: rose at the top of the screen melting into gold and a touch of lilac below. Soft-light blending
   warms the colours under it without greying them (main.js also turns the lawn's hue back towards green so the low
   golden sun cannot make it olive), and a rosy glow sits over the far edge like the evening sky */
.tint { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0; mix-blend-mode: soft-light;
  background: linear-gradient(180deg, rgba(255, 70, 140, 0.55) 0%, rgba(255, 150, 110, 0.28) 45%, rgba(170, 140, 255, 0.18) 100%); }
.glow { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 150, 175, 0.42) 0%, rgba(255, 190, 150, 0.16) 18%, rgba(255, 210, 170, 0) 34%); }

/* signs over the garden */
#marks { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
/* a bed whose plants are drooping: a drop with "!" in a bubble, bobbing (with the droop and the colour, never colour alone) */
.need { position: absolute; left: 0; top: 0; width: 34px; height: 38px; margin: -38px 0 0 -17px; }
.need svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 0 rgba(90, 55, 20, 0.35)); }
.need.urgent { animation: bob 0.6s ease-in-out infinite; }
.need.dry { opacity: 0.85; width: 26px; height: 29px; margin: -29px 0 0 -13px; }
@keyframes bob { 50% { translate: 0 -4px; } }
/* the first steps: "Drink here" over the pond, then "Rain here" over the first bed */
.guide { position: absolute; left: 0; top: 0; translate: -50% 10px; white-space: nowrap; padding: 6px 12px 7px; border-radius: 12px; background: #fffdf6; border: 2px solid var(--wood);
  font-weight: 900; font-size: 15px; color: var(--ink); box-shadow: 0 3px 0 rgba(120, 80, 40, 0.25); animation: bob 0.9s ease-in-out infinite; }
.guide::after { content: ''; position: absolute; left: 50%; top: -8px; width: 12px; height: 12px; margin-left: -7px; background: #fffdf6; border: solid var(--wood); border-width: 2px 0 0 2px; rotate: 45deg; }
.guide.sky { border-color: var(--sky-dark); }
.guide.sky::after { border-color: var(--sky-dark); }

/* the hint under the garden */
.hint { bottom: max(14px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 32px); line-height: 1.3; padding: 8px 16px; font-size: 15.5px; z-index: 4; }

/* the Rain button: bottom right, big enough for a thumb; the blue inside rises and falls with the cloud's water */
.rain-btn {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 5;
  width: 88px; height: 88px; border-radius: 50%; padding: 0; display: grid; place-items: center; align-content: center; gap: 0; overflow: hidden;
  background: var(--cream); border: 3px solid var(--wood); box-shadow: 0 4px 0 rgba(120, 80, 40, 0.3); color: var(--ink);
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.rain-fill { position: absolute; inset: auto 0 0 0; height: 0%; background: linear-gradient(0deg, rgba(95, 176, 230, 0.55), rgba(169, 220, 255, 0.45)); transition: height 0.15s; }
.rain-btn svg { position: relative; width: 42px; height: 42px; }
.rain-btn .rain-word { position: relative; font-weight: 900; font-size: 14px; line-height: 1; margin-top: -2px; }
.rain-btn:active, .rain-btn.go { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120, 80, 40, 0.3), 0 0 0 4px rgba(127, 198, 242, 0.55); border-color: var(--sky-dark); }
.rain-btn.empty .rain-word { color: var(--ink-soft); }

/* the corner buttons stay usable over the title, pause and end cards: on a narrow or short window those cards keep below them */
@media (max-width: 800px), (max-height: 640px) {
  .overlay:not(.top) { padding-top: calc(max(12px, env(safe-area-inset-top)) + 54px); align-items: start; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 70px); margin-block: auto; }
}
@media (max-width: 640px) {
  #hud { grid-template-columns: auto 1fr auto; }
  #hud > .card { min-width: 0; padding: 4px 9px; gap: 6px; }
  .chip { font-size: 13.5px; padding: 2px 7px; }
  .gauge { width: 70px; height: 14px; }
  .dial { width: 46px; height: 25px; }
  .clock { font-size: 13.5px; min-width: 0; }
  .hud-mid { gap: 5px; }
  .stat svg { width: 22px; height: 22px; }
  .how .keys { min-width: 112px; }
  .wide-only { display: none; }
  .tag { margin-bottom: 12px; } .how { margin-bottom: 14px; gap: 7px; }
  .rain-btn { width: 82px; height: 82px; }
}
/* a phone held upright: the end card's day in one row and its two buttons side by side, so the name box, Sign in,
   Play again and Leaderboard all fit without scrolling */
@media (max-width: 440px) {
  #over .panel { padding: 14px 14px 14px; }
  #over h2 { margin-bottom: 8px; font-size: 23px; }
  #over .stats { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 6px; }
  #over .stats div { padding: 5px 2px 4px; display: flex; flex-direction: column; justify-content: space-between; }
  #over .stats dt { font-size: 9.5px; letter-spacing: 0.2px; line-height: 1.15; }
  #over .stats dd { font-size: 19px; }
  #over .post { margin-top: 8px; padding: 10px 10px 8px; }
  #over .row-btns { flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
  #over .row-btns .big-btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 17px; }
}
/* a short window (a phone on its side): a slimmer score bar, and a title card that fits */
@media (max-height: 480px) {
  #hud > .card { min-height: 40px; padding: 3px 10px; }
  .hint { font-size: 14px; padding: 6px 12px; }
  .panel { padding: 14px 18px 14px; }
  h1 { font-size: 28px; }
  .tag { margin: 4px 0 8px; font-size: 14px; }
  .how { gap: 4px; margin-bottom: 8px; font-size: 13px; }
  .row-btns { margin-top: 8px; }
  .best { margin-top: 8px; }
  /* the title card goes wide, with its four lines in two columns, so Play stays on screen */
  #title .panel { width: min(700px, 100%); }
  h1::after { display: none; }
  #title .how { grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 6px; }
  #title .how li { line-height: 1.3; }
  #title .how li:has(.keys) { flex-direction: column; gap: 3px; }
  #title .how .keys { min-width: 0; }
  body.touch .wide-only { display: none; }
  /* the end card goes wide too, in two columns: the day and the score on the left, the leaderboard and the buttons on the right */
  #over .panel { width: min(720px, 100%); display: grid; grid-template-columns: 1fr 1.15fr; column-gap: 16px; align-content: start; }
  #over .panel > * { grid-column: 1; }
  #over h2 { grid-row: 1; margin-bottom: 4px; font-size: 22px; }
  #over .newbest { grid-row: 2; margin: 0 0 4px; }
  #over .stats { grid-row: 3; gap: 6px; margin-bottom: 4px; }
  #over .stats div { padding: 3px 6px; }
  #over .stats dd { font-size: 19px; }
  #over .score { grid-row: 4; margin: 2px 0 0; }
  #over .best { grid-row: 5; margin-top: 0; }
  #over .post { grid-column: 2; grid-row: 1 / 5; margin: 0; padding: 8px 10px 6px; align-self: start; }
  #over .row-btns { grid-column: 2; grid-row: 5 / 7; margin-top: 8px; }
}

/* the thumb stick (phones and tablets only, src/stick.js): faint in the bottom left corner while a run is on, until a finger
   goes down on the game view; then it sits under that finger and the knob follows it (never out of the ring). It takes no
   touches itself: the game view under it does */
.stick { display: none; position: fixed; z-index: 4; left: calc(max(12px, env(safe-area-inset-left)) + 12px); bottom: max(18px, env(safe-area-inset-bottom));
  width: 112px; height: 112px; border-radius: 50%; pointer-events: none; opacity: 0.55; transition: opacity 0.15s ease;
  border: 3px solid rgba(255, 253, 246, 0.9); background: radial-gradient(circle, rgba(91, 58, 30, 0.10), rgba(91, 58, 30, 0.28));
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.2); }
body.touch .stick:not([hidden]) { display: block; }
.stick.held { bottom: auto; translate: -50% -50%; opacity: 1; transition: none; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
  background: #fffdf6; border: 2px solid var(--wood); box-shadow: var(--shadow); }
.stick.held .stick-knob { border-color: var(--accent); }
/* the word under the resting stick, until the first time a finger takes it */
.stick-word { position: absolute; left: 50%; top: calc(100% + 4px); translate: -50% 0; white-space: nowrap; font-family: inherit; font-weight: 800; font-size: 12px; line-height: 1;
  color: #fffdf6; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.stick.held .stick-word, .stick.used .stick-word { display: none; }
/* phones and tablets: the hint sits right on top of the resting stick, under the garden (main.js keeps the garden above
   it, or moves the hint beside the stick and the Rain button when they sit beside the garden) */
body.touch .hint { bottom: max(132px, calc(env(safe-area-inset-bottom) + 126px)); }
@media (max-width: 640px) { body.touch .hint { font-size: 13px; line-height: 1.25; padding: 5px 12px; } }
body.touch .hint.beside { bottom: max(14px, env(safe-area-inset-bottom)); max-width: calc(100vw - 280px); }
/* a narrow phone (375 wide and under): with the "×3" chip up, the score, the clock and the water gauge ran into each other */
@media (max-width: 400px) {
  #hud { gap: 4px; }
  #hud > .card { padding: 4px 7px; gap: 4px; }
  .gauge { width: 46px; }
  .dial { width: 36px; height: 20px; }
  .clock { font-size: 12.5px; }
  .hud-mid { justify-self: center; }
}
