:root {
  color-scheme: light;
  --paper: #f7efdb;
  --page: #fff9e9;
  --ink: #30291f;
  --muted: #655947;
  --moss: #405638;
  --moss-dark: #2b3d26;
  --clay: #9b472f;
  --line: #b7a581;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; color: var(--ink); background: var(--paper); }
main { width: min(calc(100% - 28px), 620px); margin: auto; padding: max(11px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom)); }
.zoo-header, .hud { display: flex; align-items: center; gap: 12px; }
.zoo-header { justify-content: space-between; padding: 5px 9px 5px 13px; background: var(--moss); color: #fff8e9; border: 1px solid var(--moss-dark); border-radius: 5px; box-shadow: 0 3px var(--moss-dark); }
h1, .intro h2 { font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", serif; }
h1 { margin: 0; font-size: clamp(1.15rem, 5vw, 1.65rem); font-weight: 900; }
button { cursor: pointer; color: inherit; font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.sound { min-height: 44px; min-width: 69px; border: 1px solid #b4bf9d; border-radius: 4px; background: var(--moss-dark); font-size: .84rem; font-weight: 800; }
.sound[aria-pressed="false"] { background: #f3e8ca; color: var(--moss-dark); }
.hud { min-height: 54px; padding: 4px 2px 0; }
.streak, .best { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.streak strong { color: var(--moss-dark); font-size: 2rem; line-height: 1; }
.streak span, .best span, .clock small { color: var(--muted); font-size: .82rem; font-weight: 800; }
.best strong { font-size: 1.03rem; }
.clock { margin-left: auto; min-width: 4.8rem; text-align: right; font-size: 1.48rem; font-weight: 900; white-space: nowrap; }
.stage { position: relative; height: clamp(145px, calc(100svh - var(--ksk-header-height, 0px) - 228px), 440px); overflow: hidden; isolation: isolate; background: var(--page); border: 1px solid var(--line); border-radius: 5px; box-shadow: inset 0 0 0 4px #efe3c7, 0 3px #daccae; }
.stage::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--line); pointer-events: none; }
#photo, .cover { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); }
#photo { object-fit: contain; }
.cover { display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 4px; }
.cover img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.intro { position: absolute; bottom: 19px; left: 15px; padding: 12px 15px; background: var(--page); border: 1px solid var(--line); box-shadow: 3px 3px #30291f; transform: rotate(-1deg); }
.intro h2 { margin: 0; color: var(--moss-dark); font-size: clamp(1.45rem, 6vw, 2.65rem); line-height: 1.1; font-weight: 900; }
.intro p { margin: 8px 0 0; font-size: .875rem; line-height: 1.45; font-weight: 750; }
.cue { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 8px; background: var(--page); }
.cue strong { font-size: clamp(1.15rem, 5vw, 1.45rem); color: var(--moss-dark); }
.cue span { color: var(--muted); }
.feedback { position: absolute; bottom: 12px; left: 12px; display: flex; align-items: center; gap: 10px; padding: 7px 11px; border: 2px solid var(--moss-dark); border-radius: 4px; color: var(--moss-dark); background: var(--page); font-weight: 900; transform-origin: bottom left; animation: stamp 220ms ease-out both; }
.feedback span { border-left: 1px solid currentColor; padding-left: 9px; }
@keyframes stamp { 0% { transform: translateY(5px) scale(.88); } 55% { transform: translateY(-2px) scale(1.06); } }
@keyframes score-pop { 45% { transform: translateY(-2px) scale(1.16); } }
main[data-phase="correct"] .stage::after { border: 3px solid var(--moss); }
main[data-phase="correct"] .streak strong { animation: score-pop 240ms ease-out; }
main[data-celebration="combo"] .feedback { background: #f4d98c; border-color: #624519; color: #624519; }
main[data-urgent="true"] .stage::after { border: 2px solid var(--clay); }
main[data-urgent="true"] .clock { color: var(--clay); }
main[data-phase="ended"] .stage { height: clamp(105px, calc(100svh - var(--ksk-header-height, 0px) - 430px), 310px); }
main[data-phase="ended"] .stage::after { border-color: var(--clay); }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; padding-bottom: 4px; }
.answers button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: clamp(58px, 10svh, 72px); padding: 7px; background: #f3e5c5; border: 1px solid #887552; border-radius: 6px; box-shadow: 0 4px #887552; font-weight: 900; font-size: clamp(.94rem, 4.3vw, 1.25rem); line-height: 1.18; overflow-wrap: anywhere; }
.answers button kbd { font: 700 .75rem system-ui; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px; }
.answers button[aria-disabled="true"] { cursor: default; }
.answers button:active, .actions button:active { transform: translateY(3px); box-shadow: 0 1px #887552; }
.answers button.correct { transform: translateY(3px); box-shadow: 0 1px var(--moss-dark); background: var(--moss); color: #fff9e9; border-color: var(--moss-dark); }
.answers button.correct kbd { color: inherit; }
.result { margin-top: 10px; padding: 10px; background: var(--page); border: 1px solid var(--line); border-left: 4px solid var(--clay); border-radius: 4px; animation: result-in 160ms ease-out; }
@keyframes result-in { from { transform: translateY(4px); } }
.result h2 { font-size: clamp(1rem, 4.5vw, 1.3rem); line-height: 1.33; color: var(--clay); margin: 0 0 4px; overflow-wrap: anywhere; }
.result-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-weight: 850; }
.result-score strong { color: var(--moss-dark); font-size: 2rem; line-height: 1; }
#fastest { margin-left: auto; color: var(--muted); font-size: .875rem; }
.review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
.review div { min-width: 0; background: #eee6cc; padding: 4px 7px; border-radius: 3px; }
.review span, .review strong { display: block; overflow-wrap: anywhere; }
.review span, .quip { font-size: .82rem; color: var(--muted); }
.review strong { font-size: .93rem; }
.review div:first-child strong { color: var(--moss-dark); }
.review div:nth-child(2) strong { color: var(--clay); }
.quip { margin: 6px 0 0; font-weight: 700; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
.actions:has(> [hidden]:first-child):has(> [hidden]:last-child) { margin-top: 0; }
.actions button { flex: 1; min-height: 46px; border-radius: 5px; font-weight: 900; padding: 5px; box-shadow: 0 3px #887552; }
.primary { border: 1px solid var(--moss-dark); background: var(--moss); color: #fff9e9; font-size: 1.08rem; }
.primary:disabled { opacity: .65; cursor: default; }
.secondary { background: #f3e5c5; border: 1px solid #887552; }
#status { margin: 6px 0 0; white-space: pre-wrap; font-size: .875rem; color: var(--muted); }
#status:empty { margin: 0; }
details { margin-top: 10px; font-size: .83rem; color: var(--muted); }
summary { cursor: pointer; width: max-content; }
li { margin-block: 5px; }
a { color: inherit; }
@media (pointer: coarse) { .answers button kbd { display: none; } }
@media (max-height: 620px) { .hud { min-height: 46px; } .stage { height: clamp(125px, calc(100svh - var(--ksk-header-height, 0px) - 208px), 350px); } main[data-phase="ended"] .stage { height: clamp(84px, calc(100svh - var(--ksk-header-height, 0px) - 405px), 190px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* Paper and crayon marks sit behind the live text and touch targets. */
:root {
  --paper: #faf3df;
  --page: #fff9e9;
  --ink: #2d2928;
  --muted: #534746;
  --moss: #386447;
  --moss-dark: #214632;
  --clay: #942f32;
  --line: #b5a486;
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='137' height='137'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.73' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.21'/%3E%3C/svg%3E");
}
body { background-image: var(--paper-grain); background-blend-mode: multiply; }
.crayon-filters { position: absolute; pointer-events: none; }
.zoo-header { position: relative; isolation: isolate; background: transparent; color: var(--ink); border: 0; border-radius: 0; box-shadow: none; }
.zoo-header::before {
  content: ""; position: absolute; z-index: -1; inset: 2px 0;
  background: repeating-linear-gradient(-8deg,#f1cc63 0 7px,#ffe492 10px 17px,#f9d46d 19px 22px);
  border: 3px solid #906222; border-radius: 9% 4% 7% 5% / 19% 21% 16% 12%;
  filter: url(#rough-crayon);
}
h1 { font-family: inherit; font-weight: 1000; letter-spacing: -.035em; transform: rotate(-1deg); }
h1 span { display: inline-block; }
h1 span:first-child { color: #255b8c; transform: rotate(3deg) translateY(1px); }
h1 span:last-child { color: #952e33; transform: rotate(-4deg); }
.sound { border: 2px solid #453b2c; border-radius: 7px 4px 9px 5px; background: #fff7de; color: var(--ink); }
.stage { background: var(--page); border: 0; border-radius: 1% 3% 2% 2% / 2% 1% 2% 2%; box-shadow: none; }
.stage::after {
  inset: 4px 5px 5px 4px; border: 5px solid #365d83;
  border-radius: 2% 3% 3% 2% / 3% 1% 2% 4%; filter: url(#rough-crayon);
}
.intro { border: 0; box-shadow: none; isolation: isolate; right: auto; left: 16px; bottom: 18px; background: transparent; }
.intro::before { content: ""; position: absolute; z-index: -1; inset: -2px; border: 4px solid #39764e; background: var(--page); border-radius: 3% 6% 2% 3% / 7% 5% 8% 4%; filter: url(#rough-crayon); }
.intro h2 { font-family: inherit; font-weight: 1000; letter-spacing: -.06em; transform: rotate(-1.5deg); }
.sun { position: absolute; width: clamp(43px, 13vw, 75px); right: -27px; top: -32px; transform: rotate(9deg); filter: url(#rough-crayon); pointer-events: none; }
.cue { background: var(--page) var(--paper-grain); background-blend-mode: multiply; }
.feedback { border: 0; isolation: isolate; background: transparent; transform: rotate(-3deg); }
.feedback::before { content: ""; position: absolute; z-index: -1; inset: -1px; background: #e7efaf; border: 4px solid var(--moss); border-radius: 8% 4% 11% 5%; filter: url(#rough-crayon); }
main[data-celebration="combo"] .feedback { background: transparent; }
main[data-celebration="clutch"] .feedback::before { background: #ffe298; border-color: #a96729; }
main[data-celebration="combo"] .feedback::before { background: #ffdc75; border-color: #a96729; }
.answers button, .answers button:active, .answers button.correct {
  position: relative; isolation: isolate; transform: none; box-shadow: none; border: 0; background: transparent;
}
.answers button { --stroke: #335f83; --fill: #e3edf4; --stripe: #c6deed; }
.answers button:nth-child(2) { --stroke: #3e6d44; --fill: #e8efcf; --stripe: #d6e6af; }
.answers button::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0 1px 3px; border: 4px solid var(--stroke);
  border-radius: 8% 4% 7% 4% / 12% 10% 16% 9%;
  background: repeating-linear-gradient(-11deg,var(--fill) 0 5px,var(--stripe) 8px 11px,var(--fill) 14px 18px);
  box-shadow: 0 3px var(--stroke); filter: url(#rough-crayon);
}
.answers button > * { pointer-events: none; }
.answers button:active::before { transform: translateY(2px); box-shadow: 0 1px var(--stroke); animation: none; }
.answers button.correct { --stroke: #214632; --fill: #386447; --stripe: #467951; color: var(--page); }
main[data-urgent] .clock { color: var(--clay); }
main[data-urgent] .stage::after { border-color: var(--clay); }
main[data-urgent="soon"] .answers button { --stroke: #986525; --fill: #ffe8ad; --stripe: #fadc90; }
main[data-urgent="rush"] .answers button { --stroke: #a95028; --fill: #ffdab0; --stripe: #f7c38c; }
main[data-urgent="last"] .answers button { --stroke: #942f32; --fill: #ffcccc; --stripe: #f6aeab; }
/* Only the crayon plate pulses. The interactive button stays in place. */
main[data-urgent] .answers button::before {
  animation: var(--bump) 145ms ease-out;
}
main[data-urgent="soon"] { --bump: bump-soon; }
main[data-urgent="rush"] { --bump: bump-rush; }
main[data-urgent="last"] { --bump: bump-last; }
main[data-urgent] .answers button:active::before { animation: none; }
@keyframes bump-soon { 44% { transform: scale(1.025, 1.05) rotate(-.45deg); } }
@keyframes bump-rush { 40% { transform: scale(1.04, 1.08) rotate(.65deg); } }
@keyframes bump-last { 35% { transform: scale(1.05, 1.12) rotate(-.75deg); } 70% { transform: rotate(.4deg); } }
.result { border: 0; position: relative; isolation: isolate; background: transparent; padding-inline: 13px; }
.result::before { content: ""; position: absolute; z-index: -1; inset: 0; border: 4px solid #942f32; border-radius: 3% 2% 4% 2% / 9% 7% 9% 5%; background: var(--page); filter: url(#rough-crayon); }
.result h2 { font-weight: 1000; text-decoration: underline wavy #ce765d 2px; text-underline-offset: 4px; margin-bottom: 7px; }
.quip { display: flex; gap: 7px; align-items: center; }
.quip svg { flex: 0 0 36px; width: 36px; transform: rotate(-10deg); }
main[data-outcome="wrong"] .stage::after { animation: wrong-frame 210ms ease-out; }
@keyframes wrong-frame { 30% { transform: rotate(-.7deg); } 65% { transform: rotate(.5deg); } }
.actions button { border-radius: 7px 3px 9px 4px; border-width: 2px; }
@media (max-width: 400px) { .intro { max-width: calc(100% - 55px); } }

#share-card, #timeout-photo {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0;
  object-fit: contain;
  background: var(--page);
}
#timeout-photo { max-height: min(30svh, 220px); }
.actions { flex-wrap: wrap; }
.actions .share-link {
  flex: 1 0 100%; display: grid; place-items: center; min-height: 44px;
  border: 2px solid #887552; border-radius: 7px 3px 9px 4px;
  text-decoration: none; font-weight: 850;
}
.share-link:is(:hover, :focus-visible) { background: #ffe492; }

#share-card:not([hidden]) { clip-path: inset(0); animation: wrong-photo-punch 260ms cubic-bezier(.18,.85,.29,1) both; }
@keyframes wrong-photo-punch {
  from { transform: scale(1.23) rotate(-1.2deg); }
  65% { transform: scale(1.025) rotate(.35deg); }
  to { transform: scale(1); }
}

.actions .share-link { flex: 1 1 30%; padding: 4px; text-align: center; }
#ksk-manual-copy textarea { display: block; width: 100%; min-height: 7rem; }
@media (max-width: 400px) {
  .zoo-header { gap: 5px; }
  .zoo-header h1 { font-size: 1.04rem; }
  .zoo-header .sound { min-width: 46px; }
}
.entry-language { display: flex; align-items: center; gap: 2px; }
.entry-language select { max-width: 5.4rem; font: inherit; }
.game-bar .brand { margin-left: auto; }
.entry-links { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: .83rem; }
.entry-links details { margin: 0; }
#entry-scores { max-height: 34vh; overflow: auto; }
main[data-phase="idle"] .stage { height: clamp(180px, calc(100svh - var(--ksk-header-height) - 205px), 380px); }
@media (max-width: 600px) {
  .entry-language select { width: 3.3rem; }
  .game-bar .bar-title { max-width: 40%; white-space: normal; text-align: center; line-height: 1.15; }
}
.entry-visual > .cover { object-fit: cover; }
#ksk-ranking-badge { flex-basis: 100%; font-size: .85rem; }
.result-heading { margin: 0 0 4px; color: var(--muted); font-size: .82rem; font-weight: 800; }

.result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.result-actions > :is(button, a) {
  display: grid;
  place-items: center;
  min-height: 46px;
  min-width: 0;
  padding: 7px 5px;
  font-size: .875rem;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
@media (max-width: 460px) {
  .result-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#ksk-share-x {
  background: #121212;
  border-color: #121212;
  color: #fff;
}
#ksk-share-x:hover { background: #303030; }

.answers button span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-break: strict;
}

.rank-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, auto);
  gap: 5px 8px;
  padding: 10px;
  margin-top: 12px;
  background: #e4edcb;
  border-radius: 6px;
}
.rank-form label, .rank-form p { grid-column: 1 / -1; }
.rank-form label { font-weight: 850; font-size: .85rem; }
.rank-form input { width: 100%; min-width: 0; padding: 7px; font: inherit; }
.rank-form button { min-height: 44px; padding: 6px 10px; border-radius: 5px; font-weight: 900; }
.rank-form p { margin: 0; font-size: .8rem; }
.rank-form p:empty { display: none; }
.result-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: .8rem; }
.result-links a { display: inline-flex; align-items: center; min-height: 30px; color: var(--muted); }


main[data-clock-ended] .answers button {
  --stroke: #726454;
  --fill: #e4dac3;
  --stripe: #d6cbb4;
  color: #51463a;
}
main[data-clock-ended] .clock { color: var(--muted); }

.screen-gauge {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
  --sweep: rgb(224 133 29 / .17);
  --edge: #dc913c;
  --goal-width: clamp(16px, 3.5vw, 30px);
}
main[data-phase="question"] .screen-gauge { visibility: visible; }
.screen-gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sweep);
  border-right: 3px solid var(--edge);
  transform: translateX(calc(var(--remaining, 1) * -100%));
}
main[data-urgent="rush"] .screen-gauge,
main[data-urgent="last"] .screen-gauge {
  --sweep: rgb(181 57 43 / .23);
  --edge: #b54336;
}
main[data-clock-ended] .screen-gauge {
  --sweep: rgb(62 52 48 / .25);
  --edge: transparent;
}


.screen-gauge::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--goal-width);
  background: repeating-linear-gradient(-45deg, #ffd52c 0 8px, #211b12 8px 16px);
  border-left: 1px solid #211b12;
}
.screen-gauge-goal {
  position: absolute;
  right: var(--goal-width);
  top: min(16%, 100px);
  padding: 3px 7px;
  background: #ffd52c;
  color: #211b12;
  border: 1px solid #211b12;
  font-size: .8rem;
  font-weight: 900;
  white-space: nowrap;
}
main[data-clock-ended] .screen-gauge-goal { background: #211b12; color: #ffd52c; }
.time-track {
  height: 6px;
  background: #ded1ac;
  border-radius: 4px;
  overflow: hidden;
  visibility: hidden;
}
main > .time-track { display: none; margin-bottom: 8px; }
main:is([data-phase="preview"],[data-phase="question"],[data-phase="correct"]) > .time-track {
  display: block;
  visibility: visible;
}
.time-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--stroke, var(--moss));
  transform: scaleX(var(--remaining, 1));
  transform-origin: right;
}
main[data-urgent] > .time-track { --stroke: #b54336; }
.choice-gauge { position: absolute; inset: auto 12px 8px; height: 5px; }
main[data-phase="question"] .choice-gauge { visibility: visible; }
.answers button { padding-bottom: 14px; }

.ranking-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100% - 24px));
  border: 2px solid var(--moss);
  border-radius: 8px;
  padding: 16px;
  background: var(--page);
  color: var(--ink);
}
.ranking-dialog::backdrop { background: rgb(27 23 18 / .55); }
.ranking-dialog ol { padding-inline-start: 32px; }
.ranking-dialog button, .ranking-open { min-height: 40px; padding-inline: 9px; }

/* Keep the enlarged choices close to the photo, including on short screens. */
main:has(.answers:not([hidden])) {
  padding-top: max(6px, env(safe-area-inset-top));
}
main:has(.answers:not([hidden])) .stage {
  height: clamp(110px, calc(100svh - var(--ksk-header-height, 0px) - 270px), 398px);
}
.answers { margin-top: 2px; }
main:has(.answers:not([hidden])) #photo { object-position: center bottom; }
.answers button {
  min-height: clamp(116px, 20svh, 144px);
  font-size: clamp(1.25rem, 5.6vw, 1.75rem);
  line-height: 1.17;
}
.answers button span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-break: strict;
}

#entry-tools:not([hidden]) { display:flex; flex-direction:column; gap:12px; }
#entry-tools .actions, #ksk-start-btn { width:100%; margin:0; }
#ksk-start-btn { min-height:64px; font-size:1.55rem; }
.zoo-rules p { margin:4px 0; }
.zoo-ad { order:0; max-width:100%; align-self:center; text-align:center; }
.zoo-ad small { display:block; }
@media(max-width:719px){
  main:has(#entry-tools:not([hidden])) .stage { width:144px; height:81px; margin:4px auto 12px; }
  #entry-cover { inset:0; width:100%; height:100%; object-fit:contain; }
}
@media(min-width:720px){
  main:has(#entry-tools:not([hidden])) { width:min(96%,1040px); display:grid; grid-template-columns:minmax(0,1.2fr) minmax(310px,1fr); column-gap:28px; align-items:start; }
  main:has(#entry-tools:not([hidden])) .zoo-header { grid-column:1; grid-row:1; }
  main:has(#entry-tools:not([hidden])) .stage { grid-column:1; grid-row:2; height:auto; aspect-ratio:16/9; }
  main:has(#entry-tools:not([hidden])) #entry-tools { grid-column:2; grid-row:1/4; }
  #entry-tools .zoo-ad { order:-2; }
  #entry-tools .zoo-rules { order:-1; }
}

.ranking-dialog[open] { display:flex; flex-direction:column; max-height:86dvh; overflow:hidden; border-radius:12px 8px 14px 7px; }
.board-header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:8px; border-bottom:3px solid var(--moss); }
.board-header h2 { margin:0; color:var(--moss-dark); font-size:1.25rem; }
.board-header small { white-space:nowrap; font-size:.8rem; }
.board-header button { min-height:44px; border:2px solid var(--moss); background:var(--page); color:var(--moss-dark); border-radius:6px; }
.board-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }
.board-scroll table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.board-rank { width:18%; } .board-score { width:28%; }
.board-scroll :is(th,td) { padding:8px 4px; text-align:start; overflow-wrap:anywhere; border-bottom:1px solid var(--line); }
.board-scroll th { position:sticky; top:0; background:var(--page); }
.board-scroll :is(th,td):last-child { text-align:end; font-variant-numeric:tabular-nums; }
#entry-scores { max-height:none; overflow:visible; }

/* Keep both answers above bottom overlays in mobile in-app browsers. */
@media (max-width: 719px), (pointer: coarse) and (max-height: 500px) {
  main:has(.answers:not([hidden])) {
    display: flex;
    flex-direction: column;
  }
  main:has(.answers:not([hidden])) .stage {
    order: 1;
    margin-top: 6px;
    height: clamp(76px, calc(var(--zoo-visible-height, 100dvh) - var(--ksk-header-height, 54px) - 218px - env(safe-area-inset-bottom, 0px)), 398px);
  }
  main:has(.answers:not([hidden])) .answers button {
    min-height: clamp(72px, 14dvh, 116px);
    padding-block: 8px;
  }
}
