:root {
  color-scheme: light;
  --forest: #102b25;
  --forest-dark: #091d19;
  --paper: #f9efdb;
  --ink: #232e25;
  --muted: #625a4a;
  --cream: #fff2d6;
  --gold: #f3ce83;
  --gold-dark: #9d682b;
  --red: #9e352b;
  --serif: "Songti SC", "Noto Serif SC", "STSong", SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --edge: clamp(20px, 6.25vw, 100px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; color: var(--ink); background: var(--forest); font: 1rem/1.55 var(--sans); }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .53; }
a { color: inherit; }
:focus-visible { outline: 3px solid #a74b28; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
button:not(:disabled), .text-link { transition: background-color .2s, border-color .2s, color .2s, transform .2s; }
button:not(:disabled):hover { transform: translateY(-2px); }
button:not(:disabled):active { transform: translateY(1px); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 9; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); padding: 10px 16px; background: var(--paper); }

.masthead { position: absolute; inset: 0 0 auto; padding-top: var(--safe-top); color: var(--cream); z-index: 2; }
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between; min-height: 79px;
  margin-left: max(var(--edge), calc(var(--safe-left) + 12px));
  margin-right: max(var(--edge), calc(var(--safe-right) + 12px));
  border-bottom: 1px solid #f3ce8352;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 700 17px/1.15 var(--serif); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--gold); border: 1px solid #f3ce8380; background: #112b23bf; font: 22px Georgia, serif;
}
nav { display: flex; align-items: center; gap: 12px; }
.nav-link, .sound {
  min-height: 44px; border: 1px solid #fff2d66a; border-radius: 999px; color: var(--cream); background: #132e25d9;
}
.nav-link { padding: 0 16px; font-size: 14px; font-weight: 700; }
.nav-link span:first-child { color: var(--gold); margin-right: 4px; }
.sound { width: 44px; font: 21px Georgia, serif; }
.sound[aria-pressed="true"] { background: #f3ce83; color: var(--forest); }
.nav-link:hover, .sound[aria-pressed="false"]:hover { background: #2a4e3c; }

.hero { min-height: max(680px, 100svh); display: grid; align-items: center; position: relative; isolation: isolate; overflow: hidden; color: var(--cream); }
.hero-art, .hero::after, .snow { position: absolute; width: 100%; height: 100%; inset: 0; }
.hero-art { object-fit: cover; object-position: center 62%; z-index: -3; }
.hero::after { content: ""; z-index: -2; background: linear-gradient(90deg,#071b17e8 0%,#071b17c2 21%,#071b1763 42%,transparent 67%), linear-gradient(0deg,#091e1bba,transparent 27%,transparent 84%,#091e1b64); }
.hero-inner { width: calc(100% - var(--edge) * 2); margin-inline: auto; padding-block: 122px 100px; }
.hero-copy { width: min(100%, 485px); animation: arrival .7s both; }
.edition { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 14px; font-weight: 700; letter-spacing: .17em; }
.edition span { font-size: 17px; }
.edition::after { content: ""; display: inline-block; height: 1px; width: 35px; background: currentColor; opacity: .65; }
h1 { margin: 18px 0 17px; font: 800 clamp(69px, 7vw, 116px)/.99 var(--serif); letter-spacing: -.08em; text-shadow: 0 4px 30px #061511b8; }
h1 span { display: block; color: var(--gold); line-height: 1.04; }
.hero-lead { margin-top: 21px; line-height: 1.35; font: 700 clamp(21px, 2.1vw, 30px)/1.4 var(--serif); }
.hero-description { max-width: 23em; margin-top: 11px; color: #f6e4c8; line-height: 1.72; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 26px; }
.primary, .secondary {
  min-height: 50px; border-radius: 8px; padding: 10px 22px;
  font-weight: 800; border: 1px solid transparent; text-align: center;
}
.primary { color: #31220f; background: var(--gold); border-color: #fbe1a7; box-shadow: 0 3px 0 #8e5929, inset 0 0 0 2px #f6d79e; }
.primary span { margin-left: 8px; }
.primary:not(:disabled):hover { background: #ffe1a0; }
.secondary { color: var(--forest); border-color: #aa8d62; background: #fff8e9; }
.secondary:not(:disabled):hover { background: #eee2c6; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 5px; font-weight: 700; }
.text-link:hover { color: var(--gold); }
.snow { pointer-events: none; z-index: -1; }
.flake { position: absolute; top: var(--y); left: var(--x); width: var(--size); height: var(--size); border-radius: 50%; background: #fff5d6; opacity: 0; animation: snow 4s var(--delay) both; }
@keyframes snow { 0% { opacity: 0; transform: translate(-12px,-28px); } 23%, 64% { opacity: .72; } 100% { opacity: 0; transform: translate(24px,95px); } }
@keyframes arrival { from { opacity: .4; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }

.how { min-height: 100svh; display: grid; align-items: center; background: var(--paper); padding: 85px var(--edge); border-top: 7px solid #b08851; }
.how-inner { width: 100%; margin: auto; text-align: center; }
.how .edition { color: #8b3c2d; justify-content: center; }
.how .edition::after { display: none; }
.how h2 { font: 800 clamp(37px, 5vw, 65px)/1.2 var(--serif); margin-top: 12px; }
.route-list { list-style: none; padding: 0; margin: 36px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.route-list li {
  padding: 25px 18px 27px; background: #fff7e8; border: 1px solid #d9c398;
  border-radius: 10px; box-shadow: inset 0 0 0 4px #f6ecd6;
}
.route-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%; border: 1px dashed #cf9f4e; color: #ffe1a2; background: #214837; font-size: 32px; }
.route-list li:nth-child(2) .route-icon { background: #91392d; }
.route-list h3 { font: 800 24px/1.15 var(--serif); margin-bottom: 8px; }
.route-list p { color: var(--muted); }
.noscript { padding: 20px var(--edge); background: var(--paper); }

.play {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
  padding: calc(108px + var(--safe-top)) var(--edge) calc(46px + var(--safe-bottom));
  background: linear-gradient(#081f1b84,#081f1bd4), url(christmas-tree.jpg) center / cover;
}
.paper {
  width: min(100%,740px); margin: 0 auto; padding: clamp(23px,5vw,44px); background: var(--paper);
  border: 1px solid #ddbb80; border-radius: 15px;
  box-shadow: 0 25px 95px #09181480, inset 0 0 0 5px #eddab8, inset 0 0 0 6px #cfaf7d;
  position: relative; overflow: hidden;
}
.paper::before {
  position: absolute; content: ""; top: 0; inset-inline: 0; height: 6px; border-radius: 14px 14px 0 0;
  background: repeating-linear-gradient(135deg,#9b4437 0 11px,#ead9b6 11px 20px,#3b604d 20px 31px,#ead9b6 31px 40px);
}
.paper .edition { color: #8b3c2d; margin-bottom: 8px; }
.paper h1 {
  font: 800 clamp(34px,5vw,49px)/1.13 var(--serif); color: var(--forest);
  margin: 0 0 10px; letter-spacing: -.06em; text-shadow: none; overflow-wrap: anywhere;
}
.paper h2 { font: 800 24px/1.25 var(--serif); margin-bottom: 8px; }
.paper .intro { color: var(--muted); margin-bottom: 20px; overflow-wrap: anywhere; }
.paper .primary { background: var(--red); color: #fff6df; border-color: #ae5c46; box-shadow: 0 3px 0 #6c231e, inset 0 0 0 2px #ae584746; }
.paper .primary:not(:disabled):hover { background: #843026; }
.paper .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 19px; }
.plain {
  border: 0; padding: 3px 4px; min-height: 44px; color: #65432c; background: none;
  font-weight: 700; text-decoration: underline; text-underline-offset: 4px;
}
.plain:hover { color: var(--red); }
.paper form { margin-top: 16px; }
.field { display: block; margin-top: 16px; font-weight: 700; }
input, textarea {
  display: block; width: 100%; margin-top: 6px; border: 1px solid #ae9370; border-radius: 7px;
  background: #fffbef; padding: 11px 13px; color: var(--ink); min-height: 46px; resize: vertical;
}
textarea { min-height: 88px; }
input[readonly], textarea[readonly] { color: #554c3d; }
.error { min-height: 0; margin-top: 6px; font-size: 14px; color: #8d2a25; }
.error:empty { display: none; }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #784a34; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
progress { appearance: none; display: block; width: 100%; height: 7px; border: 0; border-radius: 999px; overflow: hidden; background: #e7d6b9; margin-bottom: 19px; }
progress::-webkit-progress-bar { background: #e7d6b9; }
progress::-webkit-progress-value { background: #9d4435; }
progress::-moz-progress-bar { background: #9d4435; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 10px; min-height: 62px; border: 1px solid #c9af86;
  background: #fff9ec; padding: 9px 12px; border-radius: 8px; color: var(--forest);
  text-align: left; font-weight: 700; line-height: 1.35;
}
.option:hover { background: #f1e6cf; }
.option[aria-pressed="true"] { color: #fff6df; border-color: #204937; background: #204937; }
.option-icon { width: 24px; text-align: center; flex: 0 0 24px; font-size: 20px; }
.share-box, .create-next {
  padding: 14px; border: 1px solid #d0b185; border-radius: 8px; background: #fff6e3;
}
.share-box { margin: 12px 0 18px; }
.share-box .field { margin-top: 0; }
.share-box .hint { margin-top: 6px; }
.share-box .actions { margin-top: 10px; }
.create-next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; margin: 14px 0 0;
}
.create-next > div { flex: 1 1 160px; }
.create-next h2 { margin-bottom: 3px; }
.create-next p { color: var(--muted); font-size: 14px; }
.create-next .primary {
  display: inline-flex; flex: none; align-items: center; justify-content: center; text-decoration: none;
}
.hint { color: var(--muted); font-size: 14px; margin-top: 12px; }
@media (max-width: 900px) {
  .hero-art { object-position: 59% center; }
  .hero::after { background: linear-gradient(90deg,#071b17eb,#071b17ac 33%,transparent 82%),linear-gradient(0deg,#081c18a6,transparent 27%); }
}
@media (max-width: 640px) {
  .masthead-inner { min-height: 66px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  nav { gap: 8px; }
  .nav-link { padding-inline: 12px; }
  .hero { min-height: 100svh; align-items: end; }
  .hero-art { height: 64%; object-position: 71% 57%; }
  .hero::after { background: linear-gradient(0deg,#0c2420 0%,#0c2420 35%,#0c2420e8 43%,#0c242038 63%,#0a211c00 75%,#091e1b86); }
  .hero-inner { padding-block: max(calc(78px + var(--safe-top)), 27svh) calc(23px + var(--safe-bottom)); }
  .hero-copy { max-width: 450px; }
  h1 { font-size: clamp(42px,10.4vw,65px); letter-spacing: -.07em; margin: 6px 0 9px; }
  h1 span { display: inline; }
  .hero-lead { margin-top: 10px; }
  .hero-description { margin-top: 7px; }
  .hero-actions { flex-wrap: wrap; gap: 12px 18px; margin-top: 16px; }
  .hero-meta { margin-top: 11px; }
  .hero-caption { display: none; }
  .how { padding-block: 56px; }
  .route-list { grid-template-columns: 1fr; margin-block: 25px; gap: 10px; }
  .route-list li { display: grid; grid-template-columns: 60px 1fr; text-align: left; column-gap: 13px; padding: 14px; align-items: center; }
  .route-icon { grid-row: span 2; width: 55px; height: 55px; margin: 0; font-size: 27px; }
  .route-list h3 { margin: 0; font-size: 21px; }
  .route-list p { font-size: 15px; }
  .play { background-position: 65% center; }
  .options { grid-template-columns: 1fr; }
  .option { min-height: 50px; }
}
@media (max-width: 360px) {
  .hero-actions { gap: 16px; }
  .paper { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.text-button { border: 0; background: transparent; color: var(--cream); padding: 4px 0; text-decoration: underline; }
.paper.wide { width: min(100%, 1080px); }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.board-tree, .board-side { min-width: 0; }
.tree-scene {
  position: relative; isolation: isolate; min-width: 0; min-height: 332px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 12px; border: 1px solid #a88149; background: #17352e;
  box-shadow: 0 5px 16px #32231024;
}
.tree-picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tree-flurries { position: absolute; inset: 0; pointer-events: none; }
.front-flake {
  position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size);
  display: grid; place-items: center; border-radius: 50%; background: #f8f5e8;
  opacity: .51; animation: tree-snow 4s var(--delay) ease-in-out both;
}
.front-flake.snow-star { width: auto; height: auto; color: #fff9ed; background: none; font: 13px/1 var(--sans); }
@keyframes tree-snow {
  from { opacity: .3; transform: translate(-5px,-9px); }
  57% { opacity: .72; }
  to { opacity: .57; transform: translate(6px,11px); }
}
.ornament {
  --ball: #a83831; --halo: #e49a74; position: relative; display: inline-block;
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: radial-gradient(ellipse at 34% 27%,#fff0caa8,transparent 38%), var(--ball);
  border: 1px solid #f4d39e;
  box-shadow: inset -5px -6px 9px #15171147, 0 2px 7px #111c1766;
}
.ornament::before {
  content: ""; width: 36%; height: 20%; position: absolute; top: -12%; left: 32%;
  border-radius: 3px 3px 1px 1px; background: linear-gradient(90deg,#867441,#e9c983,#a37938);
}
.ornament.gold { --ball: #bd832e; --halo: #f2c96d; }
.ornament.mint { --ball: #4b9867; --halo: #a1d3a7; }
.ornament.ice { --ball: #4a759f; --halo: #a2ccdc; }
.tree-pin {
  position: absolute; display: grid; place-items: center; z-index: 2; width: 44px; height: 44px; padding: 0;
  left: var(--x); top: var(--y); translate: -50% -50%; border: 0; border-radius: 50%;
  background: transparent; color: #442b1e;
}
.tree-pin.selected { z-index: 3; }
.tree-pin.featured { z-index: 4; width: 52px; height: 52px; }
.tree-pin:focus-visible { outline: 2px solid #fff1c3; outline-offset: 1px; }
.pin-figure { display: grid; place-items: center; position: relative; transform-origin: 50% -11px; }
.pin-figure::before {
  content: ""; position: absolute; left: 50%; bottom: 96%; width: 1px; height: 8px; background: #f4cc82;
}
.tree-pin .ornament { width: 25px; height: 25px; }
.tree-pin.selected:not(.featured) .ornament { outline: 2px solid #ffe4a1; outline-offset: 2px; }
.pin-name {
  position: absolute; z-index: 1; color: #432619; background: #fff2d0; border: 1px solid #cfaa65;
  border-radius: 4px; box-shadow: 0 2px 5px #211b1380; white-space: nowrap;
  line-height: 1; font-size: 12px; font-weight: 800; padding: 4px 6px;
}
.pin-name { top: 50%; translate: 0 -50%; }
.tag-left .pin-name { right: calc(100% + 2px); }
.tag-right .pin-name { left: calc(100% + 2px); }
.tree-pin.featured .pin-figure { animation: bulb-sway 2.4s ease-in-out 2 both; }
.tree-pin.featured .ornament {
  width: 42px; height: 42px; border-width: 2px;
  box-shadow: inset -6px -9px 12px #24160748, 0 0 16px color-mix(in srgb,var(--halo) 47%,transparent);
  animation: bulb-glimmer 2.4s ease-in-out 2 both;
}
.tree-pin.featured .pin-name {
  background: #fff4d8; color: #66271d; border: 2px solid #e5b366; font-size: 13px; padding-block: 6px;
}
@keyframes bulb-sway {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  75% { transform: rotate(9deg); }
}
@keyframes bulb-glimmer {
  0%,100% { box-shadow: inset -6px -9px 12px #24160748, 0 0 12px 1px color-mix(in srgb,var(--halo) 38%,transparent); }
  50% { box-shadow: inset -6px -9px 12px #24160748, 0 0 19px 2px color-mix(in srgb,var(--halo) 55%,transparent); }
}
.my-result {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center;
  margin: 13px 0 16px; padding: 10px 14px; border: 1px solid #cca679; border-radius: 10px;
  background: #f6e4c0; box-shadow: inset 0 0 0 3px #fff4dbad;
}
.result-kicker { font-size: 14px; font-weight: 700; color: #74362b; }
.my-rank { white-space: nowrap; font-size: 17px; font-weight: 800; color: #712d22; }
.my-rank strong { font: 800 34px/.95 var(--serif); }
.result-detail { padding-left: 14px; border-left: 1px solid #c7a578; color: var(--ink); overflow-wrap: anywhere; }
.result-nickname { font-weight: 800; color: var(--forest); }
.find-pin {
  min-height: 44px; padding: 3px 8px; border: 0; background: transparent; color: #752e24;
  text-underline-offset: 4px; text-decoration: underline; font-size: 14px; font-weight: 700;
}
.own-label { margin-left: 8px; color: #772f24; font-weight: 700; }
.question-swap { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; margin-top: 10px; }
.question-swap > span { color: var(--muted); font-size: 14px; }
.swap-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 11px;
  background: #f4e4c5; border: 1px solid #a18255; border-radius: 7px; color: #603727; font-weight: 800;
}
.swap-button:hover { background: #ebd5ae; }
.swap-button span { font: 800 21px/1 var(--sans); }
#screen-title:focus { outline: none; }
.ornament-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ornament-cards .option { min-height: 55px; }
.board-score { background: #f0dfb9; border: 1px solid #ccab71; border-radius: 8px; padding: 11px 12px; margin: 8px 0 15px; overflow-wrap: anywhere; }
.board-score strong { color: #84392d; }
.board .intro { margin-bottom: 12px; }
.rankings { list-style: none; margin: 0; padding: 0; max-height: 224px; overflow-y: auto; }
.rankings li { margin-bottom: 5px; }
.rank-row {
  display: grid; grid-template-columns: 3ch 33px minmax(0,1fr); align-items: center; gap: 9px; text-align: left;
  width: 100%; min-height: 46px; padding: 4px 9px; color: var(--forest); border: 1px solid #d6be95;
  border-radius: 7px; background: #fdf5e4; font-size: 14px;
}
.rank-row[aria-pressed="true"] { background: #ead8b2; border-color: #90683c; }
.rank-name { overflow-wrap: anywhere; }
.rank-number { color: #845338; font-variant-numeric: tabular-nums; }
.saved-trees { list-style: none; padding: 0; margin: 12px 0; }
.saved-trees li { margin: 8px 0; }
.saved-trees .option { width: 100%; }
@media (max-width: 700px) {
  .board { grid-template-columns: 1fr; }
  .tree-scene, .board-tree .create-next { width: min(100%,420px); margin-inline: auto; }
}
@media (max-width: 640px) {
  .hero-art { object-position: 74% center; }
  h1 { font-size: clamp(47px,12vw,70px); }
  h1 span { margin-left: .12em; }
  .board .actions .primary, .board .actions .secondary { flex: 1 1 100%; }
}
.hero h1 { letter-spacing: -.035em; }
.rankings { max-height: 322px; }
@media (max-width: 640px) {
  .hero-art { top: calc(44px + var(--safe-top)); height: 61%; }
}

.how { padding-block: 52px; }
.how-inner { max-width: 1020px; text-align: left; }
.how .edition { justify-content: flex-start; }
.guide-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; margin-top: 25px; }
.guide-preview .tree-scene { width: min(100%,368px); }
.guide-layout .route-list { grid-template-columns: 1fr; gap: 10px; margin: 0 0 16px; }
.guide-layout .route-list li { display: grid; grid-template-columns: 58px 1fr; align-items: center; column-gap: 14px; padding: 13px; }
.guide-layout .route-icon { grid-row: span 2; width: 53px; height: 53px; margin: 0; font-size: 27px; }
.guide-layout .route-list h3 { margin: 0; font-size: 23px; }
@media (max-width: 700px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-preview .tree-scene { width: min(100%,350px); }
}

@media (max-width: 460px) {
  .my-result { gap: 9px; padding-inline: 10px; }
  .result-detail { padding-left: 9px; font-size: 14px; }
  .find-pin { width: 5.4em; padding-inline: 2px; line-height: 1.25; }
  .pin-name { font-size: 11px; padding-inline: 4px; }
  .tree-pin.featured .pin-name { font-size: 12px; }
}

@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .masthead-inner { min-height: 68px; }

  .play {
    --phone-gutter: clamp(12px, 4vw, 24px);
    --phone-left: max(var(--phone-gutter), calc(var(--safe-left) + 12px));
    --phone-right: max(var(--phone-gutter), calc(var(--safe-right) + 12px));
    align-items: start;
    padding: calc(84px + var(--safe-top)) var(--phone-right) calc(24px + var(--safe-bottom)) var(--phone-left);
  }

  .paper { padding: clamp(18px, 5.3vw, 29px); overflow: visible; }
  .paper h1 { font-size: clamp(28px, 8.2vw, 38px); }
  .paper input { font-size: 16px; }
  .board { gap: 18px; }
  .rankings { max-height: none; overflow: visible; }

  .play.quiz-step { padding-bottom: calc(108px + var(--safe-bottom)); }
  .quiz-step .paper h1 { font-size: clamp(27px, 8vw, 35px); line-height: 1.22; }
  .quiz-step .paper .edition { margin-bottom: 6px; }
  .quiz-step progress { margin-bottom: 12px; }
  .progress-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress-row span:last-child { flex-shrink: 0; }

  .quiz-step .options { gap: 9px; }
  .quiz-step .option {
    min-height: 57px; padding: 10px 13px; font-size: 16px;
    overflow-wrap: anywhere; scroll-margin-bottom: calc(85px + var(--safe-bottom));
  }
  .quiz-step .swap-button { scroll-margin-bottom: calc(85px + var(--safe-bottom)); }

  .quiz-dock {
    position: fixed; inset: auto 0 0; z-index: 4;
    padding: 9px var(--phone-right) calc(13px + var(--safe-bottom)) var(--phone-left);
    background: var(--paper); border-top: 1px solid #c9a977; box-shadow: 0 -5px 20px #142e2552;
  }
  .paper .quiz-dock .actions {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
    width: min(100%, 640px); margin: 0 auto;
  }
  .quiz-dock .error { width: min(100%, 640px); margin: 0 auto 6px; overflow-wrap: anywhere; }
  .quiz-dock .primary { min-height: 52px; padding: 8px 12px; }
  .quiz-dock .plain { min-height: 52px; padding-inline: 10px; }
}

@media (max-width: 700px) {
  .share-box .primary { width: 100%; }
}

@media (max-width: 380px) {
  .create-next .primary { width: 100%; }
}

@media (max-width: 350px) {
  .my-result { grid-template-columns: auto minmax(0, 1fr); }
  .find-pin { grid-column: 2; justify-self: start; width: auto; }
}

@media (max-width: 360px), (max-height: 520px) and (pointer: coarse) {
  .masthead-inner { min-height: 62px; }
  .play { padding-top: calc(76px + var(--safe-top)); }
  .paper { padding: 16px; }
  .quiz-step .paper h1 { font-size: 25px; }
  .quiz-step .options { gap: 8px; }
  .quiz-step .option { min-height: 50px; padding: 8px 10px; }
  .quiz-dock .primary, .quiz-dock .plain { min-height: 48px; }
}
