@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: #344044;
  background: #f4f2e8;
  --ink: #344044;
  --muted: #636e6d;
  --paper: #fffcf3;
  --line: #dfded2;
  --edge-x: clamp(20px, 3.05vw, 52px);
  --edge-top: clamp(20px, 3.3vh, 38px);
  --edge-bottom: max(25px, 3.6vh, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body, .game-screen { width: 100%; height: 100%; margin: 0; overflow: hidden; }
.game-screen { height: 100dvh; position: relative; isolation: isolate; }
body { -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; background: transparent; border: 0; -webkit-tap-highlight-color: transparent; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #367986; outline-offset: 3px; }
canvas:focus-visible { outline-offset: -3px; }
button:disabled { cursor: default; }
button, .hud-header, .construction { -webkit-user-select: none; user-select: none; }
svg { display: block; }
[hidden] { display: none !important; }
#city { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.hud-header {
  position: absolute; top: max(var(--edge-top), env(safe-area-inset-top)); left: var(--edge-x); right: var(--edge-x);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none;
}
.identity { display: flex; align-items: center; gap: 12px; color: #354143; }
.brand-mark { width: 48px; height: 48px; transform: rotate(-4deg); filter: drop-shadow(0 2px 1px #797b701a); }
h1 { font-size: clamp(29px, 2.3vw, 37px); line-height: 1.08; letter-spacing: -.062em; font-weight: 800; margin: 0; }
.location { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-top: 4px; padding: 3px 6px; border: 1px solid #b9c2b3; border-radius: 7px; background: #fffdf2ed; color: #455d50; font-weight: 650; font-size: 13px; line-height: 1.2; letter-spacing: .005em; white-space: nowrap; pointer-events: auto; }
.location svg { width: 13px; height: 13px; }
.location svg.location-chevron { width: 11px; height: 11px; margin-left: 2px; }
@media (hover: hover) { .location:hover { border-color: #6d8570; background: #fffef6; } }
@media (pointer: coarse) { .location::after { content: ""; position: absolute; inset: -6px -3px; } }
.panel { background: #fffdf5f5; border: 1px solid #38484024; box-shadow: 0 2px 0 #545e4820, 0 4px 11px #33473409; }
.top-controls, .stats, .stat-part, .playback, .zoom-controls, .utility { display: flex; align-items: center; }
.top-controls { gap: 10px; pointer-events: auto; }
.stats, .playback { height: 56px; border-radius: 18px; }
.stats { padding: 0 15px; gap: 15px; }
.stat-part { gap: 9px; }
.stat-part strong, .stat-part small { display: block; font-variant-numeric: tabular-nums; }
.stat-part strong { font-size: 16px; line-height: 19px; font-weight: 750; letter-spacing: -.025em; }
.stat-part small { font-size: 12px; color: var(--muted); line-height: 16px; font-weight: 550; }
.trip-mark, .trip-mark svg { width: 24px; height: 28px; color: #dc806e; }
.trips-stat strong { font-size: 21px; }
.time-stat { min-width: 112px; }
.clock { width: 31px; height: 31px; color: #3e494c; }
.separator { flex: 0 0 1px; width: 1px; height: 23px; background: var(--line); }
.playback { padding: 5px; gap: 2px; }
.pause { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #3f4c4e; color: #fffdf5; }
.pause:hover { background: #293739; }
.pause svg { width: 19px; height: 19px; }
#speed { min-width: 33px; height: 40px; font-weight: 750; font-size: 15px; border-radius: 10px; }
#speed:hover, .zoom-controls button:hover, .undo:enabled:hover { background: #eaece0; }
.paused-label { position: absolute; left: 50%; top: var(--edge-top); transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 8px 14px; color: #fffdf5; background: #3c494b; border-radius: 99px; font-size: 14px; font-weight: 650; pointer-events: none; }
.paused-label svg { width: 13px; height: 13px; }
.construction { position: absolute; bottom: var(--edge-bottom); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; pointer-events: none; }
.toolbox { display: flex; align-items: center; gap: 3px; padding: 6px; background: #fffdf5fa; border-radius: 22px; box-shadow: 0 3px 0 #565b4923, 0 7px 18px #4c553610; pointer-events: auto; }
.tool { height: 66px; min-width: 79px; border-radius: 15px; border: 1px solid transparent; position: relative; display: flex; align-items: center; justify-content: flex-end; flex-direction: column; padding: 3px 7px 5px; transition: background .13s, border-color .13s; }
.tool:hover { background: #efefe4; }
.tool.selected { border-color: #e4aa94; background: #f8e1cf; box-shadow: inset 0 -1px #e3ad9055; }
.tool.selected .tool-name { color: #774737; }
.tool-icon { display: block; width: 40px; height: 32px; margin: 0 3px 3px 0; }
.tool-icon svg { width: 100%; height: 100%; overflow: visible; }
.tool-name { font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: -.015em; }
.count { position: absolute; right: 5px; top: 4px; height: 18px; min-width: 18px; padding: 0 4px; line-height: 16px; border: 1px solid #9eaa9b55; border-radius: 7px; background: #fffff5; font-size: 11px; font-weight: 750; color: #455249; }
.tool.selected .count { color: #8d4b3b; border-color: #d8a080; }
.toolbox > .separator { margin: 0 5px; height: 37px; }
.erase-tool { min-width: 61px; }
.undo { display: grid; place-items: center; padding: 0; width: 33px; height: 36px; border-radius: 11px; margin-right: 3px; }
.undo svg { width: 19px; height: 19px; }
.undo:disabled { opacity: .32; }
.map-hint { margin: 12px 0 0; display: flex; align-items: center; gap: 6px; color: #636b61; font-size: 13px; font-weight: 550; letter-spacing: .005em; line-height: 17px; text-shadow: 0 1px 3px #f8f6e8; }
.map-hint svg { width: 15px; height: 15px; }
.toast { position: absolute; bottom: calc(100% + 13px); width: max-content; max-width: min(88vw, 410px); padding: 9px 15px; border-radius: 13px; background: #38494a; color: #fffef5; text-align: center; font-size: 14px; box-shadow: 0 4px 12px #2c38371a; animation: rise-in .15s ease-out; }
.corner-controls { position: absolute; bottom: var(--edge-bottom); }
.utility { left: var(--edge-x); gap: 8px; }
.round-button, .help-button, .zoom-controls { height: 40px; border-radius: 14px; }
.round-button { width: 42px; display: grid; place-items: center; }
.help-button { padding: 0 13px 0 11px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 650; }
.round-button:hover, .help-button:hover { background: #fffffa; border-color: #adb6a4; }
.corner-controls svg { width: 18px; height: 18px; }
.zoom-controls { right: var(--edge-x); padding: 1px 3px; }
.zoom-controls .separator { height: 16px; }
.zoom-controls button { display: grid; place-items: center; width: 34px; height: 32px; border-radius: 10px; padding: 0; }
.zoom-controls button:disabled { opacity: .32; }
dialog { width: min(390px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid #aeb6a9; border-radius: 25px; color: var(--ink); background: #fffcf2; padding: 25px; box-shadow: 0 6px 0 #52604c26, 0 16px 70px #35433e32; }
dialog::backdrop { background: #3d4c4138; backdrop-filter: blur(3px); }
dialog[open] { animation: rise-in .16s ease-out; }
@keyframes rise-in { from { opacity: 0; translate: 0 5px; } to {opacity: 1; translate: 0 0;} }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
.sheet-head h2 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.055em; font-weight: 750; }
#sheet[data-screen="maps"] { width: min(736px, calc(100% - 32px)); padding: clamp(16px, 3vw, 26px); overflow: auto; overscroll-behavior: contain; }
.map-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.map-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #c7ccbc; border-radius: 15px; background: #fffdf5; text-align: left; box-shadow: 0 2px 0 #52604c15; transition: border-color .15s, box-shadow .15s, transform .15s; }
.map-card[aria-current="true"] { border-color: #507760; box-shadow: 0 0 0 1px #507760; }
.map-card-art { display: block; position: relative; overflow: hidden; border-bottom: 1px solid #c7ccbc; background: #efefdf; }
.map-card-art canvas { display: block; width: 100%; height: auto; }
.map-card-status { position: absolute; left: 9px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; background: #fffdf4f5; color: #3f5248; border-radius: 5px; box-shadow: 0 0 0 1px #69785e44; font-size: 11px; line-height: 1.2; font-weight: 650; }
.map-card[aria-current="true"] .map-card-status { background: #3f624f; color: #fffdf4; }
.map-card-status svg { width: 11px; height: 11px; }
.map-card-copy { display: grid; gap: 4px; padding: 10px 13px 13px; }
.map-card-title { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 19px; line-height: 1.2; font-weight: 750; letter-spacing: -.04em; }
.map-card-arrow { flex: none; width: 17px; height: 17px; color: #617a68; }
.map-card-description { color: #525f56; font-size: 13px; line-height: 1.38; }
@media (hover: hover) {
  .map-card:hover { transform: translateY(-1px); border-color: #64816b; box-shadow: 0 2px 0 #64816b51; }
}
@media (max-width: 600px) {
  #sheet[data-screen="maps"] { width: calc(100% - 16px); max-width: calc(100% - 16px); max-height: calc(100dvh - 24px); border-radius: 19px; padding: 14px; }
  #sheet[data-screen="maps"] .sheet-head { margin-bottom: 14px; }
  .map-gallery { gap: 9px; }
  .map-card { border-radius: 11px; }
  .map-card-copy { padding: 8px 9px 10px; gap: 3px; }
  .map-card-title { font-size: 16px; }
  .map-card-arrow { width: 13px; height: 13px; }
  .map-card-description { font-size: 12px; }
  .map-card-status { left: 5px; top: 5px; font-size: 10px; padding: 2px 5px; }
}
@media (max-width: 359px) {
  .map-gallery { grid-template-columns: minmax(0, 1fr); }
  .map-card { display: grid; grid-template-columns: 36% 1fr; }
  .map-card-art { border: 0; border-right: 1px solid #c7ccbc; }
  .map-card-art canvas { height: 100%; object-fit: cover; }
}
.close-sheet { flex: none; background: #eeeee2; padding: 8px; border-radius: 50%; }
.close-sheet svg { width: 15px; height: 15px; }
.sheet-text { font-size: 15px; line-height: 1.55; color: #53615c; margin: 0 0 19px; }
.help-rows { display: grid; gap: 14px; margin: 0 0 18px; }
.help-row { display: flex; align-items: flex-start; gap: 12px; }
.help-row .mini-art { flex: 0 0 38px; margin-top: 2px; }
.help-row strong, .choice strong { font-size: 15px; }
.help-row p { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: #607068; }
.shortcuts { color: #63716a; font-size: 13px; line-height: 1.8; padding: 12px 0 0; border-top: 1px solid var(--line); margin: 0 0 16px; }
kbd { border: 1px solid #d5d8ca; border-radius: 5px; padding: 1px 4px; background: #f3f3e9; font: 600 12px "DM Sans", sans-serif; }
.action { width: 100%; border-radius: 12px; padding: 11px 15px; background: #3e5050; color: #fffdf4; font-size: 15px; font-weight: 700; }
.action:hover { background: #293c3c; }
.settings-list { display: grid; gap: 0; margin-bottom: 16px; }
.setting { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; }
.setting:first-child { padding-top: 0; }
.switch { width: 40px; height: 24px; border-radius: 99px; padding: 3px; background: #ced3c6; }
.switch:after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fffdf4; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch[aria-checked=true] { background: #62816e; }
.switch[aria-checked=true]:after { transform: translateX(16px); }
.setting-action { width: 100%; text-align: left; font-weight: 600; font-size: 15px; padding: 12px 0; }
.setting-action:hover { color: #a8503c; }
.sheet-actions { display: flex; gap: 8px; }
.secondary { background: #e9ecdf; color: #42514a; }
.secondary:hover { background: #dce2d1; }
.choices { display: grid; gap: 7px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid #d6d8ca; border-radius: 12px; text-align: left; padding: 8px 12px; background: #f5f4e8; }
.choice:hover { background: #f6e4cf; border-color: #dfb199; }
.choice svg { width: 42px; height: 36px; }
.choice small { display: block; color: #626f66; font-size: 13px; margin-top: 1px; }
noscript { position: absolute; left: 10%; top: 45%; max-width: 80%; padding: 20px; background: var(--paper); }
@media (min-width: 1700px) { .toolbox { transform: scale(1.08); transform-origin: center bottom; } }
@media (max-width: 760px) {
  :root { --edge-x: 16px; --edge-top: 17px; --edge-bottom: max(15px, env(safe-area-inset-bottom)); }
  .brand-mark { width: 39px; height: 39px; }
  .identity { gap: 7px; } h1 { font-size: 27px; }
  .location { margin-top: 3px; font-size: 12px; }
  .top-controls { gap: 6px; } .stats { padding: 0 11px; gap: 9px; }
  .stats, .playback { height: 46px; border-radius: 14px; }
  .time-stat { min-width: 83px; } .stat-part { gap: 6px; }
  .stat-part strong { font-size: 14px; } .stat-part small { font-size: 11px; line-height: 13px; }
  .trip-mark, .trip-mark svg { width: 19px; height: 22px; }
  .clock { width: 24px; height: 24px; }
  .pause { width: 32px; height: 32px; border-radius: 9px; }
  #speed { min-width: 26px; height: 32px; font-size: 13px; }
  .help-text { display: none; } .help-button { width: 40px; padding: 0; }
  .paused-label { top: calc(var(--edge-top) + 57px); }
}
@media (max-width: 600px) {
  .paused-label { display: none; }
  .construction { bottom: calc(var(--edge-bottom) + 44px); }
  .corner-controls { height: 36px; }
  .round-button, .help-button { width: 36px; height: 36px; border-radius: 12px; }
  .map-hint { margin-top: 7px; font-size: 12px; }
  .identity { align-items: flex-start; } .brand-mark { width: 30px; height: 30px; margin-top: 3px; }
  h1 { font-size: 24px; } .location { font-size: 11px; }
  .stats { padding: 0 8px; gap: 7px; }
  .time-stat { min-width: 63px; } .clock { width: 18px; height: 18px; }
  .trip-mark, .trip-mark svg { width: 15px; height: 18px; }
  .stat-part { gap: 4px; } .top-controls { gap: 4px; }
  .playback { padding: 3px; gap: 0; }
  .pause { width: 27px; height: 31px; }
  #speed { min-width: 23px; padding: 0 2px; }
  .tool { min-width: 63px; height: 59px; } .toolbox { padding: 4px; border-radius: 19px; gap: 1px; }
  .toolbox > .separator { margin: 0 2px; }
  .erase-tool { min-width: 48px; } .undo { width: 27px; }
}
@media (max-width: 390px) { :root { --edge-x: 9px; } .brand-mark { display: none; } .stats { gap: 5px; } .time-stat { min-width: 58px; } }
@media (max-width: 480px) {
  .construction { width: calc(100% - 12px); }
  .toolbox { width: 100%; max-width: 446px; display: grid; grid-template-columns: .87fr .95fr 1.28fr 1.55fr .88fr .85fr 28px; gap: 0; }
  .toolbox > .separator { display: none; }
  .tool { min-width: 0; padding-inline: 1px; border-radius: 12px; }
  .tool-name { font-size: 12px; }
  .light-prefix { display: none; }
  .light-noun { text-transform: capitalize; }
  .undo { width: 28px; margin: 0; }
  .map-hint { text-align: center; }
}
@media (max-width: 375px) {
  .toolbox { grid-template-columns: .84fr .94fr 1.3fr 1.56fr .86fr .8fr; }
  .toolbox .undo { position: absolute; left: calc(var(--edge-x) + 82px); bottom: -44px; width: 36px; height: 36px; border: 1px solid #38484024; border-radius: 12px; background: var(--paper); }
}
@media (min-width: 601px) and (max-width: 850px) {
  .tool { min-width: 63px; padding-inline: 5px; }
  .erase-tool { min-width: 47px; }
  .help-text { display: none; }
  .help-button { width: 40px; padding: 0; }
}
@media (min-width: 601px) and (max-width: 700px) {
  .construction { bottom: calc(var(--edge-bottom) + 46px); }
}
@media (max-width: 350px) {
  .hud-header { gap: 4px; }
  .hud-header .clock, .hud-header .trip-mark { display: none; }
  .stats { gap: 4px; padding-inline: 6px; }
  .stat-part strong { font-size: 13px; }
}
@media (max-height: 520px) and (min-width: 601px) {
  :root { --edge-top: 10px; --edge-bottom: 9px; --edge-x: 16px; }
  .tool { height: 47px; min-width: 62px; gap: 0; padding-bottom: 2px; }
  .tool-icon { width: 31px; height: 24px; margin-bottom: 0; } .tool-name { font-size: 11px; }
  .map-hint { display: none; } .toolbox { padding: 3px; } .undo { margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *:after { transition: none !important; animation: none !important; } }
.over-actions { display: grid; gap: 8px; }
.reviewing .toolbox, .reviewing .map-hint, .reviewing .playback, .reviewing .utility { display: none; }
.reviewing #city { cursor: grab; }
.review-panel { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 18px; pointer-events: auto; }
.review-summary { display: flex; align-items: center; gap: 10px; padding: 1px 10px 1px 5px; white-space: nowrap; }
.review-summary strong, .review-summary span#review-detail { display: block; }
.review-summary strong { font-size: 15px; line-height: 1.3; }
#review-detail { color: var(--muted); font-size: 12px; line-height: 1.45; }
.review-pin { display: grid; place-items: center; width: 26px; height: 30px; border-radius: 10px 10px 12px 12px; background: #a43f35; color: #fff9e9; font-size: 20px; line-height: 1; font-weight: 800; }
.review-locate, .review-results { min-height: 38px; border-radius: 11px; padding: 8px 13px; font-size: 14px; font-weight: 700; }
.review-locate { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: #e9ecdf; color: #42514a; }
.review-locate svg { width: 15px; height: 15px; }
.review-results { background: #3e5050; color: #fffdf4; }
.review-locate:hover { background: #dce2d1; }
.review-results:hover { background: #293c3c; }
@media (max-width: 600px) {
  .review-panel { display: grid; grid-template-columns: 1fr 1fr; width: min(calc(100vw - 28px), 350px); }
  .review-summary { grid-column: 1 / -1; padding-bottom: 3px; }
}
.city-links { display: flex; align-items: center; gap: 5px; }
.ranked-link { color: #365954; border-color: #a5b9aa; }
.ranked-link svg { width: 15px; height: 15px; }
#sheet:is([data-screen="ranked"], [data-screen="friend-challenge"]) { width: min(465px, calc(100% - 24px)); }
#challenge-target { display: block; margin-top: 6px; max-width: min(37vw, 230px); overflow: hidden; text-overflow: ellipsis; color: #754c34; background: #f8e8d2; border-color: #d2b391; font-variant-numeric: tabular-nums; }
.rank-challenge { display: grid; grid-template-columns: 36% 1fr; overflow: hidden; border: 1px solid #cbd2c0; border-radius: 15px; background: #f3f4e8; }
.rank-map-art { min-width: 0; position: relative; border-right: 1px solid #cbd2c0; }
.rank-map-art canvas { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.rank-intro { align-self: center; padding: 15px 14px; }
.rank-intro h3 { margin: 0; font-size: 21px; line-height: 1.12; letter-spacing: -.04em; }
.rank-intro p, .board-message, .rank-error, .rank-failure { font-size: 14px; line-height: 1.45; }
.rank-intro p { margin: 5px 0 0; color: #536059; }
.guest-name-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.guest-name-line > div { display: grid; min-width: 0; gap: 2px; }
.guest-name-line span, #guest-name-help { color: var(--muted); font-size: 13px; }
.guest-name-line bdi { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.guest-name-line button { min-height: 32px; padding: 4px 10px; border: 1px solid #c2cdbd; border-radius: 8px; font-size: 13px; font-weight: 650; color: #39564b; }
.guest-name-line button:hover { background: #e6ecdf; }
#guest-name-form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 650; }
#guest-name-input { display: block; width: 100%; padding: 10px 12px; border: 1px solid #899b8c; border-radius: 9px; background: #fffef7; color: var(--ink); font: inherit; }
#guest-name-input:focus-visible { outline: 3px solid #367986; outline-offset: 2px; }
#guest-name-help { margin: 8px 0 0; line-height: 1.45; }
#guest-name-error:empty { margin: 0; }
#guest-name-form .sheet-actions { margin-top: 20px; }
.board-section { margin: 16px 0 20px; }
.board-message { margin: 0; color: #58655d; }
.board-message p { margin: 0; }
.board-retry { color: #385950; padding: 4px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; }
.rank-row:last-child { padding-bottom: 0; }
.rank-place { display: grid; min-width: 26px; height: 26px; padding: 0 4px; place-items: center; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 750; border: 1px solid #c5cabc; border-radius: 7px; color: #55645c; }
.rank-row:first-child .rank-place { background: #f5e6bf; border-color: #d8c48d; color: #6a552f; }
.rank-standing, .rank-details { display: flex; justify-content: space-between; align-items: baseline; column-gap: 10px; }
.rank-standing { padding-top: 2px; }
.rank-player { min-width: 0; font-size: 16px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.rank-standing strong { flex: none; font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rank-standing small { font-size: 13px; font-weight: 550; }
.rank-details { flex-wrap: wrap; align-items: center; margin-top: 3px; row-gap: 4px; }
.rank-details > span { color: var(--muted); font-size: 12px; }
.rank-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rank-row-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 5px 8px; font-weight: 650; font-size: 13px; border-radius: 8px; white-space: nowrap; }
.rank-row-actions button:first-child { background: #e6ecdf; color: #39564b; }
.rank-row-actions button:hover { background: #dbe3d3; }
.rank-row-actions svg { width: 11px; height: 11px; }
.rank-result { margin-bottom: 16px; border-block: 1px solid var(--line); padding-block: 14px; }
.rank-result-map { color: #56675e; font-size: 14px; font-weight: 650; }
.rank-score { display: flex; align-items: baseline; gap: 7px; font-size: 18px; font-weight: 600; line-height: 1.25; }
.rank-score > span { display: flex; align-self: center; color: #d97e6b; }
.rank-score svg { width: 25px; height: 28px; }
.rank-score strong { font-size: 40px; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.rank-failure { margin: 5px 0 0; color: #53615c; }
.verification-status { display: flex; align-items: center; gap: 6px; margin: 9px 0 0; font-size: 13px; font-weight: 550; color: #536359; }
.verification-symbol { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; line-height: 1; background: #dfe4d7; font-size: 13px; }
.is-verified { color: #38604e; }
.is-verified .verification-symbol { background: #d9e9d9; }
.has-error, .rank-error { color: #893f35; }
.has-error .verification-symbol { background: #f7dfd3; }
.rank-error { margin: 4px 0; overflow-wrap: anywhere; }
.result-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; }
.result-links button { padding: 8px 3px; font-size: 14px; font-weight: 650; color: #385950; }
.result-links button:hover { text-decoration: underline; text-underline-offset: 2px; }
.friend-target { background-color: #f6eedc; border-color: #cec8b0; }
.friend-target.no-preview { grid-template-columns: 1fr; }
.friend-target-score { display: block; font-size: 34px; line-height: 1.05; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.friend-target-score small { color: #665c46; font-size: 15px; letter-spacing: 0; }
.friend-host { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 9px; margin: 8px 0 15px; }
.friend-share { margin: 16px 0; }
.friend-share label, .friend-section-head h3 { display: block; margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; }
.friend-share-controls { display: flex; gap: 6px; margin-top: 6px; }
.friend-share-controls input { flex: 1; width: 0; min-width: 0; border: 1px solid #afb8a8; border-radius: 9px; padding: 8px 10px; background: #fffef8; color: #4a5850; font: inherit; font-size: 14px; }
.friend-share-controls input:focus-visible { outline: 3px solid #367986; outline-offset: 1px; }
.friend-share-controls .action { width: auto; padding: 9px 12px; font-size: 14px; }
.friend-share-note, #challenge-copy-status { color: #5b655b; font-size: 13px; line-height: 1.4; margin: 6px 0 0; }
#challenge-copy-status:empty { margin: 0; }
.friend-standings { margin: 16px 0; padding-top: 8px; border-top: 1px solid var(--line); }
.friend-section-head, .friend-match { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.friend-section-head { margin-bottom: 5px; }
.friend-section-head button { min-height: 32px; color: #39564b; font-size: 13px; font-weight: 650; padding: 4px 2px; }
.friend-section-head button:hover { text-decoration: underline; text-underline-offset: 2px; }
.friend-responses li { border-top: 1px solid var(--line); padding: 8px 0; }
.friend-responses .ahead { color: #38604e; font-weight: 700; }
.friend-match { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.friend-match div { min-width: 0; }
.friend-match span { display: block; font-size: 13px; color: var(--muted); }
.friend-match bdi { font-weight: 650; overflow-wrap: anywhere; }
.friend-match strong { flex: none; font-variant-numeric: tabular-nums; }
.friend-difference { margin: 4px 0 8px; color: #53635a; font-size: 14px; font-weight: 600; }
.game-screen[data-run-mode="replay"] :is(.toolbox, .map-hint, .utility) { display: none; }
.game-screen[data-run-mode="replay"] #city { cursor: grab; }
.replay-panel { display: flex; align-items: center; gap: 15px; padding: 8px 9px 8px 15px; border-radius: 17px; pointer-events: auto; }
.replay-readout { min-width: 155px; }
.replay-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 14px; }
#replay-clock { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
#replay-progress { display: block; width: 100%; height: 4px; margin-top: 5px; border: 0; border-radius: 99px; overflow: hidden; background: #dce1d4; color: #d28670; appearance: none; }
#replay-progress::-webkit-progress-bar { background: #dce1d4; }
#replay-progress::-webkit-progress-value { background: #d28670; }
#replay-progress::-moz-progress-bar { background: #d28670; }
@media (max-width: 600px) {
  .city-links { gap: 4px; }
  .ranked-link { position: fixed; bottom: var(--edge-bottom); left: calc(var(--edge-x) + 88px); justify-content: center; gap: 4px; height: 36px; margin: 0; padding: 0 9px; border-radius: 12px; font-size: 12px; box-shadow: 0 2px 0 #545e4820; }
  .reviewing .ranked-link, .game-screen[data-run-mode="replay"] .ranked-link { left: var(--edge-x); }
  .replay-panel { gap: 9px; max-width: calc(100vw - 22px); }
  .replay-readout { min-width: 130px; }
}
@media (max-width: 375px) {
  .city-links { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ranked-link { position: relative; inset: auto; height: 30px; padding: 3px 6px; border-radius: 7px; box-shadow: none; }
  .reviewing .ranked-link, .game-screen[data-run-mode="replay"] .ranked-link { left: auto; }
}
@media (max-width: 420px) {
  #sheet:is([data-screen="ranked"], [data-screen="friend-challenge"]) { padding: 17px; }
  .rank-row { gap: 8px; }
  .rank-challenge { grid-template-columns: 30% 1fr; }
  .rank-intro { padding: 12px; }
}
