:root{--paper:#f5f4ed;--ink:#183638;--muted:#708381;--line:#d9dfd6;--accent:#e86145;--sea:#dce9e9;--white:#fffdf7;--shadow:0 18px 65px #153c3d20;font-family:'Hiragino Kaku Gothic ProN','Yu Gothic',Meiryo,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,select,input{font:inherit}button,select{color:inherit}button{cursor:pointer;transition:background .17s,transform .17s;border:0}button:active:not(:disabled){transform:translateY(1px)}button:disabled{opacity:.42;cursor:default}button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #e86145;outline-offset:3px}button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}a{color:inherit}svg{display:block}.hidden{display:none!important}.header{height:74px;padding:0 32px;display:flex;align-items:center;border-bottom:1px solid var(--line);gap:32px;position:relative;z-index:2}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-size:22px;letter-spacing:-1px;font-weight:850}.brand svg{width:33px;height:33px;fill:none;stroke:var(--ink);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.brand .accent{stroke:var(--accent);stroke-width:2.8}.orange{color:var(--accent)}.header-sub{font:10px ui-monospace,monospace;letter-spacing:2.7px;color:var(--muted)}.text-button{background:transparent;padding:8px 5px;font-size:12px}.header>.text-button{margin-left:auto;display:flex;align-items:center;gap:9px}.help-icon{border:1px solid #adbbb6;border-radius:50%;height:20px;width:20px;display:inline-grid;place-items:center;font-size:11px}.workspace{height:calc(100dvh - 74px);display:grid;grid-template-columns:310px minmax(0,1fr);max-width:1920px;margin:auto}.sidebar{padding:30px 25px 20px;overflow-y:auto;display:flex;flex-direction:column;gap:20px;border-right:1px solid var(--line);scrollbar-width:thin}.eyebrow{display:flex;align-items:center;gap:7px;letter-spacing:1.2px;font-size:10px;font-weight:700;color:#72857d}.dot{width:6px;height:6px;background:var(--accent);border-radius:50%}h1{font-size:32px;line-height:1.5;letter-spacing:-1.7px;margin:17px 0 12px;font-weight:800}h1 em{font-family:Georgia,serif;font-size:51px;line-height:1;font-weight:400;font-style:italic;color:var(--accent);margin-right:6px}.intro{font-size:12px;line-height:1.9;color:#70837d;margin:0}.session-stats{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;display:flex;gap:36px}.session-stats>div{display:flex;flex-direction:column;gap:7px}.session-stats span{font-size:10px;color:var(--muted)}.session-stats strong{font:25px ui-monospace,monospace;letter-spacing:-1px}.session-stats small{font:10px sans-serif;color:var(--muted);margin-left:5px}.section-label{font:9px ui-monospace,monospace;letter-spacing:2px;color:var(--muted);display:block;margin:0 0 11px}.tool-group{display:flex;gap:7px}.tool{flex:1;border:1px solid var(--line);background:transparent;border-radius:8px;display:flex;flex-direction:column;align-items:center;gap:9px;padding:13px 2px 10px;font-size:11px;font-weight:700}.tool.active{background:var(--ink);color:var(--white);border-color:var(--ink)}.tool:not(.active):hover,.secondary:hover{background:#e8ece3}.edit-row{display:flex;gap:12px;margin-top:10px}.secondary{background:transparent;border:1px solid #bcc9be;border-radius:7px;padding:11px 14px;font-size:12px;font-weight:600}.edit-row>.secondary{flex:1}.settings{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px}.settings select{max-width:170px;border:1px solid var(--line);border-radius:6px;background:transparent;padding:9px 5px;font-size:11px}.guide-card{background:#ebeee4;border:1px solid #e1e6da;border-radius:8px;padding:15px}.guide-number{font:9px ui-monospace,monospace;letter-spacing:2px;color:#7e9081}.guide-card h2{font-size:11px;margin:10px 0 7px;font-weight:750;letter-spacing:-.5px}.guide-card p{font-size:10px;line-height:1.9;color:#77847a;margin:0}.guide-foot{display:flex;gap:9px;margin-top:12px;color:#526b5d;font-size:9px}.guide-foot span{border-bottom:1px solid #aabcac;padding-bottom:3px}.submit-area{margin-top:auto;display:flex;flex-direction:column;gap:9px}.primary{background:var(--accent);color:white;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:13px;font-weight:750;padding:15px 17px;min-height:50px;box-shadow:0 3px 0 #c9503620}.primary:hover{background:#d75237}.primary .arrow{margin-left:auto;font-size:23px;font-weight:300}.save-state{font-size:9px;color:#8a9990;text-align:center}.best{font-size:10px;border-top:1px solid var(--line);padding-top:16px;display:flex;align-items:center;gap:10px;color:var(--muted)}.best b{margin-left:auto;font:16px ui-monospace,monospace;color:var(--ink)}.best>span{font-size:8px}.map-shell{position:relative;min-width:0;min-height:0;overflow:hidden;background:var(--sea)}canvas#map{width:100%;height:100%;display:block;touch-action:none;cursor:crosshair}.map-top{position:absolute;top:23px;left:25px;right:25px;display:flex;justify-content:space-between;align-items:center;pointer-events:none;gap:10px}.map-caption{color:#476e6c;font-size:11px;font-weight:600;letter-spacing:1px;display:flex;align-items:center;gap:8px}.map-dot{width:5px;height:5px;border:1px solid #658b83;border-radius:50%}.region-control{pointer-events:auto}#region{border:1px solid #b5cbc5;appearance:none;background:#f7faf3dd;border-radius:7px;padding:10px 29px 10px 12px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%235b7770'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;font-size:11px}.map-navigation{position:absolute;right:25px;top:93px;display:flex;align-items:center;flex-direction:column;gap:27px}.north{font:10px ui-monospace,monospace;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;color:#4e7371}.north svg{height:28px;width:20px;fill:#658782}.zoom{display:flex;flex-direction:column;border:1px solid #bad0c9;background:#fbfdf8ed;border-radius:9px;box-shadow:0 4px 10px #45665e0a;overflow:hidden}.zoom button{background:transparent;font:23px sans-serif;width:40px;height:41px;display:grid;place-items:center}.zoom button+button{border-top:1px solid #d7e2da}.zoom svg{width:17px;height:17px}.zoom button:hover{background:#e1e9df}.map-bottom{position:absolute;bottom:59px;left:25px;right:25px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.height-legend{display:flex;align-items:center;gap:8px;font-size:9px;color:#4c7069;background:#e4eeeeaf;padding:5px 7px;border-radius:5px}.height-legend i{width:75px;height:6px;border-radius:3px;background:linear-gradient(90deg,#89b6a2,#c4c781,#b99b78,#866b64)}.scale{color:#557774;font:10px ui-monospace,monospace;position:relative;text-align:center;border-bottom:1px solid #628480;padding-bottom:4px;min-width:30px}.scale:before,.scale:after{content:'';position:absolute;bottom:0;height:5px;width:1px;background:#628480}.scale:before{left:0}.scale:after{right:0}.gesture-hint{position:absolute;bottom:86px;left:50%;transform:translateX(-50%);padding:9px 14px;border:1px solid #eaf0e2;background:#fbfdf4e8;box-shadow:0 5px 25px #1746420a;border-radius:50px;font-size:10px;color:#6a8072;white-space:nowrap;pointer-events:none;transition:opacity .5s}.map-credit{position:absolute;bottom:10px;left:25px;right:20px;color:#64837d;font-size:8px;line-height:1.6}.map-credit>span{font-size:7px;opacity:.8}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;font-size:12px;background:var(--sea);z-index:4}.spinner{width:30px;height:30px;border:2px solid #b8cbc3;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.mobile-heading,.mobile-only,.touch-hint{display:none!important}.toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%);z-index:100;background:var(--ink);color:white;border-radius:8px;padding:12px 20px;font-size:12px;box-shadow:var(--shadow);max-width:90vw}.full{width:100%}dialog{border:1px solid #e2e4d9;border-radius:16px;box-shadow:var(--shadow);background:var(--paper);color:var(--ink);width:min(530px,calc(100% - 28px));max-height:calc(100dvh - 40px);padding:33px;overflow:auto}dialog::backdrop{background:#163b3e70;backdrop-filter:blur(4px)}dialog h2{font-size:24px;letter-spacing:-1px;margin:15px 0 17px}dialog p{font-size:12px;color:#6d8177;line-height:1.95}dialog a{text-underline-offset:3px}.dialog-close{position:absolute;top:15px;right:17px;width:28px;height:28px;background:#e5e9df;border-radius:50%;font-size:22px;font-weight:300}.help-steps{padding:0;list-style:none;counter-reset:step;display:flex;flex-direction:column;gap:19px;margin:24px 0}.help-steps li{counter-increment:step;position:relative;padding-left:36px}.help-steps li:before{content:'0' counter(step);position:absolute;left:0;top:0;font:19px Georgia,serif;color:var(--accent)}.help-steps b{font-size:13px;display:block;margin-bottom:6px}.help-steps span{font-size:11px;line-height:1.8;color:#6f8279;display:block}.help-note{background:#e9eee2;border-radius:7px;padding:14px;font-size:11px;line-height:1.9;color:#59735e}details{margin:20px 0}summary{cursor:pointer;font-size:12px;font-weight:650}details p{font-size:10px}.result-score{display:flex;align-items:center;gap:10px;margin:20px 0 12px}.result-score>strong{font:100px/.98 Georgia,serif;letter-spacing:-5px;color:var(--accent)}.result-score>span{font:30px Georgia,serif;padding-top:17px;color:var(--accent)}.result-score small{display:block;color:var(--muted);font:10px sans-serif;margin-top:12px;letter-spacing:0}.rank-row{display:flex;align-items:center;justify-content:space-between;margin:20px 0;border-bottom:1px solid var(--line);padding-bottom:18px}.rank-row>b{font-size:13px;letter-spacing:.6px}.rank-row>span{font-size:9px;color:var(--muted)}.rank-row strong{font:17px ui-monospace,monospace;color:var(--ink)}.result-metrics{display:flex;gap:20px}.result-metrics>div{flex:1;display:grid;grid-template-columns:1fr auto;gap:10px;font-size:10px}.result-metrics b{font:14px ui-monospace,monospace}.result-metrics i{grid-column:span 2;height:5px;background:#e0e6da;border-radius:9px;overflow:hidden}.result-metrics i span{display:block;height:100%;background:#648c77;border-radius:9px}.result-actions{display:flex;gap:8px}.result-actions>*{flex:1}.result-actions>.primary{font-size:11px}.result-actions>.secondary{font-size:11px}.result-sidebar{border-bottom:1px solid var(--line);padding-bottom:18px}.side-score{font:64px Georgia,serif;color:var(--accent);letter-spacing:-2px;margin:6px 0}.side-score small{font-size:22px;margin-left:3px}.result-sidebar p{font-size:12px;margin:8px 0 17px}.layer-switch{display:flex;gap:12px;margin:15px 0;font-size:10px}.layer-switch label{display:flex;align-items:center;gap:4px}.layer-switch input{width:12px;height:12px;accent-color:var(--ink)}.line{height:3px;width:12px;display:inline-block}.line.mine{background:#ea524c}.line.correct{background:#087e83}.small{font-size:10px}#prefList{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin:18px 0}.pref-item{font-size:10px;display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--line)}.pref-item b{font-family:ui-monospace,monospace}.pref-item .sea-label{font-size:9px;color:var(--muted)}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}body.results .challenge-head{display:none}body.results .settings,body.results .guide-card,body.results .controls-section{display:none}body.results .session-stats{border-top:0;padding-top:0}body.results .sidebar{gap:17px}#prefDetails summary{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:20px}
@media(min-width:1500px){.workspace{grid-template-columns:340px 1fr}.sidebar{padding-left:32px;padding-right:32px}h1{font-size:36px}}
@media(max-height:840px) and (min-width:761px){.sidebar{gap:16px;padding-top:23px}.guide-card{padding:12px}.guide-card p{font-size:9px}.challenge-head h1{font-size:28px;margin:10px 0 8px}.guide-foot{display:none}.best{padding-top:10px}.intro{font-size:11px}.session-stats{padding:12px 0}.tool{padding:10px 2px 8px}}
@media(max-height:720px) and (min-width:761px){.guide-card{display:none}.sidebar{gap:15px}}
@media(max-width:760px){.header{height:54px;padding:0 17px;gap:10px}.brand{font-size:19px;gap:7px}.brand svg{width:28px;height:28px}.header-sub{display:none}.header>.text-button{font-size:10px}.workspace{height:calc(100dvh - 54px);display:flex;flex-direction:column;position:relative}.sidebar{display:contents}.challenge-head,.guide-card,.best,.section-label,.settings{display:none}.mobile-heading{display:flex!important;padding:13px 16px 10px;justify-content:space-between;align-items:center;gap:5px;font-size:11px;font-weight:650;flex-shrink:0;order:0}.mobile-heading b{font-size:8px;background:#e9ede2;color:#6b806e;font-weight:500;letter-spacing:.5px;border-radius:3px;padding:5px 7px}.session-stats{order:1;gap:0;padding:0 16px 12px;justify-content:space-between;align-items:center;border-top:0;flex-shrink:0}.session-stats>div{flex-direction:row;align-items:baseline;gap:7px}.session-stats span{font-size:8px}.session-stats strong{font-size:17px;letter-spacing:-.5px}.session-stats small{font-size:8px;margin-left:2px}.session-stats .unlimited{font:10px sans-serif}.mobile-only{display:flex!important}.map-shell{order:2;flex:1;min-height:170px}.map-top{top:13px;left:15px;right:15px}.map-caption{font-size:9px;letter-spacing:.5px}#region{font-size:10px;padding:8px 24px 8px 10px}.map-navigation{right:15px;top:65px;gap:20px}.north{font-size:8px;gap:4px}.north svg{height:21px}.zoom button{width:34px;height:34px;font-size:21px}.map-bottom{bottom:50px;left:15px;right:15px}.height-legend{font-size:8px;gap:6px;padding-left:0;background:transparent}.height-legend i{width:45px;height:4px}.map-credit{bottom:7px;left:15px;right:8px;font-size:6px}.map-credit>span{font-size:5.5px}.gesture-hint{bottom:78px;font-size:8px;padding:6px 11px;max-width:92%;}.desktop-hint{display:none}.touch-hint{display:inline!important}.controls-section{order:3;padding:10px 15px 0;display:flex;gap:8px;align-items:center;background:var(--paper);flex-shrink:0}.tool-group{flex:1;gap:5px}.tool{flex-direction:row;justify-content:center;gap:5px;padding:10px 7px;font-size:10px;border-radius:6px}.tool svg{width:17px;height:17px}.edit-row{margin:0;gap:5px;align-self:stretch;align-items:center}.edit-row>.secondary{font-size:0;padding:9px 12px;min-height:39px}.edit-row>.secondary:after{content:'↶';font:19px sans-serif}.edit-row>.text-button{font-size:9px;padding:7px 5px}.submit-area{order:4;margin:0;padding:9px 15px max(9px,env(safe-area-inset-bottom));gap:5px;flex-shrink:0}.submit-area .primary{min-height:44px;padding:11px 15px;font-size:12px}.submit-area .arrow{font-size:19px}.save-state{font-size:7px}.result-sidebar{order:3;display:flex;align-items:center;gap:10px;padding:10px 15px 0;border:0}.result-sidebar>.eyebrow{font-size:8px;max-width:36px;line-height:1.7;letter-spacing:0}.result-sidebar .side-score{font-size:37px;margin:0}.side-score small{font-size:15px}.result-sidebar>p{display:none}.result-sidebar .layer-switch{margin:0 0 0 auto;flex-direction:column;gap:7px;font-size:9px}.result-sidebar>.secondary{display:none}.layer-switch .line{display:none}body.results .session-stats{padding:0 16px 10px}body.results .mobile-heading{padding-bottom:9px}body.results .submit-area{display:grid;grid-template-columns:1fr 1fr}body.results .submit-area .save-state{grid-column:span 2}body.results .submit-area .secondary{font-size:11px}dialog{padding:29px 22px 23px;border-radius:13px}dialog h2{font-size:21px}.result-score>strong{font-size:88px}.result-score>span{font-size:24px}.rank-row>b{font-size:11px}.rank-row strong{font-size:15px}.result-actions .primary{font-size:10px;padding:13px 10px}.result-actions .secondary{font-size:10px;padding:12px 10px}#helpDialog .eyebrow{font-size:9px}.toast{font-size:11px;bottom:130px;text-align:center;min-width:200px}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

.help-settings{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-top:20px;gap:12px}.help-settings select{background:transparent;border:1px solid #bcc9be;border-radius:6px;padding:9px;font-size:12px}

/* Larger bottom controls, with separate rows to preserve touch-target width. */
.tool{min-height:72px;font-size:13px}.edit-row .secondary,.edit-row .text-button{min-height:44px;font-size:13px}.submit-area .primary{min-height:58px;font-size:16px}.submit-area .secondary{min-height:50px;font-size:14px}
@media(max-width:760px){
 .controls-section{display:grid;grid-template-columns:1fr auto;gap:9px;padding:11px 12px 0}
 .tool-group{gap:7px}.tool{min-height:60px;flex-direction:column;gap:5px;padding:8px 4px;font-size:12px}.tool svg{width:23px;height:23px}
 .edit-row{gap:6px}.edit-row>.secondary{min-width:46px;min-height:60px;padding:10px;font-size:0}.edit-row>.secondary:after{font-size:26px}.edit-row>.text-button{min-width:44px;min-height:60px;font-size:12px;padding:8px 4px}
 .submit-area{padding:10px 12px max(10px,env(safe-area-inset-bottom));gap:6px}.submit-area .primary{min-height:58px;font-size:16px;padding:14px 18px}.submit-area .arrow{font-size:25px}.save-state{font-size:9px}
 body.results .submit-area .secondary{min-height:58px;font-size:14px}.result-sidebar .layer-switch{font-size:11px;gap:9px}.layer-switch input{width:18px;height:18px}
}
@media(max-width:360px){.controls-section{gap:6px}.tool{font-size:11px}.edit-row>.secondary{min-width:40px}.edit-row>.text-button{min-width:38px;font-size:11px}}

.pref-top-section{margin:20px 0}.pref-top-section h3{font-size:13px;margin:0 0 12px;letter-spacing:.2px}#prefTop{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.pref-top-card{display:flex;flex-direction:column;align-items:center;gap:8px;padding:13px 5px;background:#e9eee2;border:1px solid #d9e2d0;border-radius:8px}.pref-top-card:first-child{background:#f4ead5;border-color:#e2ce9e}.pref-place{font-size:11px;color:#6c7c60;font-weight:700}.pref-top-card b{font-size:13px}.pref-top-card strong{font:24px Georgia,serif;color:var(--accent)}.ranking-empty{grid-column:1/-1;margin:0;background:#e9eee2;padding:14px;border-radius:7px}#prefList{display:flex;flex-direction:column;gap:0;margin:16px 0}.pref-item{display:grid;grid-template-columns:34px 1fr auto;gap:8px 10px;align-items:center;padding:12px 0;font-size:13px}.pref-position{font:12px ui-monospace,monospace;color:#839082}.pref-name{font-weight:600}.pref-item>b{font-size:14px}.pref-track{grid-column:2/4;height:4px;background:#e1e7da;border-radius:5px;overflow:hidden}.pref-track>span{display:block;height:100%;background:#80a28c}.pref-item.top-ranked .pref-position{color:var(--accent);font-weight:800}.pref-item.top-ranked .pref-track>span{background:#df9575}.pref-item .sea-label{font-size:11px}

.snap-switch{position:absolute;left:25px;top:61px;display:flex;align-items:center;gap:8px;background:#fafcf2ee;border:1px solid #bccfc4;border-radius:7px;padding:10px 12px;font-size:11px;color:#476960;box-shadow:0 3px 12px #234e3b0a;cursor:pointer;user-select:none}.snap-switch input{width:17px;height:17px;margin:0;accent-color:#3d7264}.snap-switch:has(input:disabled){opacity:.7}@media(max-width:760px){.snap-switch{left:15px;top:53px;gap:7px;padding:10px;font-size:10px;max-width:calc(100% - 75px)}.snap-switch input{width:18px;height:18px}}

/* Timed prefecture challenge */
[hidden]{display:none!important}.round-hud{position:absolute;top:66px;left:24px;right:72px;background:#fffdf5f5;border:1px solid #d4daca;border-radius:16px;padding:14px 18px;box-shadow:0 4px 18px #153d3a14;display:flex;align-items:center;justify-content:space-between;gap:12px;pointer-events:none}.round-hud span{display:block;font-size:12px;color:#536965}.round-hud strong{display:block;font-size:27px;margin-top:3px}.round-hud>b{font-size:34px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#174b46}.round-hud>b.urgent{color:#d94335}.timer-track{position:absolute;bottom:0;left:12px;right:12px;height:4px;overflow:hidden}.timer-track i{display:block;height:100%;width:100%;background:#e8754d}.publish-form{padding:18px;background:#edf2e8;border-radius:14px;margin:20px 0}.publish-form h3{margin:0 0 14px}.publish-form>label{display:block;font-size:13px;margin-bottom:8px}.publish-form>input{width:100%;padding:13px;border:1px solid #a8b9af;border-radius:8px;font:inherit;background:white}.publish-form .consent{display:flex;align-items:flex-start;gap:10px;margin:14px 0;line-height:1.6}.consent input{width:20px;height:20px;flex-shrink:0}.ranking-select{display:flex;gap:10px}.ranking-select select{flex:1;padding:12px;font:inherit;min-width:0}.ranking-select button{padding:10px}#rankingList{list-style:none;margin:0;padding:0;max-height:330px;overflow:auto}#rankingList li{display:grid;grid-template-columns:45px 1fr auto;gap:10px;align-items:center;padding:13px 3px;border-bottom:1px solid #dce0d7}#rankingList b{overflow-wrap:anywhere}#rankingList span{color:#7b867c}#rankingStatus,#publishStatus{font-size:13px;line-height:1.6}#leaderboardBtn{margin:14px 0}#resultDialog .result-actions{display:flex;flex-wrap:wrap}#nextRound{flex:1 0 100%}.settings{display:none}.guide-card{margin-top:12px}#rankingPanel{margin-top:20px}
@media(max-width:760px){.round-hud{top:50px;left:12px;right:55px;padding:10px 12px;border-radius:12px}.round-hud strong{font-size:23px}.round-hud>b{font-size:26px}.round-hud span{font-size:10px}.sidebar #leaderboardBtn{margin:0;min-height:36px;padding:6px;font-size:12px}.map-top{top:10px}.save-state{font-size:10px}.session-stats{display:none!important}.mobile-heading{display:none!important}.result-dialog{max-height:90dvh}.publish-form{padding:14px}.result-score strong{font-size:64px}}

@media(max-width:760px){body.results .submit-area{display:flex}.sidebar #leaderboardBtn{order:0}.round-hud strong{font-size:21px}.round-hud>b{font-size:23px}.round-hud{gap:7px}}

.series-hud{display:flex;gap:15px;align-items:center;color:#e86145;margin-bottom:5px}.series-hud b{font:700 12px ui-monospace,monospace}.series-hud #runningTotal{font-size:11px;color:#526b5d}.sound-button{position:absolute;bottom:110px;left:18px;padding:9px 12px;border-radius:30px;background:#fffdf7e8;font-size:12px;color:#476e6c}.answer-reveal{pointer-events:none;position:absolute;left:50%;bottom:95px;transform:translateX(-50%);min-width:240px;text-align:center;background:#fffdf5f2;border:2px solid #81b4a1;border-radius:24px;padding:14px 25px;box-shadow:0 12px 40px #12494525;animation:reward-pop .4s cubic-bezier(.18,.9,.25,1.25)}.answer-reveal>span{font-size:12px;display:block;color:#476e6c}.answer-reveal>strong{display:block;font-size:22px;color:#147b69;margin:5px 0}.answer-reveal>b{font:800 46px ui-monospace,monospace;display:block;color:#174b46}.answer-reveal>em{display:block;font-style:normal;color:#e86145;font-size:21px;font-weight:800;margin-top:3px}.reward-sparks{position:absolute;inset:-24px -18px auto;color:#e9ad36;font-size:25px;animation:spark-rise 1.5s ease-out both}.series-progress{color:#e86145!important;font-weight:700!important;font-size:13px!important}.ranking-select>span{flex:1;font-size:12px;align-self:center}#seriesRows{padding:0;list-style:none}#seriesRows li{padding:11px 5px;border-bottom:1px solid #dce0d7;font-size:14px}#seriesSummary{margin:18px 0}.result-score>strong{font-variant-numeric:tabular-nums}@keyframes reward-pop{from{opacity:0;transform:translateX(-50%) scale(.75)}to{opacity:1;transform:translateX(-50%) scale(1)}}@keyframes spark-rise{from{opacity:0;transform:translateY(20px) scale(.5)}30%{opacity:1}to{opacity:0;transform:translateY(-30px) scale(1.2)}}
@media(max-width:760px){.round-hud{top:48px}.round-hud strong{font-size:21px}.answer-reveal{bottom:80px;min-width:225px;padding:10px 20px}.answer-reveal>b{font-size:36px}.answer-reveal>strong{font-size:19px}.sound-button{bottom:108px;font-size:10px;padding:7px;left:12px}.series-hud{margin-bottom:2px}.series-hud b{font-size:10px}.series-hud #runningTotal{font-size:10px}}
@media(prefers-reduced-motion:reduce){.answer-reveal,.reward-sparks{animation:none}.reward-sparks{display:none}}

.total-hero{text-align:center;padding:15px 0 20px}.total-hero>span{display:block;font-size:13px;color:#74867c}.total-hero strong{display:block;font:800 clamp(40px,10vw,66px) ui-monospace,monospace;color:#e86145;letter-spacing:-3px;line-height:1.35}.total-hero small{font-size:12px;color:#74867c}.final-result .result-score,.final-result .rank-row>span{display:none}.final-result .rank-row{justify-content:center}

/* Map and feedback have separate layout space, never overlap. */
.map-shell{display:flex;flex-direction:column}.map-viewport{position:relative;flex:1;min-height:160px;overflow:hidden}.map-shell>.answer-reveal{position:relative;left:auto;bottom:auto;inset:auto;transform:none;flex:0 0 auto;min-width:0;width:100%;border:0;border-top:2px solid #81b4a1;border-radius:0;box-shadow:none;padding:10px 20px;display:grid;grid-template-columns:1fr auto;gap:2px 16px;text-align:left;animation:none;background:#fffdf5}.answer-reveal>span{grid-column:1}.answer-reveal>strong{grid-column:1;font-size:20px;margin:0}.answer-reveal>b{grid-column:2;grid-row:1 / 3;font-size:36px;align-self:center}.answer-reveal>em{grid-column:1 / 3;font-size:16px;margin:0}.answer-reveal .reward-sparks{display:none}.result-inline{flex:0 1 auto;max-height:55%;overflow:auto;padding:20px 26px;background:var(--paper);border-top:1px solid var(--line);scrollbar-width:thin}.result-inline>h2{font-size:22px;margin:7px 0}.result-inline .total-hero{padding:6px 0}.result-inline .total-hero strong{font-size:44px}.result-inline .series-progress{margin:0}.result-inline .result-actions{display:flex;gap:10px;flex-wrap:wrap}.result-inline .publish-form{margin:12px 0}.result-inline .result-actions .primary{flex:1}.result-inline .small{line-height:1.6}.result-inline #seriesRows{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.result-inline #seriesRows li{font-size:12px}.result-inline .eyebrow{display:none}
@media(max-width:760px){.map-shell>.answer-reveal{padding:7px 14px;gap:1px 12px}.answer-reveal>span{font-size:10px}.answer-reveal>strong{font-size:17px}.answer-reveal>b{font-size:29px}.answer-reveal>em{font-size:14px}.result-inline{padding:12px 16px;max-height:55%}.result-inline .total-hero strong{font-size:40px}.map-viewport{min-height:145px}.result-inline #seriesRows{grid-template-columns:1fr}.sound-button{font-size:10px}}

body.results .round-hud{top:43px;padding:6px 12px}body.results .round-hud #roundPrompt,body.results .round-hud .series-hud{display:none}body.results .round-hud strong{font-size:19px}body.results .round-hud>b{font-size:20px}

/* Final contact sheet: the five maps are the main result content. */
body.final-gallery .map-viewport{display:none}body.final-gallery .result-inline{flex:1;min-height:0;max-height:100%;border-top:0;padding:22px 26px}body.final-gallery .result-inline>h2{margin:5px 0;font-size:24px}body.final-gallery .total-hero{padding:0 0 8px}body.final-gallery #resultMessage{margin:8px 0;font-size:12px}body.final-gallery #seriesSummary{margin:16px 0 25px}#seriesSummary>h3{font-size:21px;line-height:1.5;margin:0 0 10px}.comparison-legend{display:flex;gap:20px;margin:0 0 14px;flex-wrap:wrap;font-size:13px;font-weight:700}.comparison-legend>span{display:flex;align-items:center;gap:8px}.comparison-legend i{display:block;width:26px;border-top:3px solid #e44f50}.comparison-legend .legend-answer{border-top:3px dashed #087e83}.result-inline #seriesRows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:0}.result-inline #seriesRows li.comparison-card{padding:0;border:1px solid #ccd9ce;border-radius:15px;overflow:hidden;background:#fffdf7;box-shadow:0 5px 16px #1f504b0c}.comparison-heading{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:14px 16px}.comparison-heading h4{font-size:18px;margin:0}.comparison-heading strong{font:800 23px ui-monospace,monospace;color:#e86145}.comparison-map{display:block;width:100%;height:auto;aspect-ratio:8/5;background:#dce9e9;border-block:1px solid #d9e3da}.comparison-caption{margin:0;padding:10px 16px;font-size:13px;font-weight:700;color:#49675b}.final-gallery .rank-row{margin:0}.final-gallery .submit-area .save-state{display:none}
@media(max-width:760px){body.final-gallery .result-inline{padding:16px 13px}.result-inline #seriesRows{grid-template-columns:1fr;gap:16px}#seriesSummary>h3{font-size:19px}.comparison-heading{padding:11px 13px}.comparison-heading h4{font-size:18px}.comparison-map{min-height:210px;object-fit:contain}.comparison-legend{font-size:12px;gap:18px}.final-gallery #leaderboardBtn{display:none}}

/* A single screenshot result with the player's border as the visual focus. */
body.final-gallery .sidebar{display:none}body.final-gallery .workspace{display:flex;flex-direction:column}body.final-gallery .map-shell{flex:1;min-height:0}body.final-gallery .result-inline{display:grid;grid-template-columns:1fr auto;grid-template-rows:auto minmax(0,1fr) auto;gap:10px 18px;flex:1;min-height:0;height:100%;padding:14px 24px;overflow:hidden;max-height:none}body.final-gallery #resultTitle{grid-column:1;grid-row:1;margin:0;align-self:center;font-size:25px}body.final-gallery #totalHero{grid-column:2;grid-row:1;display:flex;gap:8px;align-items:baseline;padding:0}body.final-gallery #totalHero>span{display:none}body.final-gallery #totalHero strong{font-size:32px;letter-spacing:-1px}body.final-gallery #totalHero small{font-size:10px}body.final-gallery #seriesProgress,body.final-gallery .rank-row,body.final-gallery #resultMessage,body.final-gallery #resultRankingHost{display:none!important}body.final-gallery #seriesSummary{grid-column:1 / 3;grid-row:2;display:flex;flex-direction:column;min-height:0;margin:0}body.final-gallery #seriesSummary>h3{display:none}body.final-gallery .comparison-legend{flex-shrink:0;justify-content:center;margin:0 0 8px;font-size:12px}body.final-gallery #seriesRows{display:flex;flex:1;min-height:0;margin:0}body.final-gallery #seriesRows li.comparison-card{display:flex;flex-direction:column;flex:1;min-height:0;padding:0;background:#dce9e9;border:2px solid #fffdf7;box-shadow:0 4px 20px #18363818}body.final-gallery .comparison-heading,body.final-gallery .comparison-caption{display:none}body.final-gallery .comparison-map{flex:1;min-height:0;min-width:0;width:100%;height:100%;aspect-ratio:auto;object-fit:contain;border:0}body.final-gallery .result-actions{grid-column:1 / 3;grid-row:3;display:flex;align-items:center;flex-wrap:nowrap;gap:10px}body.final-gallery #nextRound{flex:1 1 auto;min-height:42px;padding:10px 14px}body.final-gallery #shareBtn{display:none}body.final-gallery .result-actions .secondary{min-height:42px;padding:8px 12px}body.final-gallery .result-actions .text-button{font-size:11px}body.final-gallery .comparison-legend .legend-mine{border-top-width:5px;border-color:#ed3e4e}body.final-gallery .comparison-legend .legend-answer{border-color:#38756c;border-top-width:2px}
@media(max-width:760px){body.final-gallery .result-inline{padding:10px 12px max(10px,env(safe-area-inset-bottom));gap:8px;grid-template-columns:1fr auto}body.final-gallery #resultTitle{font-size:18px;line-height:1.25}body.final-gallery #totalHero{gap:3px;flex-direction:column;align-items:flex-end}body.final-gallery #totalHero strong{font-size:27px;line-height:1.1}body.final-gallery #totalHero small{font-size:9px}body.final-gallery .result-actions{gap:6px}body.final-gallery #nextRound{font-size:13px;padding:9px}body.final-gallery .result-actions .secondary{font-size:12px;padding:8px}body.final-gallery .comparison-legend{font-size:11px;gap:20px;margin-bottom:6px}}
@media(max-height:500px){body.final-gallery .result-inline{padding:6px 12px;gap:5px}body.final-gallery #resultTitle{font-size:17px}body.final-gallery #totalHero strong{font-size:25px}body.final-gallery .comparison-legend{margin-bottom:3px}body.final-gallery #nextRound,body.final-gallery .result-actions .secondary{min-height:34px;padding:6px}}

/* Prominent official border and compact screenshot rank. */
body.final-gallery .comparison-legend .legend-answer{border-color:#126cda;border-top-width:4px}.line.correct{background:#126cda}
body.final-gallery .result-inline{grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px 18px}body.final-gallery #rankBadge{display:flex!important;grid-column:1 / 3;grid-row:2;align-items:center;justify-content:flex-start;gap:12px;margin:0;padding:7px 12px;border-radius:10px;background:#fffdf7;border:1px solid #e1d9ba}body.final-gallery #rankLetter{display:grid;place-items:center;background:#e5af30;color:#fff;width:43px;height:43px;flex-shrink:0;border-radius:9px;font:900 32px ui-monospace,monospace;box-shadow:0 3px 0 #b588211c}body.final-gallery #rankLabel{font-size:20px;line-height:1.3;font-weight:800;overflow-wrap:anywhere}body.final-gallery #rankBadge[data-rank="B"] #rankLetter{background:#258c9c}body.final-gallery #rankBadge[data-rank="C"] #rankLetter{background:#4e9867}body.final-gallery #rankBadge[data-rank="D"] #rankLetter{background:#6b7d95}body.final-gallery #rankBadge[data-rank="E"] #rankLetter{background:#bf5360}body.final-gallery #seriesSummary{grid-row:3}body.final-gallery .result-actions{grid-row:4}
@media(max-width:760px){body.final-gallery .result-inline{gap:6px 8px}body.final-gallery #rankBadge{padding:6px 10px;gap:9px}body.final-gallery #rankLetter{width:35px;height:35px;font-size:27px}body.final-gallery #rankLabel{font-size:16px}}
@media(max-height:500px){body.final-gallery #rankBadge{padding:3px 8px}body.final-gallery #rankLetter{width:27px;height:27px;font-size:22px}body.final-gallery #rankLabel{font-size:14px}}

/* Readable rank label and desktop start-first layout. */
body.final-gallery #rankLetter{width:auto;min-width:100px;padding:0 12px;font:850 22px/1.2 'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;white-space:nowrap}
@media(max-width:760px){body.final-gallery #rankLetter{min-width:76px;padding:0 8px;font-size:17px}}
@media(max-height:500px){body.final-gallery #rankLetter{min-width:72px;font-size:15px}}
@media(min-width:761px){
 .workspace{grid-template-columns:340px minmax(0,1fr)}
 .sidebar{padding:24px;gap:18px}
 .sidebar>.submit-area{margin-top:0;flex-shrink:0}
 .submit-area .primary{min-height:68px;font-size:21px;border-radius:12px;box-shadow:0 5px 0 #bb472f,0 10px 22px #e8614529}
 .submit-area .save-state{font-size:11px;line-height:1.5;margin-top:4px}
 body.game-idle .session-stats,body.game-idle #drawControls,body.game-idle .best{display:none}
 body.game-idle .guide-card{display:block;margin:8px 0 0;padding:18px}
 body.game-idle .guide-card h2{font-size:15px;line-height:1.6}
 body.game-idle .guide-card p{font-size:13px;line-height:1.8;color:#526b5d}
 body.game-idle .guide-foot{display:flex;flex-wrap:wrap;font-size:11px}
 body.game-idle #leaderboardBtn{margin:0;min-height:44px}
 body.game-idle .round-hud{display:none}
 body:not(.game-idle):not(.results) .challenge-head{display:none}
 body:not(.game-idle):not(.results) .guide-card{display:none}
 .challenge-head h1{font-size:34px;line-height:1.35;margin:14px 0}
 .challenge-head .intro{font-size:13px}
}
@media(min-width:761px) and (max-height:650px){.sidebar{padding:16px 20px;gap:12px}.challenge-head h1{font-size:27px;margin:9px 0}.challenge-head h1 em{font-size:40px}body.game-idle .guide-card{padding:12px;margin:0}body.game-idle .guide-foot{display:none}.submit-area .primary{min-height:58px}}

/* Keep the start action visible on compact desktop windows. */
@media(min-width:761px){body.game-idle .sidebar>.submit-area{position:sticky;top:0;z-index:3;background:var(--paper);padding:10px 0 12px}body.game-idle #scoreBtn{border:2px solid #fffdf7}body.game-idle #scoreBtn:focus-visible{outline:4px solid var(--ink);outline-offset:4px}}

/* Compact, readable attribution; full terms live on their own page. */
.credits-link{font-size:11px;white-space:nowrap;text-underline-offset:3px}.header{column-gap:18px}.map-credit{left:12px;right:auto;max-width:calc(100% - 24px);padding:4px 6px;background:#f5f4edee;border-radius:4px;font-size:10px;line-height:1.4;color:#355b59}.map-credit>span{font-size:inherit;opacity:1}.map-bottom{bottom:70px}.gesture-hint{bottom:102px}@media(max-width:760px){.header{column-gap:12px}.map-credit{left:8px;max-width:calc(100% - 16px);font-size:9px}.map-bottom{bottom:65px}.gesture-hint{bottom:93px}.credits-link{font-size:10px}}

/* Three primary tools, with clear-all easy to find. */
.controls-section>.section-label{display:none}.clear-tool{border:2px solid var(--accent);background:#fbe5de;color:#a93624;font-weight:800}.clear-tool:hover:not(:disabled){background:#f8d0c4}.clear-tool:disabled{opacity:.55}.edit-row #undoBtn{flex:0 0 auto;font-size:24px;min-width:44px;padding:6px 10px}.edit-row{justify-content:flex-end}@media(max-width:760px){.controls-section{gap:6px}.tool-group{gap:6px}.tool-group .tool{flex:1;min-width:0}.edit-row #undoBtn{font-size:24px;width:44px;height:52px;padding:6px}.edit-row #undoBtn:after{content:none}}

body.game-idle .map-caption{display:none}.map-top{justify-content:flex-end}.ranking-select select{min-height:44px;min-width:160px;border:1px solid #b5cbc5;border-radius:7px;padding:8px 12px;background:#fffdf7;color:var(--ink);font-weight:700}.ranking-select{align-items:center;gap:10px}

/* Minimal start screen and a clear, optional ranking action. */
body.game-idle #drawControls,body.game-idle .round-hud,body.game-idle .gesture-hint{display:none}
body.game-idle .sidebar{justify-content:center}
body.game-idle .sidebar>.submit-area{position:static;margin:0;padding:0}
body.game-idle #leaderboardBtn{margin:0;min-height:48px}
body.final-gallery #openPublish{flex:1.5 1 0;min-height:50px;padding:12px 18px;font-size:16px;font-weight:800;box-shadow:0 3px 0 #bd472f}
body.final-gallery #nextRound{flex:1 1 0;min-height:50px;padding:10px 14px;font-size:14px;box-shadow:none}
body.final-gallery #resultRankingBtn{min-height:44px;white-space:nowrap}
@media(min-width:761px){body.game-idle .workspace{grid-template-columns:280px minmax(0,1fr)}body.game-idle .sidebar{padding:24px;gap:14px}}
@media(max-width:760px){
 body.game-idle .sidebar>.submit-area{padding:12px 12px 6px}
 body.game-idle #scoreBtn{min-height:56px;font-size:18px;border-radius:10px}
 body.game-idle .sidebar #leaderboardBtn{order:5;margin:0 12px max(10px,env(safe-area-inset-bottom));min-height:40px;border:0;background:transparent}
 body.final-gallery #openPublish{min-height:48px;padding:10px 8px;font-size:13px}
 body.final-gallery #nextRound{min-height:48px;padding:10px 8px;font-size:12px}
 body.final-gallery #resultRankingBtn{font-size:10px;padding:6px 2px}
}
@media(max-width:360px){body.final-gallery #openPublish{font-size:12px}body.final-gallery #nextRound{font-size:11px}}
@media(max-height:500px){body.final-gallery #openPublish,body.final-gallery #nextRound{min-height:38px;padding:7px 10px}}

/* Four tools remain comfortably tappable on narrow phones. */
@media(max-width:760px){.controls-section{grid-template-columns:minmax(0,1fr) auto;gap:5px}.tool-group{gap:4px}.tool-group .tool{font-size:11px;padding:8px 2px;min-height:56px}.edit-row #undoBtn{width:38px;min-width:38px;padding:5px}.tool-group .tool svg{width:21px;height:21px}}

/* S rank stands above A in the compact result. */
body.final-gallery #rankBadge[data-rank="S"]{background:#fff4d8;border-color:#e8c16b}
body.final-gallery #rankBadge[data-rank="S"] #rankLetter{background:linear-gradient(135deg,#b8681e,#e1ac36);color:#fff;box-shadow:0 3px 0 #9d611d38}

/* Share remains visible beside replay and optional ranking registration. */
body.final-gallery #shareBtn{display:flex;align-items:center;justify-content:center;min-height:48px;font-size:13px;white-space:nowrap}
#shareText{display:block;width:100%;resize:none;border:1px solid var(--line);border-radius:8px;background:#fffdf7;padding:12px;color:var(--ink);font-family:inherit;font-size:14px;line-height:1.6;margin:16px 0}
.share-options{display:flex;gap:10px}.share-options>*{flex:1;text-align:center;text-decoration:none}#shareStatus{font-size:12px}
@media(max-width:760px){body.final-gallery .result-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 8px}body.final-gallery #openPublish{grid-column:1;grid-row:1}body.final-gallery #shareBtn{grid-column:2;grid-row:1}body.final-gallery #nextRound{grid-column:1;grid-row:2;min-height:36px;padding:6px}body.final-gallery #resultRankingBtn{grid-column:2;grid-row:2;min-height:36px;padding:6px}}

/* Keep the active drawing area clear; the question and timer share one row. */
body:not(.game-idle):not(.results) #leaderboardBtn,
body:not(.game-idle):not(.results) .map-top,
body:not(.game-idle):not(.results) .round-hud .series-hud,
body:not(.game-idle):not(.results) #roundPrompt{display:none}
body:not(.game-idle):not(.results) .round-hud{top:10px;left:12px;right:64px;padding:10px 14px;gap:12px;pointer-events:none}
body:not(.game-idle):not(.results) .round-hud strong{font-size:23px;margin:0}
body:not(.game-idle):not(.results) .round-hud>b{font-size:25px}
body:not(.game-idle):not(.results) .map-navigation{top:12px;right:12px;gap:12px}
body:not(.game-idle):not(.results) .map-navigation .north{display:none}
@media(max-width:760px){
 body:not(.game-idle):not(.results) .round-hud{top:8px;left:10px;right:58px;padding:9px 12px}
 body:not(.game-idle):not(.results) .round-hud strong{font-size:20px}
 body:not(.game-idle):not(.results) .round-hud>b{font-size:22px}
 body:not(.game-idle):not(.results) .map-navigation{top:8px;right:10px}
}

/* Make region choice obvious before the question starts. */
body.game-idle .region-control{display:flex;flex-direction:column;gap:5px;padding:9px;background:#fffdf7f2;border:1px solid #e8d7c4;border-radius:12px;box-shadow:0 6px 18px #18363826}
.region-label{font-size:11px;font-weight:800;color:#9b4935;padding-left:3px}
body.game-idle #region{appearance:none;min-width:186px;min-height:46px;border:2px solid var(--accent);border-radius:8px;background-color:#fff7ee;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='m2 2 6 6 6-6' fill='none' stroke='%23bd4b30' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right 13px center;background-repeat:no-repeat;padding:9px 38px 9px 12px;font-size:15px;font-weight:800;box-shadow:0 2px 0 #bd4b3026;cursor:pointer}
body.game-idle #region:hover{background-color:#ffecdf}
@media(max-width:760px){body.game-idle .map-top{top:12px;right:12px;left:12px}body.game-idle .region-control{padding:7px;gap:3px}body.game-idle #region{min-height:44px;font-size:14px}}

/* Keep sharing first; give replay the strongest secondary action. */
body.final-gallery #shareBtn{order:0;flex:2.2 1 0;min-height:56px;padding:10px 20px;border:0;border-radius:11px;background:var(--accent);color:#fff;font-size:18px;font-weight:850;box-shadow:0 4px 0 #b94730,0 8px 19px #b9473030;gap:12px}
body.final-gallery #shareBtn:hover{background:#d75237}
body.final-gallery #shareBtn span{font-size:23px;line-height:1}
body.final-gallery #nextRound{order:1;flex:1.35 1 0;min-height:50px;background:#20484a;color:#fff;border:0;border-radius:9px;font-size:16px;font-weight:800;box-shadow:0 3px 0 #13393b35}
body.final-gallery #nextRound:hover{background:#173b3e}
body.final-gallery #openPublish{order:2;flex:.9 1 0;min-height:50px;background:#fffdf7;color:#20484a;border:1px solid #aebfb3;box-shadow:none;font-size:12px;font-weight:700}
body.final-gallery #openPublish:hover{background:#e8ece3}
body.final-gallery #resultRankingBtn{order:3;flex:0 0 auto}
@media(max-width:760px){
 body.final-gallery .result-actions{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,.65fr);gap:7px}
 body.final-gallery #shareBtn{grid-column:1 / 4;grid-row:1;min-height:54px;font-size:18px;padding:9px 14px}
 body.final-gallery #nextRound{grid-column:1;grid-row:2;min-height:50px;font-size:15px;padding:8px 5px;white-space:nowrap}
 body.final-gallery #openPublish{grid-column:2;grid-row:2;min-height:50px;font-size:11px;padding:6px 4px;line-height:1.2}
 body.final-gallery #resultRankingBtn{grid-column:3;grid-row:2;min-height:50px;font-size:10px;padding:6px 2px}
}
@media(min-width:761px){
 body.final-gallery .result-actions{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr) auto;gap:8px}
 body.final-gallery #shareBtn{grid-column:1 / 4;grid-row:1;min-height:60px;font-size:20px}
 body.final-gallery #nextRound{grid-column:1;grid-row:2;min-height:50px}
 body.final-gallery #openPublish{grid-column:2;grid-row:2;min-height:50px}
 body.final-gallery #resultRankingBtn{grid-column:3;grid-row:2;min-height:50px;padding:8px 16px}
}

/* Result hierarchy: rank and verdict lead, score stays supporting. */
body.final-gallery .result-inline{grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px 14px}
body.final-gallery #resultTitle{font-size:13px;font-weight:600;color:var(--muted);line-height:1.4}
body.final-gallery #totalHero{flex-direction:row;align-items:baseline;gap:4px}
body.final-gallery #totalHero strong{font:700 17px/1.2 ui-monospace,monospace;letter-spacing:0;color:var(--muted)}
body.final-gallery #totalHero small{font-size:9px;color:var(--muted)}
body.final-gallery #rankBadge{--rank-color:#b67b10;--rank-wash:#fff5d9;display:flex!important;gap:22px;padding:16px 22px;background:var(--rank-wash);border:2px solid var(--rank-color);border-radius:16px;box-shadow:0 4px 0 #18363810}
body.final-gallery #rankBadge[data-rank="S"]{--rank-color:#7652a6;--rank-wash:#f0e8fa}
body.final-gallery #rankBadge[data-rank="B"]{--rank-color:#247f8b;--rank-wash:#e8f5f5}
body.final-gallery #rankBadge[data-rank="C"]{--rank-color:#43845a;--rank-wash:#edf5ed}
body.final-gallery #rankBadge[data-rank="D"]{--rank-color:#607086;--rank-wash:#eef1f5}
body.final-gallery #rankBadge[data-rank="E"]{--rank-color:#a94957;--rank-wash:#faedf0}
body.final-gallery #rankBadge #rankLetter{display:flex;align-items:center;justify-content:center;gap:7px;width:auto;min-width:145px;height:84px;padding:8px 16px;background:var(--rank-color);border-radius:12px;color:#fff;font:900 20px/1 sans-serif;box-shadow:none}
body.final-gallery #rankLetter .rank-symbol{font:950 66px/.95 ui-sans-serif,sans-serif}
body.final-gallery #rankLabel{font-size:clamp(25px,3vw,38px);font-weight:900;line-height:1.3;letter-spacing:-.035em;color:var(--ink);text-wrap:balance}
.portal-home{font-size:11px;font-weight:700;text-decoration:none;padding:7px 9px;border:1px solid var(--line);border-radius:6px;white-space:nowrap}
@media(max-width:760px){body.final-gallery #resultTitle{font-size:11px}body.final-gallery #totalHero strong{font-size:15px}body.final-gallery #totalHero small{font-size:8px}body.final-gallery #rankBadge{gap:12px;padding:12px;border-radius:13px}body.final-gallery #rankBadge #rankLetter{min-width:103px;height:76px;padding:8px 10px;gap:4px;font-size:14px}body.final-gallery #rankLetter .rank-symbol{font-size:56px}body.final-gallery #rankLabel{font-size:clamp(21px,5.8vw,29px)}.portal-home{font-size:10px;padding:6px}.header{gap:10px}}
@media(max-height:650px){body.final-gallery #rankBadge{padding:7px 10px}body.final-gallery #rankBadge #rankLetter{height:55px;min-width:96px;font-size:13px}body.final-gallery #rankLetter .rank-symbol{font-size:43px}body.final-gallery #rankLabel{font-size:22px}}

/* Portal identity, kept in the existing header to preserve map space. */
.header .portal-home{order:5;margin-left:auto;display:flex;align-items:center;gap:7px;border:0;padding:4px 0;color:#142329;font-size:17px;font-weight:900;letter-spacing:-.6px}.portal-home img{width:32px;height:32px;object-fit:contain}.header .header-sub{display:none}.header .brand{margin-right:auto}.header #helpBtn{margin-left:0}
@media(max-width:760px){.header{gap:9px;padding-left:12px;padding-right:12px}.header .portal-home{font-size:11px;gap:3px;letter-spacing:-.5px}.portal-home img{width:24px;height:24px}.header .brand{font-size:20px;gap:4px}.header .brand svg{width:22px}.header #helpBtn{font-size:10px}.header .credits-link{font-size:10px}.header .help-icon{display:none}}

body.final-gallery .result-actions{display:grid;grid-template-columns:1.15fr 1fr;gap:10px}body.final-gallery .result-actions #shareBtn,body.final-gallery .result-actions #nextRound{grid-column:auto;width:100%;min-height:58px}
