/* 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: #2f8fb8; color: var(--ink); -webkit-tap-highlight-color: transparent;
  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; }
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; z-index: 5;
  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;
  /* (above the title, pause and end cards, z-index 10, so sound can be switched there too; under the leaderboard, 20) */
  display: flex; gap: 8px; 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;
  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(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; }
/* (a finger-sized target: the link is small text in a line) */
#board-account .plain-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; vertical-align: middle; margin: -12px 0; }
/* 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; }


/* ---------- Fish Snatch ---------- */
a, button, input { -webkit-tap-highlight-color: transparent; }
html, body { background: #2f8fb8; }
.panel.card { background: rgba(255, 249, 236, 0.97); }
.board-panel.card { background: #fff9ec; }
h1::after { background: repeating-linear-gradient(90deg, #ff8a3c 0 10px, #fdf8ee 10px 20px); box-shadow: 0 0 0 1px rgba(155, 109, 67, 0.35); }
.overlay { background: radial-gradient(ellipse at center, rgba(20, 60, 90, 0.08), rgba(10, 40, 70, 0.42)); }
.overlay.top { background: rgba(10, 40, 70, 0.55); }
/* the end card says all of it */
body[data-card="over"] #hud { visibility: hidden; }
.big-btn, .mid-btn, .icon-btn, .link-btn, .slide-btn { touch-action: manipulation; }
.col-btns { display: grid; gap: 10px; }
.tag { margin: 8px 0 16px; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.ends { margin: -4px 0 10px; font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.ends:empty { display: none; }

/* a fish, as a sign */
.fi { fill: #ff8a3c; stroke: #a8480f; stroke-width: 1.7; stroke-linejoin: round; flex: none; }
.fi .eye { fill: #14171f; stroke: none; }

/* ---------- HUD: every penguin's nest (left), the match (after it), the sound buttons (right corner) ---------- */
#hud { display: flex; align-items: flex-start; gap: 10px; grid-template-columns: none; left: 16px; right: 180px; padding: 0; }
.chips { display: flex; gap: 8px; }
.chip-p { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 4px 10px 4px 9px; background: var(--cream); border: 2px solid var(--wood); border-radius: 14px;
  box-shadow: var(--shadow); font-weight: 900; font-size: 15px; line-height: 1; white-space: nowrap; }
/* (the player's own: a thick edge in its colour) */
.chip-p.me { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.chip-p .hat { position: relative; width: 20px; height: 17px; margin-top: 5px; border-radius: 10px 10px 4px 4px; background: var(--c); box-shadow: inset 0 -5px 0 #fff3dc, 0 0 0 1.5px rgba(60, 40, 20, 0.45); flex: none; }
.chip-p .hat::after { content: ''; position: absolute; left: 50%; top: -6px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #fff3dc; box-shadow: 0 0 0 1.5px rgba(60, 40, 20, 0.45); }
.chip-p .nm { display: none; }
.chip-p .fishes { display: flex; gap: 3px; }
.chip-p .fi { width: 25px; height: 16px; fill: rgba(255, 253, 246, 0.6); stroke: #b39d80; stroke-dasharray: 3 2.4; }
.chip-p .fi .eye { display: none; }
.chip-p .fi.on { fill: #ff8a3c; stroke: #a8480f; stroke-dasharray: none; }
.chip-p .fi.on .eye { display: inline; }
.chip-p .fi.pop { animation: pop 0.45s ease-out; }
.chip-p.lead { background: #fff6d6; }
.info { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 5px 14px; font-size: 17px; font-weight: 900; line-height: 1; white-space: nowrap; }
.info > span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.info svg { width: 22px; height: 22px; flex: none; }
.info .fi { width: 28px; height: 18px; }
.info .time b { min-width: 2.3em; }
.info .time.late { color: var(--accent-dark); }
.info .pile.none { color: var(--accent-dark); }
.info .pile.none .fi { fill: rgba(255, 253, 246, 0.6); stroke: var(--accent-dark); stroke-dasharray: 3 2.4; }
.info .pile.pop { animation: pop 0.45s ease-out; }
@keyframes popSmall { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.info .pts { display: none; }
@media (min-width: 1200px) { .chip-p .nm { display: inline; } }
@media (min-width: 1380px) { .info .pts { display: inline-flex; } }

/* words over the ice: a dark edge all round so they read on snow and on the sea alike */
#popups { z-index: 3; }
.popup { font-size: 22px; color: #fff3c4; letter-spacing: 0.01em; -webkit-text-stroke: 6px #2a1606; paint-order: stroke fill; text-shadow: 0 3px 0 #2a1606, 0 4px 8px rgba(0, 0, 0, 0.45); }
.popup.gold { color: #ffc93a; font-size: 25px; }
.popup.bad { color: #ffd0c8; -webkit-text-stroke-color: #5a1a12; text-shadow: 0 3px 0 #5a1a12, 0 4px 8px rgba(0, 0, 0, 0.45); }
.popup.c1 { color: #bfdcff; } .popup.c2 { color: #c9f2c4; } .popup.c3 { color: #e3cdfb; }

/* names over the penguins while a match is getting ready */
#marks { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.tagname { position: absolute; left: 0; top: 0; translate: -50% -100%; padding: 3px 10px 4px; border-radius: 11px; background: var(--c); color: #fff; border: 2px solid #fffdf6;
  font-weight: 900; font-size: 15px; line-height: 1.1; white-space: nowrap; box-shadow: 0 3px 0 rgba(40, 30, 20, 0.3); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.tagname::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; margin-left: -6px; background: var(--c); border: solid #fffdf6; border-width: 0 2px 2px 0; rotate: 45deg; }

/* messages: one band under the HUD (never over the ice): the banner for what just happened, short hints */
.msgs { position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 52px); bottom: auto; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; z-index: 4; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.banner { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 7px 18px; border-radius: 16px; text-align: center; background: rgba(255, 249, 236, 0.96); border: 2px solid var(--wood); box-shadow: var(--shadow);
  animation: bannerIn 0.4s cubic-bezier(.2, 1.4, .5, 1); max-width: calc(100vw - 24px); line-height: 1.2; }
.banner b { font-size: 19px; font-weight: 900; }
.banner span { font-size: 15px; font-weight: 800; color: var(--ink-soft); }
.banner span:empty { display: none; }
.banner.win { border-color: var(--gold); background: #fff6d6; }
@keyframes bannerIn { from { opacity: 0; transform: scale(0.9); } }
.hint { position: static; transform: none; width: auto; max-width: calc(100vw - 24px); padding: 7px 16px; font-size: 15px; line-height: 1.25; animation: hintIn2 0.35s ease-out; }
@keyframes hintIn2 { from { opacity: 0; transform: translateY(-6px); } }

/* the wait before the next belly slide, for keys and the mouse: a small sign in the bottom left corner */
.slide-key { position: fixed; z-index: 4; left: 16px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-weight: 800; font-size: 15px; pointer-events: none; }
body.touch .slide-key { display: none; }
.slide-key .gauge { position: relative; display: block; width: 64px; height: 12px; border-radius: 999px; background: #f3e7d2; border: 2px solid var(--wood); overflow: hidden; }
.slide-key .gauge i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #f29a3a, #ffd36a); }
.slide-key.wait { color: var(--ink-soft); }
.slide-key.wait .gauge i { background: #c9b9a6; }

/* the belly-slide button (phones and tablets): bottom right, a ring round it that fills while it waits */
.slide-btn { display: none; position: fixed; z-index: 4; right: calc(max(12px, env(safe-area-inset-right)) + 18px); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 20px);
  width: 88px; height: 88px; border-radius: 50%; border: 0; padding: 0; background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--accent-dark), 0 8px 18px rgba(0, 0, 30, 0.3); }
body.touch .slide-btn:not([hidden]) { display: grid; place-items: center; }
.slide-btn .ring { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); pointer-events: none; }
.ring-bg { fill: none; stroke: rgba(255, 253, 246, 0.92); stroke-width: 6; }
.ring-on { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; }
.slide-btn .ico { width: 52px; height: 35px; margin-top: -14px; pointer-events: none; }
.slide-word { position: absolute; left: 0; right: 0; bottom: 11px; font-weight: 900; font-size: 15px; line-height: 1; pointer-events: none; }
.slide-btn.wait { background: #a99a8e; box-shadow: 0 5px 0 #7d6f64, 0 8px 18px rgba(0, 0, 30, 0.3); }
.slide-btn.wait .ico { opacity: 0.6; }
.slide-btn.down { transform: translateY(3px); }

/* how-to-play lines on the title card */
.how li { align-items: flex-start; line-height: 1.35; }
.how .keys, .how .dot { margin-top: 1px; }
.how .keys { min-width: 150px; flex-wrap: wrap; }
.touch-only { display: none; }
body.touch .touch-only { display: inline-grid; }
body.touch .wide-only { display: none; }
.how .dot { width: 150px; height: 24px; margin: 0; border-radius: 0; display: flex; align-items: center; justify-content: flex-start; padding-left: 4px; }
.how .dot .fi { width: 34px; height: 22px; }
.dot.d-nest::before { content: ''; width: 34px; height: 20px; border-radius: 7px; background: #d9effb; border: 3px solid #e0483f; box-shadow: 0 2px 0 rgba(60, 40, 20, 0.25); }

@media (max-width: 640px) {
  /* a phone held upright: the match beside the sound buttons, the nests in a row under them, then the messages */
  #hud { left: 10px; right: 10px; top: max(12px, env(safe-area-inset-top)); display: block; height: 0; }
  .info { position: absolute; left: 0; top: 0; padding: 4px 9px 4px 8px; gap: 6px; font-size: 16px; max-width: calc(100vw - 20px - 158px); }
  .info svg { width: 17px; height: 17px; } .info .fi { width: 22px; height: 14px; }
  .info > span { gap: 3px; } .info .time b { min-width: 2.05em; }
  .info .pile.pop { animation-name: popSmall; }
  .chips { position: absolute; left: 0; right: 0; top: 52px; gap: 4px; }
  .chip-p { flex: 1 1 0; min-width: 0; justify-content: center; padding: 3px 2px; gap: 4px; border-radius: 12px; }
  .chip-p .hat { width: 16px; height: 14px; }
  .chip-p .hat::after { width: 8px; height: 8px; margin-left: -4px; top: -5px; }
  .chip-p .fishes { gap: 2px; }
  .chip-p .fi { width: clamp(18px, 6vw, 25px); height: auto; aspect-ratio: 28 / 18; }
  /* (four nests in the row from match 3 on: smaller fish, still one row) */
  .chips[data-n="4"] .chip-p .fi { width: clamp(14px, 4.5vw, 22px); }
  .msgs { top: calc(max(12px, env(safe-area-inset-top)) + 102px); max-width: calc(100vw - 16px); }
  .banner { padding: 5px 12px; gap: 2px 8px; max-width: calc(100vw - 16px); } .banner b { font-size: 17px; }
  .hint { padding: 6px 12px; max-width: calc(100vw - 16px); }
  h1 { font-size: 36px; }
  .how { font-size: 14px; }
  .how .keys { min-width: 0; width: 86px; }
  .how .dot { width: 86px; }
  .how kbd { padding: 0 4px; font-size: 11px; }
  .tag { margin-bottom: 12px; } .how { margin-bottom: 14px; gap: 7px; }
  .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; }
  .popup { font-size: 18px; } .popup.gold { font-size: 20px; }
}
/* short screens (a phone held sideways): the nests in a column on the left, the match under the sound buttons on the
   right, the messages between them at the top; the ice has the whole height in the middle */
@media (max-height: 480px) {
  #hud { left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); top: 8px; display: block; height: 0; }
  .corner { top: 8px; right: max(10px, env(safe-area-inset-right)); }
  .chips { position: absolute; left: 0; top: 0; flex-direction: column; gap: 4px; width: 138px; }
  .chip-p { flex: none; min-height: 31px; padding: 1px 8px; gap: 8px; border-radius: 11px; justify-content: flex-start; }
  .chip-p .hat { width: 17px; height: 15px; margin-top: 4px; }
  .chip-p .fi { width: 25px; height: 16px; }
  .info { position: absolute; right: 0; left: auto; top: 52px; max-width: none; flex-direction: column; align-items: flex-start; gap: 5px; padding: 6px 10px; font-size: 16px; }
  .msgs { top: 8px; left: 164px; right: 174px; transform: none; width: auto; max-width: none; grid-template-columns: minmax(0, 1fr); }
  .banner, .hint { max-width: 100%; }
  .banner { padding: 4px 12px; } .banner b { font-size: 17px; }
  .hint { padding: 5px 12px; }
  .slide-key { left: 10px; bottom: 8px; }
  .panel { padding: 14px 18px 12px; }
  h1 { font-size: 30px; } h2 { font-size: 22px; margin-bottom: 6px; }
  h1::after { display: none; }
  .tag { margin: 4px 0 8px; font-size: 15px; }
  .how { font-size: 14px; gap: 4px 14px; margin-bottom: 8px; grid-template-columns: 1fr 1fr; }
  .how .keys { min-width: 0; width: auto; } .how .dot { width: auto; padding-right: 2px; }
  .row-btns { margin-top: 8px; }
  .best { margin-top: 6px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; } .stats div { padding: 4px 6px; } .stats dd { font-size: 19px; } .stats dt { font-size: 10.5px; }
  #title .panel { width: min(680px, 100%); }
}
/* the end card on a short, wide screen (a phone held sideways): two columns, so nothing is below the fold */
@media (max-height: 480px) and (min-width: 600px) {
  .over-panel { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1.1fr; gap: 0 18px; align-items: center; padding-top: 10px; padding-bottom: 9px; }
  .over-panel h2 { margin-bottom: 0; font-size: 21px; } .over-panel .stats { gap: 4px 6px; margin-bottom: 2px; } .over-panel .stats div { padding: 1px 6px; }
  .over-panel > * { grid-column: 1; }
  .over-panel h2 { grid-row: 1; } .over-panel .ends { grid-row: 2; margin: 0 0 4px; } .over-panel .newbest { grid-row: 3; margin: 0 0 4px; }
  .over-panel .stats { grid-row: 4; grid-template-columns: 1fr 1fr; } .over-panel .stats dt { font-size: 10px; letter-spacing: 0; }
  .over-panel .score { grid-row: 5; margin: 4px 0 0; } .over-panel .best { grid-row: 6; }
  .over-panel .post { grid-column: 2; grid-row: 1 / 5; margin: 0; padding: 8px 10px 6px; align-self: start; }
  .over-panel .row-btns { grid-column: 2; grid-row: 5 / 7; flex-wrap: nowrap; margin-top: 8px; }
  .over-panel .row-btns .big-btn { padding-left: 14px; padding-right: 14px; font-size: 17px; }
}
/* a laptop-height window (1024 × 700): the end card a little tighter so it fits with the posting box and the link */
@media (max-height: 720px) and (min-width: 641px) { .over-panel { padding-top: 14px; padding-bottom: 12px; } .over-panel h2 { margin-bottom: 6px; } .over-panel .stats { margin-bottom: 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.6; transition: opacity 0.15s ease;
  border: 3px solid rgba(255, 253, 246, 0.9); background: radial-gradient(circle, rgba(255, 240, 210, 0.10), rgba(255, 240, 210, 0.22));
  box-shadow: 0 2px 10px rgba(0, 0, 20, 0.3); }
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); }
.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.7); }
.stick.held .stick-word, .stick.used .stick-word { display: none; }
@media (prefers-reduced-motion: reduce) { .guide, .way.on { animation: 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 small upright phone: 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-width: 640px) and (max-height: 700px) { #over .more-games { display: none; } }
/* a phone held sideways: the same (measured 2026-12-01: with the "can't reach the leaderboard" line the card would scroll) */
@media (max-height: 480px) { #over .more-games { display: none; } }
@media (prefers-reduced-motion: reduce) { .more-games svg { transition: none; } }

/* a short screen (a phone held sideways): the title, pause and end cards start under the sound buttons in the corner
   (2026-12-01 review: the end card covered them), their bottom + 8px */
@media (max-height: 480px) {
  .overlay:not(.top) { padding-top: calc(max(12px, env(safe-area-inset-top)) + 44px + 8px); padding-bottom: 8px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 44px - 16px); }
}
/* a phone held upright: the end card is tall enough to reach the top too, so there as well the cards start under the
   sound buttons (2026-12-01: at 375 × 667 they stood on the end card's heading), and the end card a little tighter */
@media (max-width: 640px) and (min-height: 481px) {
  .overlay:not(.top) { padding-top: calc(max(12px, env(safe-area-inset-top)) + 44px + 8px); padding-bottom: 10px; }
  .overlay:not(.top) .panel { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 44px - 18px); }
}
@media (max-width: 640px) and (min-height: 481px) and (max-height: 760px) {
  .over-panel { padding-top: 14px; padding-bottom: 12px; }
  .over-panel h2 { margin-bottom: 4px; font-size: 23px; }
  .over-panel .stats { margin-bottom: 6px; } .over-panel .stats div { padding: 3px 8px; } .over-panel .stats dd { font-size: 19px; }
  .over-panel .post { margin-top: 8px; padding: 8px 10px; } .over-panel .post-rank { margin-bottom: 6px; }
  .over-panel .row-btns { margin-top: 10px; }
}

/* Fish Snatch: the ring stays in its corner while a finger drives it (it never covers the ice), its word is big enough to read */
.stick { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 22px); }
.stick.held { left: calc(max(12px, env(safe-area-inset-left)) + 12px) !important; top: auto !important; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 22px); translate: none; }
.stick-word { font-size: 15px; font-weight: 900; top: calc(100% + 5px); }
.stick.held .stick-word, .stick.used .stick-word { display: block; }
@media (max-height: 480px) { .stick, .stick.held { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 24px); } .slide-btn { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 14px); } }

/* ---------- playing with friends (#net: src/netui.js) ---------- */
.net-panel { width: min(420px, 100%); background: #fff9ec; }
.net-panel h2 { margin: 0 0 12px; overflow-wrap: anywhere; }
.net-view { display: flex; flex-direction: column; gap: 10px; }
.net-view[hidden] { display: none; }
.net-lbl { text-align: left; font-weight: 800; font-size: 14px; color: var(--ink-soft); margin-bottom: -6px; }
.net-row { display: flex; gap: 8px; align-items: center; }
.net-row input {
  flex: 1; min-width: 0; 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;
}
.net-row input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.net-row input.code { text-align: center; font-size: 22px; letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.net-row input.code::placeholder { color: #cdb99d; }
.net-row .mid-btn { flex: none; min-width: 84px; }
.mid-btn.ghost { background: #fffdf6; color: var(--ink); border: 2px solid var(--wood); box-shadow: 0 3px 0 var(--wood); }
.mid-btn.ghost:active { box-shadow: 0 1px 0 var(--wood); }
.net-msg { margin: 0; min-height: 1.3em; font-size: 14px; font-weight: 700; color: var(--ink-soft); overflow-wrap: anywhere; }
.net-msg:empty { display: none; }
.net-msg.bad { color: var(--accent-dark); }
.net-or { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: var(--ink-soft); font-weight: 800; font-size: 13.5px; }
.net-or::before, .net-or::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: rgba(155, 109, 67, 0.3); }
.net-view > .big-btn { align-self: stretch; }
.net-view .row-btns { margin-top: 4px; }
.net-code { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; }
.net-code span { font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.net-code b { font-size: 44px; line-height: 1; letter-spacing: 0.18em; text-indent: 0.18em; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.net-row.share { padding: 4px 4px 4px 12px; border-radius: 14px; background: rgba(255, 253, 246, 0.9); border: 1.5px dashed var(--wood); }
.net-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); user-select: all; -webkit-user-select: all; }
.net-seats { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.net-seats li { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 12px; border-radius: 12px; background: #fffdf6; border: 2px solid rgba(201, 155, 107, 0.55); font-weight: 800; font-size: 16px; }
.net-seats li.won { border-color: var(--gold); background: #fff6d6; box-shadow: 0 0 0 2px var(--gold); }
.net-seats .hat { position: relative; width: 20px; height: 17px; margin-top: 5px; border-radius: 10px 10px 4px 4px; background: var(--c); box-shadow: inset 0 -5px 0 #fff3dc, 0 0 0 1.5px rgba(60, 40, 20, 0.45); flex: none; }
.net-seats .hat::after { content: ''; position: absolute; left: 50%; top: -6px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #fff3dc; box-shadow: 0 0 0 1.5px rgba(60, 40, 20, 0.45); }
.net-seats .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-seats .tg { flex: none; padding: 2px 7px 3px; border-radius: 8px; background: rgba(155, 109, 67, 0.16); color: var(--ink-soft); font-size: 12px; font-weight: 800; line-height: 1.2; }
.net-seats .tg.you { background: var(--c); color: #fff; }
.net-seats .fishes { display: flex; gap: 3px; margin-left: auto; flex: none; }
.net-seats .fi { width: 25px; height: 16px; fill: rgba(255, 253, 246, 0.6); stroke: #b39d80; stroke-width: 1.6; stroke-dasharray: 3 2.4; }
.net-seats .fi .eye { display: none; }
.net-seats .fi.on { fill: #ff8a3c; stroke: #a8480f; stroke-dasharray: none; }
.net-seats .fi.on .eye { display: inline; fill: #14171f; stroke: none; }
.popup.c0 { color: #ffd0c8; }
/* in a room the match has no run and no score: the HUD says which room instead */
body[data-net] .info .pts { display: none; }
@media (max-width: 640px) {
  .net-code b { font-size: 38px; }
  .net-seats li { padding: 4px 10px; gap: 7px; font-size: 15px; }
  .net-seats .fi { width: 21px; height: 14px; }
}
@media (max-height: 480px) {
  .net-panel { width: min(560px, 100%); }
  .net-panel h2 { margin-bottom: 6px; font-size: 22px; }
  .net-view { gap: 6px; }
  .net-code { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; }
  .net-code b { font-size: 30px; }
  .net-seats { grid-template-columns: 1fr 1fr; }
}

/* ---------- playing with friends, stage 2: the series' cards, the crown, the emotes ---------- */
.net-sub { margin: -6px 0 0; font-size: 14px; font-weight: 800; color: var(--ink-soft); overflow-wrap: anywhere; }
.net-view .room-top, .net-view .room-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* the little crown: on the hat of whoever leads the series (HUD chips, the cards' lists) */
.hat .cr { display: none; position: absolute; left: 50%; top: -11px; width: 22px; height: 16.5px; translate: -50% 0; filter: drop-shadow(0 1px 0 rgba(60, 40, 20, 0.35)); }
.net-seats .hat.crowned .cr, .chip-p.crowned .hat .cr { display: block; }
.net-seats .hat.crowned::after, .chip-p.crowned .hat::after { display: none; }
.net-seats .hat.crowned { margin-top: 9px; }
.chip-p.crowned .hat { margin-top: 8px; }
/* the series' table: wins as stars out of 3, the fish brought home over the series */
.net-seats .wins { display: flex; gap: 2px; margin-left: auto; flex: none; }
.net-seats .st { width: 22px; height: 22px; fill: rgba(255, 253, 246, 0.6); stroke: #b39d80; stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 3 2.4; }
.net-seats .st.on { fill: #ffc531; stroke: #7a4c00; stroke-dasharray: none; }
.net-seats li.won .st.on:last-of-type { animation: pop 0.5s ease-out; }
.net-seats .fishn { display: flex; align-items: center; gap: 3px; flex: none; min-width: 46px; justify-content: flex-end; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.net-seats .fishn .fi { width: 21px; height: 13.5px; }
.net-seats.table li { padding-right: 9px; }
/* the champion's crown: big, and it flashes once */
.champ-crown { display: grid; place-items: center; margin: -4px 0 2px; }
.champ-crown[hidden] { display: none; }
.champ-crown svg { width: 104px; height: 80px; overflow: visible; animation: crownIn 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.2) 1 both; filter: drop-shadow(0 4px 0 rgba(122, 76, 0, 0.3)); }
.champ-crown .rays { transform-origin: 60px 60px; animation: crownRays 1.1s ease-out 1 both; }
@keyframes crownIn { 0% { transform: scale(0.3) rotate(-14deg); filter: brightness(1) drop-shadow(0 4px 0 rgba(122, 76, 0, 0.3)); } 45% { transform: scale(1.18) rotate(4deg); filter: brightness(1.9) drop-shadow(0 0 18px #fff3b0); } 100% { transform: none; filter: brightness(1) drop-shadow(0 4px 0 rgba(122, 76, 0, 0.3)); } }
@keyframes crownRays { 0% { opacity: 0; transform: scale(0.5); } 45% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.35); } }
/* the four emotes: beside the controls, never over the ice. A mouse: a row in the bottom right corner with their keys */
.emotes { position: fixed; z-index: 4; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.emotes[hidden] { display: none; }
.emo-btn { position: relative; width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 2px solid var(--wood); background: var(--cream); box-shadow: 0 3px 0 var(--wood), 0 5px 10px rgba(0, 0, 30, 0.22); cursor: pointer; touch-action: manipulation; display: grid; place-items: center; }
.emo-btn .emo { width: 32px; height: 32px; pointer-events: none; }
.emo-btn kbd { position: absolute; right: -5px; top: -7px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 6px; background: var(--ink); color: #fffdf6; font: 800 11px/17px inherit; font-family: inherit; text-align: center; pointer-events: none; }
.emo-btn:hover { background: #fff6d6; }
.emo-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood); }
.emo-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.emotes.wait .emo-btn { opacity: 0.45; }
body.touch .emo-btn { width: 44px; height: 44px; }
body.touch .emo-btn kbd { display: none; }
/* fingers, a wide screen: two by two above the Slide button */
body.touch .emotes { grid-template-columns: repeat(2, auto); gap: 6px; right: calc(max(12px, env(safe-area-inset-right)) + 15px); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 132px); }
@media (max-width: 640px) {
  .emotes { right: 8px; gap: 4px; }
  .emo-btn { width: 36px; height: 36px; } .emo-btn .emo { width: 28px; height: 28px; }
  /* a phone held upright: two by two between the stick and the Slide button */
  body.touch .emotes { right: auto; left: calc(50% + 5px); translate: -50% 0; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 26px); gap: 6px; }
  body.touch .emo-btn { width: 44px; height: 44px; } body.touch .emo-btn .emo { width: 32px; height: 32px; }
  .net-seats .st { width: 19px; height: 19px; }
  .net-seats .fishn { min-width: 40px; }
  .champ-crown svg { width: 92px; height: 71px; }
}
@media (max-height: 480px) {
  .emotes { bottom: 8px; right: 10px; }
  /* a phone held sideways: a row of four over the stick, under the nests' column */
  body.touch .emotes { grid-template-columns: repeat(4, auto); gap: 2px; right: auto; left: max(4px, env(safe-area-inset-left)); translate: none; bottom: auto; top: min(156px, calc(100vh - 192px)); }
  body.touch .emo-btn { width: 34px; height: 44px; border-radius: 15px; } body.touch .emo-btn .emo { width: 28px; height: 28px; }
  .net-sub { margin-top: -2px; font-size: 13px; }
  .net-seats.table { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .net-seats li { min-height: 40px; min-width: 0; }
  #net[data-view="score"] .net-panel { width: min(700px, 100%); }
  /* the waiting room: the code, the link and the name on the left, who is in on the right */
  #net[data-view="room"] .net-panel { width: min(700px, 100%); }
  #net-room:not([hidden]) { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0 16px; align-items: start; }
  #net-room .room-top, #net-room .room-list { gap: 6px; }
  #net-room .net-seats { grid-template-columns: 1fr; }
  #net-room .net-seats li { min-height: 34px; }
  /* the champion: the crown beside the words */
  #net[data-view="champ"] .net-panel { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: center; width: min(700px, 100%); }
  #net[data-view="champ"] .net-panel h2 { margin: 0; text-align: left; }
  #net[data-view="champ"] .net-view { grid-column: 1 / -1; }
  .champ-crown { margin: 0; } .champ-crown svg { width: 62px; height: 48px; }
}
/* an emote over a penguin: a round bubble in that penguin's colour with a little tail */
.emo-bubble { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -58px 0 0 -23px; border-radius: 50%; background: #fffdf6; border: 3px solid var(--c); box-shadow: 0 3px 8px rgba(0, 0, 30, 0.35); display: grid; place-items: center; }
.emo-bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; margin-left: -6px; background: #fffdf6; border: solid var(--c); border-width: 0 3px 3px 0; rotate: 45deg; border-radius: 0 0 3px 0; }
.emo-bubble .emo { position: relative; z-index: 1; width: 36px; height: 36px; animation: emoIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.5) both; }
.emo-bubble.out { opacity: 0; transition: opacity 0.2s ease; }
@keyframes emoIn { from { transform: scale(0.2); } to { transform: none; } }
/* a sideways phone that is at least twice as wide as high (most are): room for full 44 px buttons beside the ice */
@media (max-height: 480px) and (min-aspect-ratio: 2/1) {
  body.touch .emotes { left: max(10px, env(safe-area-inset-left)); }
  body.touch .emo-btn { width: 44px; border-radius: 50%; } body.touch .emo-btn .emo { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .champ-crown svg, .champ-crown .rays, .emo-bubble .emo, .net-seats li.won .st.on:last-of-type { animation: none; } .champ-crown .rays { opacity: 0; } }

/* ---------- playing online, stage 3: Quick match (a public room: no code, no link, no name box, a countdown) ---------- */
.on-name { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#net-room[data-pub] .room-top { display: none; }
.net-count { margin: 2px 0 0; font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.net-count[hidden] { display: none; }
.net-count b { display: inline-block; min-width: 1.3em; font-size: 28px; line-height: 1; color: var(--accent-dark); vertical-align: -3px; }
@media (max-height: 480px) {
  .on-name { gap: 6px; }
  #net-room[data-pub]:not([hidden]) { display: flex; }
  #net-room[data-pub] .net-seats { grid-template-columns: 1fr 1fr; }
  /* the first card on a phone held sideways: the name and Quick match on the left, the friends' room on the right */
  #net[data-view="friends"] .net-panel { width: min(700px, 100%); }
  #net-friends:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; align-items: start; }
  #net-friends > .on-name, #net-friends > #btn-quick, #net-friends > #net-quick-msg { grid-column: 1; }
  #net-friends > .net-or, #net-friends > #btn-create, #net-friends > .net-row, #net-friends > #net-friends-msg, #net-friends > #btn-net-close { grid-column: 2; }
  #net-friends > .on-name { grid-row: 1 / span 2; }
  #net-friends > #btn-quick { grid-row: 3; }
  #net-friends > #net-quick-msg { grid-row: 4 / span 2; }
  #net-friends > .net-or { grid-row: 1; margin: 0; }
  #net-friends > #btn-create { grid-row: 2; }
  #net-friends > .net-row { grid-row: 3; }
  #net-friends > #net-friends-msg { grid-row: 4; }
  #net-friends > #btn-net-close { grid-row: 5; }
}

/* ---------- five languages (src/i18n.js, src/langmenu.js; 2026-12-06) ---------- */
/* a page that will not be in English waits out of sight until its words are in (index.html's first script) */
html.i18n-wait body { visibility: hidden; }
/* Nunito has only Latin letters: each language names the fonts for its own (the computer's own; nothing is downloaded),
   by <html lang>, so that Japanese is not drawn with Chinese shapes. An element that says its own language (a row of
   the language menu) gets that language's fonts. English is as it was. */
:lang(zh-Hant) { --cjk: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', sans-serif; }
:lang(zh-Hans) { --cjk: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif; }
:lang(ja) { --cjk: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'YuGothic', 'Noto Sans JP', 'Noto Sans CJK JP', sans-serif; }
:lang(ko) { --cjk: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', sans-serif; }
:lang(zh-Hant), :lang(zh-Hans), :lang(ja), :lang(ko) { font-family: 'Nunito', var(--cjk); }
/* (their fonts stand taller than Nunito: with the browser's own "normal" every line would be a pixel higher than in
   English, and a card that just fits a low phone screen would start to scroll. Only where nothing sets a height.) */
html:lang(zh-Hant), html:lang(zh-Hans), html:lang(ja), html:lang(ko) { line-height: 1.33; }
:is(:lang(zh-Hant), :lang(zh-Hans), :lang(ja), :lang(ko)).g-btn, :is(:lang(zh-Hant), :lang(zh-Hans), :lang(ja), :lang(ko)).g-btn * { font-family: Roboto, Arial, var(--cjk); }
/* Korean breaks between words, not inside them; Japanese between phrases where the browser can */
:lang(ko) { word-break: keep-all; }
:lang(ja) { word-break: auto-phrase; }
/* (a row of a room's list may shrink, so that a long typed name ends in … instead of pushing the row out of its card:
   the tags beside it are wider in these languages) */
.net-seats li { min-width: 0; }   /* (every language: an English page can meet a long Chinese name too) */
/* (the stats' labels: capitals and wide spacing are for Latin letters) */
:is(:lang(zh-Hant), :lang(zh-Hans), :lang(ja), :lang(ko)) .stats dt { letter-spacing: 0; }

/* the globe button: the language's own name beside it */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 9px 0 10px; 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); font-weight: 800; font-size: 15px; line-height: 1; white-space: nowrap; touch-action: manipulation; }
.lang-btn:hover { background: #fffdf6; }
.lang-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 80, 40, 0.25); }
.lang-btn .globe { width: 21px; height: 21px; flex: none; }
.lang-btn .caret { width: 12px; height: 12px; flex: none; color: var(--ink-soft); }
/* on the title: top left of the screen, level with the sound buttons across from it (the card is as it was) */
#title > .lang-btn { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
/* on the pause card: under its two buttons */
/* (46px: still 44 while the card is coming up at 97% of its size) */
#pause .lang-btn { display: flex; width: max-content; max-width: 100%; min-height: 46px; margin: 12px auto 0; }
@media (max-width: 640px) { #title > .lang-btn { left: max(10px, env(safe-area-inset-left)); } }
@media (max-height: 480px) { #title > .lang-btn { top: 8px; left: max(10px, env(safe-area-inset-left)); } #pause .lang-btn { margin-top: 8px; } }

/* its menu: over everything (a click outside only closes it), under the button or over it; nothing is marked until a key moves */
.lang-pop { position: fixed; inset: 0; z-index: 30; overscroll-behavior: contain; }
.lang-menu { position: fixed; left: 8px; top: 8px; min-width: 190px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain; padding: 6px; background: #fff9ec; animation: menuIn 0.14s ease-out; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.lang-menu[data-side="over"] { animation-name: menuInUp; }
@keyframes menuInUp { from { opacity: 0; transform: translateY(4px); } }
.lang-list { display: grid; gap: 2px; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 40px; padding: 0 10px 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  font-weight: 700; font-size: 16px; line-height: 1.2; text-align: left; white-space: nowrap; touch-action: manipulation; }
.lang-item:hover { background: rgba(155, 109, 67, 0.14); }
.lang-item:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; background: rgba(155, 109, 67, 0.14); }
.lang-item .check { width: 18px; height: 18px; flex: none; color: var(--ink-soft); visibility: hidden; }
.lang-item[aria-checked="true"] .check { visibility: visible; }
.lang-note { margin: 4px 10px 8px; max-width: 230px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--ink-soft); text-align: left; }
/* a phone or a tablet: a sheet from the bottom, rows for a finger */
.lang-pop.sheet { background: rgba(10, 40, 70, 0.5); }
.lang-pop.sheet .lang-menu { left: 0; right: 0; top: auto; bottom: 0; width: min(480px, 100%); max-width: 100%; margin: 0 auto; max-height: calc(100dvh - 24px); border-radius: 18px 18px 0 0; border-bottom: 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); animation: sheetIn 0.2s ease-out; }
@keyframes sheetIn { from { transform: translateY(40%); opacity: 0; } }
.lang-pop.sheet .lang-item { min-height: 48px; font-size: 17px; padding: 0 12px 0 14px; }
.lang-pop.sheet .lang-note { max-width: none; margin: 2px 14px 8px; font-size: 14px; }
@media (max-height: 480px) { .lang-pop.sheet .lang-menu { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); } .lang-pop.sheet .lang-item { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .lang-menu, .lang-pop.sheet .lang-menu { animation: none; } }
