:root {
  --paper: #eee1c8;
  --paper-light: #fff9ec;
  --ink: #3f382f;
  --muted: #726757;
  --street: #ccbfa9;
  --shadow: rgba(83, 66, 43, .18);
  --building-width: 68px;
  --lane-label-size: 16px;
  --slots: 9;
  --clue-bands: 2;
  font-family: "Trebuchet MS", "Avenir Next", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

@property --building {
  syntax: "<color>";
  inherits: true;
  initial-value: #aaa8a2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.72), transparent 23rem),
    radial-gradient(circle at 88% 35%, rgba(194,159,105,.18), transparent 25rem),
    linear-gradient(145deg, #f8efdd, #e5d4b6);
}
html { overscroll-behavior: none; }
button, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible) { outline: none; }
button:focus-visible { outline: 3px solid #2f706f; outline-offset: 3px; }
[hidden] { display: none !important; }
main { min-width: 0; max-width: 100%; }

.app-shell { width: min(1120px, 100%); margin: auto; padding: max(14px, env(safe-area-inset-top)) 14px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.wordmark { border: 0; background: none; padding: 3px; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; }
.logo-buildings { width: 60px; height: 64px; padding: 5px 6px 4px; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 2px; border: 1px solid rgba(86,69,50,.15); border-radius: 15px; background: rgba(255,250,240,.72); box-shadow: inset 0 1px rgba(255,255,255,.9), 0 7px 18px rgba(92,76,54,.12); }
.logo-sky { min-height: 0; display: flex; align-items: end; gap: 3px; }
.logo-building { flex: 1; display: grid; place-items: end center; padding-bottom: 6px; border-radius: 5px 5px 2px 2px; color: #594b40; font-size: 13px; line-height: 1; font-weight: 1000; box-shadow: inset 2px 2px 2px rgba(255,255,255,.42), inset -2px -3px 4px rgba(83,65,48,.1), 0 2px 3px rgba(83,65,48,.12); }
.logo-s { height: 62%; background: #dca4b1; }
.logo-k { height: 88%; background: #9fc9d3; }
.logo-y { height: 72%; background: #e4c17d; }
.logo-icon-lines { color: #4f4942; font-size: 7px; line-height: 1; letter-spacing: .18em; text-align: center; text-indent: .18em; font-weight: 1000; }
.logo-copy { display: grid; grid-template-columns: max-content max-content; align-items: baseline; column-gap: 0; line-height: .86; letter-spacing: -.055em; }
.logo-copy strong, .logo-copy b { font-size: 34px; font-weight: 1000; }
.logo-copy strong { color: #715c4d; }
.logo-copy b { margin-left: -.09em; color: #3e3b37; }
.logo-copy small { grid-column: 1 / -1; margin-top: 7px; color: #846f5c; font-size: 9px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; font-weight: 900; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.corner-menu-wrap { position: relative; }
.corner-menu { position: absolute; z-index: 10020; top: calc(100% + 7px); right: 0; width: 210px; display: grid; gap: 4px; padding: 8px; border: 1px solid rgba(75,65,51,.16); border-radius: 17px; background: rgba(248,251,249,.98); box-shadow: 0 16px 36px rgba(42,59,56,.25), inset 0 1px white; backdrop-filter: blur(12px); }
.corner-menu button { min-height: 43px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 12px; padding: 8px 10px; background: transparent; color: #4c5e59; text-align: left; font-weight: 1000; cursor: pointer; }
.corner-menu button:hover { background: rgba(213,228,221,.56); }
.corner-menu button > span:first-child { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 8px; background: #e5eee9; }
.menu-button[aria-expanded="true"] { background: #445e52; color: #fffaf0; }
.icon-button, .quiet-button, .learning-button { border: 1px solid rgba(75,65,51,.14); background: rgba(255,250,240,.76); box-shadow: 0 7px 18px var(--shadow), inset 0 1px white; cursor: pointer; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; font-weight: 900; font-size: 19px; }
.quiet-button { border-radius: 999px; padding: 10px 15px; font-weight: 800; }
.learning-button { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 9px 14px; color: #4e5e57; font-size: 13px; font-weight: 1000; }
.learning-button span { font-size: 16px; line-height: 1; }

.picker { display: grid; gap: 0; }
.welcome-blade { min-height: clamp(170px, 23vw, 235px); display: flex; align-items: flex-start; position: relative; overflow: hidden; isolation: isolate; margin: 0 -14px; padding: clamp(20px, 3vw, 34px) clamp(18px, 5vw, 58px) clamp(58px, 7vw, 78px); border-radius: 30px 30px 0 0; background-image: url("assets/city-panorama.svg"); background-position: center 36%; background-size: cover; box-shadow: inset 0 2px rgba(255,255,255,.55); }
.welcome-blade::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(241,247,244,.08) 0%, rgba(237,243,240,.22) 38%, rgba(233,239,236,.82) 78%, var(--paper) 100%); }
.hero-copy { width: 100%; padding: clamp(14px, 2vw, 20px) clamp(17px, 3vw, 27px); border: 1px solid rgba(255,255,255,.48); border-radius: 21px; background: rgba(247,250,246,.72); box-shadow: 0 14px 34px rgba(51,69,68,.16), inset 0 1px rgba(255,255,255,.82); backdrop-filter: blur(5px); }
.kicker { margin: 0 0 7px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 1000; color: #9a684b; }
.hero-copy h1, .game-heading h1, .dialog-card h2 { margin: 0; font-size: clamp(38px, 8vw, 76px); line-height: .96; letter-spacing: -.065em; }
.hero-copy h1 { font-size: clamp(28px, 5vw, 49px); }
.hero-copy > p:last-child, .puzzle-copy { color: var(--muted); font-size: 17px; line-height: 1.5; }
.hero-copy > p:last-child { max-width: none; margin: 8px 0 0; }
.puzzle-list { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: -34px; }
.puzzle-card { text-align: left; border: 1px solid rgba(75,65,51,.14); border-radius: 24px; padding: 19px; min-height: 148px; background: rgba(255,250,240,.77); box-shadow: 0 12px 28px var(--shadow), inset 0 2px rgba(255,255,255,.9); display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.puzzle-card.featured { grid-column: 1 / -1; min-height: 168px; background: linear-gradient(145deg, #b9d7c4, #e8f0e8); box-shadow: 0 16px 34px rgba(54,89,75,.22), inset 0 2px rgba(255,255,255,.9); }
.puzzle-card.practice { background: linear-gradient(145deg, rgba(221,211,231,.88), rgba(255,250,240,.82)); }
.puzzle-card.is-in-progress { border-color: rgba(57,105,83,.34); }
.puzzle-card.is-failed { border-color: rgba(151,86,64,.3); }
.card-copy { min-width: 0; }
.puzzle-card h2 { margin: 5px 0; font-size: 24px; letter-spacing: -.04em; }
.puzzle-card p { margin: 0; color: var(--muted); line-height: 1.35; }
.card-label { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 1000; color: #8d6047; }
.card-state { flex: none; display: grid; justify-items: center; gap: 7px; }
.card-action { max-width: 80px; color: #405d52; font-size: 12px; line-height: 1.1; text-align: center; }
.puzzle-card.is-failed .card-action { color: #8a4938; }
.card-arrow, .preview-icon { flex: none; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; background: rgba(255,255,255,.65); box-shadow: inset 0 1px white, 0 5px 12px var(--shadow); font-weight: 1000; font-size: 19px; }
.preview-card { cursor: default; background: #e4d8e8; }
.daily-unavailable-card { grid-column: 1 / -1; min-height: 126px; cursor: default; background: rgba(255,250,240,.9); border-style: dashed; }
.error-card { padding: 20px; border-radius: 20px; background: #f2d5d0; }
.version-tracker { justify-self: center; width: min(620px, 100%); margin-top: 20px; color: #71807d; font-size: 11px; }
.version-tracker summary { width: max-content; max-width: 100%; margin: auto; padding: 5px 9px; border-radius: 999px; cursor: pointer; list-style: none; letter-spacing: .035em; }
.version-tracker summary::-webkit-details-marker { display: none; }
.version-tracker summary::after { content: "⌄"; display: inline-block; margin-left: 6px; font-size: 12px; transition: transform .16s ease; }
.version-tracker[open] summary::after { transform: rotate(180deg); }
.version-tracker summary:hover { background: rgba(255,250,240,.55); color: #53635f; }
.version-tracker summary span { font-weight: 1000; }
.version-tracker summary time::before { content: " · "; }
.version-history { margin-top: 7px; padding: 12px 14px; border-top: 1px solid rgba(75,65,51,.12); }
.version-history-heading { margin: 0 0 8px; text-align: center; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 1000; }
.version-history ol { max-height: 260px; margin: 0; padding: 0 4px 0 26px; overflow-y: auto; scrollbar-width: thin; }
.version-history li { padding: 5px 0 6px 5px; border-bottom: 1px solid rgba(75,65,51,.08); }
.version-history li:last-child { border-bottom: 0; }
.version-history li span { color: #4f615d; font-weight: 1000; }
.version-history li time { margin-left: 7px; color: #87928f; }
.version-history li p { display: inline; margin: 0 0 0 7px; color: #65716f; }
.game-screen { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.game-heading h1 { font-size: clamp(34px, 7vw, 64px); }
.puzzle-title-row { min-width: 0; display: flex; align-items: center; gap: 9px; }
.puzzle-title-row h1 { min-width: 0; }
.title-restart-button { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(75,65,51,.17); border-radius: 50%; padding: 0; background: rgba(255,250,240,.78); box-shadow: inset 0 1px white, 0 6px 14px var(--shadow); color: #52615e; font-size: 22px; line-height: 1; font-weight: 1000; cursor: pointer; }
.game-heading .puzzle-copy { margin: 7px 0 0; }
.score-strip { flex: none; display: flex; align-items: center; gap: 7px; }
.score-metrics { display: flex; gap: 7px; }
.score-metrics > div { min-width: 88px; padding: 10px 12px; border-radius: 17px; background: rgba(255,250,240,.7); box-shadow: inset 0 1px white, 0 7px 17px var(--shadow); text-align: center; }
.tutorial-active .time-metric { display: none; }
.score-metrics span { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 1000; color: var(--muted); }
.score-metrics strong { display: block; margin-top: 2px; font-size: 18px; }
.help-wrap { position: relative; flex: none; }
.help-button { min-width: 72px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(75,65,51,.14); border-radius: 17px; padding: 8px 12px; background: rgba(255,250,240,.76); box-shadow: 0 7px 17px var(--shadow), inset 0 1px white; color: #52615e; font-weight: 1000; cursor: pointer; }
.help-button span:first-child { width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: 12px; }
.help-button[aria-expanded="true"] { background: #445e52; color: #fffaf0; }
.help-menu { position: absolute; z-index: 90; top: calc(100% + 7px); right: 0; width: min(290px, calc(100vw - 20px)); display: grid; gap: 3px; padding: 8px; border: 1px solid rgba(75,65,51,.16); border-radius: 16px; background: rgba(248,251,249,.99); box-shadow: 0 14px 32px rgba(42,59,56,.25), inset 0 1px white; backdrop-filter: blur(12px); }
.help-menu[hidden], .tutorial-help-actions[hidden] { display: none; }
.help-menu-action { width: 100%; min-height: 40px; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 7px 9px; background: transparent; color: #4f605c; text-align: left; font-size: 12px; font-weight: 1000; cursor: pointer; }
.help-menu-action:hover, .help-menu-action:focus-visible { background: rgba(213,228,221,.58); }
.help-menu-action > span:first-child { width: 20px; height: 20px; display: grid; place-items: center; color: #45675f; font-size: 15px; }
.help-menu-action[aria-pressed="false"] > span:first-child { opacity: .45; }
.help-risk-copy { display: grid; gap: 2px; margin: 4px 3px; padding: 9px 10px; border-radius: 10px; background: #f4ead8; color: #5e5a4c; font-size: 11px; line-height: 1.3; }
.help-risk-copy strong { color: #7b4438; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.tutorial-help-actions { display: grid; gap: 3px; padding-top: 4px; border-top: 1px solid rgba(75,65,51,.12); }
.instruction-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label button" "context button"; align-items: center; gap: 3px 18px; padding: 12px 16px; border-radius: 21px; background: rgba(255,250,240,.82); box-shadow: inset 0 1px white, 0 9px 24px var(--shadow); }
.instruction-card p { margin: 0; line-height: 1.35; }
.instruction-card .kicker { grid-area: label; align-self: end; }
.explore-context { grid-area: context; color: #455653; font-weight: 900; }
.instruction-card.danger { border: 2px solid #8c1f17; padding: 10px 14px; background: linear-gradient(145deg, #c73528, #9f2119); box-shadow: inset 0 1px rgba(255,255,255,.2), 0 0 0 4px rgba(191,45,30,.14), 0 11px 26px rgba(130,28,20,.3); }
.instruction-card.danger .kicker { color: #ffd86a; }
.explore-context.danger { color: #fff; text-shadow: 0 1px 2px rgba(91,14,9,.45); }
.explore-actions { grid-area: button; display: grid; grid-template-columns: minmax(152px, 1fr) minmax(48px, .42fr); gap: 8px; }
.explore-button { min-width: 152px; min-height: 54px; font-size: 18px; }
.lightning-button, .tutorial-hint-button { min-width: 48px; min-height: 48px; border: 1px solid rgba(84,70,45,.2); border-radius: 999px; padding: 8px 12px; background: linear-gradient(#fff5bd, #e7bb44); box-shadow: inset 0 2px rgba(255,255,255,.55), 0 7px 15px rgba(100,77,23,.22); color: #624b13; font-size: 22px; line-height: 1; font-weight: 1000; cursor: pointer; }
.lightning-button:disabled { opacity: .38; cursor: not-allowed; }
.primary-button { border: 0; border-radius: 999px; padding: 13px 20px; background: #445e52; color: #fffaf0; box-shadow: inset 0 2px rgba(255,255,255,.2), 0 8px 16px rgba(68,94,82,.22); font-weight: 1000; cursor: pointer; }
.primary-button:disabled { opacity: .38; cursor: not-allowed; }
.primary-button.danger { border: 2px solid #8e2419; padding: 11px 18px; background: linear-gradient(#ffe477, #efbd35); color: #9b2118; box-shadow: inset 0 2px rgba(255,255,255,.48), 0 0 0 4px rgba(255,220,92,.22), 0 10px 22px rgba(92,19,13,.32); text-transform: uppercase; letter-spacing: .035em; }

.play-area { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.play-area.key-expanded { grid-template-columns: minmax(0, 1fr) 190px; }
.board-wrap { min-width: 0; max-width: 100%; overflow-x: auto; padding: 5px 0 10px; scrollbar-width: thin; }
.mobile-explore-dock { display: none; }
.board { --board-footer-height: 152px; --scene-gap: 6px; min-width: var(--board-min-width, 735px); min-height: 520px; display: grid; grid-template-rows: 1fr 50px 86px; padding: 22px 14px 16px; position: relative; overflow: hidden; border: 1px solid rgba(84,70,87,.2); border-radius: 30px; background: linear-gradient(to bottom, #d7c8d5 0, #d9cfd7 calc(100% - var(--board-footer-height)), var(--street) calc(100% - var(--board-footer-height)), #aabbb7 100%); box-shadow: inset 0 2px rgba(255,255,255,.52), inset 0 -14px 25px rgba(74,57,77,.1), 0 18px 34px var(--shadow); user-select: none; }
.board.no-regions { --board-footer-height: 66px; grid-template-rows: 1fr 50px; }
.board.no-regions .regions { display: none; }
.buildings, .street, .regions { display: grid; grid-template-columns: repeat(var(--slots), minmax(0, 1fr)); gap: var(--scene-gap); grid-column: 1; }
.buildings { grid-row: 1; }
.street { grid-row: 2; }
.regions { grid-row: 3; }
.city-scene { z-index: 0; grid-row: 1; grid-column: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(var(--slots), minmax(0, 1fr)); gap: var(--scene-gap); padding: 27px 1px 0; pointer-events: none; }
.city-scene.scene-theme-river-market { --scene-image: url("assets/city-panorama.svg"); }
.scene-lane { min-width: 0; position: relative; overflow: hidden; border-radius: 18px 18px 5px 5px; box-shadow: inset 1px 0 rgba(255,255,255,.2); }
.scene-lane::before, .scene-lane::after { content: ""; position: absolute; inset: 0; }
.scene-lane::before { top: 0; bottom: 0; left: var(--scene-left); width: var(--scene-width); background-image: var(--scene-image); background-repeat: no-repeat; background-size: 100% 100%; }
.scene-lane::after { background: linear-gradient(180deg, #d7c8d5, #d9cfd7); opacity: 1; }
.scene-lane.revealed::after { opacity: 0; }
.buildings { z-index: 1; align-items: end; padding: 27px 1px 0; }
.building-slot { min-width: 0; height: 100%; display: flex; align-items: end; justify-content: center; position: relative; isolation: isolate; border: 1px solid rgba(96,78,56,.06); border-bottom: 0; border-radius: 18px 18px 5px 5px; background: linear-gradient(180deg, rgba(255,252,245,.13), rgba(255,250,239,.03)); box-shadow: inset 1px 0 rgba(255,255,255,.2); overflow: hidden; transition: background .14s ease, box-shadow .14s ease, transform .14s ease; }
.building-slot.correct-slot { border-color: rgba(81,126,137,.24); background: transparent; box-shadow: inset 0 1px rgba(255,255,255,.42), inset 0 -18px 24px rgba(87,91,70,.08), 0 0 20px rgba(65,117,127,.13); }
.building-slot.active-correct-slot::before { content: "✓"; position: absolute; z-index: 8; top: 3px; left: 50%; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: #4e965d; box-shadow: 0 3px 8px rgba(35,83,45,.32); color: #fff; font-size: 15px; line-height: 1; font-weight: 1000; transform: translateX(-50%); }
.building-slot.correct-slot::after { content: ""; position: absolute; z-index: 3; left: 7%; right: 7%; bottom: 0; height: 10px; border-radius: 50% 50% 0 0; background: linear-gradient(90deg, rgba(104,129,91,.65), rgba(132,146,102,.42), rgba(91,120,86,.62)); opacity: .66; }
.building-slot.drop-ready { background: rgba(255,250,240,.38); box-shadow: inset 0 0 0 3px rgba(68,94,82,.3); transform: translateY(-3px); }
.building-slot.drop-blocked { background: rgba(170,91,76,.1); box-shadow: inset 0 0 0 3px rgba(145,75,63,.28); }
.board.no-selection .building:not(.locked):hover { transform: translateY(-4px); filter: drop-shadow(0 9px 7px rgba(51,69,68,.2)) brightness(1.025); }
.selection-link { position: absolute; z-index: 8; height: 3px; border-radius: 999px; background: linear-gradient(90deg, transparent, #3f7771 12%, #3f7771 88%, transparent); box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 0 11px rgba(63,119,113,.42); opacity: 0; pointer-events: none; transform-origin: left center; }
.selection-link::before, .selection-link::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #3f7771; transform: translateY(-50%); }
.selection-link::before { left: -2px; }.selection-link::after { right: -2px; }
.selection-link.visible { opacity: 1; }
.building { --authored-building: #e2a7b6; --building: #aaa8a2; --body-height: calc(105px + var(--base-floors) * 18px); --roof-cap-height: 14px; width: var(--building-width); min-width: var(--building-width); max-width: var(--building-width); height: calc(var(--clue-base-height, 159px) + (var(--clue-bands) + 1) * 31px + 15px); padding: 0; border: 0; border-radius: 0; background: none; appearance: none; -webkit-appearance: none; display: block; position: relative; z-index: 2; cursor: grab; filter: drop-shadow(0 7px 6px rgba(51,69,68,.15)); touch-action: pan-y; -webkit-tap-highlight-color: transparent; transform-origin: 50% 100%; }
.building.has-warning { z-index: 6; }
.building.comparison-full { cursor: default; }
.building.selected { --selection-y: -7px; z-index: 11; transform: translateY(var(--selection-y)) scale(1.035); filter: drop-shadow(0 10px 8px rgba(42,78,74,.24)) brightness(1.025); }
.building-selection-frame { display: none; position: absolute; z-index: 7; left: -5px; right: -5px; bottom: -5px; height: calc(var(--body-height) + var(--piece-clue-bands) * 31px + 30px + var(--roof-cap-height) + 10px); border: 4px solid rgba(65,107,106,.36); border-radius: 10px 10px 7px 7px; box-shadow: 0 0 0 2px rgba(255,255,255,.42); pointer-events: none; }
.building.selected .building-selection-frame { display: block; border-color: rgba(47,112,111,.72); box-shadow: 0 0 0 2px rgba(255,255,255,.72), 0 0 18px rgba(47,112,111,.32); }
.building.locked { --building: var(--authored-building); cursor: default; }
.building.result-correct { --building: var(--authored-building); cursor: default; filter: drop-shadow(0 0 9px rgba(55,126,99,.42)) drop-shadow(0 8px 7px rgba(51,69,68,.18)); }
.building.result-incorrect { cursor: default; filter: grayscale(.25) saturate(.55) drop-shadow(0 7px 6px rgba(105,48,43,.22)); opacity: .78; }
.board.result-revealing { cursor: wait; }
.board.result-revealing .building, .board.result-revealing .clue-floor, .board.result-revealing .address-plaque { pointer-events: none; }
.building-slot.result-address-revealed { z-index: 8; }
.result-address-marker { position: absolute; z-index: 20; left: 50%; bottom: calc(var(--clue-base-height, 159px) + 8px); width: max-content; max-width: calc(100% + 28px); min-width: 32px; padding: 3px 7px; border: 2px solid rgba(255,255,255,.9); border-radius: 999px; display: grid; place-items: center; gap: 1px; color: white; font-weight: 1000; line-height: 1; text-align: center; transform: translateX(-50%); box-shadow: 0 6px 16px rgba(47,55,52,.28); pointer-events: none; }
.result-address-marker strong { font-size: 22px; }
.result-address-marker small { font-size: 9px; line-height: 1.05; white-space: nowrap; }
.result-address-marker.is-correct { background: #287452; }
.result-address-marker.is-incorrect { background: #a53f39; }
.result-reveal-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.building.partner-highlight { z-index: 12; filter: brightness(1.09) drop-shadow(0 0 10px rgba(255,255,255,.92)) drop-shadow(0 0 13px var(--clue-bg, rgba(72,119,112,.45))); }
.building.feedback-focus { z-index: 13; }
.building.risk-rising { filter: drop-shadow(0 5px 5px rgba(154,103,44,.2)); }
.building.risk-critical { z-index: 7; filter: drop-shadow(0 0 7px rgba(190,80,45,.48)) drop-shadow(0 6px 6px rgba(83,42,31,.2)); }
.building.risk-critical .roof-story::after { content: ""; position: absolute; inset: -3px; border: 2px solid rgba(181,75,48,.62); border-radius: 7px; pointer-events: none; }
.building.locked .windows { opacity: 1; }
.building.locked .windows i { border-color: rgba(255,239,172,.72); background: #ffe9a1; box-shadow: 0 0 5px rgba(255,217,105,.62), inset 1px 1px rgba(255,255,255,.7); }
.building.drag-source { opacity: .18; filter: grayscale(.25) saturate(.65); }
.building.dragging { position: fixed !important; left: 0; top: 0; z-index: 9999; pointer-events: none; margin: 0; animation: none !important; transform: translate3d(var(--drag-x), var(--drag-y), 0) translate(-50%, -66%) rotate(var(--drag-angle, 0deg)) scale(1.025); filter: drop-shadow(0 13px 11px rgba(77,61,44,.23)) brightness(1.025); cursor: grabbing; transition: filter .1s ease !important; }
.building.dragging, .building.dragging * { pointer-events: none !important; }
.building.dragging.drag-lifted { transform: translate3d(var(--drag-x), var(--drag-y), 0) translate(-50%, -73%) rotate(var(--drag-angle, 0deg)) scale(1.075); filter: drop-shadow(0 22px 17px rgba(77,61,44,.3)) brightness(1.045); }
.building.dragging.drag-returning { transform: translate3d(var(--drag-x), var(--drag-y), 0) translate(-50%, -68%) rotate(0deg) scale(1); transition: transform .17s cubic-bezier(.2,.9,.28,1.08), filter .17s ease !important; }
body.dragging-piece { cursor: grabbing; }
.clue-grid { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.clue-floor { position: absolute; left: 0; right: 0; bottom: calc(var(--clue-base-height) + var(--clue-band) * 31px); min-width: 0; height: 30px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--clue-bg, #c7dbe2), #67584a 18%); border-radius: 5px; background: linear-gradient(180deg, rgba(255,255,255,.2), transparent 42%, rgba(91,74,55,.035)), var(--clue-bg, #c7dbe2); box-shadow: inset 0 1px rgba(255,255,255,.68), inset 0 -1px rgba(91,74,55,.11), 0 2px 0 rgba(104,82,61,.12), 0 4px 6px rgba(83,65,48,.08); color: var(--clue-ink, #526f78); pointer-events: auto; cursor: help; }
.clue-floor:focus-visible { outline: 3px solid #fff7c9; outline-offset: 2px; box-shadow: inset 0 1px rgba(255,255,255,.68), 0 0 0 5px rgba(53,78,70,.58), 0 5px 10px rgba(53,78,70,.2); }
.clue-floor.satisfied { opacity: 1; filter: saturate(.82) brightness(1.08); box-shadow: inset 0 1px rgba(255,255,255,.82), inset 0 -1px rgba(91,74,55,.07), 0 2px 0 rgba(104,82,61,.09), 0 0 9px color-mix(in srgb, var(--clue-bg), white 28%); }
.clue-floor.satisfied::before { content: ""; position: absolute; right: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; opacity: .62; }
.clue-floor.violated { z-index: 9; box-shadow: inset 0 1px rgba(255,255,255,.68), inset 0 -1px rgba(91,74,55,.11), 0 2px 0 rgba(104,82,61,.12), 0 4px 6px rgba(83,65,48,.08); }
.clue-floor.violated::after { content: ""; position: absolute; z-index: 1; inset: -1px; border: 2px solid rgba(182,95,75,.72); border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,243,223,.8), 0 2px 5px rgba(111,54,42,.14); pointer-events: none; }
.clue-floor.pair-highlight { z-index: 10; filter: brightness(1.08); box-shadow: inset 0 1px rgba(255,255,255,.68), inset 0 -1px rgba(91,74,55,.11), 0 2px 0 rgba(104,82,61,.12), 0 4px 6px rgba(83,65,48,.08), 0 0 0 3px rgba(255,255,255,.9), 0 0 15px 8px color-mix(in srgb, var(--clue-bg), white 12%); }
.clue-floor.newly-discovered, .clue-floor.newly-satisfied { z-index: 12; }
.clue-floor.normal-story { height: 31px; border-color: transparent rgba(82,67,52,.17); border-radius: 0; background: linear-gradient(105deg, rgba(255,255,255,.2), transparent 34%, rgba(86,67,48,.045) 76%, rgba(86,67,48,.08)), var(--building); box-shadow: inset 1px 0 2px rgba(255,255,255,.58), inset -2px 0 5px rgba(86,67,48,.08); pointer-events: none; cursor: default; }
.clue-floor svg { width: 48px; height: 21px; overflow: visible; }
.chain-symbol rect { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linejoin: round; }
.close-symbol { width: 40px; height: 22px; overflow: visible; }
.close-symbol path { fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sum-symbol { font-size: 16px; line-height: 1; font-weight: 1000; letter-spacing: -.04em; }
.clue-not { display: flex; align-items: center; justify-content: center; gap: 6px; }
.not-clue-symbol { font-size: 21px; line-height: 1; }
.not-clue-address { min-width: 1ch; font-size: 16px; line-height: 1; font-weight: 1000; }
.compare-symbol, .clue-floor .compare-symbol { width: 39px; height: 19px; overflow: visible; }
.compare-symbol path { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.building-body { position: absolute; left: 0; right: 0; bottom: 0; height: var(--body-height); display: block; border: 1px solid rgba(82,67,52,.17); border-radius: 5px 5px 2px 2px; background: linear-gradient(105deg, rgba(255,255,255,.2), transparent 34%, rgba(86,67,48,.045) 76%, rgba(86,67,48,.08)), var(--building); box-shadow: inset 1px 1px 2px rgba(255,255,255,.58), inset -2px -3px 5px rgba(86,67,48,.08), 0 2px 0 rgba(92,71,51,.11), 0 5px 8px rgba(83,65,48,.08); overflow: visible; }
.building.resolved-base .building-body { border-top-color: transparent; border-radius: 0 0 2px 2px; }
.building-body::before { content: ""; position: absolute; z-index: 0; inset: 0; border-radius: inherit; background: var(--hint-wash, none); pointer-events: none; }
.roof-story { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(var(--clue-base-height) + var(--piece-clue-bands) * 31px); height: 30px; border: 1px solid rgba(74,88,86,.18); border-radius: 5px 5px 3px 3px; background: var(--cap-hint-wash, none), linear-gradient(105deg, rgba(255,255,255,.27), transparent 34%, rgba(55,75,72,.055) 76%), var(--building); box-shadow: inset 1px 1px 2px rgba(255,255,255,.62), inset -2px -2px 4px rgba(48,68,65,.08), 0 2px 4px rgba(48,68,65,.1); pointer-events: none; }
.building:not(.has-clue) .roof-story { bottom: calc(var(--clue-base-height) - 1px); height: 31px; border-bottom: 0; border-radius: 5px 5px 0 0; box-shadow: inset 1px 1px 2px rgba(255,255,255,.62), inset -2px 0 4px rgba(48,68,65,.08); }
.building:not(.has-clue) .building-body { border-top-color: transparent; border-radius: 0 0 2px 2px; }
.roof { position: absolute; z-index: 3; left: 24%; right: 24%; bottom: calc(100% - 1px); height: 14px; border: 1px solid rgba(74,88,86,.18); border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--cap-hint-wash, none), linear-gradient(105deg, rgba(255,255,255,.3), rgba(55,75,72,.045)), var(--building); box-shadow: inset 1px 1px rgba(255,255,255,.52), 0 -2px 4px rgba(48,68,65,.07); }
.roof-parapet .roof { left: 18%; right: 18%; height: 11px; }
.roof-parapet { --roof-cap-height: 11px; }
.roof-terrace .roof { left: 28%; right: 28%; height: 17px; }
.roof-terrace { --roof-cap-height: 17px; }
.roof-crown .roof { left: 22%; right: 22%; height: 14px; }
.windows { position: absolute; z-index: 1; inset: 24px 11px 15px; display: grid; grid-template-columns: repeat(3, 9px); grid-auto-rows: 9px; align-content: space-evenly; justify-content: space-between; overflow: hidden; opacity: .72; }
.windows i { width: 9px; height: 9px; border-top: 2px solid color-mix(in srgb, #d9d7d2, #635648 20%); border-left: 2px solid color-mix(in srgb, #d9d7d2, #635648 17%); border-right: 1px solid rgba(255,255,255,.38); border-bottom: 1px solid rgba(255,255,255,.32); border-radius: 1px; background: color-mix(in srgb, #d9d7d2, #8c7c69 5%); box-shadow: inset 1px 1px 2px rgba(76,62,49,.12); }
.risk-metric strong { color: #4c635c; }
.risk-metric.risk-rising { background: rgba(255,235,190,.82); }
.risk-metric.risk-rising strong { color: #986721; }
.risk-metric.risk-high { background: rgba(246,213,199,.9); box-shadow: inset 0 1px white, 0 0 0 2px rgba(181,75,48,.16), 0 7px 17px rgba(132,59,40,.18); }
.risk-metric.risk-high strong { color: #a43e2d; }
.tone-rose { --authored-building: #dca4b1; }.tone-honey { --authored-building: #e4c17d; }.tone-sky { --authored-building: #9fc9d3; }.tone-mint { --authored-building: #aecaaf; }.tone-lilac { --authored-building: #c4afd2; }.tone-coral { --authored-building: #dda087; }.tone-blue { --authored-building: #9faed0; }.tone-sage { --authored-building: #bbc39a; }.tone-berry { --authored-building: #c994b3; }

.street { align-items: center; padding: 5px 4px; border-radius: 12px; background: var(--street); box-shadow: inset 0 4px 7px rgba(91,69,44,.1), inset 0 -2px rgba(255,255,255,.55); }
.address-plaque { position: relative; height: 35px; display: grid; place-items: center; border: 1px solid rgba(88,68,45,.1); border-radius: 10px; background: rgba(255,248,231,.76); box-shadow: inset 0 1px white, 0 2px 5px rgba(88,68,45,.12); font-size: var(--lane-label-size); font-weight: 1000; cursor: default; }
.address-plaque.correct-address { color: #fffdf2; border-color: rgba(35,78,84,.46); background: linear-gradient(145deg, #5f9da2, #316d7a); box-shadow: inset 0 0 0 3px rgba(255,247,218,.56), inset 0 1px rgba(255,255,255,.68), 0 0 0 4px rgba(75,133,139,.18), 0 5px 11px rgba(44,86,91,.28); text-shadow: 0 1px 1px rgba(25,56,61,.38); transform: translateY(-1px); }
.address-number { position: relative; z-index: 2; }
.solved-indicator { position: absolute; z-index: 1; left: 20%; right: 20%; bottom: -10px; height: 8px; border: 1px solid #8f671c; border-radius: 999px; background: linear-gradient(180deg, #f6d778, #d39a28); box-shadow: inset 0 1px rgba(255,255,255,.68), 0 3px 6px rgba(105,72,16,.28); }
.address-plaque.move-target { outline: 2px dashed rgba(68,94,82,.45); outline-offset: -4px; }
.address-plaque.drop-ready { background: rgba(238,247,235,.96); box-shadow: inset 0 0 0 2px rgba(68,94,82,.42), 0 5px 12px rgba(68,94,82,.18); transform: translateY(-2px); }
.address-plaque.drop-blocked { background: rgba(241,218,211,.92); box-shadow: inset 0 0 0 2px rgba(145,75,63,.35); }
.regions { grid-template-rows: repeat(2, 31px); padding: 8px 4px 12px; }
.region-sign { position: relative; isolation: isolate; height: 29px; display: grid; place-items: center; align-self: start; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); background: #655846; filter: drop-shadow(0 4px 4px rgba(68,50,34,.3)); color: #423b32; font-size: var(--lane-label-size); line-height: 1; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 1px rgba(255,255,255,.58); font-weight: 1000; }
.region-sign::before { content: ""; position: absolute; z-index: -1; inset: 2px; clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%, 0 50%); background: var(--region-fill); box-shadow: inset 0 2px rgba(255,255,255,.68); }
.region-sign span { position: relative; z-index: 1; }
.region-row-1 { align-self: end; }
.region-color-0 { --region-fill: #f0d69d; }
.region-color-1 { --region-fill: #cbb7c8; }
.region-color-2 { --region-fill: #a9c9b3; }
.hint-tooltip { position: fixed; z-index: 10000; width: max-content; max-width: min(280px, calc(100vw - 24px)); padding: 9px 11px; border: 1px solid rgba(66,53,38,.2); border-radius: 10px; background: #3f3a34; color: #fffaf0; box-shadow: 0 8px 22px rgba(55,43,31,.24); font-size: 12px; line-height: 1.35; pointer-events: none; }
.hint-tooltip.is-persistent { border-color: rgba(255,247,201,.58); box-shadow: 0 8px 22px rgba(55,43,31,.3), 0 0 0 2px rgba(255,247,201,.24); }
.discovery-toast { position: fixed; z-index: 9500; left: 50%; bottom: max(72px, calc(env(safe-area-inset-bottom) + 66px)); max-width: calc(100vw - 28px); padding: 10px 16px; border: 1px solid rgba(75,65,51,.16); border-radius: 999px; background: rgba(55,70,66,.94); box-shadow: 0 12px 30px rgba(35,50,47,.28), inset 0 1px rgba(255,255,255,.18); color: #fffdf5; font-size: 13px; text-align: center; font-weight: 1000; pointer-events: none; transform: translateX(-50%); }
.discovery-toast.correct { background: rgba(48,112,88,.96); }
.discovery-toast.satisfied { background: rgba(70,104,83,.96); }
.discovery-toast.solved { background: linear-gradient(135deg, #2f756c, #6c9462); font-size: 15px; }
.board.city-solved { border-color: rgba(48,113,100,.48); box-shadow: inset 0 2px rgba(255,255,255,.72), inset 0 -14px 25px rgba(55,105,85,.13), 0 0 0 4px rgba(116,177,142,.16), 0 18px 42px rgba(47,105,91,.28); }
.board.city-solved .region-sign { filter: drop-shadow(0 4px 5px rgba(47,91,72,.32)) brightness(1.04); }
.clue-key { margin-top: 5px; padding: 12px 10px 10px; border: 1px solid rgba(75,65,51,.12); border-radius: 18px; background: rgba(255,250,240,.68); box-shadow: inset 0 1px white, 0 7px 18px rgba(52,70,69,.1); }
.clue-key-heading { padding: 0 4px 9px; }
.clue-key-heading h2 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.025em; }
.clue-waterfall { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.key-step { min-width: 0; display: grid; grid-template-columns: 22px 42px minmax(0, 1fr); align-items: center; gap: 5px; padding: 5px 4px; position: relative; border-radius: 9px; }
.key-step:not(:last-child)::after { content: ""; position: absolute; left: 35px; top: calc(100% - 1px); width: 1px; height: 6px; background: rgba(72,92,87,.24); }
.key-order { color: #7a8582; font-size: 9px; line-height: 1; text-align: center; text-transform: uppercase; font-weight: 1000; }
.key-symbol { width: 42px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(76,97,104,.13); border-radius: 5px; background: linear-gradient(rgba(255,255,255,.18), transparent), #b5cedd; color: #5e86a1; box-shadow: inset 0 1px rgba(255,255,255,.58), 0 2px 3px rgba(77,61,44,.08); font-size: 13px; font-weight: 1000; }
.key-symbol svg { max-width: 35px; max-height: 19px; }
.correct-step { padding-block: 7px; background: linear-gradient(90deg, rgba(255,250,240,.72), rgba(255,250,240,.22)); }
.correct-symbol { border-color: rgba(65,108,99,.26); background: linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)), url("assets/city-panorama.svg") center / cover; color: #fffdf4; text-shadow: 0 1px 3px #274b46; font-size: 18px; }
.sum-symbol-wrap { background-color: #efcc78; color: #9e6b0f; }
.close-symbol-wrap { background-color: #c8d99e; color: #6e8735; }
.compare-symbol-wrap { background-color: #d5c3df; color: #765388; }
.key-step strong { display: block; font-size: 11px; line-height: 1.1; }
.key-step small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.22; }
.not-step { margin-top: 4px; border-top: 1px dashed rgba(113,80,68,.24); padding-top: 9px; }
.not-step .not-symbol { display: flex; align-items: center; justify-content: center; gap: 4px; background-color: #e6b4ae; color: #9d3027; }
.not-step .not-symbol span { font-size: 17px; line-height: 1; }
.not-step .not-symbol b { font-size: 12px; }
.game-actions { display: flex; justify-content: center; gap: 9px; margin-top: -6px; flex-wrap: wrap; }

dialog { width: min(680px, calc(100% - 24px)); border: 0; padding: 0; border-radius: 28px; color: var(--ink); background: transparent; }
dialog::backdrop { background: rgba(63,55,45,.45); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(75,65,51,.16); border-radius: 28px; background: var(--paper-light); box-shadow: inset 0 2px white, 0 24px 60px rgba(66,53,38,.28); }
.dialog-card h2 { font-size: clamp(34px, 7vw, 58px); }
.dialog-card li { margin: 9px 0; line-height: 1.4; }
.dialog-close { position: absolute; right: 15px; top: 15px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eee1cd; font-size: 24px; cursor: pointer; }
.legend { display: grid; gap: 9px; margin-top: 20px; }
.legend > div { display: flex; gap: 12px; align-items: center; }
.legend p { margin: 0; }
.mini-clue { flex: none; width: 70px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(76,97,104,.16); border-radius: 5px; background: linear-gradient(rgba(255,255,255,.18), transparent), #b5cedd; color: #5e86a1; box-shadow: inset 0 1px rgba(255,255,255,.66), inset 0 -1px rgba(77,61,44,.08), 0 2px 3px rgba(77,61,44,.1); font-size: 16px; font-weight: 1000; }
.mini-clue.chain .chain-symbol { width: 52px; height: 23px; }
.mini-clue.region-symbol { border: 0; background: #c8d99e; color: #78933b; }
.mini-clue.region-symbol .close-symbol { width: 43px; height: 23px; }
.mini-clue.sum { background-color: #efcc78; color: #bd861b; }
.mini-clue.not-symbol { display: flex; align-items: center; justify-content: center; gap: 7px; background-color: #e6b4ae; color: #9d3027; }
.mini-clue.not-symbol span { font-size: 22px; line-height: 1; }
.mini-clue.not-symbol b { font-size: 16px; }
.clue-letter { background: linear-gradient(rgba(255,255,255,.22), transparent), #e7d5f0; color: #76548d; }
.letter-clue-symbol { font-size: 17px; line-height: 1; font-weight: 1000; }
.result-card { overflow: hidden; text-align: center; background: linear-gradient(180deg, #fbfdfb 0%, #f2f6f2 58%, #edf1ec 100%); }
.result-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 120px; background: radial-gradient(circle at 50% 0, rgba(246,205,105,.34), transparent 68%); pointer-events: none; }
.result-card > * { position: relative; }
.result-card .kicker { margin-bottom: 8px; }
.result-card h2 { margin-bottom: 8px; font-size: clamp(40px, 8vw, 62px); line-height: .98; text-wrap: balance; }
.result-card #resultCopy { max-width: 440px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.45; }
.result-kudos { margin: 10px 0 -9px; color: #d59c20; font-size: 29px; line-height: 1; letter-spacing: .08em; text-shadow: 0 1px #fff, 0 3px 7px rgba(116,79,8,.2); }
.result-skyline { height: 76px; display: flex; align-items: end; justify-content: center; gap: 7px; margin: 24px auto 18px; }
.result-skyline span { width: 34px; border-radius: 9px 9px 3px 3px; background: #afbbb6; box-shadow: inset 3px 3px rgba(255,255,255,.38), inset -3px -4px rgba(53,70,66,.09), 0 7px 13px rgba(45,62,58,.14); }
.result-skyline span:nth-child(1) { height: 42px; }.result-skyline span:nth-child(2) { height: 64px; }.result-skyline span:nth-child(3) { height: 51px; }.result-skyline span:nth-child(4) { height: 74px; }.result-skyline span:nth-child(5) { height: 57px; }
.result-skyline.is-solved span:nth-child(1) { background: #dca4b1; }.result-skyline.is-solved span:nth-child(2) { background: #e4c17d; }.result-skyline.is-solved span:nth-child(3) { background: #9fc9d3; }.result-skyline.is-solved span:nth-child(4) { background: #9fc7aa; }.result-skyline.is-solved span:nth-child(5) { background: #bda8cf; }
.result-skyline.is-failed { opacity: .72; filter: saturate(.45); }
.result-stats { max-width: 460px; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 9px; margin: 0 auto; }
.result-stats > div { min-width: 0; padding: 12px 10px; border: 1px solid rgba(66,91,82,.12); border-radius: 15px; background: rgba(255,255,255,.68); box-shadow: inset 0 1px white; }
.result-stats dt { color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.result-stats dd { margin: 4px 0 0; color: #314b43; font-size: 21px; font-weight: 1000; }
.share-source { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; }
.share-feedback { min-height: 1.35em; margin: 12px 0 0; color: #49675e; font-size: 13px; font-weight: 900; }
.tutorial-result-panel { margin-top: 22px; padding: 18px; border: 1px solid rgba(75,65,51,.14); border-radius: 19px; background: linear-gradient(145deg, #f2dfbd, #fff9ed); box-shadow: inset 0 1px white; }
.tutorial-result-prompt { margin: 0; text-align: center; color: var(--muted); font-size: 17px; line-height: 1.45; }
.welcome-dialog { width: min(560px, calc(100% - 24px)); }
.welcome-dialog-card { overflow: hidden; text-align: center; background: linear-gradient(180deg, rgba(248,251,249,.97), rgba(244,236,220,.98)); }
.welcome-dialog-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 105px; background: url("assets/city-panorama.svg") center 39% / cover; opacity: .38; mask-image: linear-gradient(#000, transparent); pointer-events: none; }
.welcome-dialog-card > * { position: relative; }
.welcome-dialog-card h2 { font-size: clamp(38px, 8vw, 58px); }
.welcome-dialog-card h2 span { display: block; }
.welcome-dialog-card > p:not(.kicker) { margin: 10px 0; color: var(--muted); font-size: 19px; }
.welcome-city-mark { height: 58px; display: flex; align-items: end; justify-content: center; gap: 6px; margin: 5px auto 17px; }
.welcome-city-mark i { width: 26px; border-radius: 7px 7px 2px 2px; box-shadow: inset 2px 2px rgba(255,255,255,.42), 0 4px 8px rgba(60,75,72,.14); }
.welcome-city-mark i:nth-child(1) { height: 38px; background: #dca4b1; }.welcome-city-mark i:nth-child(2) { height: 55px; background: #9fc9d3; }.welcome-city-mark i:nth-child(3) { height: 45px; background: #e4c17d; }
.welcome-time { display: block; margin-top: 16px; color: #526a61; }
.welcome-actions { margin-top: 22px; }
.learning-options { display: grid; gap: 9px; margin-top: 22px; }
.learning-option { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; border: 1px solid rgba(75,65,51,.13); border-radius: 16px; padding: 12px 14px; background: rgba(255,250,240,.72); text-align: left; cursor: pointer; }
.learning-option > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #dce9e2; font-weight: 1000; }
.learning-option strong, .learning-option small { display: block; }.learning-option small { margin-top: 3px; color: var(--muted); }
.featured-learning-option { background: linear-gradient(145deg, #d1e4d6, #fff9ed); }
.restart-learning-option { background: linear-gradient(145deg, #f3e3d5, #fff9ed); }
.learn-clue-guide { margin-top: 16px; padding: 14px; border-radius: 15px; background: #edf3ef; color: #53635f; line-height: 1.45; }
.learn-clue-guide h3 { margin: 0; color: var(--ink); }.learn-clue-guide p:last-child { margin-bottom: 0; }
.tutorial-layer { position: fixed; z-index: 9800; inset: 0; pointer-events: none; }
.tutorial-target-element { outline: 4px solid rgba(231,184,57,.88); outline-offset: 4px; border-radius: 12px; filter: brightness(1.05); }
.explore-heading { grid-area: label; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.explore-heading .kicker { grid-area: auto; }
.instruction-card.tutorial-panel { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label button" "tutorial button"; align-items: center; gap: 7px 18px; padding-block: 10px; }
.tutorial-panel-header { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tutorial-progress { margin: 0; color: #94674c; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 1000; white-space: nowrap; }
.tutorial-panel-content { grid-area: tutorial; min-width: 0; }
.tutorial-objective { margin: 0 0 2px; color: #263d37; font-size: 15px; font-weight: 1000; }
.tutorial-copy { margin: 0; color: #3e504b; font-size: 15px; line-height: 1.3; font-weight: 900; }
.tutorial-city-intro { --intro-address-step: clamp(46px, 15vw, 64px); width: min(350px, 100%); margin: 8px auto 10px; padding: 11px 12px 8px; border: 1px solid rgba(75,65,51,.14); border-radius: 14px; background: linear-gradient(#dcebea 0 68%, #c8bca3 68% 74%, #f5ead6 74%); overflow: hidden; }
.tutorial-intro-buildings, .tutorial-intro-addresses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.tutorial-intro-buildings { height: 64px; }
.tutorial-intro-building { --intro-shift: 0; position: relative; z-index: 1; width: 34px; height: 50px; justify-self: center; display: flex; align-items: flex-end; border-radius: 7px 7px 2px 2px; background: var(--intro-color); box-shadow: inset 3px 3px rgba(255,255,255,.36), 0 5px 8px rgba(43,57,54,.2); transform: translateX(0); transition: transform .65s cubic-bezier(.2,.8,.25,1.15); }
.tutorial-intro-building i { width: 5px; height: 7px; margin: 0 auto 9px; border-radius: 2px; background: rgba(255,248,205,.9); box-shadow: -10px 0 rgba(255,248,205,.9), 10px 0 rgba(255,248,205,.9), 0 -14px rgba(255,248,205,.9), -10px -14px rgba(255,248,205,.9), 10px -14px rgba(255,248,205,.9); }
.tutorial-intro-building.intro-rose { --intro-color: #dca4b1; --intro-shift: 0; height: 42px; }
.tutorial-intro-building.intro-honey { --intro-color: #e4c17d; --intro-shift: 4; height: 56px; }
.tutorial-intro-building.intro-sky { --intro-color: #9fc9d3; --intro-shift: -2; height: 44px; }
.tutorial-intro-building.intro-mint { --intro-color: #9fc7aa; --intro-shift: 0; height: 54px; }
.tutorial-intro-building.intro-lilac { --intro-color: #bda8cf; --intro-shift: -2; height: 46px; }
.tutorial-city-intro[data-phase="shuffled"] .tutorial-intro-building { transform: translateX(calc(var(--intro-shift) * var(--intro-address-step))); }
.tutorial-intro-addresses { margin-top: 5px; color: #695d4e; text-align: center; font-size: 11px; font-weight: 1000; }
.tutorial-exit-action { color: #7b4438; }
.developer-controls { position: fixed; z-index: 10040; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 24px); padding: 9px 10px; border: 1px dashed rgba(93,67,48,.42); border-radius: 14px; background: rgba(255,247,229,.97); box-shadow: 0 10px 28px rgba(44,58,54,.25); }
.developer-controls[hidden] { display: none; }
.developer-controls strong { color: #7b4438; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.developer-controls button { min-height: 44px; }
.menu-guidance { position: fixed; z-index: 10030; top: max(72px, calc(env(safe-area-inset-top) + 66px)); right: max(13px, env(safe-area-inset-right)); width: min(300px, calc(100vw - 26px)); padding: 14px 40px 14px 16px; border: 1px solid rgba(75,65,51,.17); border-radius: 16px; background: #fff9ed; box-shadow: 0 14px 34px rgba(44,58,54,.27); }
.menu-guidance p { margin: 0; color: #4d5d58; line-height: 1.35; font-weight: 900; }
.menu-guidance button { position: absolute; right: 7px; top: 7px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; font-size: 19px; cursor: pointer; }
.menu-guidance-arrow { position: absolute; right: 17px; top: -30px; color: #d5a83c; font-size: 27px; transform: rotate(-90deg); }
.menu-guidance-target { outline: 4px solid rgba(238,193,73,.5); outline-offset: 3px; }
.dialog-actions { display: flex; justify-content: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.result-card #standardResultActions { max-width: 460px; display: grid; grid-template-columns: 1fr; margin: 8px auto 0; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.share-actions button, .result-next-button { width: 100%; }
.result-next-button { min-height: 45px; }
.result-text-button { justify-self: center; border: 0; padding: 8px 12px; background: transparent; color: #5f706b; font-weight: 1000; cursor: pointer; }
.view-city-button span { display: inline-block; margin-right: 3px; font-size: 20px; line-height: 0; vertical-align: -1px; letter-spacing: -.18em; }
.result-return-button { position: fixed; z-index: 9000; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); min-height: 46px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(75,65,51,.18); border-radius: 999px; padding: 10px 13px 10px 17px; background: rgba(255,250,240,.94); box-shadow: 0 10px 26px rgba(66,53,38,.24), inset 0 1px white; color: var(--ink); font-weight: 1000; cursor: pointer; }
.result-return-button span:last-child { font-size: 25px; line-height: .7; }

@media (max-width: 700px), (orientation: landscape) and (max-height: 560px) and (max-width: 1000px) {
  :root { --building-width: clamp(27px, 8.4vw, 36px); --lane-label-size: 12px; }
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .welcome-blade { margin: 0 -10px; padding: 16px 10px 57px; border-radius: 24px 24px 0 0; background-position: 48% 35%; }
  .hero-copy { padding: 15px 17px; }
  .hero-copy h1 { font-size: clamp(29px, 9vw, 42px); }
  .hero-copy > p:last-child { font-size: 15px; }
  .puzzle-list { margin-top: -28px; }
  .game-screen, .game-heading, .instruction-card { width: 100%; max-width: 100%; }
  .puzzle-list { grid-template-columns: 1fr; }
  .puzzle-card.featured { grid-column: auto; min-height: 154px; }
  .puzzle-card { min-width: 0; padding: 17px; gap: 10px; }
  .card-action { max-width: 72px; font-size: 11px; }
  .version-tracker { margin-top: 15px; }
  .version-history { padding-inline: 8px; }
  .version-history li p { display: block; margin: 2px 0 0; line-height: 1.3; }
  .welcome-dialog-card { padding: 22px 17px 18px; }
  .welcome-dialog { width: calc(100% - 20px); max-width: calc(100% - 20px); }
  .welcome-dialog-card h2 { width: 100%; max-width: 100%; font-size: 32px; letter-spacing: -.05em; white-space: normal; overflow-wrap: normal; text-wrap: balance; }
  .welcome-dialog-card > p:not(.kicker) { font-size: 16px; }
  .welcome-city-mark { height: 45px; margin-bottom: 11px; }.welcome-city-mark i:nth-child(1) { height: 30px; }.welcome-city-mark i:nth-child(2) { height: 44px; }.welcome-city-mark i:nth-child(3) { height: 36px; }
  .welcome-actions { display: grid; }.welcome-actions button { width: 100%; }
  .instruction-card.tutorial-panel { text-align: left; }
  .tutorial-panel-header { min-height: 22px; gap: 6px; }
  .tutorial-objective { font-size: 12px; }
  .tutorial-copy { font-size: 12px; line-height: 1.22; }
  .tutorial-city-intro { margin: 5px auto 6px; padding: 7px 9px 5px; }
  .tutorial-intro-buildings { height: 45px; }
  .tutorial-intro-building { width: 25px; height: 36px; }
  .tutorial-intro-building.intro-rose { height: 31px; }.tutorial-intro-building.intro-honey { height: 41px; }.tutorial-intro-building.intro-sky { height: 33px; }.tutorial-intro-building.intro-mint { height: 39px; }.tutorial-intro-building.intro-lilac { height: 34px; }
  .tutorial-intro-building i { transform: scale(.72); }
  .developer-controls { right: max(8px, env(safe-area-inset-right)); left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); justify-content: space-between; }
  .developer-controls strong { font-size: 9px; }
  .game-heading { align-items: stretch; flex-direction: column; }
  .score-strip { align-self: stretch; }
  .score-metrics { min-width: 0; flex: 1; }
  .score-metrics > div { min-width: 0; flex: 1; }
  .instruction-card { grid-template-columns: 1fr; grid-template-areas: "label" "context"; text-align: center; }
  .instruction-card .kicker { align-self: auto; }
  .instruction-card .explore-actions { display: none; }
  .play-area.key-expanded { grid-template-columns: minmax(0, 1fr); }
  .clue-key { order: -1; margin: 0; }
  .clue-waterfall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-step:not(:last-child)::after { display: none; }
  .primary-button { min-height: 48px; }
  dialog#resultDialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); }
  .result-card { padding: 22px 16px 16px; }
  .result-card h2 { font-size: 39px; }
  .result-card #resultCopy { font-size: 15px; }
  .result-skyline { height: 58px; gap: 5px; margin: 17px auto 13px; }
  .result-skyline span { width: 27px; }
  .result-skyline span:nth-child(1) { height: 32px; }.result-skyline span:nth-child(2) { height: 49px; }.result-skyline span:nth-child(3) { height: 39px; }.result-skyline span:nth-child(4) { height: 57px; }.result-skyline span:nth-child(5) { height: 44px; }
  .result-stats > div { padding: 9px 7px; }
  .result-stats dd { font-size: 18px; }
  .share-feedback { margin-top: 8px; }
  .board-wrap { width: calc(100% + 20px); max-width: none; margin-left: -10px; overflow: visible; padding: 3px 0 0; }
  .board { --board-footer-height: 90px; --scene-gap: 2px; width: 100%; min-width: 0; min-height: 326px; grid-template-rows: minmax(0, 1fr) 38px 52px; padding: 9px 5px 8px; border-radius: 20px; }
  .board.no-regions { --board-footer-height: 46px; grid-template-rows: minmax(0, 1fr) 38px; }
  .city-scene, .buildings { padding-top: 9px; }
  .scene-lane, .building-slot { border-radius: 8px 8px 2px 2px; }
  .building-slot.active-correct-slot::before { top: 2px; width: 16px; height: 16px; border-width: 1px; font-size: 11px; }
  .building-slot.correct-slot::after { height: 7px; }
  .building { --body-height: 78px; --roof-cap-height: 9px; height: calc(78px + (var(--clue-bands) + 1) * 21px + 9px); filter: drop-shadow(0 4px 4px rgba(51,69,68,.13)); }
  .roof-parapet { --roof-cap-height: 7px; }
  .roof-terrace { --roof-cap-height: 11px; }
  .roof-crown { --roof-cap-height: 9px; }
  .building.selected { --selection-y: -3px; transform: translateY(var(--selection-y)) scale(1.035); }
  .building-selection-frame { left: -2px; right: -2px; bottom: -2px; height: calc(78px + var(--piece-clue-bands) * 21px + 21px + var(--roof-cap-height) + 5px); border-width: 2px; border-radius: 7px 7px 5px 5px; box-shadow: 0 0 0 1px rgba(255,255,255,.48); }
  .clue-floor { bottom: calc(78px + var(--clue-band) * 21px); height: 20px; padding-inline: 2px; border-radius: 3px; overflow: hidden; }
  .clue-floor.normal-story { height: 21px; }
  .clue-floor.violated::after { inset: 0; border-width: 2px; border-radius: 3px; box-shadow: inset 0 0 0 1px #fff3df; }
  .clue-floor svg, .clue-floor .chain-symbol, .clue-floor .close-symbol, .compare-symbol, .clue-floor .compare-symbol { width: min(23px, calc(100% - 4px)); height: 12px; overflow: hidden; }
  .clue-floor .close-symbol { width: min(22px, calc(100% - 4px)); }
  .chain-symbol rect { stroke-width: 2.5; }
  .close-symbol path { stroke-width: 2; }
  .compare-symbol path { stroke-width: 2; }
  .sum-symbol, .not-clue-address { font-size: 10px; }
  .not-clue-symbol { font-size: 13px; }
  .clue-not { gap: 1px; }
  .building-body { height: 78px; }
  .roof-story { bottom: calc(78px + var(--piece-clue-bands) * 21px); height: 20px; }
  .building:not(.has-clue) .roof-story { bottom: 77px; height: 21px; }
  .roof-parapet .roof { height: 7px; }
  .roof-terrace .roof { height: 11px; }
  .roof-crown .roof { height: 9px; }
  .windows { inset: 14px 4px 8px; grid-template-columns: repeat(2, 6px); grid-auto-rows: 6px; }
  .windows i { width: 6px; height: 6px; border-top-width: 1px; border-left-width: 1px; }
  .street { padding: 3px 2px; border-radius: 8px; }
  .address-plaque { height: 28px; border-radius: 6px; }
  .address-plaque.correct-address { box-shadow: inset 0 0 0 2px rgba(255,247,218,.56), inset 0 1px rgba(255,255,255,.68), 0 0 0 2px rgba(75,133,139,.18), 0 3px 7px rgba(44,86,91,.24); }
  .regions { grid-template-rows: repeat(2, 19px); padding: 4px 2px 6px; }
  .region-sign { height: 18px; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%); font-size: 9px; letter-spacing: 0; filter: drop-shadow(0 2px 2px rgba(68,50,34,.24)); }
  .region-sign::before { inset: 1px; clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 5px 100%, 0 50%); }
  .mobile-explore-dock { position: sticky; z-index: 30; bottom: max(6px, env(safe-area-inset-bottom)); width: calc(100% - 12px); min-height: 54px; margin: -6px auto 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid rgba(75,65,51,.18); border-radius: 16px; background: rgba(248,251,249,.96); box-shadow: 0 8px 20px rgba(52,70,69,.22), inset 0 1px white; backdrop-filter: blur(10px); }
  .mobile-explore-dock.danger { border: 2px solid #8c1f17; padding: 7px 7px 7px 13px; background: linear-gradient(145deg, rgba(199,53,40,.97), rgba(159,33,25,.97)); box-shadow: 0 0 0 4px rgba(191,45,30,.14), 0 11px 28px rgba(130,28,20,.32); }
  .mobile-explore-status { min-width: 0; color: #455653; font-size: 11px; line-height: 1.15; font-weight: 1000; }
  .mobile-explore-dock.danger .mobile-explore-status { color: #fff; }
  .mobile-explore-button { min-width: 100px; min-height: 42px; padding: 8px 15px; }
  .mobile-explore-actions { display: grid; grid-template-columns: minmax(100px, 1fr) 44px; gap: 6px; }
  .mobile-lightning-button { min-width: 44px; width: 44px; min-height: 42px; padding: 6px; font-size: 19px; }
  .logo-copy strong, .logo-copy b { font-size: 29px; }
  .logo-copy small { display: none; }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1000px) {
  html.short-landscape-game, html.short-landscape-game body { width: 100%; height: var(--app-height, 100dvh); overflow: hidden; overscroll-behavior: none; }
  html.short-landscape-game body { position: fixed; inset: 0; min-height: 0; }
  html.short-landscape-game body.game-active .app-shell { position: fixed; inset: 0; width: var(--app-width, 100%); max-width: none; height: var(--app-height, 100dvh); margin: 0; padding: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); display: grid; grid-template-rows: 38px minmax(0, 1fr); gap: 3px; overflow: hidden; }
  html.short-landscape-game body.game-active main, html.short-landscape-game body.game-active .game-screen { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
  body.game-active .topbar { min-height: 0; margin: 0; justify-content: flex-end; }
  body.game-active .topbar .wordmark { display: none; }
  body.game-active .menu-button { min-height: 36px; padding: 5px 10px; }
  body.game-active .game-screen { grid-template-rows: 42px minmax(0, 1fr); gap: 4px; position: relative; }
  body.game-active .game-heading { min-height: 0; height: 42px; align-items: center; flex-direction: row; gap: 8px; padding-inline: 3px; }
  body.game-active .game-heading > div:first-child { min-width: 0; flex: 1 1 auto; }
  body.game-active .game-heading .kicker, body.game-active .game-heading .puzzle-copy { display: none; }
  body.game-active .game-heading h1 { max-width: 29vw; overflow: hidden; font-size: clamp(18px, 3.2vw, 27px); line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  body.game-active .score-strip { width: auto; align-self: center; }
  body.game-active .score-metrics { gap: 4px; }
  body.game-active .score-metrics > div { min-width: 61px; padding: 4px 7px; border-radius: 11px; box-shadow: inset 0 1px white, 0 3px 9px var(--shadow); }
  body.game-active .score-metrics span { font-size: 7px; }
  body.game-active .score-metrics strong { margin-top: 0; font-size: 13px; }
  body.game-active .help-button { width: 64px; min-width: 64px; height: 44px; min-height: 44px; padding: 5px 7px; border-radius: 12px; }
  body.game-active .help-button span:first-child { width: 18px; height: 18px; font-size: 10px; }
  body.game-active .instruction-card { display: none; }
  body.game-active .play-area { grid-row: 2; height: 100%; min-height: 0; position: relative; display: block; overflow: hidden; touch-action: pan-y; }
  body.game-active .board-wrap { width: 100%; height: 100%; margin: 0; padding: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, var(--compact-board-height, 283px)) 44px; gap: 4px; overflow: hidden; touch-action: pan-y; }
  body.game-active .board-wrap::before { content: ""; grid-row: 1; min-height: 0; border-radius: 18px; background: radial-gradient(circle at 18% 72%, rgba(255,255,255,.62), transparent 24%), radial-gradient(circle at 78% 30%, rgba(177,205,199,.26), transparent 30%); pointer-events: none; }
  body.game-active .board { grid-row: 2; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 6px 4px 5px; border-radius: 17px; touch-action: pan-y; }
  body.game-active .city-scene, body.game-active .buildings { padding-top: 6px; }
  body.game-active .mobile-explore-dock { grid-row: 3; position: static; width: 100%; min-height: 0; height: 44px; margin: 0; padding: 4px 4px 4px 11px; border-radius: 14px; box-shadow: 0 4px 12px rgba(52,70,69,.18), inset 0 1px white; touch-action: manipulation; }
  body.game-active .mobile-explore-dock.danger { padding: 3px 3px 3px 10px; }
  body.game-active .mobile-explore-status { font-size: 10px; }
  body.game-active .mobile-explore-button { min-width: 96px; min-height: 36px; height: 36px; padding: 6px 14px; touch-action: manipulation; }
  body.game-active .clue-key { position: absolute; z-index: 60; top: 4px; right: 4px; width: min(420px, 58vw); max-height: calc(100% - 8px); margin: 0; overflow: auto; overscroll-behavior: contain; background: rgba(248,251,249,.98); box-shadow: 0 10px 28px rgba(39,54,52,.3), inset 0 1px white; touch-action: pan-y; }
  body.game-active .clue-key-heading { padding-bottom: 5px; }
  body.game-active .clue-key-heading h2 { font-size: 14px; }
  body.game-active .clue-waterfall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.game-active .game-actions { display: none; }
  body.tutorial-active .game-screen { grid-template-columns: minmax(250px, 34vw) minmax(0, 1fr); grid-template-rows: 42px minmax(0, 1fr); column-gap: 6px; }
  body.tutorial-active .game-heading { grid-column: 1 / -1; }
  body.tutorial-active .instruction-card { grid-column: 1; grid-row: 2; align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "tutorial" "button" "actions"; align-content: center; gap: 6px; min-height: 0; padding: 8px; overflow: visible; }
  body.tutorial-active .explore-heading { align-items: flex-start; }
  body.tutorial-active .tutorial-panel-header { align-items: flex-end; flex-direction: column; gap: 3px; }
  body.tutorial-active .tutorial-progress { font-size: 8px; }
  body.tutorial-active .tutorial-city-intro { width: 100%; margin-block: 4px; }
  body.tutorial-active .explore-actions { grid-area: button; display: grid; grid-template-columns: minmax(0, 1fr); }
  body.tutorial-active .explore-actions.has-secondary { grid-template-columns: minmax(0, 1fr) 44px; }
  body.tutorial-active .explore-button { width: 100%; min-width: 0; min-height: 44px; }
  body.tutorial-active .play-area { grid-column: 2; grid-row: 2; }
  body.tutorial-active .board-wrap { grid-template-rows: minmax(0, 1fr) minmax(0, var(--compact-board-height, 283px)); }
  body.tutorial-active .board-wrap::before { grid-row: 1; }
  body.tutorial-active .board { grid-row: 2; }
  body.tutorial-active .mobile-explore-dock { display: none; }
}

@media (orientation: portrait) and (max-width: 700px) {
  html.portrait-mobile-game, html.portrait-mobile-game body { width: 100%; height: var(--app-height, 100dvh); overflow: hidden; overscroll-behavior: none; }
  html.portrait-mobile-game body { position: fixed; inset: 0; min-height: 0; }
  html.portrait-mobile-game body.game-active .app-shell { position: fixed; inset: 0; width: var(--app-width, 100%); max-width: none; height: var(--app-height, 100dvh); margin: 0; padding: max(5px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); display: grid; grid-template-rows: 40px minmax(0, 1fr); gap: 3px; overflow: hidden; }
  html.portrait-mobile-game body.game-active main, html.portrait-mobile-game body.game-active .game-screen { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
  body.game-active .topbar { min-height: 0; margin: 0; justify-content: flex-end; }
  body.game-active .topbar .wordmark { display: none; }
  body.game-active .menu-button { min-height: 38px; padding: 6px 11px; }
  body.game-active .game-screen { grid-template-rows: 46px minmax(0, 1fr); gap: 4px; position: relative; }
  body.game-active .game-heading { grid-row: 1; min-height: 0; height: 46px; align-items: center; flex-direction: row; gap: 6px; padding-inline: 3px; }
  body.game-active .game-heading > div:first-child { min-width: 0; flex: 1 1 auto; }
  body.game-active .game-heading .kicker, body.game-active .game-heading .puzzle-copy { display: none; }
  body.game-active .game-heading h1 { max-width: 100%; overflow: hidden; font-size: clamp(19px, 6vw, 27px); line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  body.game-active .puzzle-title-row { gap: 5px; }
  body.game-active .title-restart-button { width: 40px; height: 40px; font-size: 19px; }
  body.game-active .score-strip { width: auto; min-width: 0; flex: none; align-self: center; margin-left: auto; gap: 4px; }
  body.game-active .score-metrics { min-width: 0; flex: none; gap: 4px; }
  body.game-active .score-metrics > div { width: 50px; min-width: 50px; flex: none; padding: 4px; border-radius: 11px; box-shadow: inset 0 1px white, 0 3px 9px var(--shadow); }
  body.game-active .score-metrics span { font-size: 7px; }
  body.game-active .score-metrics strong { margin-top: 0; font-size: 13px; }
  body.game-active .help-button { width: 64px; min-width: 64px; height: 44px; min-height: 44px; padding: 5px 7px; border-radius: 12px; }
  body.game-active .help-button span:first-child { width: 18px; height: 18px; font-size: 10px; }
  body.game-active .play-area { grid-row: 2; height: 100%; min-height: 0; position: relative; display: block; overflow: hidden; touch-action: pan-y; }
  body.game-active .board-wrap { width: 100%; height: 100%; max-width: none; margin: 0; padding: 0; display: grid; align-content: start; grid-template-rows: clamp(8px, 4.5vh, 34px) minmax(0, var(--compact-board-height, 283px)) 50px; gap: 4px; overflow: hidden; touch-action: pan-y; }
  body.game-active .board-wrap::before { content: ""; grid-row: 1; min-height: 0; border-radius: 20px; background: radial-gradient(circle at 22% 70%, rgba(255,255,255,.7), transparent 26%), radial-gradient(circle at 76% 34%, rgba(177,205,199,.3), transparent 32%), linear-gradient(180deg, rgba(248,251,249,.08), rgba(223,232,228,.22)); pointer-events: none; }
  body.game-active .board { grid-row: 2; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 7px 4px 5px; border-radius: 18px; touch-action: pan-y; }
  body.game-active .city-scene, body.game-active .buildings { padding-top: 7px; }
  body.game-active .mobile-explore-dock { grid-row: 3; position: static; width: 100%; min-height: 0; height: 50px; margin: 0; padding: 4px 4px 4px 11px; border-radius: 14px; box-shadow: 0 4px 12px rgba(52,70,69,.18), inset 0 1px white; touch-action: manipulation; }
  body.game-active .mobile-explore-dock.danger { padding: 3px 3px 3px 10px; }
  body.game-active .mobile-explore-status { font-size: 10px; }
  body.game-active .mobile-explore-button { min-width: 100px; min-height: 42px; height: 42px; padding: 7px 15px; touch-action: manipulation; }
  body.game-active .clue-key { position: absolute; z-index: 60; inset: 4px; width: auto; max-height: calc(100% - 8px); margin: 0; overflow: auto; overscroll-behavior: contain; background: rgba(248,251,249,.98); box-shadow: 0 10px 28px rgba(39,54,52,.3), inset 0 1px white; touch-action: pan-y; }
  body.game-active .clue-key-heading { padding-bottom: 5px; }
  body.game-active .clue-key-heading h2 { font-size: 15px; }
  body.game-active .clue-waterfall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.game-active .game-actions { display: none; }
  body.tutorial-active .game-screen { grid-template-rows: 46px auto minmax(0, 1fr); }
  body.tutorial-active .instruction-card { grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "tutorial button"; gap: 4px 8px; min-height: 0; max-height: none; padding: 7px 9px; overflow: visible; text-align: left; }
  body.tutorial-active .explore-heading { align-items: center; gap: 6px; }
  body.tutorial-active .tutorial-panel-header { min-width: 0; flex: 1; justify-content: space-between; }
  body.tutorial-active .tutorial-progress { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  body.tutorial-active .tutorial-city-intro { width: min(290px, 100%); margin: 4px auto 5px; }
  body.tutorial-active .explore-actions { grid-area: button; display: grid; grid-template-columns: minmax(104px, 1fr); align-self: stretch; }
  body.tutorial-active .explore-actions.has-secondary { grid-template-columns: minmax(104px, 1fr) 44px; }
  body.tutorial-active .explore-button { min-width: 104px; min-height: 48px; height: 100%; padding-inline: 12px; }
  body.tutorial-active .play-area { grid-row: 3; }
  body.tutorial-active .board-wrap { grid-template-rows: clamp(4px, 2vh, 14px) minmax(0, var(--compact-board-height, 283px)); }
  body.tutorial-active .board-wrap::before { grid-row: 1; }
  body.tutorial-active .board { grid-row: 2; }
  body.tutorial-active .mobile-explore-dock { display: none; }
}

@media (max-width: 500px) {
  .clue-waterfall { grid-template-columns: minmax(0, 1fr); }
  .key-step { grid-template-columns: 26px 42px minmax(0, 1fr); }
  .key-step small { font-size: 10px; }
}

@media (orientation: portrait) and (max-width: 340px) {
  body.game-active .game-heading > div:first-child { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes reveal-scene { from { opacity: 1; } to { opacity: 0; } }
  @keyframes danger-pulse { 50% { box-shadow: inset 0 2px rgba(255,255,255,.5), 0 0 0 7px rgba(255,216,77,.28), 0 12px 25px rgba(92,19,13,.42); transform: scale(1.025); } }
  @keyframes risk-glow { 50% { text-shadow: 0 0 14px rgba(255,255,255,.6); } }
  @keyframes selection-breathe { 0%,100% { filter: drop-shadow(0 10px 8px rgba(42,78,74,.24)) brightness(1.025); } 50% { filter: drop-shadow(0 10px 9px rgba(42,78,74,.3)) brightness(1.045); } }
  @keyframes story-build { 0% { opacity: 0; transform: translateY(18px) scaleY(.18); } 58% { opacity: 1; transform: translateY(-3px) scaleY(1.08); } 100% { transform: translateY(0) scaleY(1); } }
  @keyframes discovery-satisfied { 0%,100% { transform: scale(1); } 45% { transform: scale(1.12); filter: brightness(1.18); } }
  @keyframes building-lock { 0% { transform: translateY(-7px) scale(1.04); } 48% { transform: translateY(3px) scale(.98); } 72% { transform: translateY(-2px) scale(1.02); } 100% { transform: translateY(0) scale(1); } }
  @keyframes building-color { from { --building: #aaa8a2; } to { --building: var(--authored-building); } }
  @keyframes window-light { from { opacity: .2; filter: brightness(.7); } to { opacity: 1; filter: brightness(1.18); } }
  @keyframes toast-arrive { from { opacity: 0; transform: translate(-50%, 12px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
  @keyframes city-awaken { 0% { transform: translateY(3px); filter: saturate(.8); } 60% { transform: translateY(-2px); filter: saturate(1.16) brightness(1.06); } 100% { transform: translateY(0); filter: none; } }
  @keyframes lane-awaken { 0% { opacity: .76; transform: translateY(5px); } 100% { opacity: 1; transform: translateY(0); } }
  @keyframes result-mark-arrive { 0% { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.55); } 65% { opacity: 1; transform: translateX(-50%) translateY(-3px) scale(1.08); } 100% { transform: translateX(-50%) translateY(0) scale(1); } }
  @keyframes result-building-correct { 0% { filter: grayscale(1) saturate(0); } 100% { filter: drop-shadow(0 0 9px rgba(55,126,99,.42)) drop-shadow(0 8px 7px rgba(51,69,68,.18)); } }
  @keyframes result-building-wrong { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-3px); } 65% { transform: translateX(3px); } }
  @keyframes risk-tremble { 25% { transform: rotate(-.45deg); } 75% { transform: rotate(.45deg); } }
  @keyframes invitation-nudge { 0%,58%,100% { transform: translateY(0); } 72% { transform: translateY(-4px); } 84% { transform: translateY(-1px); } }
  button { transition: transform .16s ease, filter .16s ease, opacity .16s ease; }
  button:not(:disabled):hover { filter: brightness(1.025); }
  button:not(:disabled):active { transform: translateY(2px); }
  .primary-button.danger:not(:disabled) { animation: danger-pulse 1.05s ease-in-out infinite; }
  .explore-context.danger { animation: risk-glow 1.05s ease-in-out infinite; }
  .primary-button.danger:not(:disabled):active { animation: none; transform: translateY(2px); }
  .scene-lane.newly-revealed::after { animation: reveal-scene .85s ease both; }
  .building.selected { animation: selection-breathe 1.35s ease-in-out infinite; transition: transform .17s ease; }
  .clue-floor.newly-discovered { transform-origin: 50% 100%; animation: story-build .48s cubic-bezier(.2,.9,.25,1.25) both; }
  .clue-floor.newly-satisfied { animation: discovery-satisfied .55s ease both; }
  .building.just-locked { animation: building-lock .7s cubic-bezier(.2,.9,.3,1.18) both, building-color 1s ease both; }
  .building.just-locked .windows i { animation: window-light .72s ease both; animation-delay: calc(var(--address-index, 0) * 25ms); }
  .building.risk-threshold-cue .roof-story { transform-origin: 50% 100%; animation: risk-tremble .3s ease-in-out 1; }
  .board.onboarding-board.no-selection .building:not(.locked) { animation: invitation-nudge 1.25s ease both; animation-delay: calc(var(--address-index, 0) * 55ms); }
  .discovery-toast:not([hidden]) { animation: toast-arrive .28s cubic-bezier(.2,.9,.25,1.15) both; }
  .board.city-solved { animation: city-awaken 1.25s ease both; }
  .board.city-solved .building-slot { animation: lane-awaken .72s ease both; animation-delay: calc(var(--address-index) * 65ms); }
  .result-address-marker { animation: result-mark-arrive .42s cubic-bezier(.2,.9,.25,1.2) both; }
  .building.result-correct { animation: result-building-correct .5s ease both; }
  .building.result-incorrect { animation: result-building-wrong .38s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  .building.just-locked, .building.just-locked .windows i { animation: none !important; }
  .result-address-marker, .building.result-correct, .building.result-incorrect { animation: none !important; transition: none !important; }
  .result-card.is-solved .result-skyline span { animation: none; }
}
