/* ---- HUD extras (each one has a place: hud-slots, rule U27) ---- */
.sg-roomname { color: var(--gf-text); font: 700 14px/1.3 var(--gf-font); letter-spacing: 2px; background: var(--gf-hud-surface); border-bottom: 2px solid var(--gf-accent-2); padding: 4px 12px; border-radius: var(--gf-radius); opacity: 0; transition: opacity 0.5s; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; align-self: flex-start; pointer-events: none; }
.sg-roomname.show { opacity: 1; }
.sg-roomname:not(.show) { display: none; }
.sg-marker { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: -14px 0 0 -60px; width: 120px; pointer-events: none; will-change: transform; }
.sg-marker .mk-dia { color: var(--gf-accent-2); font-size: 18px; line-height: 1; text-shadow: 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.8); }
.sg-marker .mk-label { font-size: 11px; color: var(--gf-text); background: var(--gf-hud-surface); padding: 1px 7px; border-radius: 8px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.sg-marker.edge .mk-label { opacity: 0.8; }
.sg-debug { position: absolute; right: 8px; bottom: 8px; font: 11px/1.4 ui-monospace, monospace; background: rgba(0, 0, 0, 0.7); padding: 6px 8px; border-radius: 4px; white-space: pre-wrap; color: #cfe; max-width: 52vw; display: none; }
html.sg-dbg .sg-debug { display: block; }
.sg-who { display: inline-block; font: 700 11px var(--gf-font); color: var(--gf-accent-2); border: 1px solid var(--gf-accent-2); border-radius: 3px; padding: 0 4px; margin-right: 8px; vertical-align: 2px; }
.sg-who.me { color: var(--gf-text); border-color: var(--gf-border-strong); }

/* ---- lane items of the game (the lane itself: kit css/shell.css .tl-*): pick-up / place / look-at cards, the side-job note, sound captions ---- */
.tl-pickup .tl-body, .tl-place .tl-body, .tl-look .tl-body { display: flex; align-items: center; gap: 10px; }
.tl-pickup .pk-img, .tl-look .lk-img { /* pair-ok: no text */ flex: none; width: 56px; height: 56px; border-radius: 6px; background: var(--gf-surface-2) center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.tl-place .pc-img { /* pair-ok: no text */ flex: none; width: 84px; aspect-ratio: 3 / 2; border-radius: 3px; background: var(--gf-surface-2) center/cover no-repeat; box-shadow: 0 0 0 2px var(--gf-border-strong); }
.tl-pickup small, .tl-place small { display: block; font-size: 11px; color: var(--gf-text-dim); letter-spacing: 2px; }
.tl-pickup b, .tl-look b { display: block; font-size: 14px; }
.tl-place b { font: 700 16px var(--gf-font-serif); }
.tl-pickup .pk-feel, .tl-look em { display: block; font-style: normal; font-size: 12px; color: var(--gf-text-dim); }
.tl-pickup span:not(.pk-feel), .tl-look span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--gf-text-dim); }
.tl-quest-note b { display: block; font-size: 14px; }
.tl-quest-note span { color: var(--gf-text-dim); }
.tl-caption { font-size: 13px; padding-top: 4px; padding-bottom: 4px; }

/* ---- fade / death ---- */
#fade { /* pair-ok: no text */ position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 15; transition: opacity 0.35s; }
#fade.on { opacity: 1; }
#death { position: fixed; inset: 0; z-index: 25; background: #000; color: #d8d0c0; display: flex; flex-direction: column; gap: 20px; padding: 24px; text-align: center; align-items: center; justify-content: center; }
#death-text { font: 22px var(--gf-font-serif); color: #d8d0c0; letter-spacing: 4px; animation: sgfade 2s; }
#death-note { max-width: 32em; font-size: 17px; line-height: 1.7; }
#death-go { min-height: 48px; padding: 10px 28px; color: #eee6d6; border-color: rgba(238, 230, 214, 0.6); background: rgba(0, 0, 0, 0.3); }
@keyframes sgfade { from { opacity: 0; } to { opacity: 1; } }
/* what you see through what you wear / hide in (in the world, not a screen effect) */
#visor { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 4; pointer-events: none; }
#visor .vz-band { /* pair-ok: no text */ position: absolute; left: -5%; right: -5%; top: 0; height: 74%; background: linear-gradient(#000 0 82%, rgba(0, 0, 0, 0.85)); border-bottom-left-radius: 50% 22%; border-bottom-right-radius: 50% 22%; }
#visor .vz-note { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); color: #b4aa96; font-size: 13px; white-space: nowrap; }
#hide-vents { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 4; pointer-events: none; background: repeating-linear-gradient(#050505 0 26px, transparent 26px 34px); box-shadow: inset 0 0 120px #000; }
#visor.hidden, #hide-vents.hidden { display: none; }

/* ---- the opening (一人語り): a picture behind, the thought on a strip of shadow ---- */
#intro { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 22; background: #000; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px max(36px, var(--gf-safe-b, 0px)); }
#intro-bg, #intro-bg2 { /* pair-ok: no text */ position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity 1.6s; filter: saturate(0.7) brightness(0.7); }
#intro-bg.on, #intro-bg2.on { opacity: 1; }
.intro-box { color: var(--gf-mg-ink); position: relative; width: min(680px, 100%); background: rgba(0, 0, 0, 0.7); padding: 16px 20px 10px; border-radius: 6px; cursor: pointer; }
#intro-text { font: 19px/1.9 var(--gf-font-serif); color: #f4ecdc; min-height: 3.8em; }
#intro-text.in { animation: sgfade 0.6s; }
.intro-foot { display: flex; justify-content: space-between; font-size: 12px; color: #b4aea0; margin-top: 6px; }
#intro-skip { color: var(--gf-text); position: absolute; right: max(14px, var(--gf-safe-r, 0px)); top: max(14px, var(--gf-safe-t, 0px)); padding: 7px 14px; border-radius: 6px; border: 1px solid var(--gf-border-strong); background: rgba(0, 0, 0, 0.6); cursor: pointer; font-size: 13px; min-height: 44px; }
@media (max-height: 460px) { #intro-text { font-size: 16px; line-height: 1.7; min-height: 3.4em; } .intro-box { padding: 10px 14px 6px; } }

/* ---- the ending film and the result card ---- */
#ending { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 26; background: #000; }
#ending-img, #ending-img2 { /* pair-ok: no text */ position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity 2.2s; }
#ending-img.on, #ending-img2.on { opacity: 0.8; }
#ending-text { position: absolute; left: 50%; bottom: max(10%, 72px); transform: translateX(-50%); width: min(88vw, 720px); text-align: center; font: 18px/1.9 var(--gf-font-serif); text-shadow: 0 0 8px #000, 0 0 3px #000; color: #f4eee0; }
#ending-text .last { font-size: 21px; color: #fff; margin-top: 10px; }
#ending-text p { margin: 0 0 6px; padding: 8px 14px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); color: inherit; display: none; } /* pair-ok: on the dark film */
#ending-text p.on { display: block; animation: end-film-fade 1.2s both; }
@keyframes end-film-fade { from { opacity: 0; } to { opacity: 1; } }
#ending-skip { color: #f4eee0; position: absolute; right: 16px; bottom: 16px; padding: 8px 14px; border-radius: 6px; border: 1px solid #777; background: rgba(0, 0, 0, 0.7); cursor: pointer; min-height: 44px; }
.sg-result { text-align: center; }
#result-photo { /* pair-ok: no text */ height: min(34vw, 190px); margin: 0 0 10px; background: var(--gf-surface-2) center/cover no-repeat; border-radius: var(--gf-radius); }
.result-code { font-size: 13px; color: var(--gf-text-dim); letter-spacing: 2px; }
.result-title { font: 700 28px var(--gf-font-serif); margin: 6px 0; color: var(--gf-goal); }
.result-last { font: 16px var(--gf-font-serif); margin-bottom: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.result-grid div { background: var(--gf-surface-2); border-radius: 6px; padding: 8px 4px; font-size: 12px; color: var(--gf-text-dim); }
.result-grid b { display: block; font-size: 17px; color: var(--gf-text); margin-top: 2px; }
#result-ends, .sg-ends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.end-card { color: var(--gf-text); border: 1px solid var(--gf-border); border-radius: 6px; padding: 6px; font-size: 12px; background: var(--gf-surface-2); text-align: left; }
.end-card.seen { border-color: var(--gf-accent-2); }
.end-card.now { border-color: var(--gf-accent); box-shadow: 0 0 0 1px var(--gf-accent); }
.end-card .thumb { /* pair-ok: no text */ height: 56px; background: var(--gf-bg) center/cover no-repeat; border-radius: 4px; margin-bottom: 4px; }
.sg-ends .end-card { cursor: pointer; padding: 8px; font-size: 13px; font-family: inherit; }
.sg-ends .end-card .thumb { height: 90px; }
.sg-ends .end-card b, .sg-ends .end-card .small { display: block; }
.sg-btns { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.sg-btns.row { flex-direction: row; flex-wrap: wrap; }
.sg-btns .btn { min-height: 44px; }
.share-text { font-size: 13px; color: var(--gf-text-dim); margin: 6px 0; }
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 6px; }
.share-buttons button { color: var(--gf-text); padding: 9px 6px; border-radius: 8px; border: 1px solid var(--gf-border); background: var(--gf-surface-2); cursor: pointer; min-height: 44px; }
.share-buttons .share-x { color: #fff; background: #000; border-color: #555; }
.share-buttons .share-fb { color: #fff; background: #1b4f9a; }
.share-buttons .share-line { color: #fff; background: #057a38; }
.share-note { font-size: 12px; color: var(--gf-text-dim); min-height: 1.4em; }
.sg-credits p { font-size: 14px; line-height: 1.8; }
.small { font-size: 12px; color: var(--gf-text-dim); line-height: 1.6; }
.sg-keyhint { font-size: 12px; color: var(--gf-text-dim); text-align: center; margin: 10px 0 0; }

/* ---- the controls card ---- */
.sg-controls .goal { font-size: 15px; line-height: 1.8; margin: 0 0 12px; padding: 10px; border: 1px solid var(--gf-accent-2); border-radius: 6px; background: var(--gf-note-bg); color: var(--gf-note-text); }
.sg-controls .keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; font-size: 14px; margin: 8px 0; }
.sg-controls .keys dt { margin: 0; }
.sg-controls .keys dd { margin: 0; }
.sg-controls .kc { display: inline-block; min-width: 26px; padding: 2px 6px; margin-right: 3px; border: 1px solid var(--gf-border-strong); border-radius: 4px; text-align: center; font: 12px ui-monospace, monospace; background: var(--gf-surface-2); color: var(--gf-text); }
.sg-controls #controls-go { width: 100%; min-height: 48px; margin-top: 8px; font-size: 16px; }

/* ---- papers: a sheet of paper in a dark game (tokens switch together: .gf-paper) ---- */
.sg-paper { color: var(--gf-text); padding: 16px 20px 14px; border-radius: 2px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); position: relative; }
#doc-photo { /* pair-ok: no text */ height: min(42vw, 230px); margin: -2px -4px 12px; background: var(--gf-surface-2) center/cover; border: 6px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); transform: rotate(-0.8deg); }
#doc-body { font: 16px/1.95 var(--gf-font-serif); white-space: pre-wrap; user-select: text; }
#doc-body.hand { font: 19px/1.9 var(--gf-font-hand); color: #24345a; }
#doc-attach { margin: 14px 0 4px; display: flex; gap: 10px; align-items: flex-end; }
#doc-attach .att-img { /* pair-ok: no text */ width: 46%; aspect-ratio: 3 / 2; background: var(--gf-surface-2) center/cover; border: 5px solid #fff; border-bottom-width: 18px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); transform: rotate(2deg); }
#doc-attach .att-cap { font: 14px var(--gf-font-hand); color: var(--gf-text-dim); }
#doc-src { margin-top: 12px; font-size: 12px; color: var(--gf-text-dim); border-top: 1px dashed var(--gf-border-strong); padding-top: 6px; }
#doc-think { margin-top: 8px; font: 16px var(--gf-font-hand); color: #7a2a1a; }
.sg-paper.note { color: var(--gf-mg-ink); background: var(--gf-surface); }
.sg-photoview { text-align: center; }
.sg-photoview img { max-width: 100%; max-height: 50vh; border: 6px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.sg-feel { font: 16px var(--gf-font-hand); color: var(--gf-voice-text); background: var(--gf-voice-bg); border-left: 3px solid var(--gf-voice-line); padding: 6px 10px; margin: 10px 0; text-align: left; }

/* ---- a choice ---- */
.sg-choice { text-align: center; }
#choice-photo { /* pair-ok: no text */ height: min(46vw, 220px); background: var(--gf-surface-2) center/cover; margin: 0 0 12px; border: 5px solid #e8e0cc; }
#choice-text { font: 16px/1.8 var(--gf-font-serif); white-space: pre-wrap; text-align: left; }

/* ---- the notebook tab 手帳 ---- */
.sg-log h4 { margin: 14px 0 6px; font: 700 14px var(--gf-font); color: var(--gf-heading); border-bottom: 1px solid var(--gf-border); }
.sg-log .where { margin: 4px 0; }
.sg-log .hintline { color: var(--gf-note-text); background: var(--gf-note-bg); border-left: 3px solid var(--gf-note-line); padding: 4px 10px; }
.sg-log .empty { color: var(--gf-text-dim); }
.jr-q { color: var(--gf-mg-ink); background: var(--gf-surface-2); border: 1px solid var(--gf-border); padding: 8px 10px; margin-bottom: 8px; border-radius: 4px; }
.jr-q.done { opacity: 0.9; }
.jr-qt { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.jr-qs { margin-left: auto; font-size: 12px; color: var(--gf-text-dim); }
.jr-qsteps { margin: 4px 0 0; padding-left: 1.6em; }
.jr-qsteps li.done { color: var(--gf-text-dim); text-decoration: line-through; }
.jr-qsteps li.now { color: var(--gf-goal); font-weight: 700; }
.jr-qr { color: var(--gf-ok); font-size: 13px; }
.jr-notes { list-style: none; padding: 0; margin: 0; }
.jr-notes li { padding: 3px 0; font-family: var(--gf-font-hand); font-size: 16px; color: var(--gf-text); }
.jr-notes li.rule { color: var(--gf-accent-2); }
.jr-notes .t { font: 11px var(--gf-font); color: var(--gf-text-dim); margin-right: 6px; }
.jr-work { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.jr-work .wk { text-align: left; background: var(--gf-surface-2); color: var(--gf-text); border: 1px solid var(--gf-border); border-radius: 6px; padding: 10px; min-height: 56px; font-family: var(--gf-font-hand); cursor: pointer; }
.jr-work .wk small { display: block; color: var(--gf-text-dim); font-family: var(--gf-font); font-size: 11px; }
.jr-work .wk.new { border-color: var(--gf-accent-2); box-shadow: 0 0 0 2px var(--gf-accent-2); }

/* ---- the job panels (the standard window "term"): dark glass ---- */
.sg-term { background: var(--gf-mg-bg); color: var(--gf-mg-ink); border: 1px solid var(--gf-mg-line); border-radius: var(--gf-radius); padding: 10px 12px; position: relative; min-height: 100%; box-sizing: border-box; }
.sg-termhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sg-termhead #term-photo { /* pair-ok: no text */ width: 76px; height: 52px; background: var(--gf-mg-bg-2) center/cover; border: 2px solid var(--gf-border-strong); flex: none; }
.sg-termhead #term-photo.hidden { display: none; }
#term-body { font-size: 14px; line-height: 1.6; }
#term-body button { border: 1px solid var(--gf-mg-line); background: var(--gf-mg-btn); color: var(--gf-mg-ink); border-radius: 6px; padding: 8px 10px; font-size: 14px; cursor: pointer; min-height: 44px; }
#term-body button.on { color: var(--gf-mg-ink); background: var(--gf-accent-soft); border-color: var(--gf-ok); }
#term-body button.off, #term-body button.main.off { opacity: 1; pointer-events: none; border-style: dashed; background: var(--gf-mg-btn); border-color: var(--gf-mg-line); color: var(--gf-mg-dim); } /* unavailable: a quieter paired colour, not a see-through one (U30) */
#term-body button.main { background: var(--gf-accent-2); border-color: var(--gf-accent-2); color: #1a1400; font-weight: 700; padding: 10px 18px; }
#term-body button.danger { background: #5a2018; border-color: var(--gf-danger); color: #fff; }
#term-body button.sm { padding: 6px 9px; }
#term-body button.focus, #term-body button:focus-visible { outline: 2px solid var(--gf-mg-warn); }
.t-lead { color: var(--gf-mg-ink); margin: 0 0 8px; }
.t-miss { color: var(--gf-mg-warn); margin-bottom: 8px; }
.t-done { color: var(--gf-ok); font-weight: 700; margin: 8px 0; }
.t-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.t-col { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.t-col button { text-align: left; min-height: 48px; }
.t-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.t-sel small { width: 100%; color: var(--gf-mg-dim); font-size: 12px; }
.t-hint { margin-top: 10px; padding: 8px; border-left: 3px solid var(--gf-mg-warn); background: var(--gf-mg-bg-2); color: var(--gf-mg-ink); font-size: 13px; }
.t-hint.dim { color: var(--gf-mg-dim); border-color: var(--gf-mg-line); }
.t-warn { margin: 10px 0 0; padding: 8px; border: 2px solid var(--gf-danger); background: var(--gf-warn-bg); color: var(--gf-warn-text); border-radius: 6px; }
.t-why { font: 16px/1.6 var(--gf-font-hand); color: var(--gf-mg-ink); margin: 0 0 8px; }
.t-why .who { display: inline-block; font: 700 11px var(--gf-font); color: var(--gf-mg-warn); border: 1px solid var(--gf-mg-warn); border-radius: 3px; padding: 0 4px; margin-right: 8px; vertical-align: 2px; }
.t-top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.t-goal { flex: 1; font-size: 13px; line-height: 1.6; color: var(--gf-mg-ink); background: var(--gf-mg-bg-2); border-left: 3px solid var(--gf-ok); padding: 4px 8px; }
.t-goal b { color: var(--gf-ok); margin-right: 6px; }
#term-body .t-help { flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; font-weight: 700; }
.t-helpbox { font-size: 13px; line-height: 1.7; background: var(--gf-mg-bg-2); color: var(--gf-mg-ink); border: 1px dashed var(--gf-mg-line); padding: 8px; margin-bottom: 8px; }
.t-helpbox b { color: var(--gf-mg-warn); margin-right: 6px; }
.t-rel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.t-rel small { width: 100%; color: var(--gf-mg-dim); font-size: 11.5px; }
#term-body .t-relitem { display: flex; flex-direction: column; align-items: center; width: 78px; padding: 3px; background: #ece4cf; color: #222; border: none; border-radius: 3px; min-height: 0; }
.t-relitem span { /* pair-ok: no text */ width: 66px; height: 50px; background: #333 center/cover; }
.t-relitem i { font-style: normal; font-size: 10.5px; line-height: 1.25; margin-top: 2px; color: #222; }
.t-reldetail { position: absolute; inset: 0; background: var(--gf-mg-bg); color: var(--gf-mg-ink); display: flex; gap: 14px; padding: 18px; z-index: 3; border-radius: var(--gf-radius); cursor: pointer; }
.t-reldetail .rd-img { /* pair-ok: no text */ flex: 1; background: var(--gf-mg-bg-2) center/contain no-repeat; min-height: 200px; }
.t-reldetail .rd-txt { flex: 1; overflow: auto; }
.t-reldetail .rd-txt p { white-space: pre-wrap; font: 16px/1.8 var(--gf-font-serif); }
.t-reldetail .close-btn { position: absolute; right: 12px; top: 12px; border: 1px solid var(--gf-mg-line); background: var(--gf-mg-btn); color: var(--gf-mg-ink); border-radius: 6px; padding: 6px 12px; min-height: 44px; }
.dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.dial { color: var(--gf-mg-ink); background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 6px; padding: 6px; text-align: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.dial small { width: 100%; color: var(--gf-mg-dim); font-size: 12px; }
.dial b { flex: 1; font-size: 15px; color: var(--gf-mg-ink); min-width: 4em; }
.t-dep ul.dep { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; }
.t-dep li { color: var(--gf-mg-ink); background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 6px; padding: 6px 10px; }
.t-dep li.ok b { color: var(--gf-ok); }
.t-dep li.lock b { color: var(--gf-mg-dim); }
.t-dep li small { display: block; color: var(--gf-mg-dim); font-size: 12px; }
.t-dep h4 { margin: 12px 0 4px; color: var(--gf-mg-ink); }
#term-toast { min-height: 1.6em; margin-top: 10px; font-size: 14px; color: var(--gf-mg-ink); line-height: 1.6; }
.p01-top { align-items: center; flex-wrap: nowrap !important; }
.p01-top .p01-screen { flex: 1; min-width: 0; }
@media (max-width: 560px) { .p01-top { flex-wrap: wrap !important; } }

/* ---- widgets common to the job panels ---- */
/* ---- hands-on controls of the job panels (js/mini.js, js/mini-moon.js): mouse, touch and keys; colours are the dark-glass tokens --gf-mg-* ---- */
.dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.dial { color: var(--gf-mg-ink); background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 6px; padding: 6px; text-align: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.dial small { width: 100%; color: var(--gf-mg-dim); font-size: 12px; }
.dial b { flex: 1; font-size: 15px; color: var(--gf-mg-ink); min-width: 4em; }
.clues { display: grid; gap: 6px; margin: 6px 0 10px; }
.clue { color: var(--gf-mg-ink); display: flex; gap: 8px; align-items: center; background: var(--gf-mg-bg-2); border-radius: 6px; padding: 5px; }
.clue span { color: var(--gf-mg-ink); width: 46px; height: 46px; flex: none; background: #333 center/cover; border: 2px solid #ddd; }
.clue b { display: block; font-size: 13px; }
.clue small { display: block; font-size: 12px; color: var(--gf-mg-ink); line-height: 1.45; }
.recs { display: grid; gap: 8px; }
.rec { position: relative; text-align: left; }
.rec small { display: block; color: var(--gf-mg-dim); }
.rec i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 700 22px ui-monospace, monospace; color: var(--gf-mg-warn); font-style: normal; }
.keys6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
/* ---- hands-on panel controls (js/mini.js) ---- */
.t-top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.t-goal { flex: 1; font-size: 13px; line-height: 1.6; color: var(--gf-mg-ink); background: rgba(120, 200, 140, 0.08); border-left: 3px solid var(--gf-ok); padding: 4px 8px; }
.t-goal b { color: var(--gf-ok); margin-right: 6px; }
#term-body .t-help { flex: none; width: 34px; height: 34px; border-radius: 50%; padding: 0; font-weight: 700; }
.t-helpbox { color: var(--gf-mg-ink); font-size: 13px; line-height: 1.7; background: var(--gf-mg-bg-2); border: 1px dashed var(--gf-mg-line); padding: 8px; margin-bottom: 8px; }
.t-helpbox b { color: var(--gf-mg-warn); margin-right: 6px; }
.t-rel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.t-rel small { width: 100%; color: var(--gf-mg-dim); font-size: 11.5px; }
#term-body .t-relitem { display: flex; flex-direction: column; align-items: center; width: 74px; padding: 3px; background: #ece4cf; color: #222; border: none; border-radius: 3px; }
.t-relitem span { color: var(--gf-mg-ink); width: 66px; height: 50px; background: #333 center/cover; }
.t-relitem i { font-style: normal; font-size: 10.5px; line-height: 1.25; margin-top: 2px; }
.t-reldetail { color: var(--gf-mg-ink); position: absolute; inset: 0; background: rgba(10, 10, 8, 0.96); display: flex; gap: 14px; padding: 18px; z-index: 3; border-radius: 10px; }
.term-panel { position: relative; }
.t-reldetail .rd-img { color: var(--gf-mg-ink); flex: 1; background: #222 center/contain no-repeat; min-height: 200px; }
.t-reldetail .rd-txt { flex: 1; overflow: auto; }
.t-reldetail .rd-txt p { white-space: pre-wrap; font: 16px/1.8 var(--gf-font-serif); }
.t-reldetail .close-btn { position: absolute; right: 12px; top: 12px; }
.mg-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0; }
.mg-drum { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 92px; }
.mg-drum small, .mg-knob small, .mg-key small, .mg-lever small, .mg-crank small { color: var(--gf-mg-dim); font-size: 12px; text-align: center; }
.mg-flap { color: var(--gf-mg-ink); position: relative; width: 112px; height: 86px; background: var(--gf-mg-bg-2); border: 2px solid var(--gf-mg-line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; box-shadow: inset 0 0 12px #000; }
.mg-flap b { font: 700 20px var(--gf-font); color: var(--gf-mg-ink); z-index: 1; }
.mg-flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #000; }
.mg-flap .prev, .mg-flap .next { font-size: 11px; color: #6a6458; }
.mg-flap.flip b { animation: flip 0.18s ease-out; }
@keyframes flip { 0% { transform: scaleY(0.2); } 100% { transform: scaleY(1); } }
#term-body .mg-up, #term-body .mg-dn { padding: 2px 18px; font-size: 12px; }
.mg-knob { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mg-k { position: relative; width: 150px; height: 150px; }
.mg-k .ticks .tick { position: absolute; transform: translate(-50%, -50%); font: 11px ui-monospace, monospace; color: #8a9a8e; }
.mg-k .ticks .tick.on { color: var(--gf-mg-warn); font-weight: 700; }
.mg-k .cap { color: var(--gf-mg-ink); position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a5e60, #1a1c1e); border: 3px solid #2a2e30; box-shadow: 0 4px 10px #000; cursor: grab; touch-action: none; }
.mg-k .cap i { color: var(--gf-mg-ink); position: absolute; left: 50%; top: 6px; width: 6px; height: 26px; margin-left: -3px; background: #e8e0c8; border-radius: 3px; }
.mg-kbtn { display: flex; gap: 6px; align-items: center; }
.mg-kbtn b { min-width: 3.4em; text-align: center; color: var(--gf-mg-warn); }
.mg-key, .mg-lever, .mg-crank { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.mg-lock { color: var(--gf-mg-ink); width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #2a2c2e 30%, #4a4e50 31%, var(--gf-mg-line) 60%, #1a1c1e); display: flex; align-items: center; justify-content: center; }
.mg-bow { color: var(--gf-mg-ink); width: 64px; height: 64px; border-radius: 10px; background: #8a7a50 center/cover; border: 3px solid #c8b878; cursor: grab; touch-action: none; transition: transform 0.08s; }
.mg-key.done .mg-bow { border-color: var(--gf-ok); }
.mg-slot { color: var(--gf-mg-ink); position: relative; width: 46px; height: 130px; background: var(--gf-mg-bg-2); border: 2px solid var(--gf-mg-line); border-radius: 8px; }
.mg-handle { color: var(--gf-mg-ink); position: absolute; left: -10px; right: -10px; height: 30px; background: linear-gradient(#d84a3a, #8a2a20); border-radius: 6px; cursor: grab; touch-action: none; box-shadow: 0 3px 6px #000; }
.mg-lever.on .mg-handle { color: var(--gf-mg-ink); background: linear-gradient(#5ad07a, #2a7a3a); }
.mg-lever.off { opacity: 0.45; }
.mg-state { font: 700 13px ui-monospace, monospace; color: var(--gf-mg-warn); }
.mg-wheel { color: var(--gf-mg-ink); position: relative; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--gf-mg-line) 18%, #1a1c1e 19%, #2a2e30 70%, #111 71%); cursor: grab; touch-action: none; }
.mg-arm { color: var(--gf-mg-ink); position: absolute; left: 50%; top: 50%; width: 10px; height: 62px; margin-left: -5px; transform-origin: 50% 0; background: #9a9ea2; border-radius: 5px; }
.mg-arm { margin-top: 0; }
.mg-arm i { color: var(--gf-mg-ink); position: absolute; left: -9px; bottom: -10px; width: 28px; height: 28px; border-radius: 50%; background: #6a4a2a; }
.mg-prog { color: var(--gf-mg-ink); width: 130px; height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
.mg-prog i { color: var(--gf-mg-ink); display: block; height: 100%; width: 0; background: var(--gf-mg-warn); }
.mg-crank.done .mg-prog i { color: var(--gf-mg-ink); background: var(--gf-ok); }
.mg-cards { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.mg-slots { display: flex; gap: 8px; }
.mg-slotbox { flex: 1; min-height: 96px; border: 2px dashed var(--gf-mg-line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.mg-slotbox small { color: var(--gf-mg-dim); font-size: 12px; }
.mg-slotbox.hover { color: var(--gf-mg-ink); border-color: var(--gf-mg-warn); background: rgba(240, 192, 80, 0.08); }
.mg-tray { color: var(--gf-mg-ink); display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; padding: 6px; background: var(--gf-mg-bg-2); border-radius: 8px; }
.mg-card { background: #ece4cf; color: #1f1d1a; border-radius: 4px; padding: 8px 10px; font: 14px/1.5 var(--gf-font-serif); cursor: grab; touch-action: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); user-select: none; position: relative; z-index: 1; max-width: 100%; }
.mg-card small { display: block; color: #6a5a40; font: 12px var(--gf-font); }
.mg-card.picked { outline: 3px solid var(--gf-mg-warn); }
.mg-card.dragging { z-index: 10; opacity: 0.9; box-shadow: 0 10px 24px #000; }
@media (max-width: 640px) {
  .mg-slots { flex-direction: column; }
  .mg-k { width: 120px; height: 120px; }
  .mg-flap { width: 92px; }
}

/* ===================================================================== 潮帰り集会所 */
/* the tide gauge and the deep-water grace (spec §5: shown as numbers and signs, apart from the windmill) */
.sg-tide { color: var(--gf-text); display: flex; gap: 8px; align-items: center; background: var(--gf-hud-surface); border: 1px solid var(--gf-border); border-radius: var(--gf-radius); padding: 4px 8px; font-size: 12px; align-self: flex-end; max-width: 100%; box-sizing: border-box; }
.sg-tide .td-bar { /* pair-ok: no text */ width: 70px; height: 6px; background: var(--gf-surface-2); border-radius: 3px; overflow: hidden; flex: none; }
.sg-tide .td-bar i { /* pair-ok: no text */ display: block; height: 100%; background: var(--sg-sea); }
.sg-tide.high { border-color: var(--sg-sea-high); }
.sg-tide.high .td-bar i { /* pair-ok: no text */ background: var(--sg-sea-high); }
.sg-cold { color: var(--gf-text); width: 150px; max-width: 100%; box-sizing: border-box; background: var(--gf-hud-surface); border: 1px solid var(--gf-border); border-radius: var(--gf-radius); padding: 6px 8px; align-self: flex-end; text-align: center; }
.sg-cold small { font-size: 11px; color: var(--gf-text-dim); }
.sg-cold span { /* pair-ok: no text */ display: block; height: 8px; margin-top: 4px; background: var(--gf-surface-2); border-radius: 4px; overflow: hidden; }
.sg-cold i { /* pair-ok: no text */ display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gf-danger), var(--sg-sea)); }
#hide-vents.boards { /* pair-ok: no text */ background: linear-gradient(90deg, #070605 0 18%, transparent 18% 22%, #0a0806 22% 100%); }
/* the boat mirror's STEP card in the corridor (U22 / U23): the standard card in the left stack */
#sg-world { pointer-events: none; font-size: 13px; }
#sg-world .sg-card { color: var(--gf-text); background: var(--gf-surface); }
#sg-world .sg-next { display: none; }
#sg-world .sg-btn { pointer-events: auto; min-height: 36px; }
.sg-btns { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.sg-btns.row { flex-direction: row; flex-wrap: wrap; }
.sg-obj { color: var(--gf-note-text); background: var(--gf-note-bg); border-left: 3px solid var(--gf-note-line); padding: 6px 10px; margin: 6px 0; }
.sg-obj b { color: var(--gf-note-label); margin-right: 8px; }
.jr-steps { list-style: none; padding: 0; margin: 0; }
.jr-steps li { padding: 2px 0; }
.jr-steps li.done { color: var(--gf-text-dim); text-decoration: line-through; }
.jr-notes li.radio { font-family: var(--gf-font); font-size: 14px; }

/* the talk (radio / phone): the window is fixed size, the log scrolls inside */
.sg-talk { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--gf-text); }
.talk-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
#talk-photo { /* pair-ok: no text */ width: 64px; height: 44px; background: var(--gf-surface-2) center/cover; border: 2px solid var(--gf-border-strong); flex: none; }
#talk-log { flex: 1; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.tk-line { color: var(--gf-voice-text); max-width: 86%; background: var(--gf-voice-bg); border: 1px solid var(--gf-border); border-radius: 10px 10px 10px 2px; padding: 7px 11px; font-size: 15px; line-height: 1.55; align-self: flex-start; animation: tkin 0.25s ease-out; }
.tk-line b { display: block; font-size: 11px; color: var(--gf-voice-label); margin-bottom: 2px; }
.tk-line.me { color: var(--gf-note-text); align-self: flex-end; background: var(--gf-note-bg); border-color: var(--gf-note-line); border-radius: 10px 10px 2px 10px; }
.tk-line.me b { color: var(--gf-note-label); }
.tk-line .sys { color: var(--gf-text-dim); font-size: 13px; }
html[data-gf-calm] .tk-line { animation: none; }
@keyframes tkin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#talk-replies { flex: none; margin-top: 8px; min-height: 48px; display: flex; flex-direction: column; gap: 6px; }
#talk-replies button { min-height: 48px; text-align: left; }
@media (max-height: 499px) { .talk-top, .sg-talk .sg-keyhint { display: none; } }
/* choices with locked endings */
#choice-buttons button.locked { color: var(--gf-text-dim); border-style: dashed; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: not-allowed; }
#choice-buttons button.locked small { font-size: 12px; color: var(--gf-text-dim); }
#choice-buttons button { text-align: left; min-height: 44px; }
.jr-work { display: grid; gap: 8px; }
.sg-log h4 { margin: 14px 0 6px; font: 700 14px var(--gf-font); color: var(--gf-heading); border-bottom: 1px solid var(--gf-border); }
.sg-log .where { margin: 4px 0; }
.sg-log .hintline { color: var(--gf-note-text); background: var(--gf-note-bg); border-left: 3px solid var(--gf-note-line); padding: 4px 10px; }
.sg-log .empty { color: var(--gf-text-dim); }

/* ---- the job panels: hands-on widgets of js/mini.js (the dark-glass tokens --gf-mg-*; paper-coloured things keep their own pair) ---- */
.t-p01 { flex-direction: column; align-items: stretch; }
.mg-roster { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.mg-board { /* pair-ok: its children carry their own pair */ display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #5a4230; border: 3px solid #3a2a1c; border-radius: 4px; padding: 6px; }
.mg-hook { position: relative; min-height: 92px; border-radius: 3px; display: flex; align-items: stretch; justify-content: center; padding-top: 8px; }
.mg-hook::before { /* pair-ok: no text */ content: ""; position: absolute; top: 2px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #b0a080; }
.mg-hook.want { outline: 2px dashed var(--gf-mg-warn); }
.mg-hook .mg-empty { color: #f0dcc0; align-self: center; font-size: 11px; }
.mg-tag { width: 100%; max-width: 46px; min-height: 80px; background: #ece6d6; color: #222; border-radius: 2px; display: flex; flex-direction: column; align-items: center; cursor: pointer; touch-action: none; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); user-select: none; }
.mg-tag i { /* pair-ok: no text */ width: 100%; height: 8px; border-radius: 2px 2px 0 0; }
.mg-tag.band-浜 i { /* pair-ok: no text */ background: #2a5a9a; }
.mg-tag.band-上 i { /* pair-ok: no text */ background: #3a7a4a; }
.mg-tag.band-転入 i { /* pair-ok: no text */ background: #ccc; }
.mg-tag b { font: 700 13px/1.15 var(--gf-font); padding: 4px 0; }
.mg-tag.red { background: #a83028; color: #a83028; }
.mg-tag.red b { visibility: hidden; }
.mg-tag.red i { /* pair-ok: no text */ background: #8a2018; }
.mg-tag.picked { outline: 3px solid var(--gf-mg-warn); }
.mg-tag.dragging { opacity: 0.85; z-index: 5; position: relative; }
.mg-drawer { color: var(--gf-mg-ink); display: flex; gap: 8px; align-items: center; background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 4px; padding: 6px 10px; min-height: 96px; }
.mg-drawer small { color: var(--gf-mg-dim); font-size: 12px; }
.mg-drawer .mg-tag { width: 46px; flex: none; }
.t-memo { background: #ece4cf; color: #222; border-radius: 3px; padding: 6px 10px; margin: 6px 0; }
.t-memo pre { font: 14px/1.6 var(--gf-font-hand); margin: 2px 0 0; white-space: pre-wrap; }
.t-sel { color: var(--gf-mg-ink); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 6px 0; }
.t-sel .num { font-size: 18px; color: var(--gf-mg-warn); margin-right: 10px; }
.mg-chart { width: 100%; }
.mg-svg { /* pair-ok: its children carry their own pair */ width: 100%; max-height: 240px; background: #ece8da; border-radius: 4px; touch-action: none; }
.mg-svg .grid { stroke: rgba(40, 60, 90, 0.2); }
.mg-svg .lab { font: 11px var(--gf-font); fill: #0a0f14; }
.mg-svg .fc { fill: none; stroke: #2a4a8a; stroke-width: 2.5; stroke-dasharray: 6 4; }
.mg-svg .ob { fill: none; stroke: #c04a2a; stroke-width: 3; }
.mg-svg .pt circle { fill: #c04a2a; stroke: #fff; stroke-width: 2; cursor: ns-resize; }
.mg-svg .pt.empty circle { fill: #c8c8bc; }
.mg-svg .pt text { font: 700 12px var(--gf-font); fill: #222; }
.mg-legend { color: var(--gf-mg-ink); display: flex; gap: 14px; font-size: 12px; margin: 4px 0; }
.mg-legend .fc { color: #8ab0e0; }
.mg-legend .ob { color: #f08a6a; }
.mg-row3 { display: flex; justify-content: space-around; gap: 8px; }
.mg-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mg-col small { color: var(--gf-mg-dim); }
#term-body .mg-col button { min-width: 48px; min-height: 44px; }
/* P03 the boat mirror */
.mg-mirror { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-items: center; }
.mg-mview { position: relative; padding-bottom: 16px; }
.mg-mview canvas { width: min(300px, 78vw); aspect-ratio: 300 / 240; border-radius: 50% / 45%; border: 6px solid #8a8e90; box-shadow: 0 0 0 2px #2a2a2a, inset 0 0 20px #000; display: block; }
.mg-mnote { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--gf-mg-dim); white-space: nowrap; }
.mg-mpad { color: var(--gf-mg-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mg-mpad small { color: var(--gf-mg-dim); font-size: 12px; max-width: 200px; text-align: center; }
.mg-pad { /* pair-ok: no text */ width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #2a2c2e, #121414); border: 2px solid var(--gf-mg-line); display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.mg-knob2 { /* pair-ok: no text */ width: 40px; height: 40px; border-radius: 50%; background: #8a6a40; border: 3px solid #c8a878; pointer-events: none; }
.mg-arrows { display: grid; grid-template-columns: repeat(4, 48px); gap: 4px; }
#term-body .mg-arrows button { min-height: 44px; font-size: 18px; color: var(--gf-mg-warn); }
.mg-mkey { display: block; margin-top: 4px; font-size: 12px; color: var(--gf-mg-dim); text-align: center; }
.mg-mkey i { /* pair-ok: no text */ display: inline-block; vertical-align: middle; margin-right: 3px; }
.mg-mkey .k-hook { width: 14px; height: 0; border-top: 3px solid #e0e0d8; }
.mg-mkey .k-latch { /* pair-ok: no text */ width: 14px; height: 7px; background: #8a7a50; }
.mg-mkey .k-glass { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid rgba(170, 210, 220, 0.9); }
/* P04 the valves */
.t-pipes { display: flex; justify-content: space-between; font-size: 12px; margin: 0 10px; color: var(--gf-mg-ink); }
.t-pipes .sea { color: var(--sg-sea); }
.t-pipes .hill { color: var(--gf-ok); }
.mg-valve { color: var(--gf-mg-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 104px; }
.mg-valve small { font-size: 12px; color: var(--gf-mg-dim); text-align: center; }
.mg-wheelv { /* pair-ok: no text */ position: relative; width: 92px; height: 92px; border-radius: 50%; border: 9px solid var(--c); box-shadow: 0 3px 8px #000, inset 0 0 6px #000; cursor: grab; touch-action: none; transition: transform 0.15s; }
.mg-wheelv i { /* pair-ok: no text */ position: absolute; left: 50%; top: 50%; width: 76px; height: 8px; margin: -4px 0 0 -38px; background: var(--c); border-radius: 4px; }
.mg-wheelv i + i { transform: rotate(90deg); }
.mg-valve .mg-vstate { color: var(--gf-mg-warn); }
.mg-valve.closed .mg-vstate { color: var(--gf-danger); }
/* P05 the light table */
.mg-light { display: flex; flex-direction: column; gap: 8px; }
.mg-table { color: #1a2a4a; position: relative; height: 170px; background: radial-gradient(ellipse, #fffbea, #e8e0c0); border: 4px solid #4a4e50; border-radius: 4px; overflow: hidden; }
.mg-table .pin { /* pair-ok: no text */ position: absolute; top: 10px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #5a5e60; box-shadow: 0 1px 2px #000; z-index: 3; }
.mg-reg { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; z-index: 4; color: #1a2a4a; }
.mg-reg b { font: 700 26px ui-monospace, monospace; background: rgba(255, 255, 240, 0.85); color: #1a2a4a; padding: 2px 10px; border-radius: 3px; }
.mg-reg small { display: block; font-size: 12px; color: #3a3a3a; }
.mg-reg span { font: 700 20px ui-monospace, monospace; }
.mg-sheettray { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 82px; }
.mg-sheet { position: relative; width: 150px; height: 80px; color: #222; background: rgba(220, 230, 240, 0.55); border: 1px solid #8a9aa8; border-radius: 2px; display: flex; align-items: flex-end; justify-content: center; padding: 4px; cursor: grab; touch-action: none; user-select: none; font-size: 12px; }
.mg-sheet i { /* pair-ok: no text */ position: absolute; top: 8px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #4a5a6a; }
.mg-sheet i:nth-child(1) { left: 14%; }
.mg-sheet i:nth-child(2) { left: 46%; }
.mg-sheet i:nth-child(3) { left: 78%; }
.mg-sheet.s1 { /* pair-ok: no text */ background: rgba(240, 230, 200, 0.6); }
.mg-sheet.s2 { /* pair-ok: no text */ background: rgba(230, 220, 230, 0.6); }
.mg-sheet.off { opacity: 0.35; cursor: not-allowed; }
.mg-sheet.aligned { position: absolute; width: 92%; height: 70%; pointer-events: none; }
.mg-sheet.dragging { z-index: 9; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
.t-dial { align-items: flex-end; }
/* P06 the boards */
.t-p06 .board { /* pair-ok: no text */ display: block; height: 22px; max-width: 100%; background: linear-gradient(#7a8a7a, #5a6a5a); border: 1px solid #3a4a3a; border-radius: 2px; margin: 0 auto 4px; }
/* P07 the island map */
.t-clues { color: var(--gf-mg-ink); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.t-clues small { color: var(--gf-mg-dim); width: 100%; }
#term-body .t-clue { background: #ece4cf; color: #222; border-color: #8a7a5a; font-size: 13px; text-align: left; min-height: 44px; }
.mg-map { width: 100%; }
.mg-island { /* pair-ok: its children carry their own pair */ position: relative; height: 230px; background: #6a98b0; border-radius: 6px; overflow: hidden; touch-action: none; }
.mg-island .land { /* pair-ok: no text */ position: absolute; left: 6%; top: 8%; width: 76%; height: 84%; background: #d8d0a8; border-radius: 48% 40% 52% 44%; }
.mg-island .hill { /* pair-ok: no text */ position: absolute; left: 10%; top: 10%; width: 40%; height: 40%; background: #a8b888; border-radius: 50%; }
.mg-island .road { /* pair-ok: no text */ position: absolute; left: 36%; top: 30%; width: 30%; height: 4px; background: #7a5a3a; transform: rotate(38deg); transform-origin: left; }
#term-body .mg-place { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(255, 255, 255, 0.75); color: #1a1a1a; border: 1px solid #5a5a50; padding: 3px 6px; min-height: 0; font-size: 12px; }
#term-body .mg-place i { /* pair-ok: no text */ width: 10px; height: 10px; border-radius: 50%; background: #2a5a7a; }
#term-body .mg-place.on { border-color: var(--gf-danger); box-shadow: 0 0 0 2px var(--gf-danger); }
.mg-pin { position: absolute; transform: translate(-50%, -110%); width: 40px; height: 40px; border-radius: 50%; background: #c0302a; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
/* P08 routes and the bar */
.t-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
#term-body .t-route { display: flex; flex-direction: column; text-align: left; min-height: 60px; }
#term-body .t-route small { color: var(--gf-mg-dim); font-size: 12px; }
#term-body .t-route.on { color: var(--gf-mg-ink); border-color: var(--gf-ok); background: var(--gf-accent-soft); }
.mg-bar { color: var(--gf-mg-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 150px; }
.mg-bar small { font-size: 12px; color: var(--gf-mg-dim); }
.mg-bartrack { /* pair-ok: no text */ position: relative; width: 150px; height: 46px; background: var(--gf-mg-bg-2); border: 2px solid var(--gf-mg-line); border-radius: 6px; }
.mg-barknob { /* pair-ok: no text */ position: absolute; top: 6px; width: 54px; height: 30px; background: linear-gradient(#9a9ea0, #5a5e60); border-radius: 4px; cursor: grab; touch-action: none; }
.mg-bar.done .mg-barknob { /* pair-ok: no text */ background: linear-gradient(#7ad890, #3a7a48); }
@media (max-width: 520px) {
  .mg-hook { min-height: 74px; }
  .mg-tag { min-height: 66px; }
  .mg-tag b { font-size: 11px; }
  .mg-board { gap: 2px; padding: 3px; }
  .t-routes { grid-template-columns: 1fr; }
  .mg-sheet { width: 120px; }
}
@media (max-width: 640px) { .dials { grid-template-columns: 1fr; } .keys6 { grid-template-columns: repeat(3, 1fr); } .sg-ends, #result-ends, #gallery-list { grid-template-columns: repeat(2, 1fr); } .result-grid { grid-template-columns: repeat(2, 1fr); } }
.sg-hint::before { content: "礼子"; display: inline-block; font: 700 11px var(--gf-font); color: var(--gf-mg-warn); border: 1px solid var(--gf-mg-warn); border-radius: 3px; padding: 0 4px; margin-right: 6px; font-style: normal; vertical-align: 1px; }
.mg-help { margin: 0 0 8px; }
.mg-help .sg-card { font-size: 14px; }

/* phone portrait (390 x 844): the left HUD stack stays short (finished STEP lines are folded away: the card says STEP n/3), and the boat mirror panel fits one
   screen: the mirror and the pad come up next to the STEP card, the related-items row (also under the ? button) steps aside, the cards get tighter */
@media (max-width: 520px) and (orientation: portrait) {
  #sg-world .sg-done { display: none; }
  #sg-world .sg-card { padding: 6px 10px; }
  #term-body:has(.mg-help) .t-rel { display: none; }
  #term-body .mg-help .sg-card { padding: 8px 10px; }
  #term-body .mg-help .sg-body { font-size: 13px; line-height: 1.5; }
  #term-body .mg-help .sg-actions { margin-top: 4px; }
  #term-body .mg-help .sg-btn { min-height: 36px; }
  .mg-mirror { gap: 6px; }
  .mg-mview { padding-bottom: 14px; }
  .mg-mview canvas { margin: 0 auto; }
  .mg-mview canvas { width: min(204px, 58vw); border-width: 4px; }
  .mg-mnote { position: static; transform: none; display: block; text-align: center; margin-top: 2px; }
  .mg-mpad { gap: 4px; }
  .mg-mpad small { display: none; }
  .mg-pad { display: none; } /* (the four arrows below do the same) */
  #term-body:has(.mg-help) .t-why { font-size: 13px; line-height: 1.45; }
  #term-body:has(.mg-help) .t-top { margin-bottom: 4px; }
  .mg-mkey { display: block; line-height: 1.3; }
  .mg-arrows { grid-template-columns: repeat(4, 44px); }
  .mg-mpad .mg-lift { min-height: 40px; }
  .mg-mkey { margin-top: 2px; font-size: 11px; }
}
