/* Atlas spread: introduction on the left, a compact working page on the right. */
main:has(#home:not([hidden])){max-width:1000px}
.home{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;padding:22px 28px 16px;border-top-width:1px}
.home-cover{border-bottom:3px double #91a185;padding-bottom:16px}
.home .atlas-cover{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:24px;padding:0;margin:0;border:0}
.home .atlas-cover h1{font-size:34px;line-height:1.2;max-width:none;letter-spacing:-.03em}
.home .atlas-map{width:154px;max-width:28%;height:auto;align-self:center}
.home .match-intro{border:0;padding:16px 0 0;margin:0;border-top:3px double #8fa080}
.home .match-intro h2{font-size:19px;line-height:1.65;letter-spacing:0;text-wrap:pretty}
.home .match-intro p{font-size:12px;margin-top:8px;line-height:1.8}
.home-setup{min-width:0}
.home .settings-group{margin-bottom:16px;padding-top:8px;gap:14px;grid-template-columns:repeat(3,minmax(0,1fr))}
.home .settings-group legend{font-size:14px}
.home .settings-group label[for=region]{grid-column:auto!important}
.home .settings select,.home .settings input{font-size:15px;background:#fffdf8;border-color:#82957e}
.home .settings small{font-size:12px;line-height:1.65}
.home .primary{min-height:50px;font-size:18px;letter-spacing:.12em}
.home .start-sync{font-size:12px;line-height:1.7;margin:8px 0 0;color:#42584f;text-align:center}
.home .home-share{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,.8fr);gap:8px 24px;align-items:center;border-top:1px solid #b7c2ae;margin:0;padding:18px 0 0}
.home .match-steps{text-align:left;font-size:12px;margin:0;line-height:1.8}
.home .share-button{margin:0;background:transparent;min-height:44px;font-size:13px}
.home-share .share-status,.home-share .share-url,.home-share .share-url-label{grid-column:1/-1;margin:0}
.home#home .sync-note{grid-column:1/-1;padding:0;margin:0;border:0;font-size:12px;line-height:1.75}
.home-notes{grid-column:1/-1;border-top:1px solid #c6cfbb;padding-top:12px;text-align:left;font-size:12px}
.home-notes summary{cursor:pointer;width:fit-content;min-height:32px;line-height:2}
.home-notes summary:focus-visible{outline:3px solid #164e70;outline-offset:3px}
.home-notes .scope,.home-notes .hint{display:block;margin:8px 0!important;font-size:12px;line-height:1.8}
/* Country facts are a single block, independent of the map's height. */
.guided-game .question{display:grid;grid-template-columns:minmax(180px,.85fr) minmax(0,1.35fr);grid-template-areas:'prompt prompt' 'facts map' 'answer answer' 'advance advance';align-items:start;gap:12px 24px;padding:16px 0 12px}
.guided-game #questionPrompt{grid-area:prompt;text-align:left;margin:0;padding-bottom:8px;border-bottom:1px solid #c6cfbb}
.guided-game .country-facts{grid-area:facts;min-width:0;text-align:left;align-self:start}
.guided-game #flag{display:flex;justify-content:flex-start;align-items:center;min-height:0;margin:0}
.guided-game #flag>img{height:auto;max-height:82px;max-width:160px;width:auto;margin:0 0 10px}
.guided-game #questionCountry{margin:0;font-size:23px;line-height:1.45;text-align:left;overflow-wrap:anywhere}
.guided-game .study-card{display:block;margin:0}
.guided-game #studyCountryKana{margin:2px 0 12px;text-align:left;font-size:12px}
.guided-game .study-capital{background:transparent;border:0;border-top:1px solid #b7c2ae;padding:10px 0 0;margin:0;text-align:left}
.guided-game .study-capital strong{font-size:20px;line-height:1.5;margin:2px 0}
.guided-game .study-capital p:empty{display:none}
.guided-game #studyMap{grid-area:map;margin:0;align-self:start;min-width:0}
.guided-game #studyMap .map-question{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:8px;margin:0;align-items:start}
.guided-game #studyMap .map-detail{grid-column:1/-1;grid-row:1}
.guided-game #studyMap .map-detail svg{max-height:180px}
.guided-game #studyMap .map-overview{grid-column:2;grid-row:2;max-width:110px}
.guided-game #studyMap .map-overview svg{max-height:55px}
.guided-game #studyMap .map-overview>span{font-size:10px;padding:3px 6px}
.guided-game .answer-reveal{grid-area:answer;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:flex-start;gap:4px 12px;padding:8px 12px;margin:0;max-width:none;text-align:left}
.guided-game .answer-reveal strong{font-size:18px;margin:0}
.guided-game .answer-reveal small{margin:0}
.guided-game .advance-status{grid-area:advance;margin:0;text-align:left;font-size:12px}
.guided-game .untimed-notice{background:transparent;border:0;border-top:1px solid #b7c2ae;padding:8px 0;margin:0 0 8px;font-size:12px;text-align:left}
.guided-game .input-wrap{margin-bottom:8px}
.guided-game .input-help{margin:8px 0;line-height:1.65}
.guided-game .practice-stats{margin:8px 0;text-align:left}
.guided-game .game-actions{padding-top:10px}
@media(max-width:900px){
 .home{grid-template-columns:1fr;padding:22px 26px;gap:18px}
 .home-cover{display:block;border:0;border-bottom:3px double #91a185;padding:0 0 16px}
 .home .atlas-cover{display:grid;grid-template-columns:1fr 78px;gap:12px;align-items:center}
 .home .atlas-cover h1{font-size:28px;max-width:none}
 .home .atlas-map{width:100%;max-width:none}
 .home .match-intro{border:0;padding:0;align-self:center}
 .home .match-intro h2{font-size:17px;line-height:1.5}
 .home .match-intro p{margin-top:4px;line-height:1.6}
 .home .settings-group{margin-bottom:16px}
 .home .home-share{gap:8px 16px;padding-top:12px}
}
@media(max-width:600px){
 .home{padding:16px;gap:12px}
 .home-cover{display:block;padding-bottom:12px}
 .home .atlas-cover{grid-template-columns:1fr 80px;margin-bottom:12px}
 .home .atlas-cover h1{font-size:25px;max-width:none}
 .home .match-intro h2{font-size:16px}
 .home .match-intro p{font-size:12px;margin:2px 0 0}
 .home .settings-group{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;padding-top:8px;margin-bottom:12px}
 .home .settings-group label[for=region]{grid-column:1/-1!important}
 .home .limits-group{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .home .settings select,.home .settings input{font-size:14px}
 .home .settings small{line-height:1.5}
 .home .home-share{grid-template-columns:1fr;gap:8px}
 .home .sync-note{margin:0}
 .home .match-steps{font-size:11px}
 .guided-game .question{grid-template-columns:minmax(0,1fr);grid-template-areas:'prompt' 'facts' 'map' 'answer' 'advance';gap:10px;padding-top:12px}
 .guided-game .country-facts{display:grid;grid-template-columns:92px minmax(0,1fr);gap:2px 14px}
 .guided-game #flag{grid-column:1;grid-row:1 / span 2;align-items:flex-start}
 .guided-game #flag>img{max-width:92px;max-height:62px;margin:4px 0}
 .guided-game #questionCountry{grid-column:2;font-size:20px}
 .guided-game .study-card{grid-column:2}
 .guided-game #studyCountryKana{margin-bottom:6px}
 .guided-game .study-capital{padding-top:6px}
 .guided-game .study-capital strong{font-size:18px}
 .guided-game #studyMap .map-question{grid-template-columns:minmax(0,1fr) 92px;align-items:start}
 .guided-game #studyMap .map-detail{grid-column:1;grid-row:1}
 .guided-game #studyMap .map-overview{grid-column:2;grid-row:1;max-width:92px}
 .guided-game #studyMap .map-detail svg{max-height:150px}
 .guided-game #studyMap .map-question>div>span{font-size:10px;padding:4px 6px}
}

/* A flag on a keycap: country knowledge meets keyboard practice. */
.brand{display:inline-flex;align-items:center;gap:10px}.brand-mark{display:block;width:42px;height:42px;flex:none}
@media(max-width:600px){.brand-mark{width:32px;height:32px}.brand{gap:8px}.home .atlas-cover{margin-bottom:0}.home .atlas-cover h1{font-size:24px}}

/* A world map printed into the page, without a separate illustration box. */
.home{position:relative;isolation:isolate;overflow:hidden}
.home::before{content:"";position:absolute;inset:0;z-index:-1;background:url('atlas-backdrop.svg') center 38% / 115% auto no-repeat;opacity:.17;pointer-events:none}
.home .atlas-cover{display:block;padding:6px 0}
.home-cover{padding-bottom:14px}
.home .settings select,.home .settings input{background:#fffdf8}
.home .share-button{background:#faf8efde}
@media(max-width:600px){.home::before{background-size:auto 70%;background-position:center 15%;opacity:.12}.home .atlas-cover{display:block;margin:0;padding:4px 0}}

/* Extend the atlas paper to the viewport instead of framing it in blue. */
:root,body{background:#faf7ed;background-image:none}
header{border-color:#b9c4b2}
.brand,.header-actions .language-label,.header-actions .quiet{color:#213f4a}
.header-actions .quiet:hover{color:#205a49;background:#e9eee1;border-color:#9baa92}
header button:focus-visible,header a:focus-visible,header select:focus-visible{outline-color:#205a49}
.home{border:0;box-shadow:none;background:transparent}
.panel{box-shadow:none}
.rule-strip p,.rule-strip>span,footer{color:#4d6268}
footer{border-color:#c6cfbb}

.flag-ribbon{display:flex;align-items:center;gap:12px;min-width:0}.flag-window{flex:1;min-width:0;overflow:hidden;mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent)}
.flag-flow{display:flex;width:max-content;animation:atlas-flags 72s linear infinite}.flag-set{display:flex;align-items:center;gap:28px;padding-right:28px}.flag-set span{width:88px;height:48px;display:flex;align-items:center;justify-content:center;flex:none}.flag-set img{display:block;max-width:88px;max-height:44px;width:auto;height:auto;filter:drop-shadow(0 1px 1px #183d3522)}
.flag-flow.paused{animation-play-state:paused}.flag-motion{flex:none;width:32px;height:32px;border:1px solid #9aaa91;background:#faf7ed;color:#205a49;border-radius:3px;font-size:16px;line-height:1;letter-spacing:0}.flag-motion:hover{background:#e9eee1}.flag-motion:focus-visible{outline:3px solid #205a49;outline-offset:3px}
@keyframes atlas-flags{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media(max-width:600px){.flag-set span{width:70px;height:40px}.flag-set img{max-width:70px;max-height:36px}.flag-set{gap:22px;padding-right:22px}}
.flag-ribbon{display:block;cursor:pointer;outline-offset:5px}
.flag-ribbon:focus-visible{outline:3px solid #205a49}
.flag-set span{width:116px;height:68px}
.flag-set img{width:100%;height:100%;max-width:116px;max-height:64px;object-fit:contain}
.flag-info{min-height:24px;margin-top:8px;font-size:12px;line-height:1.6;color:#42584f;display:flex;justify-content:center;align-items:baseline;gap:6px 16px;flex-wrap:wrap}
.flag-info strong{font-size:15px;color:#213f4a}
@media(max-width:600px){.flag-set span{width:94px;height:58px}.flag-set img{max-width:94px;max-height:54px}.flag-info{font-size:11px;min-height:36px;gap:2px 10px}.flag-info strong{font-size:14px}}

#ready{position:relative;isolation:isolate;overflow:hidden;background:#faf7ed}
#ready::before{content:"";position:absolute;inset:0;z-index:-1;background:url('atlas-backdrop.svg') center / cover no-repeat;opacity:.13;pointer-events:none}
#ready .ready-clock{background:#faf7eddb}
#rules p{white-space:pre-line;line-height:1.85;font-size:14px}
#rules h3{font-size:16px;margin:24px 0 8px;padding-bottom:6px;border-bottom:1px solid #bac6ac}
#rules .rules-details{margin-top:24px;font-size:13px}#rules summary{cursor:pointer;padding:10px 0}#rules .formula{margin:12px 0;font-size:12px}
/* Soft blue seas, sage land, and a warm primary action. */
.home::before{opacity:.42;mask-image:linear-gradient(to bottom,transparent,black 12%,black 80%,transparent)}
#ready::before{opacity:.35;mask-image:linear-gradient(to bottom,transparent,black 12%,black 88%,transparent)}
#start,#readyStart{background:#91482f;border-color:#91482f;color:#fffdf7}
#start:hover,#readyStart:hover{background:#753923;border-color:#753923}
#start:active,#readyStart:active{background:#64311f;border-color:#64311f}
#start:focus-visible,#readyStart:focus-visible{outline:3px solid #91482f;outline-offset:4px}
@media(max-width:600px){.home::before{opacity:.32}}

.guided-game .input-wrap{display:block;position:relative;padding-top:38px}
.guided-example{position:absolute;top:10px;left:15px;right:15px;white-space:pre;overflow:hidden;text-align:left;font-size:21px;line-height:28px;letter-spacing:.035em;color:#83918a;pointer-events:none}
.guided-example strong{color:#183f32;font-weight:700}.guided-example span{font-weight:400}
.guided-game .typed-display{top:49px;font-size:16px;line-height:30px}.guided-game .input-wrap input{height:48px}
.map-question .map-overview{width:260px;max-width:100%}.map-question .map-overview svg{max-height:130px}
.guided-game #studyMap .map-question{grid-template-columns:minmax(0,1fr) 260px}
.guided-game #studyMap .map-overview{max-width:260px}.guided-game #studyMap .map-overview svg{max-height:130px}.guided-game #studyMap .map-overview>span{font-size:12px;padding:6px 10px}
@media(max-width:600px){.guided-example{font-size:18px}.guided-game #studyMap .map-question{grid-template-columns:minmax(0,1fr)}.guided-game #studyMap .map-detail{grid-column:1;grid-row:1}.guided-game #studyMap .map-overview{grid-column:1;grid-row:2;justify-self:end;max-width:240px;width:100%}.guided-game #studyMap .map-overview svg{max-height:120px}}
/* Confine the backdrop to settings, away from flags and sharing. */
.home::before{display:none}
.home-setup{position:relative;isolation:isolate;padding:16px 18px;margin:0 -18px}
.home-setup::before{content:"";position:absolute;inset:0;z-index:-1;background:url('atlas-backdrop.svg') center / cover no-repeat;opacity:.38;pointer-events:none}
.guided-game .question{grid-template-columns:minmax(0,1fr);grid-template-areas:'prompt' 'facts' 'map' 'answer' 'advance'}
.guided-game #studyMap{grid-column:1;grid-row:auto;width:100%}
.flag .map-question,.guided-game #studyMap .map-question{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;max-width:none;width:100%;align-items:start}
.flag .map-question .map-detail,.guided-game #studyMap .map-detail{grid-column:1;grid-row:1;width:100%}
.flag .map-question .map-overview,.guided-game #studyMap .map-overview{grid-column:2;grid-row:1;max-width:none;width:100%}
.flag .map-question .map-detail svg,.flag .map-question .map-overview svg,.guided-game #studyMap .map-detail svg,.guided-game #studyMap .map-overview svg{aspect-ratio:2;width:100%;height:auto;max-height:none}
.flag .map-question>div>span,.guided-game #studyMap .map-question>div>span{font-size:13px;padding:8px 10px}
@media(min-width:601px){.guided-game .country-facts{display:grid;grid-template-columns:150px minmax(0,1fr) minmax(0,1fr);gap:2px 20px;align-items:start}.guided-game #flag{grid-column:1;grid-row:1/span 2}.guided-game #flag>img{max-width:140px;max-height:80px;margin:0}.guided-game #questionCountry{grid-column:2;grid-row:1}.guided-game .study-card{display:contents}.guided-game #studyCountryKana{grid-column:2;grid-row:2}.guided-game .study-capital{grid-column:3;grid-row:1/span 2;border-top:0;border-left:1px solid #b7c2ae;padding:0 0 0 20px;margin:0}}
@media(max-width:600px){.home-setup{padding:12px;margin:0 -12px}.home-setup::before{opacity:.3}.flag .map-question,.guided-game #studyMap .map-question{gap:8px}.flag .map-question>div>span,.guided-game #studyMap .map-question>div>span{font-size:11px;padding:6px}}
/* Rankings keep the atlas's ruled, typographic treatment. */
#rankingSetup{margin:12px 0 16px;padding:12px 0;border-top:1px solid #93a58e}
#rankingSetup label{display:block;margin-bottom:6px;font-weight:700}
#rankingName{width:min(100%,320px);padding:10px 12px;font:inherit;background:#fffdf7;border:1px solid #849780;border-radius:2px}
#rankingNote{font-size:12px;line-height:1.7;margin:8px 0 0}
#rankingDialog{width:min(640px,90vw)}
#rankingRules{font-size:13px;line-height:1.8}
.ranking-scroll{overflow:auto;max-height:60vh}
.ranking-scroll table{width:100%;border-collapse:collapse;text-align:left;font-variant-numeric:tabular-nums}
.ranking-scroll th,.ranking-scroll td{padding:12px 8px;border-bottom:1px solid #c6ceb9}
.ranking-scroll td:nth-child(2){overflow-wrap:anywhere}
.ranking-scroll th{background:#e8eddc;position:sticky;top:0}
#rankingResult,.result-sharing{border-top:1px solid #acb99e;padding:18px 0;margin:18px 0}
#rankingResult h3,.result-sharing h3{margin:0 0 10px}
#rankingResult button{margin:4px 10px 4px 0}
.share-actions{display:flex;flex-wrap:wrap;gap:10px}
.share-actions a{display:inline-flex;align-items:center;padding:10px 20px;border:1px solid #859b80;color:#174d3f;text-decoration:none;font-weight:700}
#resultShareText{box-sizing:border-box;width:100%;margin-top:12px;font:inherit}
#rankSync:empty{display:none}
.progress{flex-wrap:wrap;row-gap:3px}
.progress span{min-width:2px}
.home{grid-template-columns:minmax(0,1fr)}
.home>*{min-width:0}
#rankingNote{overflow-wrap:anywhere}
.home{padding-top:10px;gap:12px}
.home-cover{padding-bottom:6px}
.home .atlas-cover{padding:0}
.flag-info{min-height:18px;margin-top:2px}
.home .settings-group legend::before{display:none}
/* The map follows the column width, never the changing form height. */
.home-setup::before{background-size:100% auto;background-position:center top;background-color:#dce9e8}
.home{grid-template-columns:minmax(0,1fr) 260px;column-gap:30px;align-items:start}
.home-cover{grid-column:1/-1}
.home-setup{margin:0;padding:16px}
.home .settings-group{gap:10px}
#homeRanking{padding:12px 0 0;min-width:0;border-top:3px double #91a185}
#homeRanking h2{font-size:18px;margin:0 0 12px}
.personal-ranking{padding:12px 0;border-top:1px solid #b5c2a9;border-bottom:1px solid #b5c2a9;margin:12px 0}
.personal-metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0}
.personal-metrics dt{font-size:12px;color:#4b645b}
.personal-metrics dd{font-size:24px;font-weight:700;margin:4px 0 0;font-variant-numeric:tabular-nums;line-height:1.3}
.personal-ranking p,.board-status{font-size:12px;line-height:1.6;margin:8px 0 0}
.board-status:empty{display:none}
.home-ranking-list{list-style:none;margin:8px 0 14px;padding:0}
.home-ranking-list li{display:grid;grid-template-columns:22px minmax(0,1fr);gap:2px 8px;padding:10px 6px;border-bottom:1px solid #c6ceb9}
.rank-place{grid-row:1/3;font-variant-numeric:tabular-nums}.rank-name{overflow-wrap:anywhere;font-size:14px}.rank-score{grid-column:2;font-size:13px;color:#51665d}
.my-record{background:#e5ecdc}
#allRankings{width:100%;font-size:13px;min-height:44px}
.flag-info{height:38px;min-height:38px;max-height:38px;display:flex;flex-direction:column;justify-content:center;gap:0;line-height:18px;overflow:hidden;margin-top:2px}
.flag-info strong,.flag-info span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:760px){.home{grid-template-columns:minmax(0,1fr)}#homeRanking{grid-column:1;margin-top:8px}.home-setup{padding:12px}.personal-metrics dd{font-size:23px}}
.home{grid-template-columns:minmax(0,1fr)}
.home-play-area{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:30px;position:relative;isolation:isolate;padding:16px;align-items:start}
.home-play-area::before{content:"";position:absolute;inset:0;z-index:-1;background:#dce9e8 url('atlas-backdrop.svg') center top / 100% auto no-repeat;opacity:.38;pointer-events:none}
.home-play-area .home-setup{padding:0;isolation:auto}.home-play-area .home-setup::before{display:none}
#homeRanking .personal-ranking{background:#faf8efb8;padding:10px 8px}
#openTransfer{width:100%;margin-top:8px;min-height:44px;font-size:13px;background:#faf8efde;color:#174d3f;border:1px solid #91a185}
#transferDialog{width:min(600px,90vw);box-sizing:border-box;max-height:90vh;overflow:auto}
#transferDialog h2{font-size:22px}#transferDialog p{font-size:13px;line-height:1.7}
#transferDialog label{display:block;font-weight:700;margin:16px 0 6px}
#transferDialog input{box-sizing:border-box;width:100%;min-width:0;font:inherit;font-size:13px;padding:12px;border:1px solid #82957e;background:#fffdf8}
.transfer-code-row{display:flex;gap:8px}.transfer-code-row button{flex-shrink:0}
#transferForm{border-top:1px solid #bac6ac;margin-top:20px;padding-top:4px}
#transferPrivacy{color:#734632}#undoTransfer{font-size:13px}
@media(max-width:760px){.home-play-area{grid-template-columns:minmax(0,1fr);gap:18px;padding:12px}.home-play-area::before{opacity:.3}}
/* Stronger atlas ink, with a quiet paper surface under the score column. */
.home-play-area::before{opacity:.58}
#homeRanking{background:#faf8efe8;padding:12px;box-sizing:border-box}
#homeRanking #rankingSetup{margin-bottom:0;font-size:12px}
#homeRanking #rankingName{box-sizing:border-box;width:100%}
.home .settings small{color:#294d4e}
.home .limits-group small{min-height:3.3em}
.home .settings #untimedSetting{box-sizing:border-box;height:44px;min-height:44px;line-height:24px;margin:5px 0;padding:9px 6px;white-space:nowrap}
.flag-ribbon{position:relative;padding-bottom:58px;overflow:hidden}
.flag-ribbon .flag-info{position:absolute;top:68px;left:0;transform:translateX(-50%);width:220px;max-width:none;height:54px;min-height:0;max-height:none;margin:0;pointer-events:none;justify-content:flex-start;align-items:center;text-align:center;font-size:11px;line-height:17px}
.flag-ribbon .flag-info[hidden]{display:none}
.flag-ribbon .flag-info strong,.flag-ribbon .flag-info span{white-space:normal;overflow:visible;text-overflow:clip;font-size:12px;line-height:17px}
@media(max-width:600px){.flag-ribbon .flag-info{top:58px;width:180px}.home .limits-group small{min-height:4.5em}}
/* Keep the same geometry across modes, without reserving long descriptions. */
.home .settings-group{margin-bottom:10px}
#homeRanking h2{min-height:2.8em;line-height:1.4}
#homeRanking .home-board-viewport{height:220px;overflow:auto;scrollbar-gutter:stable;margin-bottom:10px}
#homeRanking .personal-ranking{box-sizing:border-box}
#homeRanking .board-status{height:20px;line-height:20px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
#homeRanking .home-ranking-list{margin:4px 0 10px}
#ready #rankingSetup{max-width:640px;margin:16px auto;text-align:left;padding:12px 16px;background:#faf8efe8;box-sizing:border-box}
#rankingNote{max-width:640px;margin:16px auto 24px;padding:12px 16px;text-align:left;background:#faf8efe8;border-left:3px solid #8d4930;font-size:13px;line-height:1.7}
.flag-ribbon{padding-bottom:52px}
.home .home-cover{padding-bottom:0}
.home .atlas-cover{margin-bottom:0}
.home{row-gap:8px}
/* Quiet parchment grain on paper surfaces; map artwork keeps its own colors. */
:root{--paper:#f7f0df}
body{background-color:var(--paper);background-image:url('parchment.svg');background-size:384px 384px}
#game,#result,dialog,#homeRanking,#ready #rankingSetup{background-color:var(--paper);background-image:url('parchment.svg');background-size:384px 384px}
#homeRanking .personal-ranking{background:transparent}
.home .share-button,#openTransfer{background-color:#f7f0df;background-image:url('parchment.svg');background-size:384px 384px}
/* Paper controls retain a solid, legible surface over the atlas. */
.home .settings select,.home .settings input,.language-label select,#rankingName{background-color:#faf0d9;background-image:url('parchment.svg');background-size:384px 384px;color:#203d43;border-color:#9b9378}
select option{background:#faf0d9;color:#203d43}
button,select,summary,a.brand{transition:box-shadow 140ms ease,filter 140ms ease,border-color 140ms ease}
@media(hover:hover){
 button:not(:disabled):hover,select:not(:disabled):hover,summary:hover,a.brand:hover{box-shadow:0 2px 5px #57452926;filter:brightness(1.04);outline:1px solid #8d765666;outline-offset:2px}
 .home .settings select:not(:disabled):hover,.language-label select:hover{border-color:#665c40}
}
@media(prefers-reduced-motion:reduce){button,select,summary,a.brand{transition:none}}
/* Stronger printed atlas, with the same paper grain as its surrounding page. */
.home-play-area::before{background-color:#d2dcd1;background-image:url('parchment.svg'),url('atlas-backdrop.svg');background-position:left top,center top;background-size:384px 384px,100% auto;background-repeat:repeat,no-repeat;opacity:.8;filter:sepia(.23) saturate(.85)}
#ready::before{background-image:url('parchment.svg'),url('atlas-backdrop.svg');background-size:384px 384px,cover;background-repeat:repeat,no-repeat;opacity:.52;filter:sepia(.23) saturate(.85)}
/* Translucent paper, opaque ink: geography stays visible beneath the controls. */
#homeRanking{background-color:rgb(247 240 223 / 84%)}
.home .settings select,.home .settings input{background-color:rgb(250 240 217 / 86%)}
.home .share-button,#openTransfer{background-color:rgb(247 240 223 / 82%)}
#start{background-color:rgb(141 73 48 / 92%)}
#allRankings{background-color:rgb(36 109 70 / 92%)}
.flag-ribbon{padding-bottom:44px}
.flag-ribbon .flag-info{height:44px;line-height:14px}
.flag-ribbon .flag-info strong,.flag-ribbon .flag-info span{line-height:14px}
/* Let the atlas show through while retaining dark, opaque ranking text. */
#homeRanking{background-color:rgb(247 240 223 / 65%);border:2px solid #8b9277;color:#203d43}
#homeRanking .personal-note,#homeRanking .rank-score,#homeRanking .board-status{color:#294847}
button:is(.primary,.quiet,.share-button),#start,#allRankings,.home .settings select,.language-label select{border-width:2px}
#openTransfer{border-width:2px}
/* Blend the browser's numeric stepper into the paper instead of a white tile. */
.home .settings input[type="number"]::-webkit-inner-spin-button{background-color:transparent;mix-blend-mode:multiply;opacity:.7;cursor:pointer}
.home .settings input[type="number"]::-webkit-inner-spin-button:hover{opacity:1}
.home-play-area::before{opacity:.95;filter:sepia(.18) saturate(1.08)}
#ready::before{opacity:.64;filter:sepia(.18) saturate(1.08)}
.home .settings input[type="number"]{border:2px solid #9b9378}
/* Compact the ranking summary and continue the map's sea below its artwork. */
#homeRanking h2{font-size:16px;min-height:1.4em;margin-bottom:6px}
#homeRanking{align-self:end;margin-bottom:var(--start-note-height,28.4px)}
footer .creator-credit{display:block;margin-top:8px;font-size:12px;letter-spacing:.03em;color:#344e43}
@media(max-width:760px){#homeRanking{align-self:start;margin-bottom:0}}
#homeRanking .home-board-viewport{height:180px;margin-bottom:8px}
#homeRanking .personal-ranking{padding:8px 6px;margin:6px 0}
#homeRanking .personal-ranking p{margin-top:6px}
.home-play-area::before{background-color:#b9d8e0}
.home-play-area::before{box-shadow:inset 0 0 0 3px #34492e}
button:is(.primary,.quiet,.share-button),#start,#allRankings{border-color:#52634a}
#start{border-color:#703b27}
#allRankings{border-color:#1b5138}
#openTransfer,.home .share-button,.home .settings select,.home .settings input[type="number"],.language-label select{border-color:#6c7054}
@media(hover:hover){.home .settings input[type="number"]:not(:disabled):hover{border-color:#665c40;box-shadow:0 2px 5px #57452926;filter:brightness(1.04);outline:1px solid #8d765666;outline-offset:2px}}
/* Slightly deeper ink, retaining the atlas palette and text hierarchy. */
:root{--ink:#17343d;--secondary:#354d50}
.brand,.header-actions .language-label,.header-actions .quiet{color:#17343d}
.home .settings small,.home .start-sync{color:#213f40}
.home .settings select,.home .settings input,.language-label select,#rankingName,select option{color:#183438}
#homeRanking{color:#183438}
.personal-metrics dt,.rank-score,#homeRanking .personal-note,#homeRanking .rank-score,#homeRanking .board-status{color:#304b43}
.rule-strip p,.rule-strip>span,footer{color:#354d50}
/* Keep the clock and start controls aligned with the ranking preparation screen. */
#ready #rankingSetup[hidden]{display:block!important;visibility:hidden;pointer-events:none}
/* Compact shared preparation layout; long ranking guidance follows the controls. */
#ready{padding:20px 24px}
#ready h2{margin:0 0 8px;font-size:26px;line-height:1.4}
#ready>p{margin:6px auto;max-width:640px;color:var(--secondary)}
#ready #rankingSetup{display:flex;align-items:center;justify-content:center;gap:12px;max-width:520px;margin:10px auto;padding:6px 10px;min-height:54px;border-top:0}
#ready #rankingSetup[hidden]{display:flex!important}
#ready #rankingSetup label{margin:0;font-size:12px;flex-shrink:0}
#ready #rankingName{min-width:0;width:260px;padding:7px 10px;box-sizing:border-box}
#ready .ready-clock{margin:10px auto 6px;padding:10px 0}
#ready .clock-status{min-height:20px;font-size:12px;margin:4px auto}
#ready .clock-help{margin:6px auto 10px;max-width:560px;font-size:12px;line-height:1.65}
#ready .primary{display:block;margin:10px auto 6px;min-height:48px;padding:10px 20px}
#readyBack{margin-top:6px;padding:8px 16px;min-height:40px}
#readyError:empty{display:none}
#ready #rankingNote{margin:16px auto 0;padding:12px 16px;font-size:12px;line-height:1.7}
@media(max-width:480px){#ready{padding:16px 12px}#ready h2{font-size:23px}#ready>p{font-size:12px;line-height:1.6}#ready #rankingSetup{gap:8px;padding:4px 0}#ready #rankingSetup label{max-width:110px}#ready #rankingName{flex:1;width:0}#ready .ready-clock{padding:8px 0}#ready .primary{width:min(100%,300px)}}
/* Separate the way to play, the displayed question, and the typed answer. */
.home .settings-group legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.home .settings-group{border:0;padding-top:0;margin-bottom:10px;gap:8px 12px}
.home .settings #modeField,.home .settings #guidedTargetField{display:none!important}
.home .settings .play-mode-field{display:grid;grid-template-columns:minmax(160px,190px) minmax(0,1fr);column-gap:14px;margin:0 0 12px;font-size:13px;font-weight:700;color:var(--ink)}
.play-mode-field>span{grid-column:1}.play-mode-field>select{grid-column:1;grid-row:2}
.home .settings .play-mode-field>small{grid-column:2;grid-row:2;align-self:center;min-height:0!important;margin:0}
.home .settings #questionSelectionSummary{grid-column:1/-1;margin:0;min-height:3.3em;line-height:1.65}
.home .settings .limits-group{margin-bottom:8px;padding-top:4px}
.home .settings .limits-group small{min-height:3.3em}
@media(max-width:600px){.home .settings .play-mode-field{grid-template-columns:minmax(140px,160px) minmax(0,1fr);gap:0 10px;margin-bottom:10px}.home .settings #questionSelectionSummary{min-height:3.3em}.home .settings .limits-group small{min-height:4.5em}}

/* One-line descriptions: remove unused second-line reservations. */
.home .settings #questionSelectionSummary,.home .settings .limits-group small{min-height:1.65em;margin:0;line-height:1.65}
.home .settings-group{row-gap:4px;margin-bottom:8px}
.home .settings .limits-group{padding-top:2px}
@media(min-width:601px){html[lang=ja] .home .settings #modeDescription{white-space:nowrap}html[lang=ja] .home .settings .play-mode-field{grid-template-columns:minmax(150px,175px) minmax(0,1fr);column-gap:12px}}
@media(max-width:600px){.home .settings .play-mode-field{grid-template-columns:1fr;margin-bottom:8px}.home .settings .play-mode-field>small{grid-column:1;grid-row:3;margin-top:5px}.home .settings #questionSelectionSummary{min-height:3.3em}.home .settings .limits-group small{min-height:1.65em}}

/* Keep paper captions snug while retaining the settings grid tracks. */
.home .settings small{width:fit-content;max-width:100%;justify-self:start;box-sizing:border-box;line-height:1.65}
.home .settings #questionSelectionSummary{justify-self:start;align-self:start;height:auto}

.home .settings .play-mode-field{display:block!important;margin-bottom:12px}.home .settings #practiceMode{display:none!important}.mode-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:5px 0 8px}.mode-buttons button{min-width:0;min-height:44px;padding:8px 4px;font-size:14px;line-height:1.4;letter-spacing:0}.mode-buttons button[aria-pressed=true]{background:#245a48;color:#fff9e9;border-color:#173d30;box-shadow:inset 0 -3px 0 #173d30}.mode-buttons button:focus-visible{outline:3px solid #245a48;outline-offset:3px}.home .settings .play-mode-field>#modeDescription{display:block;margin:0;min-height:1.65em!important;line-height:1.65;white-space:normal}
@media(max-width:600px){.mode-buttons{gap:4px}.mode-buttons button{font-size:12px;padding:8px 2px}}
.mode-buttons button{background:rgba(247,236,208,.78);color:#17343d;border:2px solid #596448;border-radius:2px;font-weight:700}.mode-buttons button:hover{background:rgba(238,221,181,.92)}.mode-buttons button[aria-pressed=true]:hover{background:#245a48;color:#fff9e9}

.mode-bubble-slot{position:relative;min-height:30px;margin-top:10px}.home .settings .mode-bubble-slot>#modeDescription{position:absolute;top:0;width:max-content;max-width:100%;margin:0;min-height:0!important;padding:2px 5px;box-shadow:none;background:rgba(247,236,208,.95);line-height:1.65;border-radius:3px;white-space:normal}.mode-bubble-slot #modeDescription::before{content:'';position:absolute;top:-6px;left:var(--bubble-tip,12px);transform:translateX(-50%);border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid rgba(247,236,208,.95)}
@media(min-width:601px){.home .settings #questionSelectionSummary{grid-column:1/3;grid-row:2;align-self:start}.home .settings #regionCount{grid-column:3;grid-row:2;align-self:start;margin:0;line-height:1.65}}
@media(max-width:600px){.mode-bubble-slot{min-height:46px}.home .settings #regionCount{grid-column:1/-1}.home .settings #questionSelectionSummary{min-height:3.3em}}
