/* =========================================================================
   Missionary Dash — game page
   One stage: the pixel scene fills it, HUD floats on top, and every
   dialogue / menu is a modal box over the scene.
   ========================================================================= */
.play-page { background: radial-gradient(100% 60% at 50% 0%, #fffdf3 0%, #fff 40%, var(--cloud) 100%); min-height: 100vh; }
.play-page .rays { position: fixed; top: 50%; opacity: .45; }
.play-page { overflow-x: clip; }
.game { position: relative; width: min(1180px, 100% - 24px); margin: 14px auto 28px; }
.foot-note { margin: 12px 0 0; }
.stage { position: relative; width: 100%; height: min(calc(100svh - 118px), calc(min(1180px, 100vw - 24px) * 0.5625)); min-height: 440px; border-radius: 22px; overflow: hidden; background: var(--sky);
  box-shadow: 0 0 0 1px var(--line), 0 0 0 7px #fff, 0 0 0 8px var(--line), 0 30px 70px -30px rgba(63, 143, 214, .55), 0 0 110px rgba(255, 238, 190, .6); isolation: isolate; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#overlay { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.maplabel { position: absolute; transform: translate(-50%, 9px); font: 600 clamp(10px, 1.3vw, 13px)/1 var(--pixel); color: var(--ink); background: rgba(255, 255, 255, .9); padding: 3px 6px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 2px rgba(38, 48, 79, .12); }
.maplabel.final { color: #c2335a; }

/* HUD chips (each opens a detail panel) */
#hud { position: absolute; z-index: 2; top: 10px; left: 10px; right: 60px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
#hud[hidden] { display: none; }
#hud > button { pointer-events: auto; cursor: pointer; border: 0; text-align: left; font: inherit; background: rgba(255, 255, 255, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 10px; padding: 5px 10px 6px; box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 2px 8px rgba(38, 48, 79, .12); min-width: 0; transition: transform .15s, box-shadow .2s, background .2s; }
#hud > button:hover, #hud > button:focus-visible { transform: translateY(-1px); background: #fff; box-shadow: 0 0 0 2px var(--gold-2), 0 4px 12px rgba(38, 48, 79, .16); outline: none; }
#hud span { display: block; font: 800 9px/1.1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
#hud b { display: flex; align-items: center; gap: 6px; font: 500 14px/1.25 var(--pixel); color: var(--ink); white-space: nowrap; }
.hl { font-style: normal; }
.hl.Good { color: #2f9a5a; } .hl.Fair { color: #c48a12; } .hl.Poor { color: #d0632a; } .hl.VeryPoor { color: #d0344f; }
.dots { display: inline-flex; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: #3fb07a; }
.dot.Fair { background: #e0a82a; } .dot.Poor { background: #e07a3a; } .dot.VeryPoor { background: #d0344f; } .dot.gone { background: #c9cfdc; }
.dot.sick { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #d0344f; }
#mute { position: absolute; z-index: 3; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 8px rgba(38, 48, 79, .15); display: grid; place-items: center; color: var(--ink); }
#mute svg { width: 20px; height: 20px; }
#mute .x { display: none; } #mute.off .x { display: block; } #mute.off .w { display: none; }

/* The modal dialog box */
.modal { position: absolute; z-index: 4; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(720px, 100% - 28px); max-height: calc(100% - 78px); overflow: auto; overscroll-behavior: contain;
  background: rgba(255, 253, 246, .95); backdrop-filter: blur(8px) saturate(1.2); -webkit-backdrop-filter: blur(8px) saturate(1.2);
  border-radius: 18px; padding: 18px 20px 16px; font-family: var(--pixel);
  box-shadow: 0 0 0 2px var(--gold-2), 0 0 0 6px rgba(255, 255, 255, .92), 0 0 0 7px rgba(212, 160, 60, .35), 0 24px 60px -12px rgba(38, 48, 79, .5);
  scrollbar-width: thin; scrollbar-color: var(--gold-2) transparent; }
.modal:empty { display: none; }
.modal.top { bottom: auto; top: 18px; width: min(620px, 100% - 28px); max-height: calc(100% - 120px); }
#hud:not([hidden]) ~ .modal.top { top: 62px; }
.modal.top.wide { width: min(900px, 100% - 28px); }
.modal.wide { width: min(900px, 100% - 28px); }
.modal > * { animation: rise .24s cubic-bezier(.2, .8, .3, 1) both; }
.modal > .choices { animation-delay: .04s; }
.modal.noanim > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal.compact { display: flex; align-items: center; gap: 14px; width: min(560px, 100% - 28px); padding: 10px 10px 10px 18px; }
.modal.compact .dlg { flex: 1; min-width: 0; }
.modal.compact .kicker { margin-bottom: 4px !important; }
.modal.compact .body p { margin: 0; font-size: 15px; }
.modal.compact .choices { margin: 0; flex: none; }
.modal.compact .choice { min-height: 44px; }

.dlg { display: flex; gap: 16px; align-items: flex-start; }
.pcol { flex: none; width: 96px; text-align: center; }
.portrait { width: 88px; height: 88px; image-rendering: pixelated; border-radius: 50%; display: block; margin: 0 auto 8px; box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--gold-2); }
.portrait.sm { width: 44px; height: 44px; margin: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold-soft); }
.who b { display: block; font: 600 13px/1.15 var(--pixel); color: var(--ink); }
.who span { display: block; font: 600 10.5px/1.25 var(--sans); color: var(--ink-3); margin-top: 3px; }
.tcol { flex: 1; min-width: 0; }
.modal .kicker { all: unset; display: block; font: 800 10.5px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
.modal h2 { font: 600 clamp(20px, 2.5vw, 26px)/1.15 var(--pixel); color: var(--ink); margin: 0 0 8px; letter-spacing: 0; }
.modal .body { font: 400 clamp(15px, 1.6vw, 17.5px)/1.45 var(--pixel); color: #35405f; }
.modal .body p { margin: 0 0 .6em; }
.modal .body p:last-child { margin-bottom: 0; }
.modal em { font-style: normal; color: var(--gold); }
.logo { display: block; font: 700 clamp(32px, 5vw, 52px)/1 var(--pixel); color: var(--ink); text-shadow: 0 3px 0 var(--gold-2); }
.logo-sub { display: block; font: 600 clamp(15px, 2vw, 19px)/1.4 var(--serif); font-style: italic; color: var(--gold); margin-top: 6px; letter-spacing: .02em; }
.ticker { color: var(--ink-2); }
.ticker::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; background: var(--gold-2); animation: twinkle 1s ease-in-out infinite; vertical-align: middle; }

.choices { display: grid; gap: 7px; margin-top: 14px; }
.choices.grid { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; cursor: pointer; border: 0; padding: 9px 12px; border-radius: 12px; background: #fff; color: var(--ink); font: 500 15.5px/1.25 var(--pixel); box-shadow: 0 0 0 1.5px var(--line); transition: box-shadow .2s, transform .15s, background .2s; min-height: 44px; }
.choice:hover:not([disabled]), .choice:focus-visible { box-shadow: 0 0 0 2px var(--sky-2), 0 6px 16px -8px rgba(63, 143, 214, .5); transform: translateY(-1px); outline: none; }
.choice .k { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--cloud); color: var(--sky-deep); font: 700 12px/1 var(--pixel); box-shadow: inset 0 0 0 1px var(--sky-2); }
.choice .l small { display: block; font: 600 12px/1.3 var(--sans); color: var(--ink-3); margin-top: 2px; }
.choice .l em { font-size: 13px; margin-left: 4px; }
.choice.primary { background: linear-gradient(180deg, #fffaf0, #fff3d6); box-shadow: 0 0 0 1.5px var(--gold-2), 0 6px 16px -10px rgba(212, 160, 60, .8); }
.choice.primary .k { background: var(--gold-2); color: #5a3e0c; box-shadow: none; }
.choice[disabled] { opacity: .45; cursor: not-allowed; }
.sep { height: 4px; }

/* Character customization */
.looker { margin-top: 10px; }
.ltabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ltab { display: flex; align-items: center; gap: 7px; border: 0; cursor: pointer; background: #fff; border-radius: 12px; padding: 5px 8px; font: 500 13.5px/1.1 var(--pixel); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); min-width: 0; }
.ltab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltab .portrait.sm { width: 32px; height: 32px; flex: none; }
.ltab.on { background: linear-gradient(180deg, #fffaf0, #fff3d6); color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold-2); }
.lgrid { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.lprev { text-align: center; }
.lprev .portrait { width: 104px; height: 104px; margin: 0 auto 6px; }
.lprev b { display: block; font: 600 14px/1.2 var(--pixel); color: var(--ink); }
.lprev small { font: 700 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lrows { display: grid; gap: 7px; }
.lrow { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; }
.lrow > span { font: 800 10px/1.1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lrow > div { display: flex; flex-wrap: wrap; gap: 5px; }
.sw { width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(38, 48, 79, .18); transition: transform .12s; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }
.chip { border: 0; cursor: pointer; font: 500 13.5px/1 var(--pixel); color: var(--ink-2); background: #fff; padding: 7px 10px; border-radius: 9px; box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.on { color: var(--ink); background: #fff3d6; box-shadow: inset 0 0 0 2px var(--gold-2); }
@media (max-width: 700px) {
  .ltabs { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .ltab { flex-direction: column; padding: 5px 2px; font-size: 11px; gap: 3px; }
  .lgrid { grid-template-columns: 1fr; }
  .lprev { display: none; }
  .lrow { grid-template-columns: 1fr; gap: 4px; }
  .sw { width: 28px; height: 28px; }
}

/* Little moments (toasts) */
#toasts { position: absolute; z-index: 3; left: 50%; translate: -50% 0; top: 70px; width: min(560px, 100% - 28px); display: grid; gap: 8px; pointer-events: none; }
.stage.peeking #toasts { display: none; }
.toast { pointer-events: auto; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 253, 246, .96); border-radius: 14px; padding: 10px 14px; font: 400 15px/1.4 var(--pixel); color: #35405f;
  box-shadow: 0 0 0 1.5px var(--gold-2), 0 10px 24px -10px rgba(38, 48, 79, .45); animation: toastin .45s cubic-bezier(.2, .9, .3, 1.2) both; transition: opacity .6s ease, transform .6s ease; }
.toast i { font-style: normal; flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #fff3d6; color: #b07a0c; font: 700 15px/1 var(--sans); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastin { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { #toasts { top: 96px; width: calc(100% - 16px); } .toast { font-size: 13.5px; padding: 8px 10px; } }

/* Warning states */
#hud > button small { font: 600 11px/1 var(--sans); color: var(--ink-3); margin-left: 2px; }
#hud span em { font-style: normal; display: inline-grid; place-items: center; width: 12px; height: 12px; border-radius: 50%; background: currentColor; margin-left: 3px; vertical-align: -2px; }
#hud span em { color: #e0a82a; font-size: 0; }
#hud > button.warn { background: #fff6dc; box-shadow: 0 0 0 1.5px #f2cf7a, 0 2px 8px rgba(38, 48, 79, .12); }
#hud > button.warn small { color: #b07a0c; }
#hud > button.danger { background: #ffe8ee; box-shadow: 0 0 0 2px #f0708f, 0 2px 10px rgba(208, 52, 79, .3); animation: hudpulse 1.3s ease-in-out infinite; }
#hud > button.danger span, #hud > button.danger small { color: #c2335a; }
#hud > button.danger span em { color: #d0344f; }
@keyframes hudpulse { 50% { box-shadow: 0 0 0 4px rgba(240, 112, 143, .45), 0 2px 12px rgba(208, 52, 79, .35); } }
.modal.tone-warn { box-shadow: 0 0 0 2px #f2cf7a, 0 0 0 6px rgba(255, 255, 255, .92), 0 0 0 7px rgba(224, 168, 42, .55), 0 24px 60px -12px rgba(38, 48, 79, .5); }
.modal.tone-danger { box-shadow: 0 0 0 2px #f0708f, 0 0 0 6px rgba(255, 255, 255, .92), 0 0 0 7px rgba(208, 52, 79, .5), 0 24px 60px -12px rgba(208, 52, 79, .45); }
.modal.tone-danger .kicker { color: #c2335a !important; }
.modal.tone-good { box-shadow: 0 0 0 2px #8fdcaa, 0 0 0 6px rgba(255, 255, 255, .92), 0 0 0 7px rgba(63, 176, 122, .45), 0 24px 60px -12px rgba(38, 48, 79, .45); }
.modal.tone-good .kicker { color: #2f9a5a !important; }
@media (prefers-reduced-motion: reduce) { #hud > button.danger { animation: none; } }

/* Detail panels ("peek") over the game */
.stage.peeking .modal { visibility: hidden; }
.peek { display: none; }
.peek.peek:not(:empty) { display: block; position: absolute; z-index: 6; left: 50%; top: 50%; translate: -50% -50%; width: min(780px, 100% - 28px); max-height: calc(100% - 28px); overflow: auto; overscroll-behavior: contain;
  background: rgba(255, 253, 246, .97); border-radius: 18px; padding: 14px 18px 14px; font-family: var(--pixel);
  box-shadow: 0 0 0 2px var(--sky-2), 0 0 0 6px rgba(255, 255, 255, .92), 0 0 0 7px rgba(63, 143, 214, .3), 0 24px 60px -12px rgba(38, 48, 79, .5); animation: rise .2s ease both; }
.peek.low:not(:empty) { top: auto; bottom: 14px; translate: -50% 0; max-height: 46%; }
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ptab { border: 0; cursor: pointer; font: 600 14px/1 var(--pixel); color: var(--ink-2); background: var(--cloud); padding: 8px 11px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); display: inline-flex; gap: 7px; align-items: center; }
.ptab kbd { font: 700 10px/1 var(--sans); color: var(--ink-3); background: #fff; border-radius: 4px; padding: 2px 4px; box-shadow: inset 0 0 0 1px var(--line); }
.ptab.on { background: linear-gradient(180deg, #fffaf0, #fff3d6); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.pbody h3 { font: 600 22px/1.2 var(--pixel); color: var(--ink); margin: 0 0 10px; }
.pbody .party { margin-bottom: 8px; }
.pbody .member small { margin-top: 2px; }
.pbody .member small.warn, .ptip .warn { color: #c2335a; }
.pbody .bar i.Fair { background: linear-gradient(90deg, #f2cf7a, #e0a82a); } .pbody .bar i.Poor { background: linear-gradient(90deg, #f6b07a, #e07a3a); } .pbody .bar i.VeryPoor { background: linear-gradient(90deg, #f08aa0, #d0344f); }
.ptip { font: 400 15px/1.5 var(--pixel); color: #35405f; margin: 10px 0 0; }
.ptip b { color: var(--ink); font-weight: 600; }
.pdone { margin-top: 12px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; max-width: 420px; }
.calgrid > b { font: 800 10px/1 var(--sans); color: var(--ink-3); text-align: center; letter-spacing: .1em; }
.cal { font-style: normal; display: grid; place-items: center; height: 34px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 500 14px/1 var(--pixel); color: var(--ink); }
.cal-pad { display: block; }
.cal.past { opacity: .4; }
.cal.sun { background: var(--cloud); color: var(--sky-deep); }
.cal.evt { background: #fff3d6; box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.cal.xfer { background: #ffe3ea; color: #c2335a; box-shadow: inset 0 0 0 1.5px #f58fae; }
.cal.today { background: var(--ink); color: #fff; box-shadow: 0 0 0 2px var(--gold-2); opacity: 1; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font: 400 14.5px/1.4 var(--pixel); color: #35405f; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .cal { width: 26px; height: 26px; flex: none; font-size: 12px; }
.route { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.route li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.route li i { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--ink-3); justify-self: center; }
.route li b { font-weight: 500; color: var(--ink); }
.route li span { font: 600 12.5px/1.2 var(--sans); color: var(--ink-3); text-align: right; }
.route .r-done i { background: #3fb07a; box-shadow: none; } .route .r-done b { color: var(--ink-3); }
.route .r-here i, .route .r-next i { background: var(--gold-2); box-shadow: 0 0 0 3px rgba(242, 207, 122, .4); }
.route .r-here b, .route .r-next b { font-weight: 700; }
.route .r-fork i { border-radius: 2px; transform: rotate(45deg); background: var(--sky-2); box-shadow: none; }
@media (max-width: 700px) {
  .peek.peek:not(:empty) { width: calc(100% - 16px); max-height: calc(100% - 16px); padding: 12px 12px; }
  .ptab { padding: 7px 9px; font-size: 13px; } .ptab kbd { display: none; }
  .peek.low:not(:empty) { bottom: 8px; max-height: 50%; }
}

/* Scene transitions: fade to white (or night) with a title card */
.curtain { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; text-align: center; opacity: 0; pointer-events: none; cursor: pointer; transition: opacity .42s ease;
  background: radial-gradient(circle at 50% 46%, #fffdf2 0%, #ffffff 48%, #f3f8ff 100%); }
.curtain::before { content: ''; position: absolute; left: 50%; top: 46%; width: 1400px; height: 1400px; margin: -700px 0 0 -700px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(242, 207, 122, .18) 0deg 5deg, rgba(255, 255, 255, 0) 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%); mask: radial-gradient(circle, #000 0%, transparent 55%); animation: spin 120s linear infinite; }
.curtain.on { opacity: 1; pointer-events: auto; }
.curtain.plain::before { display: none; }
.curtain .card { position: relative; max-width: 620px; opacity: 0; transform: translateY(10px); transition: opacity .5s ease .28s, transform .6s cubic-bezier(.2, .8, .3, 1) .28s; }
.curtain.on .card { opacity: 1; transform: none; }
.curtain .ck { display: block; font: 800 12px/1.3 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.curtain h3 { font: 600 clamp(34px, 5.4vw, 58px)/1.05 var(--serif); color: var(--ink); margin: 0 0 14px; }
.curtain p { font: italic 500 clamp(17px, 2vw, 21px)/1.4 var(--serif); color: var(--ink-2); margin: 0 auto; max-width: 30em; }
.curtain .orn { display: block; font-style: normal; color: var(--gold-2); margin-top: 18px; font-size: 18px; animation: twinkle 2.4s ease-in-out infinite; }
.curtain .hint { position: absolute; bottom: 18px; left: 0; right: 0; font: 700 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); opacity: 0; transition: opacity .4s ease 1s; }
.curtain.on .hint { opacity: .7; }
.curtain.dark { background: radial-gradient(circle at 50% 46%, #2a3360 0%, #161b33 55%, #0d1022 100%); }
.curtain.dark::before { background: repeating-conic-gradient(from 0deg, rgba(160, 190, 255, .06) 0deg 5deg, rgba(0, 0, 0, 0) 5deg 15deg); }
.curtain.dark h3 { color: #ffffff; }
.curtain.dark p { color: #b9c3e6; }
.curtain.dark .ck { color: var(--gold-2); }
.curtain.dark .hint { color: #8d97c0; }
@media (prefers-reduced-motion: reduce) { .curtain, .curtain .card { transition-duration: .01s; } }

/* Phones: the stage becomes the whole screen; the modal is a bottom sheet */
@media (max-width: 700px) {
  .game { width: 100%; margin: 0 0 20px; }
  .stage { height: calc(100svh - 66px); min-height: 520px; border-radius: 0; box-shadow: none; }
  .modal, .modal.wide { width: calc(100% - 16px); bottom: 8px; max-height: calc(100% - 96px); padding: 14px 14px 12px; border-radius: 16px; }
  .modal.compact { width: calc(100% - 16px); padding: 8px 8px 8px 14px; }
  .modal.compact { gap: 10px; }
  .modal.compact .kicker { font-size: 9.5px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal.compact .body p { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal.compact .ticker::after { display: none; }
  .modal.compact .choice { font-size: 14px; padding: 8px 12px; }
  .modal.compact .choice .k { display: none; }
  .dlg { gap: 12px; }
  .pcol { width: 64px; }
  .portrait { width: 60px; height: 60px; }
  .who span { display: none; }
  .choices.grid { grid-template-columns: 1fr; }
  .choices.many { grid-template-columns: 1fr 1fr; }
  .choices.many .choice { font-size: 14px; padding: 8px 9px; gap: 8px; min-height: 42px; }
  .choices.many .choice .k { display: none; }
  .choices.many .choice .l small { display: none; }
  .modal.top, .modal.top.wide { top: 56px; bottom: auto; max-height: calc(100% - 150px); }
  #hud:not([hidden]) ~ .modal.top { top: 92px; max-height: calc(100% - 180px); }
  #hud { left: 8px; top: 8px; right: 56px; gap: 4px; }
  #hud > button { padding: 4px 7px 5px; }
  #hud b { font-size: 12.5px; }
  #hud > button:nth-child(2), #hud > button:nth-child(6), #hud > button:nth-child(7) { display: none; }
  #mute { top: 8px; right: 8px; width: 38px; height: 38px; }
  .foot-note { padding: 0 16px; }
}
@media (max-width: 700px) and (max-height: 700px) { .portrait { width: 48px; height: 48px; } .pcol { width: 52px; } .who { display: none; } }

/* forms & tables */
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 560px) { .names { grid-template-columns: 1fr; } }
.namefield { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 6px 10px; box-shadow: 0 0 0 1.5px var(--line); }
.namefield span { font: 800 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); width: 64px; }
.namefield em { color: var(--gold) !important; font: 500 16px var(--pixel) !important; }
.namefield input, .epitaph input { border: 0; outline: 0; font: 500 17px/1.2 var(--pixel); color: var(--ink); background: transparent; min-width: 0; padding: 6px 0; width: 100%; }
.epitaph { display: block; margin-top: 12px; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 0 0 1.5px var(--gold-soft); }
.epitaph span { display: block; font: 700 12.5px/1.3 var(--sans); color: var(--ink-3); }
.namefield:focus-within, .epitaph:focus-within { box-shadow: 0 0 0 2px var(--sky-2); }

.store { margin-top: 10px; display: grid; gap: 6px; }
.store .row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 8px 10px 8px 14px; box-shadow: 0 0 0 1px var(--line); }
.store .nm b { font-weight: 600; font-size: 16px; color: var(--ink); }
.store small { display: block; font: 600 12px/1.3 var(--sans); color: var(--ink-3); }
.store .pr { text-align: right; font-size: 15px; color: var(--ink); white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer; background: var(--cloud); color: var(--sky-deep); font: 700 18px/1 var(--pixel); box-shadow: inset 0 0 0 1px var(--sky-2); }
.qty button:hover { background: var(--sky); }
.qty output { min-width: 38px; text-align: center; font-size: 17px; color: var(--ink); }
@media (max-width: 560px) { .store .row { grid-template-columns: 1fr auto; } .store .pr { grid-row: 1; grid-column: 2; } .qty { grid-column: 1 / -1; justify-content: flex-end; } .store .nm small { display: none; } }
.bill { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 14px; background: var(--gold-soft); border-radius: 12px; font-size: 16px; }
.bill .over { color: #d0344f; }

.party { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (max-width: 560px) { .party { grid-template-columns: 1fr; } }
.member { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 8px 10px; box-shadow: 0 0 0 1px var(--line); }
.member > div { flex: 1; min-width: 0; }
.member b { font-weight: 600; font-size: 15px; color: var(--ink); }
.member small { display: block; font: 600 12px/1.3 var(--sans); color: var(--ink-3); }
.member.gone { opacity: .55; }
.bar { height: 6px; background: var(--cloud); border-radius: 9px; margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8fdc6a, #3fb07a); border-radius: 9px; }
.inv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (max-width: 560px) { .inv { grid-template-columns: 1fr 1fr; } }
.inv div, .report div { background: #fff; border-radius: 10px; padding: 7px 10px; box-shadow: 0 0 0 1px var(--line); }
.inv span, .report span { display: block; font: 700 11px/1.2 var(--sans); color: var(--ink-3); }
.inv b, .report b { font-weight: 600; font-size: 17px; color: var(--ink); }
.report { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
@media (max-width: 560px) { .report { grid-template-columns: 1fr 1fr; } }
.trade { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; font-size: 16px; }
.trade span { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 0 0 1px var(--line); }
.trade b { display: block; font-weight: 600; color: var(--ink); }
table.hof, table.score { width: 100%; border-collapse: collapse; font-size: 16px; }
table.hof th { text-align: left; font: 800 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px; }
table.hof td, table.score td { padding: 7px 8px; border-top: 1px solid var(--line); color: var(--ink); }
table.hof tr:nth-child(1) td { color: #b88324; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
table.score tr.sub td { border-top: 2px solid var(--gold-soft); }
table.score tr.tot td { font-size: 20px; color: #b88324; border-top: 2px solid var(--gold-2); }
.rank { margin-top: 10px; }
.foot-note { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 18px; font-family: var(--sans); }
.foot-note kbd { font: 600 12px var(--pixel); background: #fff; border-radius: 6px; padding: 2px 6px; box-shadow: 0 0 0 1px var(--line); }
