/* 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: #0b1438; 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; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
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: 164px; /* 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;
  /* over the title, pause and end cards (10), so music and sound can be switched there too; the leaderboard (20) covers them */
  z-index: 11;
}
.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;
  /* every floating word is coloured and outlined in a dark colour: white words vanished on the snow in Snow Fort (2026-12-01) */
  --o: #5b3a1e; color: #ffd84a;
  text-shadow: 2px 0 0 var(--o), -2px 0 0 var(--o), 0 2px 0 var(--o), 0 -2px 0 var(--o),
    1.5px 1.5px 0 var(--o), -1.5px 1.5px 0 var(--o), 1.5px -1.5px 0 var(--o), -1.5px -1.5px 0 var(--o),
    0 4px 0 var(--o), 0 6px 10px rgba(30, 20, 10, 0.35);
}
/* ---------- screens ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(255, 240, 210, 0.15), rgba(60, 40, 20, 0.28));
  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: 44px; font-weight: 900; letter-spacing: 0.5px; color: var(--ink); }
h1::after { content: ''; display: block; width: 70px; height: 5px; margin: 6px auto 0; border-radius: 4px; background: repeating-linear-gradient(90deg, #e8892c 0 10px, var(--gold) 10px 20px); }
h2 { margin: 0 0 12px; font-size: 26px; font-weight: 900; }
.tag-line { 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: 36px; }
  .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-family: inherit; font-weight: 800; font-size: 16px; line-height: 1.2; 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-family: inherit; font-weight: 900; font-size: 16px; line-height: 1; 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(60, 40, 20, 0.42); }
/* 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: 44px; padding: 2px 8px; border: 0; background: none; cursor: pointer; color: var(--accent-dark); font-family: inherit; font-weight: 800; font-size: 14px; line-height: 1; 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: 22px; height: 22px; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Firework Show ---------- */
/* the end card says all of it */
body[data-card="over"] #hud { visibility: hidden; }
#hud-score { font-variant-numeric: tabular-nums; min-width: 34px; }
.stat b { font-weight: 900; }
/* the streak: the multiplier and six pips; grey until the first ×2 */
.combo { display: flex; align-items: center; gap: 6px; opacity: 0.55; transition: opacity 0.2s; }
.combo.on { opacity: 1; }
.combo b { font-weight: 900; font-size: 15px; color: #fff; background: #b9a58c; padding: 1px 8px; border-radius: 999px; box-shadow: 0 2px 0 #96826a; min-width: 34px; text-align: center; }
.combo.on b { background: var(--gold); box-shadow: 0 2px 0 #c98d1c; }
.combo.hot b { background: var(--accent); box-shadow: 0 2px 0 var(--accent-dark); }
.combo b.pop { animation: pop 0.4s ease-out; }
.pips { display: flex; gap: 3px; }
.pips i { width: 8px; height: 8px; border-radius: 50%; background: #ecdcc3; box-shadow: inset 0 1px 1px rgba(90, 55, 20, 0.25); transition: background 0.15s, transform 0.15s; }
.pips i.on { background: var(--gold); transform: scale(1.15); box-shadow: 0 0 6px rgba(242, 181, 58, 0.8); }
.combo.hot .pips i.on { background: var(--accent); box-shadow: 0 0 6px rgba(227, 91, 79, 0.7); }
/* the clock: time to midnight, and a bar that empties */
#hud > .hud-mid { flex-direction: column; gap: 3px; padding-top: 5px; padding-bottom: 6px; }
.clock-row { display: flex; align-items: center; gap: 5px; font-size: 20px; font-variant-numeric: tabular-nums; }
.clock-row b { font-weight: 900; min-width: 44px; }
.clock-row svg { width: 22px; height: 22px; }
.hud-mid.late .clock-row b { color: var(--accent); animation: pop 1s ease-out infinite; }
.bar { position: relative; width: 110px; height: 8px; border-radius: 999px; background: #ecdcc3; border: 1.5px solid var(--wood); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #e8892c, var(--gold)); transition: width 0.2s linear; }
.hud-mid.late .bar i { background: var(--accent); }
/* how-to-play markers on the title card */
.how li { align-items: center; line-height: 1.35; }
.ic { width: 26px; height: 26px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; }
.col-btns { display: grid; gap: 10px; }

/* floating words under the picture: gold for a perfect burst, cream for a good one, a big gold one for a picture,
   orange streak, rose for a miss; each with its own dark outline */
.popup.small { font-size: 17px; color: #d8f5b0; --o: #2f5a1e; }
.popup.big { font-size: 28px; color: #ffe36b; }
.popup.gold { color: #ffe36b; --o: #7a4a00; }
.popup.combo { font-size: 32px; color: #ffb340; --o: #6b2f00; }
.popup.grey { color: #d9efff; font-size: 18px; --o: #2a4a6e; }
.popup.green { color: #ffc8d8; --o: #8a2548; }
.popup.bad { color: #ffb3a6; --o: #7a1f14; }

/* the message strip: at the bottom over the near bank, on one line */
.banner {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); pointer-events: none; text-align: center; z-index: 4; width: max-content;
  padding: 8px 24px; border-radius: 18px; background: rgba(255, 249, 236, 0.95); border: 2px solid var(--wood); box-shadow: var(--shadow);
  animation: bannerIn 0.45s cubic-bezier(.2, 1.4, .5, 1); max-width: calc(100vw - 32px);
}
.banner b { font-size: 22px; font-weight: 900; color: var(--accent-dark); }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } }
.hint { width: max-content; bottom: max(20px, env(safe-area-inset-bottom)); }
.ends { margin: 0 0 6px; font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.ends:empty { display: none; }

@media (max-width: 640px) {
  #hud > .card { padding: 4px 9px; min-height: 48px; }
  .stat { font-size: 21px; }
  #hud > .hud-left { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
  .combo b { font-size: 12px; padding: 0 6px; min-width: 28px; }
  .pips i { width: 6px; height: 6px; }
  .clock-row { font-size: 18px; }
  .clock-row svg { width: 18px; height: 18px; }
  .bar { width: 84px; }
  .banner { bottom: max(12px, env(safe-area-inset-bottom)); padding: 6px 16px; }
  .banner b { font-size: 18px; }
  .hint { bottom: max(12px, env(safe-area-inset-bottom)); font-size: 14.5px; padding: 8px 14px; max-width: calc(100vw - 20px); }
  .how .keys { gap: 3px; }
  .how kbd { padding: 0 5px; font-size: 11.5px; }
  .row-btns .big-btn { padding-left: 16px; padding-right: 16px; font-size: 18px; }
  .stats { gap: 6px; margin-bottom: 8px; } .stats div { padding: 5px 8px; } .stats dd { font-size: 21px; }
  .tag-line { margin-bottom: 12px; } .how { margin-bottom: 14px; gap: 8px; }
  .popup { font-size: 19px; } .popup.big { font-size: 22px; } .popup.combo { font-size: 25px; }
}
/* phone held sideways: a low window; the sky fills the height, the messages go in the corner at the bottom */
@media (max-height: 420px) {
  #hud { top: max(8px, env(safe-area-inset-top)); left: 12px; right: 12px; padding-right: 160px; }
  #hud > .card { min-height: 42px; padding: 3px 10px; }
  #hud > .hud-left { flex-direction: row; align-items: center; }
  #hud > .hud-mid { flex-direction: row; align-items: center; gap: 8px; }
  .corner { top: max(8px, env(safe-area-inset-top)); }
  .panel { padding: 14px 18px 12px; }
  h1 { font-size: 30px; } .tag-line { margin: 4px 0 8px; } .how { gap: 4px; margin-bottom: 8px; font-size: 13px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  /* the end card in two halves side by side (the run on the left; posting and the buttons on the right), so
     everything shows without scrolling */
  .over-card { width: min(720px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; padding: 12px 16px; }
  .over-card h2 { font-size: 22px; margin-bottom: 4px; }
  .over-card .newbest { margin: 0 0 6px; font-size: 15px; }
  .over-card .stats { grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 6px; }
  .over-card .stats div { padding: 3px 8px; } .over-card .stats dd { font-size: 19px; } .over-card .stats dt { font-size: 11px; }
  .over-card .ends { font-size: 12.5px; margin-bottom: 2px; }
  .over-card .score { font-size: 16px; } .over-card .score b { font-size: 24px; }
  .over-card .best { margin-top: 4px; font-size: 12.5px; }
  .over-card .post { margin: 0; padding: 8px 10px; }
  .over-card .post-rank { margin-bottom: 6px; font-size: 13.5px; }
  .over-card .post-who { gap: 5px; margin-bottom: 6px; }
  .over-card .row-btns { margin-top: 10px; flex-wrap: nowrap; }
  .over-card .row-btns .big-btn { padding-left: 14px; padding-right: 14px; font-size: 17px; flex: 1; }
  /* bottom right, over the near bank (under the barges), never over the sky: the news and the hints take turns there */
  .banner { left: auto; right: 10px; bottom: 10px; transform: none; width: auto; max-width: min(44vw, 340px); padding: 6px 12px; text-align: left; }
  .banner b { font-size: 16px; }
  @keyframes bannerIn { from { opacity: 0; transform: translateY(10px); } }
  .hint { left: auto; right: 10px; bottom: 10px; transform: none; width: auto; max-width: min(44vw, 340px); font-size: 13px; padding: 7px 10px; animation: none; text-align: left; }
}

/* on a touch screen the number keys mean nothing: just "tap" */
@media (hover: none) and (pointer: coarse) { .how kbd.key-only { display: none; } }

/* ---------- the link to the other games (2026-11-27, the owner: no game led back to ossgolab.com) ----------
   Under the buttons of the title, pause and end cards: quiet, but a full-size target. Never on the game view. */
.more-games { display: flex; width: max-content; max-width: 100%; align-items: center; justify-content: center; gap: 5px; min-height: 44px; margin: 2px auto -8px; padding: 0 14px; border-radius: 14px;
  color: var(--ink-soft); font-weight: 800; font-size: 14.5px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.more-games b { color: var(--ink); font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--wood); }
.more-games svg { width: 16px; height: 16px; flex: none; transition: transform 0.15s; }
.more-games:hover { background: rgba(155, 109, 67, 0.12); color: var(--ink); }
.more-games:hover svg { transform: translateX(3px); }
.more-games:active { background: rgba(155, 109, 67, 0.22); }
.more-games:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
/* on the title card it is in the row of buttons: under them, or beside them on a short screen (just "More games") */
.row-btns > .more-games { flex: 0 0 100%; margin: -6px 0 -10px; }
@media (max-height: 480px) {
  .more-games { min-height: 44px; margin: 0 auto -8px; font-size: 13.5px; }
  .row-btns > .more-games { flex: 0 1 auto; margin: 0; align-self: center; padding: 0 8px; }
  .row-btns > .more-games .mg-at { display: none; }
  .row-btns > .more-games > span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--wood); }
}
/* a short screen (an upright phone, or a 1024×700 laptop window): the end card with the posting box already fills the screen (measured 2026-11-30: the link would
   make it scroll), so the link is left to the title and pause cards there */
@media (max-height: 720px) { #over .more-games { display: none; } }
@media (prefers-reduced-motion: reduce) { .more-games svg { transition: none; } }
/* a phone held upright with a short screen (375×667): the end card with the post box, the offline note and the
   longest title ("A perfect shift!") must still fit without scrolling */
@media (max-width: 640px) and (max-height: 760px) {
  .over-card h2 { font-size: 21px; margin-bottom: 4px; }
  .over-card .newbest { margin-bottom: 6px; }
  .over-card .post { margin-top: 8px; padding: 9px 10px 8px; }
  .over-card .post-rank { margin-bottom: 6px; font-size: 14px; }
  .over-card .post-who { gap: 6px; margin-bottom: 8px; }
}
/* a phone on its side (740×360, 667×375): the three HUD cards in one row that ends before the corner buttons
   (in Snow Fort, 2026-12-01: the hearts card ran under the music button). The row has to stay within the 58 px the view keeps
   free at the top (view.js frame()). */
@media (max-height: 420px) {
  #hud { display: flex; justify-content: space-between; gap: 8px; padding-right: 156px; }
  #hud > .card { min-height: 40px; padding: 3px 9px; gap: 7px; }
  .stat { font-size: 19px; }
  .combo { gap: 4px; } .combo b { font-size: 12.5px; padding: 0 6px; min-width: 28px; }
  .pips { gap: 2px; } .pips i { width: 6px; height: 6px; }
  .clock-row { font-size: 17px; } .clock-row b { min-width: 38px; } .clock-row svg { width: 17px; height: 17px; }
  .bar { width: 64px; }
}

/* ---------- 2026-12-01 review ---------- */
/* the leaderboard's Privacy link: a 44 px tall target (inline padding: the text around it does not move) */
.board-account .plain-link { padding: 14px 4px; margin: 0 -4px; }
/* a low screen: the title, pause and end cards start 8 px under the corner buttons, so the buttons are never covered */
@media (max-height: 480px) {
  .overlay:not(.top) { padding-top: calc(max(12px, env(safe-area-inset-top)) + 52px); }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 68px); }
}
@media (max-height: 420px) {
  .overlay:not(.top) { padding-top: calc(max(8px, env(safe-area-inset-top)) + 52px); padding-bottom: 8px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - 60px); }
  .over-card { padding-top: 8px; padding-bottom: 8px; }
  /* …and the title card a little tighter, so it still fits without scrolling (740×360: 280 px) */
  #title h1 { line-height: 1.15; }
  #title .row-btns { margin-top: 10px; }
  #title .how { margin-bottom: 6px; }
  #title .tag-line { margin-bottom: 6px; }
  #title .best { margin-top: 6px; line-height: 1.2; }
  #title .best:empty { display: none; }
}
/* a tap never scrolls, zooms or goes back a page; the cards' panels and the leaderboard list still scroll */
html, body { touch-action: none; overscroll-behavior: none; }
.panel, .board-list { touch-action: pan-y; }
button, a, input { touch-action: manipulation; }

/* ---------- Firework Show: this picture's card, the countdown, "Tap!", the Sky Book ---------- */
#hud > .hud-right { flex-direction: column; align-items: flex-end; gap: 3px; padding-top: 5px; padding-bottom: 6px; }
.picname { font-weight: 900; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.slots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.slots i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #c9a98a; background: #fff6f0; transition: background 0.2s, transform 0.2s; }
.slots i.on { background: var(--gold); border-color: #c98d1c; box-shadow: 0 0 6px rgba(242, 181, 58, 0.8); }
.slots i.on.perfect { background: #ffe36b; transform: scale(1.12); }
/* a missed point: a pale crossed circle (reads without colour too) */
.slots i.miss { background: linear-gradient(45deg, transparent 44%, #c9a98a 44% 56%, transparent 56%), #efe4dc; border-style: dashed; }
.hud-right.pop { animation: pop 0.45s ease-out; }
.hud-mid small { font-size: 12px; }
/* the countdown: a big number in the middle of the sky (no rockets are left then) */
.count { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); pointer-events: none; z-index: 3;
  font-weight: 900; font-size: min(26vh, 180px); line-height: 1; color: #fff4c8;
  text-shadow: 0 0 24px rgba(255, 210, 120, 0.85), 0 0 60px rgba(255, 170, 80, 0.55), 0 6px 0 rgba(60, 30, 10, 0.35); }
.count.beat { animation: beat 1s ease-out; }
@keyframes beat { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.92); } }
/* "Tap!" beside the very first rocket at the top */
.tapnow { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 3; padding: 4px 12px; border-radius: 999px;
  background: #fff4c8; color: var(--accent-dark); font-weight: 900; font-size: 18px; border: 2px solid var(--gold);
  box-shadow: 0 0 18px rgba(255, 210, 110, 0.8); animation: tapPulse 0.5s ease-in-out infinite alternate; }
@keyframes tapPulse { to { box-shadow: 0 0 4px rgba(255, 210, 110, 0.4); scale: 1.08; } }
.popup.picture { font-size: 30px; color: #ffe36b; --o: #5a2a00; }
/* the title and end card footers: the best score and the way into the Sky Book */
.title-foot, .over-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 12px; }
.title-foot span:empty { display: none; }
.book-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.book-btn > span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--wood); }
.book-btn:hover { color: var(--accent-dark); }
.book-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.ic { width: 26px; height: 26px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; }
.book-btn .ic { width: 22px; height: 22px; }
.ic-pic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Crect width='26' height='26' rx='6' fill='%23233066'/%3E%3Cpath d='M13 4 7.5 20.5 21.5 10.5h-17l14 10z' fill='none' stroke='%23ffd25a' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cg fill='%23fff4c8'%3E%3Ccircle cx='13' cy='4' r='2'/%3E%3Ccircle cx='4.5' cy='10.5' r='2'/%3E%3Ccircle cx='21.5' cy='10.5' r='2'/%3E%3Ccircle cx='7.5' cy='20.5' r='2'/%3E%3Ccircle cx='18.5' cy='20.5' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-moon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Crect width='26' height='26' rx='6' fill='%23233066'/%3E%3Cpath d='M15 4.5a8.5 8.5 0 1 0 6.5 13.5A9 9 0 0 1 15 4.5z' fill='%23ffe7a6'/%3E%3Cg stroke='%23ff8ad8' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M19 7v-3M19 7l2.2-2.2M19 7h3'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-book { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M3 6c3-1.5 6.5-1.5 10 0v15c-3.5-1.5-7-1.5-10 0z' fill='%23233066' stroke='%239b6d43' stroke-width='1.3' stroke-linejoin='round'/%3E%3Cpath d='M23 6c-3-1.5-6.5-1.5-10 0v15c3.5-1.5 7-1.5 10 0z' fill='%232c3a78' stroke='%239b6d43' stroke-width='1.3' stroke-linejoin='round'/%3E%3Cpath d='M8 9.5l.7 1.5 1.6.2-1.2 1.1.3 1.6L8 13.1l-1.4.8.3-1.6-1.2-1.1 1.6-.2z' fill='%23ffd25a'/%3E%3Cg fill='%23fff4c8'%3E%3Ccircle cx='16.5' cy='10' r='1.1'/%3E%3Ccircle cx='19.5' cy='13' r='1.1'/%3E%3Ccircle cx='16.5' cy='16' r='1.1'/%3E%3C/g%3E%3C/svg%3E"); }
.book-panel { width: min(560px, 100%); display: flex; flex-direction: column; padding-bottom: 20px; background: #fff9ec; }
.book-panel h2 { margin: 0 0 4px; }
.book-panel .big-btn { align-self: center; margin-top: 14px; }
.book-sum { margin: 0 0 10px; color: var(--ink-soft); font-weight: 700; font-size: 14.5px; }
.book-list { list-style: none; margin: 0; padding: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; overflow: auto; overscroll-behavior: contain; max-height: min(58dvh, 470px); border-radius: 10px; }
.book-list li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 8px; border-radius: 12px; background: #233066; color: #fff4c8; font-weight: 900; font-size: 14px; }
.book-list li.not { background: #e9dfd0; color: var(--ink-soft); }
.book-list li.fresh { box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(242, 181, 58, 0.6); }
.book-list svg { width: 68px; height: 68px; }
.book-list svg .ln line { stroke: #ffd25a; stroke-width: 2.6; stroke-linecap: round; opacity: 0.9; }
.book-list svg .pt circle { fill: #fff4c8; }
.book-list svg.not .ln line { stroke: #b8a690; stroke-width: 2; stroke-dasharray: 3 4; }
.book-list svg.not .pt circle { fill: #b8a690; }
.stars { display: flex; gap: 1px; font-size: 15px; line-height: 1; }
.stars i { font-style: normal; color: rgba(255, 244, 200, 0.3); }
.stars i.on { color: #ffd25a; text-shadow: 0 0 6px rgba(255, 210, 90, 0.7); }
.stars.none { font-size: 12px; font-weight: 800; }
@media (max-width: 640px) {
  .picname { font-size: 12.5px; }
  .slots { max-width: 104px; gap: 2px; } .slots i { width: 9px; height: 9px; }
  .hud-mid small { display: none; }
  .book-list { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .book-list svg { width: 54px; height: 54px; }
  .tapnow { font-size: 16px; }
}
@media (max-height: 420px) {
  #hud > .hud-right { flex-direction: row; align-items: center; gap: 6px; }
  .slots { max-width: 120px; } .slots i { width: 8px; height: 8px; }
  .picname { font-size: 12px; }
  .hud-mid small { display: none; }
  .book-list { grid-template-columns: repeat(6, 1fr); max-height: calc(100dvh - 150px); }
  .book-list svg { width: 44px; height: 44px; }
  .book-list li { font-size: 12px; padding: 4px; }
  .book-panel { width: min(700px, 100%); padding-top: 10px; }
  .book-panel .big-btn { margin-top: 8px; }
}
@media (max-width: 640px) and (max-height: 760px) { .book-list { max-height: calc(100dvh - 230px); } }

/* the end card: the score and the Sky Book side by side (one row less: the card fits a 375×667 phone and a phone on its side) */
.score-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 14px; row-gap: 0; }
.score-row .score, .score-row .best { margin-top: 0; margin-bottom: 0; }
/* a short upright phone: the cards start under the corner buttons */
@media (max-width: 640px) and (max-height: 760px) {
  .overlay:not(.top) { padding-top: calc(max(10px, env(safe-area-inset-top)) + 54px); padding-bottom: 8px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(10px, env(safe-area-inset-top)) - 62px); }
}
/* a phone on its side: the picture fills the height in the middle, so the news and the hints keep to the strip on its right */
@media (max-height: 420px) {
  .banner, .hint { max-width: calc(50vw - 162px); }
  .banner b { font-size: 14.5px; }
}
@media (max-height: 420px) {
  #title h1 { font-size: 27px; }
  #title .tag-line { margin: 2px 0 6px; }
  #title .how { gap: 2px; }
  #title .row-btns { margin-top: 6px; }
}
/* the picture card with the longest name and the most points (10) must stay inside its column: the points wrap into
   two rows on a phone, and on a phone on its side */
#hud > .hud-right { min-width: 0; max-width: 100%; }
.picname { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 640px) {
  .picname { font-size: 11.5px; }
  .slots { max-width: 66px; row-gap: 2px; }
}
@media (max-height: 420px) {
  .slots { max-width: 50px; gap: 2px; } .slots i { width: 8px; height: 8px; }
  .book-list svg { width: 34px; height: 34px; }
  .book-list li { font-size: 11.5px; padding: 3px 4px; gap: 0; }
  .book-list .stars { font-size: 12px; }
}
/* (its pop grows to the left, away from the corner buttons) */
.hud-right.pop { transform-origin: right center; }
/* a whole picture's name, big in the middle of it as it flashes */
.popup.name { font-size: 46px; color: #fff4c8; --o: #5a2a00; letter-spacing: 0.5px; }
@media (max-width: 640px), (max-height: 420px) { .popup.name { font-size: 34px; } }
/* on a phone the picture card sits a few px from the clock: its pop only swells a little, so it never covers the clock */
@keyframes pop-soft { 40% { transform: scale(1.05); } }
@media (max-width: 640px), (max-height: 420px) { .hud-right.pop { animation-name: pop-soft; } }
