@font-face{font-family:HanjiText;src:url(table-art/fonts/NanumMyeongjo-Regular.ttf) format("truetype");font-weight:400;font-display:swap}
:root{--serif:HanjiText,"AppleMyungjo",serif;--ink:#30291f;--seal:#91432f}
body,button,select,summary,dialog,input{font-family:var(--serif)}
h2,h3,legend,#board .title,#board button,#board button.landmark,#board.distant button.landmark,
#board.distant .current-square::before,#board button[data-route]::after,#scene-verse{font-family:var(--serif);font-weight:400}
#board:not(.distant) button{font-size:29px}
#board.distant button{font-size:49px}
#board .instruction,#board .han,#board .mark{font-family:var(--serif)}
.roster .player,.roster .player.active{grid-template-columns:minmax(0,1fr) minmax(72px,45%);gap:0}
.name-slip{position:relative;isolation:isolate;padding:7px 9px 8px 11px;align-self:center;min-width:0;filter:drop-shadow(1px 2px 1px #14251890);transform:rotate(-1deg)}
.name-slip::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(105deg,#f6e8cbb0,#efe0be80),url(table-art/paper.webp);clip-path:polygon(1% 4%,17% 2%,31% 3%,59% 1%,84% 3%,96% 1%,99% 7%,98% 30%,100% 58%,98% 91%,94% 97%,76% 96%,49% 99%,22% 97%,2% 99%,0 84%,1% 57%,0 29%)}
.slip-heading{display:flex;align-items:center;gap:5px}
.slip-heading strong{font:400 clamp(16px,1.5vw,24px)/1 var(--serif);color:var(--ink);white-space:nowrap}
.slip-mark{display:grid;place-items:center;flex:none;width:19px;height:19px;border:1px solid #766650;border-radius:2px;transform:rotate(-5deg);color:#645943;font:14px/1 serif}
.active .slip-mark{background:var(--seal);border-color:var(--seal);color:#fff1d2;box-shadow:inset 0 0 0 1px #e0b197}
.name-slip small{display:block;color:#564734;overflow-wrap:anywhere;font:400 14px/1.35 var(--serif)}
.name-slip .slip-place{margin-top:4px}.name-slip .slip-detail{font-size:12px;border-top:1px solid #89775b55;margin-top:5px;padding-top:3px}
.console,dialog{background:linear-gradient(102deg,#d5bd924d,transparent 11%,#fff6e1a6 68%,#e6d4ad55),url(table-art/paper.webp);color:var(--ink)}
.console{position:relative;border:1px solid #ac916a;border-radius:4px 10px 9px 4px;padding-left:clamp(24px,2.2vw,38px);box-shadow:inset 7px 0 #99836336,inset 9px 0 #fcf2dbb5,2px 2px #cbb890,4px 4px #806c50,6px 7px 7px #14271b77}
.console::before{content:"";position:absolute;left:4px;top:24px;width:11px;height:calc(100% - 48px);pointer-events:none;background:repeating-linear-gradient(165deg,transparent 0 47px,#9c7750 48px,#d0b78a 49px,#785a3f 51px,transparent 52px 86px)}
.console-head h2,#route-guide h3{color:var(--ink);background:none;clip-path:none;text-align:left;font-family:var(--serif);font-weight:400}
.console-head h2{font-size:clamp(25px,2.15vw,36px);line-height:1.15;padding:0 0 8px;border-bottom:3px double #7763479c}
#route-guide h3{width:auto;margin:10px 0 3px;padding:0;font-size:19px}
.place-strip{justify-content:space-between;border:0;border-bottom:1px solid #97846566;background:none;padding:1px 0 5px}
.place-strip>span{font:400 14px var(--serif);color:#62513b}
#route-place{font:400 clamp(22px,1.8vw,30px)/1.1 var(--serif)}
#office-duty,#result{font:400 16px/1.55 var(--serif)}
.route-options{gap:0}.route-options button{background:transparent;border:0;border-bottom:1px solid #94836765;box-shadow:none;border-radius:0;color:var(--ink);padding:3px 5px;min-height:36px;font:400 19px/1.35 var(--serif)}
.route-options button:hover:not(:disabled),.route-options button[aria-pressed=true]{background:#52745e20;color:#183d30}
.route-eye{font:400 17px/1.2 var(--serif);border-radius:3px 1px 3px 2px}
.console h3,.console summary,dialog header h2{font-family:var(--serif);font-weight:400}
.console h3{font-size:19px}.console summary{font-size:17px}
.console #counts button,.console .primary:not(#roll),.session-tools button,.avatar-row button,dialog button{font:400 17px/1.35 var(--serif)}
.console .avatar-row{padding:4px 0;border-bottom:1px solid #ab967455}
#identity-picks img{width:clamp(44px,4vw,62px);background:transparent}
#rule-list small,dialog p,#guide li,#scene-action{font:400 15px/1.65 var(--serif)}
#rule-list strong{font:400 17px/1.35 var(--serif)}
#rule-list label{padding:9px 0}.manual-roll,.session-tools{color:#51432e}
@media(max-width:760px){
 .roster .player,.roster .player.active{gap:0;padding:0}.roster #players{align-items:start;min-width:0}
 .name-slip{padding:3px 5px;text-align:center}.slip-heading{justify-content:center;gap:2px}.slip-heading strong{font-size:14px}.slip-mark{width:12px;height:12px;font-size:9px}
 .name-slip .slip-place{font-size:11px;margin:0}.name-slip .slip-detail{font-size:10px}
}

/* Keep the ink on the stroke itself. Small type gets a proportionally finer edge. */
:where(.game,dialog,.wood-result),:where(.game,dialog) :where(*),:where(.game,dialog) ::placeholder{
 -webkit-text-stroke:.023em color-mix(in srgb,currentColor 36%,transparent);
}
.slip-heading strong,#status.ink-lettering,#route-place,#route-guide h3,.route-options button span:last-child{font-weight:600}
:where(.slip-heading strong,#status.ink-lettering,#route-guide h3,.route-options button span:last-child,
 .table-title,#arrival-office,#travel-subtitle p,.arrival-story p,.slip-place,#arrival-duty,
 #office-duty,.player-note p,#report-paper p,dialog header h2,#roll-hint){
 filter:url(#ink-feather);
}
/* A repeating alpha texture follows the letters as the board zooms. */
#board :is(.tile-name,.tile-grade,.han,.mark,.instruction),.sillok-line,.pawn-grade>span{
 mask-image:url(table-art/ink-fibres.png);mask-size:48px 48px;
}
.motif{display:inline-block;flex:none;width:1.45em;height:1.45em;vertical-align:middle;background:currentColor;mask:var(--motif) center/contain no-repeat}
.lotus{--motif:url(table-art/motifs/lotus.svg)}.cloud{--motif:url(table-art/motifs/cloud.svg)}.water{--motif:url(table-art/motifs/water.svg)}.bat{--motif:url(table-art/motifs/bat.svg)}
.slip-mark,.active .slip-mark{width:clamp(24px,2.4vw,36px);height:clamp(24px,2.4vw,36px);color:#514534;background:none;border:0;box-shadow:none;transform:none}
.active .slip-mark{color:var(--seal)}.slip-mark .motif{width:100%;height:100%}
.avatar-row>.motif{width:26px;height:26px;color:var(--seal)}
.token:has(.motif),#board.distant .tokens .token:has(.motif),.actor-seal,#board .ink-traveller small{display:inline-flex;align-items:center;gap:.16em;width:auto;min-width:1.8em;padding-inline:.2em}
@media(max-width:760px){.slip-mark,.active .slip-mark{width:18px;height:18px}}
@media(max-width:760px){.game>.roster{flex-wrap:wrap}.roster #players{min-width:min(100%,285px);gap:3px}.roster .player{min-width:0;flex:1}}

.roster .player img,.roster .player.active img{grid-row:1}
.player-note{grid-column:1/-1;max-width:100%;margin:3px 0 8px;padding:3px 9px 5px;border-left:2px solid #bfa16e;color:#f6ebd3;text-align:left}
.player-status{display:block;font:600 14px/1.45 var(--serif)}
.player-note p{margin:4px 0 0;font:400 14px/1.55 var(--serif);word-break:keep-all;overflow-wrap:anywhere}
@media(max-width:760px){.roster #players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.roster .player,.roster .player.active{display:grid;grid-template-columns:35px 1fr;align-items:center}.player-note{width:100%;margin:1px 0 4px;padding:2px 5px}.player-note p{font-size:13px}}

#room-controls{margin:.45rem 0;color:inherit;font-size:.88rem}#room-status:empty{display:none}#room-controls input,#certificate-name{max-width:100%;font:inherit;background:#fff9ea;color:#382d21;border:1px solid #927d60;padding:.32em}
#certificate{width:min(46rem,94vw);box-sizing:border-box}#certificate-art{width:100%;height:auto;display:block;margin:.65rem auto}#routes details{margin:.6rem 0}#routes details .choices{flex-wrap:wrap}
@media print{
  @page{size:A4 landscape;margin:8mm}
  body:has(#certificate[open]),body:has(#certificate[open]) main{margin:0!important;padding:0!important;display:block!important;height:auto!important;overflow:visible!important;background:white!important}
  body:has(#certificate[open]) main>:not(#certificate),#certificate[open]>:not(canvas){display:none!important}
  #certificate[open]{position:static!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;border:0!important;box-shadow:none!important;background:white!important;overflow:visible!important}
  #certificate[open]::backdrop{background:transparent}#certificate-art{width:auto;height:187mm;max-width:100%;margin:0 auto}
}
.console:has(#setup[hidden]) #room-controls:has(#room-entry:not([hidden])){display:none}
#dresser.online-dressing :is(#start-dressed,#try-guard,#try-scribe){display:none}

#atlas,#panel{width:min(36rem,94vw);max-height:88svh;overflow:auto}
#atlas input,#saved-games{width:100%;background:#fcf4df;border:1px solid #938368;border-radius:3px;color:var(--ink);padding:.6em;font:inherit}
#atlas label,#saved-table label{display:block;margin:.7rem 0 .25rem}
#atlas-filters{display:flex;flex-wrap:wrap;gap:.3rem;margin:.65rem 0}
#atlas-filters button{font-size:.92rem;min-height:40px;padding:.35rem .6rem}
#atlas-filters [aria-pressed=true]{background:#335246;color:#fff6df}
#atlas-count{margin:.35rem 0;color:#65533e}
#atlas #landmarks{display:grid;grid-template-columns:1fr;max-height:min(48svh,27rem);overflow:auto;overscroll-behavior:contain;padding:0 4px 4px 0;gap:0}
#atlas #landmarks button{display:grid;grid-template-columns:minmax(5em,.28fr) 1fr;align-items:baseline;text-align:left;gap:.65rem;padding:.65rem .3rem;background:none;border:0;border-radius:0;border-bottom:1px solid #ad947455;color:#382d21}
#atlas #landmarks button:hover,#atlas #landmarks button:focus-visible{background:#49694a15}
#atlas #landmarks span{font-size:.9rem;line-height:1.45}
#office-case{margin:1rem 0;padding:.6rem .8rem;background:#eee0bd88;border-left:3px solid var(--seal)}
#office-case h3{font-size:.86rem;color:#73503b;margin:0 0 .3rem}
#office-case a{display:inline-block;margin-right:.7rem}
#transcribed-route{margin:.8rem 0}#transcribed-route summary,#office-case summary{padding:.35rem 0}
#saved-table{margin:0 0 1rem;padding:0 0 .7rem;border-bottom:1px solid #9d8464}
#saved-table .choices{margin-top:.4rem}#save-status{font-size:.82rem;color:#67553d}

#board.distant .current-square::before{content:attr(data-current-marker);white-space:nowrap}
#destination-preview{display:flex;align-items:center;gap:.45rem;padding:.5rem .65rem;background:#eee1c4 url(table-art/paper.webp);color:var(--ink);border:1px solid #8d7657;border-left:4px solid #345746}
#destination-preview div{min-width:0;flex:1}#destination-preview small,#destination-preview strong{display:block}
#destination-preview button{font-size:.9rem;min-height:40px;padding:.25rem .6rem}
#board .route-stroke{position:absolute;z-index:3;pointer-events:none;transform-origin:0 50%;height:5px;background:repeating-linear-gradient(to right,#87402b 0 15px,#ffedc6 15px 23px);box-shadow:0 1px 1px #563c23}
#board button.route-origin{outline:7px double #98432c;outline-offset:-8px}
#place-read{color:#405743;background:none;border:0;border-bottom:1px solid #689073;border-radius:0;min-height:32px;padding:0 2px;font-size:.9rem}
#office-duty{margin-bottom:0}
.frame:has(#destination-preview:not([hidden])) #journey-label{display:none}
#destination-preview:not([hidden])~.frame-head{position:static}
@media(min-width:761px){
 #destination-preview:not([hidden]){position:absolute;bottom:47px;left:6px;right:6px;z-index:4}
}
@media(max-width:760px){
 .game{row-gap:6px}
 .game:has(#play:not([hidden])) .console{display:grid;grid-template-columns:minmax(0,1fr) minmax(64px,.55fr) minmax(112px,.9fr);align-items:center;gap:4px 5px;padding:9px 10px 12px 18px}
 .game:has(#play:not([hidden])) .console>*{grid-column:1/-1;min-width:0}
 .game:has(#play:not([hidden])) .console-head{grid-area:1/1}.console-head h2{margin:0}
 .game:has(#play:not([hidden])) .console-head h2{font-size:clamp(18px,4.7vw,24px);border:0;padding:0}
 .game:has(#play:not([hidden])) .console .stick-stage{grid-area:1/2;width:100%;margin:0;align-self:center}
 .console #play:not([hidden]){display:contents}
 .console #roll{grid-area:1/3;margin:0;max-width:170px;width:100%;min-height:44px}
 .console #result{grid-area:2/1/3/-1;margin:0;padding:3px 0 6px;font-size:14px;border-bottom:1px solid #a78e6d}
 .game:has(#play:not([hidden])) #route-guide{grid-row:3;padding:4px 0}
 .console .manual-roll{grid-column:1/-1;margin:0}.route-options{grid-template-columns:repeat(2,minmax(0,1fr))}
 .route-options button{min-height:44px;font-size:16px;gap:6px;word-break:keep-all;overflow-wrap:anywhere}
 .frame:has(#board.distant):has(#scene-caption[hidden]) #journey-label{display:none}
 .game:has(#play:not([hidden])) #viewport{height:clamp(245px,44svh,420px);min-height:0}
 .bar.bottom{padding-right:92px}.frame-head #locate,.bar.bottom button{min-height:40px;font-size:14px;padding:4px 7px}
 #board-table{scroll-margin-top:5px}
}
#room-controls details>p{margin:.6em 0}
#remembered-seats{padding:0 0 .6rem;margin-bottom:.55rem;border-bottom:1px solid #a18b6a}
#remembered-seats label,#remembered-seats select{display:block;margin-bottom:.3rem}
#room-controls .room-remember{display:flex;align-items:center;gap:.3rem;margin:.4rem 0}
.console:has(#setup[hidden]) #room-controls:has(#online-local-link:not([hidden])){display:none}
#online-local-link{display:inline-block;padding:.25rem 0;color:#355843}

#ministry-open{padding:.35em .65em;margin-top:.6rem;color:#315440;border-color:#9caa8a}
#ministry-game{width:min(34rem,94vw);max-height:91svh;overflow:auto}
.task-illustration{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:1rem;align-items:center;margin:.9rem 0}
#ministry-room{aspect-ratio:1;border:1px solid #856c49;border-radius:2px}
#ministry-worker{display:block;width:100%;height:100%}
#ministry-tool{width:clamp(52px,10vw,78px);height:auto}
#ministry-clue{margin:.2rem 0 .5rem;word-break:keep-all}
#ministry-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}
#ministry-options button{min-height:44px}
#ministry-options [data-correct=true]{background:#355745;color:#ffefd2;opacity:1}
#ministry-feedback{min-height:1.5em;margin:.7rem 0}
#ministry-answer{display:flex;justify-content:space-between;align-items:center}
#ministry-review p{padding:.4rem .1rem;border-bottom:1px solid #b99c7355}
@media(max-width:440px){
 .task-illustration{gap:.6rem}#ministry-game{padding:14px}#ministry-clue{font-size:.86rem}
}
#turn-explanation{margin:.35rem 0;color:#4c4032}
#turn-explanation summary,#in-play-rules summary{font-size:.94rem}
#turn-lines{padding:.25rem .65rem;border-left:2px solid #8b5237}
#turn-lines p,#in-play-list p{margin:.4rem 0;font-size:.92rem;line-height:1.5}
#in-play-list span{display:block}
@media(max-width:760px){.console #turn-explanation{grid-column:1/-1}}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#board button:focus-visible{outline:6px solid #84452f;outline-offset:-6px;z-index:4}
#ledger-picks{display:none}
#ledger .route li{min-height:0;padding:.55rem .2rem}
#ledger .route ol{margin-top:.65rem;border-top:2px solid #b29974}
@media(max-width:700px){
 #ledger-picks{display:flex;flex-wrap:wrap;gap:4px;margin:.4rem 0}
 #ledger-picks button{display:flex;align-items:center;gap:4px;padding:4px 6px;min-height:40px;font-size:14px}
 #ledger-picks [aria-pressed=true]{background:#355745;color:#fff2d4}
 #routes{display:block;overflow:visible}#routes .route:not(.selected-route){display:none}
}
.rule-evidence{margin:.45rem 0;padding:.35rem .55rem;background:#a58c5520;font-size:.88rem}
.rule-evidence p{margin:0 0 .25rem}.rule-evidence a{font-size:.85rem}
#in-play-list>details{padding:.4rem 0;border-bottom:1px solid #b59d7555}
#trail-controls{display:flex;gap:3px}
@media(max-width:700px){#destination-preview:has(#trail-controls:not([hidden])){flex-wrap:wrap}#destination-preview:has(#trail-controls:not([hidden]))>div{flex-basis:100%}}
.roster #players{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;align-content:start;align-items:stretch;gap:8px;flex:none}
.roster #players .player{display:grid;grid-template-columns:minmax(40px,30%) minmax(0,1fr);align-content:start;align-items:center;gap:3px 5px;
  padding:7px;border:1px solid #d8c29255;border-radius:3px;background:#152e25c4}
.roster #players .player.active{border-color:#f4d799;box-shadow:inset 3px 0 #f4d799,inset 0 0 0 1px #f4d799;background:#365342}
.roster #players .player img{width:100%;height:clamp(46px,7vh,72px);object-fit:contain}
.roster .slip-heading{flex-wrap:wrap;justify-content:flex-start}
.turn-stamp{display:inline-block;background:#873923;color:#fff5de;padding:2px 4px;border-radius:2px;font:600 11px/1.25 var(--serif);white-space:nowrap}
.roster .player-note{align-self:start;grid-column:1/-1;margin:0;padding:4px 3px;border:0;border-top:1px solid #bfa16e77}
.roster .player-note p{margin:2px 0 0;font-size:13px;line-height:1.45;color:#e6dcc4}
@media(max-width:760px){
 .game>.roster{width:100%}
 .roster #players{flex:1 0 100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 .roster #players .player{grid-template-columns:29px minmax(0,1fr);gap:2px;padding:4px}
 .roster #players .player img{height:34px}
 .roster .name-slip{text-align:left}
 .roster .player-note{padding:3px 2px 0}
 .player-status,.roster .player-note p{font-size:12px;line-height:1.4}
}
#prepare-game{display:none}
@media(max-width:760px){.game:has(#setup:not([hidden]):not([inert])) #prepare-game{display:block;margin-left:auto;min-height:40px;background:#eee1c4 url(table-art/paper.webp);color:#372d21}}
#guide .guide-steps{padding-left:1.45rem}#guide .guide-steps li{display:list-item;padding:.35rem 0;border:none}

.avatar-row .pawn-name{display:flex;align-items:center;gap:.5em;width:100%;font-size:.9rem}
.pawn-name input{width:0;flex:1;min-width:0;padding:.35em .5em;background:#fff9e9;border:1px solid #948166;color:var(--ink);font:inherit}
.slip-heading strong{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#game-report{width:min(42rem,94vw);max-height:88svh;overflow:auto;overflow-wrap:anywhere}
.report-controls,.report-actions{display:flex;flex-wrap:wrap;gap:.6em;align-items:center;margin:.7em 0}
.report-controls select{max-width:100%;padding:.4em;font:inherit}
#report-paper{padding:1em;background:#fff8e9;border:1px solid #bda983}
#report-paper h2,#report-paper h3{margin:.6em 0 .25em}
#report-paper p{margin:.25em 0}
#report-paper ol{padding-left:1.75em}
#report-paper .personal-result + .personal-result{margin-top:1em;border-top:1px solid #bda983}
#report-feedback:empty{display:none}
#report-copy{width:100%;height:8em}
@media print{
 @page journey-report{size:A4 portrait;margin:16mm}
 body:has(#game-report[open]),body:has(#game-report[open]) main{display:block!important;height:auto!important;overflow:visible!important;padding:0!important;margin:0!important;background:white!important;page:journey-report}
 body:has(#game-report[open]) main>:not(#game-report),#game-report[open]>:not(#report-paper){display:none!important}
 #game-report[open]{display:block!important;position:static!important;inset:auto!important;margin:0!important;padding:0!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;overflow:visible!important;border:none!important;box-shadow:none!important;background:white!important}
 #game-report[open]::backdrop{background:transparent}
 #report-paper{border:0;background:white;padding:0}
 #report-paper h2,#report-paper h3{break-after:avoid}
 #report-paper li{break-inside:avoid}
 #report-paper .personal-result + .personal-result{break-before:page;border:none}
}

#atlas .hanja-choice,#panel .hanja-choice{display:inline-flex;align-items:center;gap:.45em;min-height:40px;margin:.25em 0;color:#513f2c;cursor:pointer}
#atlas .hanja-choice input,#panel .hanja-choice input{width:1.1em;height:1.1em;accent-color:#365943}
html:not(.hanja-on) #board .han,html:not(.hanja-on) .original-line{display:none}
.hanja-on #board.distant .han{display:block}
.sillok-line{margin:.75em 0;padding:.45em .85em;border-left:3px solid #974e37;background:#dbc39340}
.sillok-line .original-line{font:1.15rem/1.7 serif;margin:.3em 0}

#arrival-note{grid-column:1/-1;margin:.5rem 0;padding:.65rem .8rem;border:1px solid #b69b6c;border-left:3px solid #873f2e;background:#fff4d67a;overflow-wrap:anywhere}
#arrival-note small{color:#6e4931}
#arrival-note h3{margin:.25rem 0}
#arrival-note p,.career-match p{margin:.35rem 0;line-height:1.55}
#arrival-note details{margin:.3em 0}
#arrival-note summary,.career-match summary{cursor:pointer}
#arrival-note a,#office-case a,.career-match a{color:#305143;text-decoration:underline;margin-right:.5em}
#arrival-note .hanja-choice{display:inline-flex;align-items:center;gap:.3em;font-size:.85rem}
.career-match{padding:.6em 0;border-top:1px solid #b79c74}
.career-match h4{margin:.7em 0 .2em}
@media(max-width:760px){
 .game:has(#play:not([hidden])) #arrival-note:not([hidden]){grid-row:3}
 .game:has(#arrival-note:not([hidden])) #route-guide{grid-row:4}
}
#final-careers:not([hidden]){display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:.65rem;margin:.6rem 0 1rem}
#final-careers>h2{grid-column:1/-1;margin:0;font-size:1.2rem}
#final-careers>p{grid-column:1/-1;margin:0}
.final-career-card{min-width:0;padding:.7rem .85rem;border:1px solid #b39a70;background:#fff4d88c;overflow-wrap:anywhere}
.final-career-card h3{display:flex;align-items:center;gap:.4em;border-bottom:1px solid #ac946e;padding-bottom:.35em;margin:0 0 .5em}
.final-career-card h4,.final-career-card p{margin:.3em 0}
.final-career-card a{color:#305143;text-decoration:underline}
.final-career-card details{margin-top:.55rem}
@media(min-width:700px){
  #final-careers:not([hidden]):has(.final-career-card:nth-of-type(4)){grid-template-columns:repeat(2,minmax(0,1fr))}
}
.final-career-card .result-pawn{width:4rem;height:3.6rem;object-fit:contain}
.final-career-card p.career-bio{margin:.4em 0 .6em;line-height:1.45;word-break:keep-all}
#report-paper .final-career-card{margin:.6em 0}
@media print{
  .final-career-card{break-inside:avoid;background:white;color:black}
}
#tray-turn{font:700 1rem var(--serif);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(min-width:761px){
}
@media(max-width:760px){
 .game:has(#play:not([hidden])) .console-head{grid-column:1/-1}
}

/* A single sheet holds the player slips, board and stitched record book. */
@media screen {
 body{background:#29372e}
 main{padding:clamp(6px,1vw,16px);max-width:1520px;margin:auto}
 .game{--sheet:#f1e4c9;--sheet-fill:linear-gradient(#f6ebd3cc,#ede0c5bc),url(table-art/paper.webp);background:var(--sheet-fill);color:#332b20;border:1px solid #927e5f;border-radius:12px;padding:clamp(10px,1.25vw,20px);box-shadow:inset 0 0 0 3px #ede1c8,inset 0 0 0 4px #bca786,1px 4px 0 #1d281f}
 .table-title{background:none;color:#392d21;font:700 clamp(18px,2vw,30px)/1.2 var(--serif);letter-spacing:.18em;width:auto;aspect-ratio:auto;text-align:left}
 .roster #players .player,.roster #players .player.active{position:relative;isolation:isolate;grid-template-columns:40% minmax(0,1fr);align-content:center;background:var(--sheet-fill);color:#30291e;border:1px solid #b9a281;border-radius:5px;box-shadow:1px 2px 1px #715b3d48,inset 0 0 0 3px #f3e7ce;padding:7px 9px;gap:0 5px}
 .roster #players .player.active{outline:2px solid #953f2c;outline-offset:2px;border-color:#953f2c;box-shadow:inset 0 0 0 2px #f8ebce,1px 2px 2px #715b3d48}
 .roster .name-slip{padding:0;filter:none;transform:none}
 .roster .name-slip::before{display:none}
 .roster .slip-mark,.roster .active .slip-mark{width:15px;height:15px}
 .roster .slip-heading{gap:4px}
 .roster .slip-heading strong{font-size:clamp(18px,1.65vw,26px);white-space:normal;overflow-wrap:anywhere;filter:url(#ink-feather)}
 .roster .turn-stamp{font:700 13px/1.3 var(--serif);padding:2px 7px;background:#9d3926}
 .roster #players .player img{height:clamp(65px,9vh,102px);object-fit:contain;max-height:none;align-self:end}
 .roster .player-note{padding:5px 2px 2px;border:0}
 .roster .player-note p{color:#564833}
 .roster .player-status{color:#362c20}
 #board-table{border:1px solid #867457;border-radius:3px;background:linear-gradient(#ecdfc3b8,#e9dbbfb8),url(table-art/paper.webp);box-shadow:inset 0 0 0 3px #f5ead4,inset 0 0 0 4px #b5a180}
 #board{background-color:#f3e7cf;outline:7px double #483c2c}
 #board.distant button{font-size:54px;font-weight:700;letter-spacing:-.055em;color:#231d16}
 #board.distant button[data-route]::after{background:#703d2f}
 #tray-turn{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .console{background:var(--sheet-fill);border:1px solid #a68d64;border-radius:5px 9px 6px 4px;box-shadow:inset 0 0 0 4px #f5ead0,inset 0 0 0 5px #baa582,2px 2px #c5af88,4px 4px #e8d9bb,5px 5px #8e795a;padding:18px 16px 16px clamp(30px,3vw,48px)}
 .console::before{left:7px;top:24px;bottom:18px;height:auto;width:17px;background:radial-gradient(ellipse at 85% 8px,#51422e 0 2px,transparent 3px) 0 0/100% 48px repeat-y,linear-gradient(165deg,transparent 0 7px,#755738 8px,#c1a174 10px,#755738 11px,transparent 12px) 0 0/100% 48px repeat-y}
 .console-head h2{font-size:17px;color:#705b40;border:0;padding:0}
 .place-strip{display:block;border-bottom:2px solid #8a7453;padding:0 0 9px}
 .place-strip>span{display:none}
 #route-place,#arrival-office{font:700 clamp(30px,3.1vw,52px)/1.3 var(--serif);color:#30271b}
 #route-place small{font:400 .36em var(--serif);color:#78694f;margin-left:.45em;letter-spacing:.1em}
 #office-duty{font-size:clamp(16px,1.35vw,21px);line-height:1.55;margin:12px 0}
 #route-options{display:grid;grid-template-columns:1fr;gap:5px}
 #route-options button{border:1px solid #bcaa8b;border-radius:4px;background:#fbf3df70;box-shadow:inset 0 0 0 2px #f2e7d0;min-height:38px;display:grid;grid-template-columns:5em 1fr;text-align:left;color:#30291e}
 #route-options button[aria-pressed=true]{outline:2px solid #8a3e2c;background:#efddc2}
 #route-options .route-eye{font:600 .84em/1 var(--serif);letter-spacing:0;background:transparent;color:#342c21;width:auto}
 #arrival-note{margin:0 0 10px;padding:4px 0 10px;border:0;border-bottom:2px solid #9d8257;background:none}
 .bar.bottom button,.frame-head #locate{background:#f3e6cd;border:1px solid #b5a17d;color:#342d21;box-shadow:none}
 footer{color:#e6dcc7}
}
@media screen and (min-width:761px){
 .game{grid-template-columns:minmax(145px, .82fr) minmax(0,2.1fr) minmax(225px,.96fr);gap:clamp(12px,1.3vw,22px);align-items:start}
 .game>.roster{min-height:0}
 .table-title{min-height:clamp(55px,8vh,84px);display:grid;align-items:center}
 .roster #players{gap:clamp(8px,1.5vh,14px)}
 .roster #players .player{min-height:clamp(96px,15vh,158px)}
 .game .bar.bottom{padding-top:5px}
}
@media screen and (max-width:760px){
 main{padding:5px}
 .game{padding:10px;gap:8px}
 .game>.roster{gap:4px}
 .game:has(#play:not([hidden])) .table-title{display:none}
 .roster #players{grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:5px;align-items:stretch}
 .roster #players .player,.roster #players .player.active{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding:4px 2px;min-height:0;text-align:center}
 .roster #players .player img{width:100%;height:44px;align-self:center}
 .roster .slip-heading{justify-content:center}.roster .slip-mark{display:none}.roster .slip-heading strong{font-size:15px}
 .roster .name-slip{text-align:center}.roster .turn-stamp{font-size:10px;padding:1px 3px}
 .roster .slip-place,.roster .player-status{font-size:11px}
 .roster .player-note{padding:2px}.roster .player-note p{display:none}
 .game:has(#play:not([hidden])) #viewport{height:min(131vw,53svh);min-height:230px}
 .game:has(#play:not([hidden])) .console{padding:14px 12px 14px 29px}
 .game:has(#play:not([hidden])) .console::before{width:12px;left:5px}
 #route-options button{min-height:44px}
}
@media screen{
 .board-pawn{display:none}
 #board.distant .tokens:has(.board-pawn){inset:auto 1px 1px;display:flex;justify-content:center;gap:0}
 #board.distant .tokens .token:has(.board-pawn){display:block;position:relative;min-width:0;width:105px;height:94px;padding:0;background:none;border:0;box-shadow:none;color:transparent;font-size:0}
 #board.distant .tokens .token:has(.board-pawn) .motif{display:none}
 #board.distant .board-pawn{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(1px 3px 1px #5744268a)}
 #board.distant button:has(.board-pawn){justify-content:flex-start;padding-top:5px}
 #board.distant button.has-scene .scene-figures,#board.distant button.has-scene .stage-scenery{visibility:hidden}
 #board.distant button[data-place]{box-shadow:inset 0 0 0 1.5px #655744}
 .roster #players .player img{object-fit:cover;object-position:center 46%}
 .roster #players .player:nth-child(1){border-left:4px solid #607d8e}
 .roster #players .player:nth-child(2){border-left:4px solid #55776b}
 .roster #players .player:nth-child(3){border-left:4px solid #c29455}
 .roster #players .player:nth-child(4){border-left:4px solid #8e748b}
 .roster #players .player.active{border-left-color:#953f2c}
}

.yunmok-lane{position:fixed;z-index:15;pointer-events:none;overflow:hidden}
.rolling-wood{position:absolute;left:0;top:0;will-change:transform}
.rolling-wood #yunmok{display:block;width:100%;height:100%}
.wood-result{position:absolute;transform:translateX(-50%);padding:3px 10px;border:1px solid #8b6541;background:#f3e6c9;color:#51311f;font:700 1.05rem var(--serif);box-shadow:1px 2px 2px #57432c42}

#board-roll{position:absolute;z-index:5;right:2%;bottom:3px;width:clamp(160px,33%,244px);height:76px;--wood-angle:-13deg}
#board-roll #roll{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;white-space:nowrap;gap:0;padding:0;border:0;background:none;box-shadow:none;color:#583721;font:700 14px/1.1 var(--serif)}
#board-roll .stick-stage{width:100%;height:auto;aspect-ratio:340/82;margin:0;transform:rotate(var(--wood-angle));background:none;pointer-events:none}
#board-roll .stick-stage::before,#board-roll .stick-stage::after{display:none}
#board-roll #yunmok{position:static;width:100%;height:100%;object-fit:contain}
#board-roll #roll-hint{position:absolute;right:17%;bottom:10%;font:700 14px/1 var(--serif);color:#59432d}
#board-roll #roll:disabled #roll-hint{visibility:hidden}
@keyframes wood-nudge{
  0%,100%{transform:rotate(var(--wood-angle))}
  38%{transform:translateY(-2px) rotate(calc(var(--wood-angle) - 4deg))}
  70%{transform:rotate(calc(var(--wood-angle) + 1deg))}
}
@media(prefers-reduced-motion:no-preference){
 #board-roll:not([hidden]) #roll:enabled .stick-stage{animation:wood-nudge .58s ease-out 1}
}
#board-roll #roll:focus-visible{outline:2px solid var(--seal);outline-offset:2px}
#board-table:has(.following) #board-roll{visibility:hidden}
@media screen and (min-width:761px){
 .game:has(#play:not([hidden])) .frame{position:sticky;top:0}
 .game:has(#play:not([hidden])) #viewport{height:calc(100svh - 98px);min-height:360px}
 .game:has(#play:not([hidden])) .console{margin-top:0;max-height:calc(100svh - 60px);overflow-y:auto;box-sizing:border-box}
}
@media screen and (max-width:760px){
 #board-table:has(#board-roll:not([hidden])){padding-bottom:29px}
 #board-roll{right:2%;bottom:4px;width:clamp(130px,38vw,166px);height:55px}
 #board-roll.reading-away #roll{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));right:12px;width:140px;height:54px;background:#f1e4cc;border:1px solid #ae9671;border-radius:6px}
 body:has(#play:not([hidden])){padding-bottom:52px}
}
@media print{#board-roll{display:none!important}}

#board button .tile-grade{font:600 15px/1.08 var(--serif);color:#694529}
#board.distant button .tile-grade{font-size:22px}
.pawn-grade{display:flex;flex-wrap:wrap;align-items:center;gap:3px 6px;margin:3px 0;color:#384f41;font:700 13px/1.25 var(--serif)}
.grade-meter{display:block;flex:none;width:40px;height:4px;background:linear-gradient(to right,#425f4d var(--grade-fill),#cdc5ad var(--grade-fill))}
.name-slip .grade-leader{color:#304d3a;font:700 11px/1.2 var(--serif);border-bottom:1px solid #69826c}
.grade-key{margin:6px 0;font:500 13px/1.5 var(--serif)}
.grade-key summary{cursor:pointer}.grade-key a{color:inherit}
#arrival-grade{color:#435b46;font-weight:700}
@media(max-width:760px){.grade-key{flex-basis:100%}.pawn-grade{justify-content:center;font-size:11px}.grade-meter{width:28px}}

.arrival-story{border-inline-start:2px solid #96764a;padding-inline-start:10px;margin:.65em 0;font-size:.92em}
.arrival-story strong{display:block;color:#604029}
.arrival-story p{margin:.15em 0 .45em}
.arrival-story a{color:#405747;text-underline-offset:.16em}

#pinned-arrival-reason h4{margin:.2em 0}

/* Keep the turn announcements available to assistive technology. */
#journey-label:not([hidden]){
 position:absolute!important;inset:auto;width:1px;height:1px;margin:-1px;padding:0;
 border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}
#scene-caption{background:transparent;color:var(--ink);border:0}
#travel-subtitle{
 position:absolute;z-index:6;inset-inline:0;bottom:10px;margin-inline:auto;
 width:fit-content;max-width:min(94%,37rem);box-sizing:border-box;padding:.35rem 1.25rem .48rem;
 text-align:center;pointer-events:none;color:#33281d;
 background:linear-gradient(95deg,#f5ead3db,#f8eedbdc,#f2e4cbd9),url(table-art/paper.webp) center/26rem;
 mask-image:linear-gradient(to right,transparent,#000 4%,#000 96%,transparent);
 word-break:keep-all;overflow-wrap:anywhere;
}
#board-table:has(#board-roll:not([hidden])):not(:has(.following)) #travel-subtitle{bottom:80px}
#travel-subtitle small{display:block;color:#6b4d38;font:600 12px/1.35 var(--serif)}
#travel-subtitle p{
 margin:.18em 0 0;font:400 clamp(17px,1.55vw,22px)/1.5 var(--serif);
 text-wrap:pretty;
}
@media(max-width:760px){
 #travel-subtitle{bottom:33px;padding-inline:.85rem}
 #board-table:has(#board-roll:not([hidden])):not(:has(.following)) #travel-subtitle{bottom:61px}
}
@media print{#travel-subtitle{display:none}}

/* The route index stays at the top of the open notebook. */
.notebook-pages{display:contents}
.console:has(#play[hidden]) .current-office-note{display:none}
@media screen{
 .game:has(#play:not([hidden])) .console{display:flex;flex-direction:column;align-items:stretch;gap:0}
 .console-head,#route-guide{flex:none}
 .console:has(#play:not([hidden])) .notebook-pages{display:block}
 .console .place-strip{display:flex;align-items:baseline;justify-content:flex-start;flex-wrap:wrap;gap:3px 8px;padding:6px 0;border-bottom:3px double #988363}
 .console .place-strip>span{display:inline;color:#685740;font:600 12px/1.3 var(--serif)}
 #route-place{font:700 clamp(21px,1.7vw,29px)/1.2 var(--serif)}
 #route-place small{font:500 12px/1.35 var(--serif);letter-spacing:0}
 #route-guide h3{font:700 17px/1.3 var(--serif);margin:9px 0 4px}
 #route-options{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
 #route-options button{display:grid;grid-template-columns:2.4em minmax(0,1fr);align-items:center;gap:8px;min-height:36px;padding:4px 6px;text-align:left;font:600 16px/1.3 var(--serif);word-break:keep-all;overflow-wrap:anywhere;border:0;border-bottom:1px solid #aa967766;border-radius:0;background:transparent;box-shadow:none}
 #route-options .route-eye{display:inline-block;width:auto;padding:3px 0;text-align:center;font:600 13px/1.2 var(--serif);color:#7c3e2c;background:#aa663218;border-radius:2px}
 #route-options button[aria-pressed=true]{outline:0;background:#57745f22;box-shadow:inset 3px 0 #425f4d}
 #route-options button:focus-visible{outline:2px solid #425f4d;outline-offset:-2px}
 #route-detail:empty{display:none}
 .current-office-note{margin:8px 0;padding:5px 0;color:#574532;font:600 15px/1.45 var(--serif)}
 .current-office-note summary{cursor:pointer}
 #arrival-note:not([hidden]){margin-top:10px}
 #arrival-office{font-size:clamp(23px,2vw,32px)}
}
@media screen and (min-width:761px) and (min-height:560px){
 .game:has(#play:not([hidden])) .console{overflow:visible}
 .console:has(#play:not([hidden])) .notebook-pages{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:#ad9572 transparent}
}
@media screen and (max-width:760px){
 #route-options button{min-height:44px}
}
@media screen and (min-width:761px){
 .frame:has(#board-roll:not([hidden])) #destination-preview:not([hidden]){bottom:104px}
}

@media screen{
 .game{--hanji-grain:url(table-art/hanji-grain.webp)}
 #board-table,#board,.game .console{
  background-color:#f0e3c9;
  background-image:var(--hanji-wash),var(--hanji-grain);
  background-position:center;
  background-size:cover,var(--hanji-scale) auto;
  background-repeat:no-repeat,repeat;
 }
 #board-table{--hanji-scale:330px;--hanji-wash:linear-gradient(135deg,#ab86501a,transparent 65%)}
 #board{--hanji-scale:530px;--hanji-wash:linear-gradient(#fffbef28,#fff7e224)}
 #board.distant{--hanji-scale:1500px}
 .game .console{--hanji-scale:345px;--hanji-wash:linear-gradient(90deg,#a2824f29,transparent 12%,#fffaf02e 55%,#fcf5e520)}
}

@media screen{
 .roster #players .player,.roster #players .player.active{
  background:#f0e3c9 var(--hanji-grain) center/345px auto repeat;
 }
 .roster #players .player.active{
  border:1px solid #752e21;
  outline:2px solid #752e21;
  outline-offset:1px;
  box-shadow:inset 0 0 0 3px #93432e,inset 0 0 0 5px #f6e8cb,inset 0 0 0 6px #93432e;
 }
 .roster .player-status{word-break:keep-all;overflow-wrap:anywhere}
}

#rule-notice:not([hidden]){
 position:absolute;inset:9px auto auto 50%;transform:translateX(-50%);z-index:8;
 display:flex;align-items:flex-start;gap:10px;width:max-content;max-width:calc(100% - 20px);
 box-sizing:border-box;padding:9px 12px;border:1px solid #99774d;border-inline-start:5px solid #913c29;
 background:#f0e3c9 var(--hanji-grain) center/345px auto;color:#372c21;box-shadow:0 2px 4px #39281333;
 font:600 15px/1.4 var(--serif);word-break:keep-all;overflow-wrap:anywhere;
}
#rule-notice strong{color:#812e21;font-size:1.12em}
#rule-notice p{margin:2px 0 0}
#rule-notice button{background:transparent;border:0;padding:4px;color:#5d503f;white-space:nowrap}
#rule-targets button{display:flex;align-items:center;gap:8px;text-align:start}
#rule-targets img{width:44px;height:52px;object-fit:contain}
#rule-targets small{display:block}
@media print{#rule-notice{display:none!important}}

#bound-roll-card{
 box-sizing:border-box;width:min(21rem,90vw);max-width:90vw;padding:24px 20px;text-align:center;
 color:#362b20;background:#f0e3c9 url(table-art/hanji-grain.webp) center/345px;
 border:5px double #863f2d;border-radius:5px;box-shadow:0 10px 28px #21190f44;
}
#bound-roll-card::backdrop{background:#221c1680}
#bound-card-owner{color:#834331;font:700 14px/1.4 var(--serif)}
#bound-roll-card h2{margin:9px 0;font:700 27px/1.3 var(--serif);color:#762f20}
#bound-card-rule{word-break:keep-all}
#bound-card-rule strong{color:#762f20}
#bound-roll-card form{display:flex;justify-content:center;gap:8px}
#bound-roll-card button{min-height:44px}
#bound-card-play{background:#783a29;color:#fff5df}
@media(prefers-reduced-motion:no-preference){
 #bound-roll-card[open]{animation:bound-card-deal .22s ease-out}
 @keyframes bound-card-deal{from{opacity:0;transform:translateY(-10px) rotate(-2deg)}to{opacity:1;transform:none}}
}

#room-entry details{margin:.45rem 0;border:1px solid #aa9677;border-radius:3px;padding:.45rem .6rem}
#room-entry summary{cursor:pointer;font-weight:700}
#room-entry form{display:grid;gap:.45rem;margin-top:.55rem}
#room-entry form label{display:grid;gap:.2rem}
#room-entry form input{box-sizing:border-box;width:100%;min-width:0}
#room-entry button[type=submit]{background:#355543;color:#fff7e5}

.solo-mode{display:block;margin:.8rem 0;font-weight:700;cursor:pointer}
.solo-mode small{display:block;margin:.2rem 0 0 1.6rem;font-weight:400}
