:root{--ink:#18324a;--muted:#526f85;--sky:#4db6ff;--blue:#2466c9;--green:#67c56b;--line:#d4e4f0;--panel:#fff;--shadow:0 8px 24px rgba(32,77,113,.13);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;color:var(--ink);background:linear-gradient(180deg,#e8f6ff,#f8fbff)}
button{font:inherit;cursor:pointer}
img{max-width:100%;display:block}
button:focus-visible,[role="button"]:focus-visible{outline:3px solid #efa800;outline-offset:2px}
.hidden{display:none!important}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.app-shell{height:100vh;height:100dvh;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:48px;min-height:48px;display:flex;justify-content:space-between;align-items:center;padding:5px 14px;background:rgba(255,255,255,.87);border-bottom:1px solid var(--line);z-index:3}
.brand-button{border:0;background:none;display:flex;align-items:center;gap:9px;color:var(--ink);font-weight:800}
.brand-mark{width:33px;height:33px;border-radius:11px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#57c1ff,#2571d0)}
.brand-copy{font-size:14px}.brand-copy strong{color:var(--blue)}
.top-actions{display:flex;align-items:center;gap:7px}
.version{border:1px solid var(--line);color:var(--muted);background:#fff;padding:4px 8px;border-radius:20px;font-size:11px}
.icon-btn{width:33px;height:33px;border:1px solid var(--line);border-radius:11px;background:white;color:var(--ink)}
.main-area{flex:1;min-height:0;min-width:0;display:flex;padding:7px;overflow:hidden}
.screen{display:none!important;min-width:0;min-height:0;width:100%;height:100%}
.screen.is-active{display:block!important}
#screen-game.is-active{display:grid!important;grid-template-rows:auto auto 6px minmax(0,1fr);row-gap:5px}
.scroll-screen.is-active{overflow-y:auto;overflow-x:hidden}
.panel{border:1px solid #dce9f2;border-radius:16px;background:rgba(255,255,255,.97);box-shadow:var(--shadow);padding:9px;min-height:0;min-width:0}
.btn-accent,.btn-muted{min-height:38px;padding:7px 10px;border:1px solid transparent;border-radius:12px;font-size:12px;font-weight:800;line-height:1.2}
.btn-accent{color:#fff;background:linear-gradient(115deg,#42b2ff,#286cce)}
.btn-muted{border-color:var(--line);background:white;color:var(--ink)}
.btn-accent:active,.btn-muted:active{transform:translateY(1px)}
/* Title: explicit grid areas prevent mobile content from disappearing above the scene. */
#screen-title.is-active{display:flex!important;flex-direction:column;gap:4px}
.title-layout{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"controls scene";gap:9px}
.title-left,.title-right{min-width:0;min-height:0;border:1px solid #dce9f2;border-radius:20px;background:rgba(255,255,255,.94);box-shadow:var(--shadow);overflow:hidden;position:relative}
.title-left{grid-area:controls;padding:clamp(10px,1.3vw,20px);display:flex;flex-direction:column;justify-content:center;gap:5px}
.title-right{grid-area:scene;background:linear-gradient(180deg,#eff9ff,#fff);display:grid;place-items:center}
.title-bg{position:absolute;bottom:0;left:0;width:100%;height:100%;object-fit:contain;object-position:center bottom}
.title-mayor{position:absolute;bottom:0;right:5%;width:36%;height:90%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 10px 14px rgba(14,50,78,.25));animation:mayor-wiggle 4s ease-in-out infinite}
.title-burst{position:absolute;top:5%;right:10%;width:90px;height:90px;border-radius:50%;background:radial-gradient(circle,rgba(255,216,90,.55),transparent 68%)}
.eyebrow{margin:0;color:#1455b6;letter-spacing:.12em;font-weight:900;font-size:11px}
.title-logo{width:min(100%,470px);height:clamp(80px,22vh,205px);object-fit:contain;object-position:left center;filter:drop-shadow(0 8px 12px rgba(35,90,165,.13))}
.tagline{margin:0 0 5px;font-size:clamp(15px,1.7vw,21px);font-weight:900}
.hero-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.hero-btn{border:1px solid var(--line);min-height:64px;border-radius:12px;padding:9px;display:grid;grid-template-columns:30px 1fr;grid-template-rows:auto auto;column-gap:6px;text-align:left;background:#fff;align-content:center}
.hero-btn span{grid-row:span 2;align-self:center;font-size:20px}.hero-btn strong{font-size:14px;line-height:1.25}.hero-btn small{font-size:10px;color:var(--muted);line-height:1.25}
.hero-btn--timed{background:#eaf6ff}.hero-btn--relaxed{background:#edffed}.hero-btn--daily{background:#fff8e9}
.continue-btn{grid-column:1/-1;border:0;padding:8px;border-radius:12px;color:#fff;background:#25435d;font-weight:800;min-height:35px}
.secondary-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.secondary-actions button{background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px;font-size:12px;font-weight:800;min-height:34px}
.mini-records{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:3px}
.mini-record{padding:6px 8px;border:1px solid var(--line);border-radius:10px;background:#f7fbff;font-size:10px;color:var(--muted);min-width:0;overflow:hidden}
.mini-record strong{display:block;margin-top:3px;font-size:14px;color:var(--ink);line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.title-mini-tip{font-size:10px;color:var(--muted)}
.title-footer{flex:none;font-size:10px;text-align:center;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Game status is compact, not three far-apart giant empty metric boxes. */
.game-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:39px}
.game-top .mode-label{margin:0;color:#2466c9;letter-spacing:.05em;font-weight:800;font-size:11px}
.game-top .turn-label{margin:1px 0 0;font-size:20px;line-height:1.2}
.clock-box{display:flex;align-items:baseline;gap:6px;min-width:93px;justify-content:center;padding:6px 10px;border:1px solid var(--line);border-radius:12px;background:#fff}
.clock-box span{font-size:11px;color:var(--muted)}.clock-box strong{font-size:21px}
.hud{display:flex;gap:7px;justify-content:flex-start;min-height:0}
.stat-card{display:flex;justify-content:space-between;align-items:center;gap:9px;min-width:0;width:clamp(95px,12vw,170px);padding:6px 10px;border-radius:12px;border:1px solid var(--line);background:#fff;box-shadow:0 3px 9px #245b8910}
.stat-card .label{color:var(--muted);font-size:13px;white-space:nowrap}.stat-card .value{font-size:22px;line-height:1.1}
.time-track{width:100%;border-radius:50px;background:#d5e4f5;overflow:hidden}
.time-fill{height:100%;width:100%;background:linear-gradient(90deg,#65c66b,#ffd651,#ff8f49);transition:width .2s linear}
.play-layout{min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.board-panel{min-height:0;display:flex;flex-direction:column;overflow:hidden}
.section-line{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:23px;font-size:14px;font-weight:850;margin-bottom:5px}
.section-line small{font-size:11px;color:var(--muted)}
#boardStatus{font-size:12px;color:#285b80;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:60%}
.board-wrap{flex:1;min-height:0;min-width:0;display:grid;place-items:center;overflow:hidden;padding:4px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(160deg,#eef8ff,#fcffff)}
.city-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:4px;width:min(100%,370px);aspect-ratio:1;min-width:0;min-height:0}
.board-cell{padding:0;border:1px dashed #bed7ea;border-radius:10px;background:#f4faff;position:relative;overflow:hidden;cursor:pointer;min-width:0;min-height:0;touch-action:none}
.board-cell.is-target{border:3px solid #1a80eb!important;box-shadow:inset 0 0 0 2px #fff;background:#c9e9ff}
.board-cell.selected-empty{border-color:#ffa51c}
.board-cell.is-best{background:#e7fcea;border-color:#62c56e}
.board-cell.is-good{background:#fffae6;border-color:#d2aa14}
.board-cell.is-risky{background:#fff3eb;border-color:#f9a18b}
.board-cell.is-best::after,.board-cell.is-good::after,.board-cell.is-risky::after{position:absolute;right:1px;top:1px;border-radius:4px;color:white;font-size:8px;padding:2px}
.board-cell.is-best::after{content:'◎';background:#4cbd62}.board-cell.is-good::after{content:'○';background:#c8a11b}.board-cell.is-risky::after{content:'!';background:#df5f60}
.tile-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#e8f6ff}
.tile-overlay{position:absolute;bottom:0;left:0;right:0;text-align:center;color:white;font-size:10px;padding:4px 1px 2px;background:linear-gradient(transparent,#13364ada)}
.tile-badge{display:none}.tile-name{font-weight:900}
.empty-mark{position:absolute;inset:0;display:grid;place-items:center;color:#9fc0d5;font-size:20px}
.board-tip{display:none}
.placement-assist{margin-top:5px;padding:6px 9px;background:#fffcf0;border:1px solid #efdf9a;border-radius:10px;font-size:12px;line-height:1.35;flex:none;max-height:52px;overflow:hidden}
.placement-assist strong{font-size:12px}.placement-assist .mini-line{display:none}
.turn-feed{flex:none;min-height:104px;margin-top:6px;padding:8px 10px;border:1px solid #cfe0f0;border-radius:14px;background:linear-gradient(180deg,#fdfefe,#eef8ff);box-shadow:0 4px 12px rgba(36,91,137,.08);overflow:hidden}
.citizen-voice-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:10px;align-items:center}
.citizen-voice-face{width:72px;height:72px;border-radius:20px;display:grid;place-items:center;background:linear-gradient(180deg,#ffffff,#dff2ff);border:1px solid #bfdaec;overflow:hidden;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.citizen-voice-face img{width:100%;height:100%;object-fit:contain}
.citizen-voice-face span{font-size:34px}
.citizen-voice-copy{min-width:0}
.citizen-voice-kicker{font-size:11px;font-weight:900;letter-spacing:.08em;color:#2466c9;margin-bottom:4px}
.citizen-voice-text{font-size:15px;font-weight:900;line-height:1.38;color:#17324a;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.feed-log{margin-top:6px;padding-top:6px;border-top:1px dashed #ccdfec;display:grid;gap:2px}
.feed-line{font-size:11px;line-height:1.32;color:#46657d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.citizen-voice--happy .citizen-voice-face{background:linear-gradient(180deg,#fffef8,#fff3cd);border-color:#ead58c}
.citizen-voice--worried .citizen-voice-face{background:linear-gradient(180deg,#fff,#e8f1ff);border-color:#b9d0ef}
.citizen-voice--angry .citizen-voice-face{background:linear-gradient(180deg,#fff7f5,#ffe1d9);border-color:#f1b9ab}
.citizen-voice--sad .citizen-voice-face{background:linear-gradient(180deg,#fff,#edf0f5);border-color:#cad3df}
.citizen-voice--surprised .citizen-voice-face{background:linear-gradient(180deg,#fffefb,#efe6ff);border-color:#d7c5f3}
.side-panel{min-height:0;display:flex;flex-direction:column;gap:7px}
.cards-panel,.preview-panel{min-height:0;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.cards-panel{flex:1}
.preview-panel{flex:0 0 125px}
.helper-badge,#previewBadge{background:#f3f8ff;border:1px solid var(--line);border-radius:12px;color:var(--muted);font-size:10px;padding:3px 6px;white-space:nowrap}
.card-row{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.card{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:12px;border:1px solid #d4e4f0;background:#fff;box-shadow:0 3px 10px #194f7520;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.card.selected{border:3px solid #40a4f1;background:#effaff}
.card.dragging{opacity:.64;cursor:grabbing}
.card img{flex:1 1 auto;min-height:0;height:30px;width:100%;object-fit:contain;background:#f0f8fc;pointer-events:none}
.card-body{flex:none;padding:5px}
.card h3{font-size:13px;line-height:1.2;margin:0 0 2px}
.card p{margin:0;color:var(--muted);font-size:11px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-meta{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px}
.meta-chip{font-size:10px;line-height:1.2;padding:2px 4px;border-radius:6px;color:#2664ac;background:#eaf5ff}
.action-bar{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px;flex:none}
.preview-box{flex:1;min-height:0;overflow:hidden}
.preview-hero{height:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(70px,27%);gap:8px;align-items:center}
.preview-copy{min-width:0;min-height:0;overflow:hidden}
.preview-copy h3{font-size:16px;margin:0 0 4px}
.preview-copy p{font-size:12px;color:var(--muted);margin:0 0 5px}
.preview-stats{display:flex;gap:4px;flex-wrap:wrap}
.stat-chip{font-size:11px;background:#edf7ff;border-radius:6px;color:#195c9c;padding:3px 5px}
.preview-hero img{height:100%;width:100%;object-fit:contain;border-radius:10px}
.preview-list,.preview-forecast{display:none}
.preview-empty{height:100%;font-size:12px;color:var(--muted);padding:8px;border:1px dashed var(--line);border-radius:10px;background:#f6fbff}
.drag-ghost{position:fixed;z-index:1100;pointer-events:none;left:-200px;top:-200px;transform:translate(-50%,-65%) rotate(-3deg);width:104px;padding:5px;border:3px solid #48b2ff;background:#fff;border-radius:12px;box-shadow:0 16px 32px #183e5c73;display:flex;flex-direction:column;gap:2px}
.drag-ghost img{width:100%;height:70px;object-fit:contain}.drag-ghost strong{text-align:center;font-size:12px}
/* Modal, including central result popup */
.modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:9px}
.modal.hidden{display:none!important}
.modal-backdrop{position:absolute;inset:0;background:#152d4885;backdrop-filter:blur(3px)}
.modal-card{z-index:1;position:relative;width:min(540px,96vw);max-height:95dvh;overflow:auto;border-radius:18px;background:#fff;box-shadow:0 20px 60px #142c4d65;padding:18px}
.modal-kicker{font-size:11px;color:#2466c9;font-weight:800}.modal-card h2{font-size:20px;margin:4px 0 7px}
.modal-body{color:var(--muted);font-size:14px;line-height:1.55;max-height:65vh;overflow-y:auto}
.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}
.modal.result-mode .modal-card{width:min(1000px,96vw);height:min(780px,94dvh);max-height:94dvh;overflow:hidden;padding:12px}
.modal.result-mode .modal-kicker,.modal.result-mode #modalTitle,.modal.result-mode .modal-actions{display:none}
.modal.result-mode .modal-body{height:100%;max-height:none;overflow:hidden;color:var(--ink)}
.result-wrap{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,33%) auto minmax(0,1fr) auto;gap:7px}
.result-popup-head{display:flex;align-items:start;justify-content:space-between;gap:10px}
.result-kicker{font-size:10px;letter-spacing:.1em;color:#2466c9;font-weight:900;margin:0 0 3px}
.result-title{font-size:clamp(22px,2.5vw,31px);line-height:1.2;margin:0 0 3px}
.result-desc{font-size:13px;line-height:1.35;margin:0;color:var(--muted)}
.result-close{flex:none;width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:23px}
.result-hero{min-height:0;display:grid;grid-template-columns:1.25fr 1fr;gap:7px}
.result-city,.result-mayor{min-height:0;border:1px solid var(--line);background:linear-gradient(135deg,#eaf7ff,#fff);border-radius:12px;display:grid;place-items:center;overflow:hidden}
.result-city img,.result-mayor img{height:100%;width:100%;object-fit:contain}
.result-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.result-stat{border:1px solid var(--line);border-radius:11px;padding:7px 10px;background:#f8fcff}
.result-stat .label{font-size:11px;color:var(--muted)}.result-stat .value{font-size:24px;font-weight:900}
.result-layout{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:7px;min-height:0}
.board-summary,.result-meta{min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;padding:8px;background:#fff}
.board-summary{display:flex;flex-direction:column;align-items:stretch}
.board-summary .section-line{font-size:12px;flex:none;min-height:18px}
.event-chip{color:var(--muted);font-size:11px}
.result-board{min-height:0;flex:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:3px;align-self:center;aspect-ratio:1;max-width:100%;height:100%}
.result-board .board-cell{border-radius:5px}.result-board .tile-overlay{padding:1px;font-size:8px}.result-board .empty-mark{font-size:10px}
.result-meta{overflow:auto;display:flex;flex-direction:column;gap:6px}
.story-box{font-size:12px;line-height:1.5}.story-box h3{font-size:13px;margin:0 0 4px}.story-box p{margin:0;color:var(--muted)}
.result-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0}
.result-actions button{min-height:35px}
.citizen-result-voice{margin-top:7px;display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;align-items:center;padding:7px 8px;border:1px solid var(--line);border-radius:12px;background:#f8fbff}
.citizen-result-voice img{width:56px;height:56px;object-fit:contain;border-radius:14px;background:linear-gradient(180deg,#fff,#e5f2ff);border:1px solid #cadceb}
.citizen-result-voice p{margin:0!important;color:var(--ink)!important;font-size:12px;line-height:1.45;font-weight:700}
.citizen-result-voice--happy img{background:linear-gradient(180deg,#fffef8,#fff3cd)}
.citizen-result-voice--worried img{background:linear-gradient(180deg,#fff,#e8f1ff)}
.citizen-result-voice--angry img{background:linear-gradient(180deg,#fff7f5,#ffe1d9)}
.citizen-result-voice--sad img{background:linear-gradient(180deg,#fff,#edf0f5)}
.citizen-result-voice--surprised img{background:linear-gradient(180deg,#fffefb,#efe6ff)}
/* Gallery is a separate explicitly scrollable collection view */
#screen-gallery{overflow-y:auto}
.gallery-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.gallery-head .result-title{font-size:25px}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.gallery-card{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}
.gallery-card img{width:100%;aspect-ratio:1.5;object-fit:contain}
.gallery-card .body{padding:9px}.gallery-card h3{margin:0 0 6px;font-size:14px}.gallery-card p{margin:0;font-size:11px;color:var(--muted)}
.gallery-card.locked img{filter:grayscale(1) brightness(.6)}
.gallery-tag{font-size:10px;color:#1c66c5}
.toast{position:fixed;z-index:1001;left:50%;bottom:10px;transform:translate(-50%,10px);max-width:94vw;background:#183e5d;color:white;border-radius:15px;padding:9px 13px;font-size:12px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translate(-50%,0)}
@keyframes mayor-wiggle{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
/* Mobile portrait: board ABOVE the three horizontal cards; everything in one viewport. */
@media (max-width:700px) and (orientation:portrait){
 .topbar{height:43px;min-height:43px;padding:4px 7px}
 .brand-mark{width:30px;height:30px}.brand-copy{font-size:12px}
 .icon-btn{width:30px;height:30px}.version{font-size:10px}
 .main-area{padding:5px}
 #screen-title .title-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,39%) minmax(0,61%);grid-template-areas:"scene" "controls";gap:5px}
 .title-right,.title-left{border-radius:13px}.title-left{padding:7px 9px;gap:3px}
 .title-bg{object-position:center bottom}.title-mayor{right:8%;height:95%;width:31%}
 .title-logo{height:clamp(66px,15vh,128px);width:100%;object-position:center center}
 .eyebrow{font-size:9px}.tagline{font-size:13px;text-align:center;margin:0 0 3px}
 .hero-buttons{gap:5px}.hero-btn{min-height:48px;padding:5px 7px;border-radius:10px;grid-template-columns:22px 1fr;column-gap:4px}
 .hero-btn span{font-size:16px}.hero-btn strong{font-size:12px}.hero-btn small{font-size:9px}
 .secondary-actions{gap:5px}.secondary-actions button{min-height:32px;padding:5px;font-size:11px}
 .mini-records{margin-top:0;gap:4px}.mini-record{padding:5px}.mini-record strong{font-size:12px}
 .title-mini-tip{font-size:9px}.title-footer{font-size:9px}
 #screen-game.is-active{row-gap:4px;grid-template-rows:auto auto 5px minmax(0,1fr)}
 .game-top{min-height:29px}.game-top .turn-label{font-size:16px}.clock-box{padding:4px 7px;min-width:80px}.clock-box strong{font-size:16px}
 .hud{gap:4px}.stat-card{flex:1;width:auto;padding:5px 7px;min-width:0}.stat-card .label{font-size:11px}.stat-card .value{font-size:16px}
 .play-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,52%) minmax(0,48%);gap:5px}
 .panel{padding:6px;border-radius:12px}
 .section-line{font-size:11px;min-height:18px;margin-bottom:3px}.section-line small{font-size:9px}
 #boardStatus{font-size:9px;max-width:55%}
 .board-panel{height:100%}.board-wrap{padding:2px;border-radius:9px}.city-board{gap:3px}
 .board-cell{border-radius:7px}.tile-overlay{font-size:8px;padding:2px}.empty-mark{font-size:16px}
 .placement-assist{display:none}
 .turn-feed{display:block;min-height:72px;margin-top:4px;padding:5px 7px;border-radius:11px}
 .citizen-voice-card{grid-template-columns:52px minmax(0,1fr);gap:7px}.citizen-voice-face{width:52px;height:52px;border-radius:14px}
 .citizen-voice-kicker{font-size:9px;margin-bottom:2px}.citizen-voice-text{font-size:12px;line-height:1.28;-webkit-line-clamp:2}.feed-log{display:none}
 .side-panel{height:100%;gap:5px}
 .cards-panel{min-height:0;flex:1}.preview-panel{flex:0 0 70px}
 .card-row{gap:4px}.card{border-radius:9px}.card-body{padding:3px}
 .card h3{font-size:12px;margin:0}.card p{display:none}.card-meta{gap:2px;margin-top:2px}.meta-chip{font-size:9px;padding:1px 3px}
 .action-bar{margin-top:4px;gap:5px}.action-bar button{min-height:34px;font-size:10px;padding:4px 5px}
 .preview-hero{grid-template-columns:1fr 60px;gap:5px}.preview-copy h3{font-size:13px;margin:0 0 2px}.preview-copy p{display:none}.stat-chip{font-size:10px;padding:2px 4px}
 .preview-empty{padding:4px 7px;font-size:10px;line-height:1.22}
 .modal.result-mode .modal-card{width:97vw;height:94dvh;padding:8px}
 .result-wrap{grid-template-rows:auto minmax(0,27%) auto minmax(0,1fr) auto;gap:5px}
 .result-hero{grid-template-columns:1.2fr 1fr;gap:5px}
 .result-title{font-size:19px}.result-desc{font-size:11px}.result-close{width:30px;height:30px;font-size:19px}
 .result-stats{gap:4px}.result-stat{padding:5px;border-radius:8px}.result-stat .label{font-size:10px}.result-stat .value{font-size:16px}
 .result-layout{grid-template-columns:1fr 1fr;gap:5px}.board-summary,.result-meta{padding:5px;border-radius:9px}
 .board-summary .section-line{font-size:10px;display:block}.event-chip{display:none}
 .story-box h3{font-size:11px}.story-box{font-size:11px;line-height:1.32}
 .citizen-result-voice{grid-template-columns:44px minmax(0,1fr);padding:5px;gap:6px}.citizen-result-voice img{width:44px;height:44px}.citizen-result-voice p{font-size:11px;line-height:1.35}
 .result-actions{grid-template-columns:1fr 1fr;gap:4px}.result-actions button{min-height:31px;font-size:10px}
}
/* Landscape phones and squat laptop windows */
@media (max-height:560px) and (orientation:landscape){
 .topbar{height:35px;min-height:35px}.brand-mark{width:27px;height:27px}.icon-btn{height:27px;width:27px}
 .main-area{padding:4px}
 #screen-game.is-active{row-gap:3px;grid-template-rows:auto auto 3px minmax(0,1fr)}
 .game-top{min-height:25px}.game-top .turn-label{font-size:14px}.clock-box{padding:2px 6px}.clock-box strong{font-size:14px}
 .stat-card{padding:3px 7px}.stat-card .label{font-size:10px}.stat-card .value{font-size:13px}
 .play-layout{grid-template-columns:1fr 1fr;gap:5px}
 .panel{padding:5px}.section-line{font-size:10px;min-height:15px;margin-bottom:2px}
 .board-tip,.placement-assist{display:none}
 .turn-feed{display:block;min-height:60px;margin-top:3px;padding:4px 6px;border-radius:10px}
 .citizen-voice-card{grid-template-columns:42px minmax(0,1fr);gap:6px}.citizen-voice-face{width:42px;height:42px;border-radius:12px}
 .citizen-voice-kicker{font-size:8px;margin-bottom:1px}.citizen-voice-text{font-size:10px;line-height:1.22;-webkit-line-clamp:2}.feed-log{display:none}
 .card h3{font-size:10px}.card p{display:none}.card-body{padding:2px}.meta-chip{font-size:8px;padding:1px 3px}
 .action-bar{margin-top:3px}.action-bar button{min-height:27px;padding:3px;font-size:9px}
 .side-panel{gap:4px}.preview-panel{flex:0 0 74px}.preview-hero{grid-template-columns:1fr 48px}.preview-copy h3{font-size:10px}.preview-copy p{display:none}.stat-chip{font-size:8px;padding:1px 3px}
 .title-logo{height:clamp(48px,23vh,90px)}.title-left{gap:2px;padding:7px}.title-right{min-height:0}
 .hero-btn{min-height:40px;padding:4px}.hero-btn strong{font-size:12px}.hero-btn small{font-size:9px}.mini-records,.title-mini-tip{display:none}
 .modal.result-mode .modal-card{height:96dvh}.result-wrap{grid-template-rows:auto minmax(0,23%) auto minmax(0,1fr) auto;gap:4px}
 .result-title{font-size:17px}.result-desc{font-size:11px}.result-stats{gap:3px}.result-stat{padding:3px}.result-stat .value{font-size:15px}
 .result-actions button{min-height:28px;font-size:10px}.result-layout{grid-template-columns:1fr 1fr}
}
@media (max-height:660px) and (orientation:portrait){
 #screen-title .title-layout{grid-template-rows:minmax(0,27%) minmax(0,73%)}
 .title-logo{height:64px}.title-left{gap:2px}
 .hero-btn{min-height:40px}.hero-btn small{display:none}
 .secondary-actions button{min-height:27px}.title-mini-tip{display:none}
 .mini-record{padding:3px}.mini-record strong{font-size:11px}
 .play-layout{grid-template-rows:minmax(0,50%) minmax(0,50%)}
 .preview-panel{flex-basis:57px}.action-bar button{min-height:30px}
 .turn-feed{min-height:68px}.citizen-voice-text{font-size:11px}
 .modal.result-mode .result-hero{min-height:0}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

@media (min-width:701px) and (min-height:560px){
 .side-panel{height:100%}
 .cards-panel{flex:0 0 60%}
 .preview-panel{flex:1;min-height:0}
 .preview-list,.preview-forecast{display:block}
 .preview-hero{grid-template-columns:minmax(0,1fr) minmax(145px,27%);align-items:start}
 .preview-hero img{max-height:190px}
 .preview-copy{overflow:auto;max-height:100%}
 .preview-forecast{padding:6px;margin-top:5px;border:1px solid var(--line);border-radius:8px}
 .preview-forecast h4{margin:0 0 4px;font-size:11px}
 .preview-forecast p{font-size:10px;margin:0}
 .preview-best-list{display:none}
 .preview-list{font-size:10px;margin:6px 0 0;padding-left:17px;color:var(--muted)}
}

/* v0.4.0 — city-building feedback. All animations are purely visual. */
.city-board{position:relative;isolation:isolate}
.city-board .board-cell{z-index:1}
.city-connections{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none;overflow:visible}
.city-link{stroke-width:5;stroke-linecap:round;opacity:.88;paint-order:stroke;stroke-dasharray:3 1;filter:drop-shadow(0 0 2px #fff);animation:city-line-in .48s ease both}
.city-link.link-road{stroke:#3ba8fd;stroke-width:6}
.city-link.link-green{stroke:#3dc969}
.city-link.link-market{stroke:#f4a63a}
.city-link.link-civic{stroke:#58c6d4}
.network-status{display:inline-block;white-space:nowrap;color:#2073a4!important;background:#e8f7ff;border:1px solid #d4eaf6;padding:2px 5px;border-radius:8px;font-weight:800}
.board-cell.is-building{animation:build-appear .68s cubic-bezier(.18,.8,.3,1.18) both;z-index:2}
.board-cell.is-building .tile-bg{animation:build-picture .64s ease both}
.board-cell.is-neighbor-boost{animation:neighbor-shine .72s ease both}
.construction-stamp{position:absolute;top:5%;left:50%;z-index:5;background:#fff3b8;border:1px solid #e5b725;color:#735412;box-shadow:0 2px 9px #1732464a;font-size:clamp(8px,.9vw,11px);font-weight:900;line-height:1.25;padding:2px 5px;border-radius:8px;white-space:nowrap;pointer-events:none;animation:build-label .8s ease-out forwards}
.construction-spark{position:absolute;left:50%;top:53%;z-index:5;pointer-events:none;color:#ffd43b;font-size:17px;text-shadow:0 1px 2px #8e570f;animation:build-spark .74s ease-out forwards}
.stat-card.stat-gain{animation:stat-positive .75s ease}
.stat-card.stat-loss{animation:stat-negative .75s ease}
@keyframes build-appear{0%{transform:scale(.65);filter:brightness(1.45);opacity:.5}52%{transform:scale(1.07)}100%{transform:scale(1);filter:brightness(1);opacity:1}}
@keyframes build-picture{0%{filter:brightness(1.28) saturate(1.06)}100%{filter:brightness(1)}}
@keyframes neighbor-shine{0%,100%{box-shadow:none}38%{box-shadow:inset 0 0 0 3px #f4d356,0 0 0 3px #ffc84c80}}
@keyframes build-label{0%{opacity:0;transform:translate(-50%,10px) scale(.75)}22%{opacity:1;transform:translate(-50%,-9px) scale(1)}65%{opacity:1;transform:translate(-50%,-16px)}100%{opacity:0;transform:translate(-50%,-25px)}}
@keyframes build-spark{0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}25%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.4)}}
@keyframes city-line-in{from{opacity:0;stroke-dasharray:1 60}to{opacity:.88;stroke-dasharray:3 1}}
@keyframes stat-positive{0%,100%{background:white}30%{background:#ddffe4}}
@keyframes stat-negative{0%,100%{background:white}30%{background:#fff0db}}

/* A complete, recognisable mayor silhouette; result-specific themes colour the stage. */
.result-mayor{position:relative;isolation:isolate;background:linear-gradient(155deg,#e7f7ff,#e4efff 64%,#ffeac4)!important}
.mayor-aura{position:absolute;inset:-10%;z-index:0;background:radial-gradient(circle at 50% 55%,#d7ecff 0%,#f0faff 55%,transparent 74%)}
.result-mayor--eco .mayor-aura{background:radial-gradient(circle at 50% 55%,#d9ffdd,#f1fff4 54%,transparent 76%)}
.result-mayor--prosperous .mayor-aura{background:radial-gradient(circle at 50% 55%,#ffe4a5,#fff7d9 55%,transparent 76%)}
.result-mayor--industrial .mayor-aura{background:radial-gradient(circle at 50% 55%,#d1e5f5,#e3eef7 55%,transparent 76%)}
.result-mayor--crisis .mayor-aura{background:radial-gradient(circle at 50% 55%,#fce0d6,#fff0ec 55%,transparent 76%)}
.result-mayor--ghost .mayor-aura{background:radial-gradient(circle at 50% 55%,#dcdaf7,#edeafa 55%,transparent 76%)}
.result-mayor .mayor-fullbody{position:relative;z-index:1;display:block;height:100%!important;width:100%!important;max-height:100%;object-fit:contain!important;object-position:center center;padding:6px 6px 1px;filter:drop-shadow(0 5px 8px #1a395039)}
.mayor-caption{position:absolute;z-index:2;left:7px;top:7px;border:1px solid #ffffffaa;border-radius:999px;background:#ffffffd9;color:#1f628c;font-weight:900;line-height:1.1;font-size:10px;padding:5px 8px;box-shadow:0 2px 9px #122b4018}
.result-mayor--eco .mayor-caption{color:#18884c}
.result-mayor--industrial .mayor-caption{color:#345677}
.result-mayor--prosperous .mayor-caption{color:#bd7d18}
.result-mayor--crisis .mayor-caption{color:#a45a41}
.result-mayor--ghost .mayor-caption{color:#6462a8}
/* The full-body source is taller than the old cropped portrait; give it a little more room on desktop. */
@media (min-width:701px) and (min-height:600px){
 .result-wrap{grid-template-rows:auto minmax(0,37%) auto minmax(0,1fr) auto}
 .result-hero{grid-template-columns:1.22fr 1fr}
}
@media (max-width:700px) and (orientation:portrait){
 .network-status{font-size:8px;padding:1px 3px}
 .mayor-caption{font-size:8px;padding:2px 4px}
 .result-mayor .mayor-fullbody{padding:2px 1px 0}
 .construction-stamp{font-size:8px}
}
@media(prefers-reduced-motion:reduce){.construction-stamp,.construction-spark{display:none!important}}
/* Explicitly anchor the full-body artwork to the result panel's actual height.
   This avoids an implicit CSS-grid image track growing to its intrinsic height. */
.result-mayor{display:block;min-height:0;overflow:hidden}
.result-mayor .mayor-fullbody{position:absolute!important;inset:0;height:100%!important;width:100%!important;max-height:100%;min-height:0;object-fit:contain!important;object-position:center center}
.result-city{position:relative;display:block;min-height:0;overflow:hidden}
.result-city img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}

/* Keep the entire city image, but blur-fill the letterbox to preserve its atmosphere. */
.result-city::before{content:"";position:absolute;inset:-12px;background-image:var(--result-scene);background-position:center;background-size:cover;filter:blur(14px);opacity:.45}
.result-city img{z-index:1;filter:drop-shadow(0 2px 7px #274a6460)}

/* v0.5.0: miniature city life — presentation only, no change to rule or save data. */
.city-mood{display:inline-block;margin-left:4px;color:#276e57;border:1px solid #b6e2cd;background:#eafaf0;border-radius:8px;padding:2px 5px;font-size:10px;white-space:nowrap;vertical-align:middle}
.city-mood[data-stage="2"]{color:#985d1e;background:#fff5d9;border-color:#f5d88c}
.city-mood[data-stage="3"]{color:#8d4c98;background:#faeaff;border-color:#e9c4ff}
.board-wrap{position:relative;transition:background-color .7s,box-shadow .7s}
.board-wrap[data-stage="1"]{background:linear-gradient(165deg,#ebf9ff,#f3fff1)}
.board-wrap[data-stage="2"]{background:linear-gradient(165deg,#e4faff,#fcfff0);box-shadow:inset 0 0 30px #87dfe922}
.board-wrap[data-stage="3"]{background:linear-gradient(155deg,#d3f7ff,#fff1d4);box-shadow:inset 0 0 32px #fbc77538}
.city-life-layer{position:absolute;inset:0;z-index:5;pointer-events:none;overflow:hidden;border-radius:inherit;isolation:isolate}
.life-agent{position:absolute;left:var(--sx);top:var(--sy);transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;min-width:1.35em;min-height:1.35em;padding:.08em .15em;border-radius:999px;background:#ffffffde;border:1px solid #ffffffbb;font-size:clamp(10px,1.25vw,16px);line-height:1;filter:drop-shadow(0 1px 2px #143e6399);pointer-events:none;white-space:nowrap;animation:life-wander var(--trip) ease-in-out var(--delay) infinite alternate}
.life-agent--car{font-size:clamp(11px,1.65vw,19px);padding:.02em .1em;background:#f7fbffeb;animation-timing-function:linear;z-index:2}
.life-agent--person{z-index:3;background:#fffef5e8;border-color:#fff7d0}
.life-accent{position:absolute;font-size:clamp(8px,1.2vw,15px);line-height:1;pointer-events:none;filter:drop-shadow(0 0 4px #fff);animation:life-twinkle 3s ease-in-out infinite}
.life-accent--leaf{color:#65d35f}.life-accent--spark{color:#ffe36a}
.city-link-halo{stroke-width:13;opacity:.27;stroke-linecap:round;filter:blur(3px)}
.city-link{stroke-dasharray:9 5;stroke-width:5;animation:network-circulate 1.65s linear infinite;opacity:1;filter:drop-shadow(0 0 3px #ffffffdd);stroke-linecap:round}
.city-link.link-road{stroke-width:6;stroke:#268de6}
.city-link.link-green{stroke-width:5;stroke:#23b86d}
.city-link.link-market{stroke-width:5;stroke:#f8a137}
.city-link.link-civic{stroke-width:5;stroke:#2db4d8}
.city-flow-dot{filter:drop-shadow(0 0 2px #fff);stroke:#fff;stroke-width:1.6;opacity:.95}
.network-status{transition:background .25s;box-shadow:0 0 0 1px #fff4}
.network-status:not(:empty){font-variant-numeric:tabular-nums}
.city-milestone{position:absolute;z-index:12;left:50%;top:42%;width:min(86%,280px);display:flex;flex-direction:column;align-items:center;gap:2px;transform:translate(-50%,-50%);padding:10px 14px;border-radius:17px;border:2px solid #f0c944;background:linear-gradient(120deg,#fff9dd,#fffefa);color:#315e76;text-align:center;box-shadow:0 8px 24px #21466755;pointer-events:none;animation:milestone-enter 1.52s ease forwards}
.city-milestone strong{font-size:clamp(12px,1.2vw,18px)}.city-milestone span{font-size:clamp(9px,.85vw,12px);line-height:1.3}
@keyframes life-wander{0%{left:var(--sx);top:var(--sy);transform:translate(-50%,-50%) scale(1)}48%{transform:translate(-50%,-56%) scale(1.08)}100%{left:var(--ex);top:var(--ey);transform:translate(-50%,-50%) scale(1)}}
@keyframes life-twinkle{0%,100%{opacity:.15;transform:scale(.7)}50%{opacity:.94;transform:scale(1.3)}}
@keyframes network-circulate{to{stroke-dashoffset:-28}}
@keyframes milestone-enter{0%{opacity:0;transform:translate(-50%,-30%) scale(.65)}18%{opacity:1;transform:translate(-50%,-50%) scale(1.06)}35%{transform:translate(-50%,-50%) scale(1)}83%{opacity:1}100%{opacity:0;transform:translate(-50%,-72%) scale(.92)}}
.city-motion-off .city-life-layer,.city-motion-off .city-milestone,.city-motion-off .city-flow-dot{display:none!important}
.city-motion-off .city-link{animation:none!important;stroke-dasharray:none}
@media(max-width:700px){.city-mood{font-size:8px;padding:1px 3px;margin-left:2px}.life-agent{font-size:10px}.life-agent--car{font-size:11px}.life-accent{font-size:9px}.city-milestone{width:min(90%,180px);padding:6px}.city-milestone strong{font-size:11px}}
@media(max-width:380px){.city-mood{font-size:7px}.city-mood[data-stage="0"]{display:none}}
@media(max-height:440px) and (orientation:landscape){.city-mood{font-size:8px;padding:1px 3px}.city-milestone{padding:5px}.city-milestone strong{font-size:10px}}
@media(prefers-reduced-motion:reduce){.city-life-layer,.city-flow-dot,.city-milestone{display:none!important}.city-link{animation:none!important;stroke-dasharray:none!important}.board-wrap{transition:none!important}}

/* Small atmosphere details attached to actual buildings at later stages. */
.board-wrap[data-stage="2"] .board-cell[data-building="office"]::before,
.board-wrap[data-stage="3"] .board-cell[data-building="office"]::before,
.board-wrap[data-stage="3"] .board-cell[data-building="shop"]::before{
 content:"✦";position:absolute;right:3px;top:3px;z-index:2;font-size:clamp(8px,1vw,12px);color:#fff5a4;text-shadow:0 0 6px #ffae00;animation:life-twinkle 2.7s ease-in-out infinite;pointer-events:none
}
.board-wrap[data-stage="2"] .board-cell[data-building="park"]::before,
.board-wrap[data-stage="3"] .board-cell[data-building="park"]::before{
 content:"✿";position:absolute;right:3px;top:3px;z-index:2;font-size:clamp(9px,1vw,13px);color:#eeff95;text-shadow:0 0 6px #d8ff8a;animation:life-twinkle 4s ease-in-out infinite;pointer-events:none
}
.city-motion-off .board-cell[data-building]::before{display:none!important}
@media(prefers-reduced-motion:reduce){.board-cell[data-building]::before{display:none!important}}

/* v0.10.0 — clearer city life commuters and readable growth status */
.city-growth-panel{
  flex:none;display:flex;align-items:center;gap:7px;min-height:27px;
  margin:0 0 5px;padding:3px 7px;border:1px solid #9ecde8;
  border-radius:9px;background:linear-gradient(90deg,#dceeff,#f2f8ff);color:#17466a;
  box-shadow:inset 3px 0 0 #488bcb;font-variant-numeric:tabular-nums;
}
.growth-name{font-size:12px;font-weight:900;white-space:nowrap}
.growth-info{font-size:10px;font-weight:800;white-space:nowrap;color:#205d8d}
.growth-meter{display:flex;gap:3px;align-items:center;flex:1;justify-content:flex-end;min-width:32px}
.growth-meter i{flex:1;max-width:29px;height:8px;border-radius:3px;background:#c5d7e4;box-shadow:inset 0 1px 1px #53758b42}
.city-growth-panel[data-stage="0"] .growth-meter i:nth-child(-n+1){background:#3f98d5}
.city-growth-panel[data-stage="1"]{background:linear-gradient(90deg,#ccf9db,#f3fff6);border-color:#6ac894;box-shadow:inset 3px 0 0 #20844b}
.city-growth-panel[data-stage="1"] .growth-meter i:nth-child(-n+2){background:#2ab766}
.city-growth-panel[data-stage="2"]{background:linear-gradient(90deg,#fff0b6,#fffaf1);border-color:#d9a844;box-shadow:inset 3px 0 0 #d58a20}
.city-growth-panel[data-stage="2"] .growth-meter i:nth-child(-n+3){background:#ef9e2c}
.city-growth-panel[data-stage="3"]{background:linear-gradient(90deg,#eec8ff,#fff4ff);border-color:#ad72e1;box-shadow:inset 3px 0 0 #9148c9}
.city-growth-panel[data-stage="3"] .growth-meter i{background:#ae65e2}
.city-growth-panel[data-stage="3"] .growth-name,.city-growth-panel[data-stage="3"] .growth-info{color:#762c91}
.board-wrap[data-stage="1"]{background:linear-gradient(165deg,#ccefe3,#eafff1)!important;border-color:#73cda1}
.board-wrap[data-stage="2"]{background:linear-gradient(165deg,#b6eee9,#fff0cb)!important;border-color:#c2a65e;box-shadow:inset 0 0 22px #4ac99955}
.board-wrap[data-stage="3"]{background:linear-gradient(155deg,#b9d6ff,#f9ddac)!important;border:2px solid #a581db;box-shadow:inset 0 0 25px #bd72e266}
.life-agent{font-size:clamp(17px,2.2vw,26px);filter:drop-shadow(0 1px 2px #07283d) drop-shadow(0 0 2px white)!important;box-shadow:0 1px 5px #14395833}
.life-agent--car{font-size:clamp(21px,2.9vw,32px);z-index:6}
.life-agent--person{z-index:7}
.city-life-layer{z-index:8}
.life-accent{font-size:clamp(13px,1.6vw,20px)}
.city-link-halo{stroke-width:19;opacity:.42;filter:blur(2px)}
.city-link,.city-link.link-road,.city-link.link-market,.city-link.link-green,.city-link.link-civic{stroke-width:8;stroke-dasharray:11 5;filter:drop-shadow(0 0 3px #fff) drop-shadow(0 0 2px #142633)}
.city-link.link-road{stroke-width:9}
.city-flow-dot{stroke:#fff;stroke-width:2.4;filter:drop-shadow(0 0 4px #fff)}
.city-motion-off .city-life-layer{display:none!important}

/* Interactive encyclopedia: entire card acts as one accessible button. */
button.gallery-card{display:block;width:100%;padding:0;text-align:left;cursor:pointer;font:inherit;color:var(--text);transition:transform .15s ease,box-shadow .15s ease}
button.gallery-card:hover,button.gallery-card:focus-visible{transform:translateY(-3px);box-shadow:0 8px 25px #19507a32;outline:2px solid #58b6ff;outline-offset:1px}
.gallery-card .body{display:flex;flex-direction:column;gap:5px}
.gallery-name-row{font-size:15px;line-height:1.28;font-weight:900;color:var(--ink)}
.gallery-heading{font-size:14px;line-height:1.25}
.gallery-teaser{font-size:11px;color:var(--muted);line-height:1.4;min-height:2.8em}
.gallery-detail-mode .modal-card{width:min(700px,96vw);max-height:94dvh;overflow:auto}
.gallery-detail-mode .modal-body{max-height:70dvh;overflow-y:auto}
.gallery-detail-art{position:relative;height:clamp(130px,26vh,250px);border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#eff8ff}
.gallery-detail-art>img:first-child{width:100%;height:100%;object-fit:contain}
.gallery-detail-art .gallery-detail-mayor{position:absolute;right:1%;bottom:0;width:28%;height:92%;object-fit:contain;filter:drop-shadow(0 2px 8px #2a4c70)}
.gallery-detail-locked>img:first-child{filter:grayscale(1) brightness(.7)}
.gallery-detail-mayor--locked{filter:grayscale(1) brightness(.82) opacity(.88) drop-shadow(0 2px 8px #2a4c70)!important}
.gallery-detail-copy{padding:11px 2px 0;color:#27455d}
.gallery-detail-copy h3{margin:5px 0 5px;font-size:18px}
.gallery-detail-copy p{font-size:14px;margin:4px 0 8px;line-height:1.55}
.gallery-detail-pill{display:inline-block;background:#e3f2ff;color:#23649a;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:800}
.gallery-detail-hint{display:grid;gap:3px;padding:9px 11px;background:#fff8e3;border:1px solid #ecd58a;border-radius:10px;font-size:14px}
.gallery-detail-copy small{display:block;font-size:10px;color:#647e91;margin-top:7px}

/* Visual mayor-led How To, scrollable independently from the game. */
.modal.help-mode .modal-card{width:min(780px,97vw);max-height:94dvh;overflow:auto}
.modal.help-mode .modal-body{max-height:min(72vh,610px);overflow-y:auto}
.howto-layout{display:grid;grid-template-columns:minmax(140px,.65fr) minmax(0,1.35fr);gap:10px;align-items:stretch}
.howto-mayor{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px 8px;border-radius:14px;background:linear-gradient(160deg,#ddf3ff,#eafdf2);min-height:220px;overflow:hidden}
.howto-mayor img{flex:1;min-height:0;height:170px;max-height:260px;width:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 4px 8px #2b5c7840)}
.howto-mayor p{font-size:12px;font-weight:800;color:#205d85;text-align:center;background:#fff;border-radius:12px;padding:9px;margin:3px 0 0;line-height:1.5}
.howto-steps{display:grid;grid-template-columns:1fr;gap:7px}
.howto-steps article{display:flex;align-items:center;gap:10px;border:1px solid #d3e7f4;background:#f5fbff;border-radius:11px;padding:9px 11px}
.howto-steps article strong{display:block;font-size:14px;color:#235d89}
.howto-steps article p{font-size:12px;line-height:1.45;color:#496b80;margin:3px 0 0}
.howto-icon{flex:0 0 36px;font-size:25px;text-align:center}
.howto-footer{font-size:12px;line-height:1.5;padding:9px 11px;margin-top:10px;background:#fff9e8;border-radius:10px;border:1px solid #e9dba9;color:#445d73}
@media (max-width:700px) and (orientation:portrait){
  .city-growth-panel{min-height:23px;padding:2px 5px;margin-bottom:3px;gap:4px;border-radius:7px}
  .growth-name{font-size:10px}.growth-info{font-size:9px}.growth-meter{gap:2px}.growth-meter i{height:7px;max-width:18px}
  .life-agent{font-size:clamp(16px,4.4vw,22px)!important}.life-agent--car{font-size:clamp(20px,5.2vw,27px)!important}
  .gallery-detail-mode .modal-card,.modal.help-mode .modal-card{padding:11px}
  .howto-layout{grid-template-columns:1fr}
  .howto-mayor{min-height:0;display:grid;grid-template-columns:93px 1fr;gap:6px;padding:6px}
  .howto-mayor img{height:110px;max-height:110px}
  .howto-steps article{padding:7px;gap:6px}
  .howto-steps article strong{font-size:12px}.howto-steps article p{font-size:11px}
  .howto-icon{flex-basis:28px;font-size:22px}
}
@media(max-height:440px) and (orientation:landscape){
  .city-growth-panel{min-height:19px;margin-bottom:2px;padding:0 4px}
  .growth-name{font-size:9px}.growth-info{font-size:8px}.growth-meter i{height:5px}
  .life-agent{font-size:16px!important}.life-agent--car{font-size:20px!important}
}
@media(prefers-reduced-motion:reduce){button.gallery-card{transition:none!important}}


/* v0.8.0 — gallery card names and spoiler-safe portraits */
.gallery-page{height:auto;min-height:100%;display:block;overflow:visible;padding:0 3px 22px}
#screen-gallery,.gallery-grid{overflow:visible}
.gallery-grid{align-items:start;grid-auto-rows:max-content}
button.gallery-card{color:var(--ink);height:auto;overflow:hidden}
.gallery-card .gallery-name-row{display:block;min-height:43px;padding:10px 9px 8px;color:#174d77;font-size:15px;line-height:1.32;font-weight:900;background:#e8f4ff;border-top:1px solid #c0ddeb;white-space:normal;overflow-wrap:anywhere}
.gallery-card.locked .gallery-name-row{color:#566b80;background:#f1f4f8}
.gallery-card .body{display:flex;flex-direction:column;padding:8px 9px 11px}
.gallery-detail-secret{position:absolute;right:1%;bottom:0;width:28%;height:92%;border-radius:18px 18px 0 0;background:linear-gradient(170deg,#61728f,#2e435f);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:2px dashed #adc0d1;box-shadow:0 4px 18px #203a5366}
.secret-icon{font-size:clamp(45px,8vw,90px);line-height:1;color:#fff;font-weight:900;text-shadow:0 3px 8px #0e233f}
.secret-caption{font-size:clamp(9px,1.2vw,13px);color:#fff;font-weight:850;text-align:center;padding:0 5px}
.civic-goal-chip{cursor:pointer;min-width:0;max-width:52%;border:1px solid #8bbfd2;border-radius:9px;background:#eafaff;color:#175378;padding:3px 6px;font-size:11px;font-weight:850;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.civic-goal-chip.is-achieved{border-color:#7ab680;background:#dff9e5;color:#225e37}
.civic-result-report{background:#eefbea;border:1px solid #bcdfb8;border-radius:8px;padding:5px 7px}
@media(max-width:700px) and (orientation:portrait){.civic-goal-chip{font-size:9px;max-width:54%;padding:2px 4px}.gallery-card .gallery-name-row{font-size:14px;min-height:42px}.civic-result-report{padding:3px 4px}}
@media(max-height:440px) and (orientation:landscape){.civic-goal-chip{font-size:9px;padding:1px 3px}}

.civic-result-top{display:inline-block;margin-top:3px;padding:2px 7px;border-radius:8px;border:1px solid #b6dcb5;background:#edfbe8;color:#205b38;font-weight:850;font-size:11px;line-height:1.15}
@media(max-width:700px){.civic-result-top{font-size:9px;padding:1px 5px}}

/* v0.9: occupation-aware citizen attribution; preserve board/card viewport sizes. */
.citizen-voice-kicker{display:flex;align-items:center;gap:6px;flex-wrap:wrap;line-height:1.25}
.citizen-voice-who{font-size:10px;letter-spacing:0;color:#405e78;background:#eaf3fd;border:1px solid #d0e2f4;padding:2px 6px;border-radius:999px;font-weight:750;white-space:nowrap}
.citizen-voice-card{min-width:0}
.citizen-voice-text{overflow-wrap:anywhere}
@media(max-width:760px){.citizen-voice-kicker{font-size:9px;gap:4px}.citizen-voice-who{font-size:8px;padding:1px 4px}}
@media(max-height:400px){.citizen-voice-who{display:none}}

/* v0.11.0 — purposeful daily life; no changes to gameplay mechanics. */
.city-growth-panel .growth-info{flex:none}
.commute-summary{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  max-width:160px;font-size:10px;font-weight:900;
  color:#19587a;background:#ffffffb8;padding:2px 5px;border-radius:6px;
  border:1px solid #c3e6f0;
}
.commute-trails{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:0}
.commute-trail{
  fill:none;stroke:#fff6b7;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:5 6;opacity:.8;
  filter:drop-shadow(0 1px 1px #195685);
}
.life-agent{will-change:left,top}
.life-arrival{
  position:absolute;transform:translate(-50%,-50%);pointer-events:none;
  width:19px;height:19px;border-radius:50%;
  border:2px solid #fff8bd;box-shadow:0 0 0 2px #f5bf3e99,0 0 9px #fff4a2aa;
  animation:arrival-glimmer 3s ease-in-out infinite;z-index:1;
}
@keyframes arrival-glimmer{
  0%,100%{opacity:.25;transform:translate(-50%,-50%) scale(.72)}
  50%{opacity:.85;transform:translate(-50%,-50%) scale(1.28)}
}
@media (max-width:700px){
  .city-growth-panel{gap:4px!important}
  .growth-name{font-size:10px}
  .commute-summary{font-size:9px;padding:1px 3px;max-width:102px}
  .growth-meter{min-width:28px;gap:2px}
  .growth-meter i{max-width:14px;height:7px}
  .life-arrival{width:12px;height:12px}
}
@media (max-width:345px){
  .commute-summary{max-width:82px;font-size:8px}
  .growth-meter{min-width:24px}
}
@media (max-height:560px) and (orientation:landscape){
  .commute-summary{max-width:90px;font-size:9px}
}
@media (prefers-reduced-motion:reduce){
  .life-arrival,.commute-trails{display:none!important}
}
.city-motion-off .life-arrival,.city-motion-off .commute-trails{display:none!important}


/* v0.12.0 — three gentle times of day, without changing HUD height. */
.turn-caption{display:flex;align-items:center;gap:7px;min-height:15px}
.turn-caption .mode-label{white-space:nowrap}
.day-phase{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;
 padding:2px 8px;border-radius:999px;background:#fff1d5;border:1px solid #e8c789;
 color:#815219;font-size:11px;font-weight:850;line-height:1.15}
.day-phase[data-phase="noon"]{background:#fffbd5;border-color:#dfd678;color:#725a00}
.day-phase[data-phase="evening"]{background:#f6e7ff;border-color:#c6a0e8;color:#713989}
.board-wrap[data-dayphase="morning"]{background:linear-gradient(140deg,#d4f2ff 0%,#f6ffe8 65%)!important}
.board-wrap[data-dayphase="noon"]{background:linear-gradient(140deg,#aeeaff 0%,#fff7c4 90%)!important}
.board-wrap[data-dayphase="evening"]{background:linear-gradient(140deg,#c1a5e7 0%,#f8bda0 60%,#ffe7b4 100%)!important}
.board-panel[data-dayphase="evening"] .tile-bg{filter:saturate(.97) sepia(.1) brightness(.9)}
.board-panel[data-dayphase="morning"] .tile-bg{filter:saturate(1.05) brightness(1.035)}
.board-panel[data-dayphase="noon"] .tile-bg{filter:saturate(1.09)}
.board-wrap[data-dayphase="evening"] .board-cell[data-building="house"]::before,
.board-wrap[data-dayphase="evening"] .board-cell[data-building="school"]::before,
.board-wrap[data-dayphase="evening"] .board-cell[data-building="shop"]::before,
.board-wrap[data-dayphase="evening"] .board-cell[data-building="office"]::before{
 content:"✦";position:absolute;z-index:4;top:2px;right:4px;font-size:clamp(10px,1.6vw,17px);
 color:#fff7a6;text-shadow:0 0 6px #fcb52c,0 0 10px #fdce68;pointer-events:none;
 animation:window-glimmer 3.5s ease-in-out infinite
}
@keyframes window-glimmer{0%,100%{opacity:.7;transform:scale(.9)}50%{opacity:1;transform:scale(1.1)}}
/* Arrival effects pulse only when a commuter reaches a building. Each period
   corresponds to the outward-and-return trip, whose midpoint is arrival. */
.life-arrival--timed{width:clamp(21px,3vw,32px);height:clamp(21px,3vw,32px);
 display:grid;place-items:center;font-size:clamp(12px,1.5vw,20px);
 background:#fff9dce9;border:2px solid #ffcf5a;opacity:0;z-index:10;
 animation:destination-pulse var(--arrival-period) ease-in-out var(--arrival-delay) infinite}
@keyframes destination-pulse{
  0%,41%,65%,100%{opacity:0;transform:translate(-50%,-50%) scale(.45)}
  48%,53%{opacity:.96;transform:translate(-50%,-50%) scale(1.14)}
}
.board-cell.destination-active{animation:arrival-building-pulse var(--arrival-period) ease-in-out var(--arrival-delay) infinite}
@keyframes arrival-building-pulse{
  0%,41%,65%,100%{box-shadow:none}
  48%,53%{box-shadow:0 0 0 3px #ffe172,0 0 15px 4px #ffe78d}
}
.city-motion-off .destination-active{animation:none!important}
@media(max-width:700px){
 .turn-caption{gap:4px;min-height:12px}
 .day-phase{font-size:9px;padding:1px 5px}
 .life-arrival--timed{width:20px;height:20px;font-size:12px}
}
@media(max-height:440px) and (orientation:landscape){.day-phase{font-size:9px;padding:1px 5px}}
@media(prefers-reduced-motion:reduce){
 .life-arrival--timed,.destination-active{animation:none!important}
 .board-wrap{transition:none!important}
}

/* v0.13.0 — little stories, without adding height to the HUD or board. */
.city-moment{margin-top:5px;padding-top:4px;border-top:1px dashed #c9ddec;display:flex;align-items:center;gap:7px;min-width:0;white-space:nowrap;overflow:hidden;font-size:12px;line-height:1.25;color:#25577d}
.city-moment strong{flex:none;font-size:10px;font-weight:900;color:#2466c9;background:#e8f3ff;padding:2px 5px;border-radius:6px}
.city-moment span{min-width:0;overflow:hidden;text-overflow:ellipsis;font-weight:750}
.life-activity{position:absolute;z-index:9;transform:translate(-50%,-50%);display:grid;place-items:center;width:27px;height:27px;border:1.5px solid #fff9d5;border-radius:50%;background:#fff9d9ed;box-shadow:0 2px 7px #1b497a66;font-size:16px;line-height:1;pointer-events:none;animation:life-activity-pop 4s ease-in-out var(--activity-delay,0s) infinite}
@keyframes life-activity-pop{0%,100%{opacity:.58;transform:translate(-50%,-48%) scale(.82)}35%{opacity:1;transform:translate(-50%,-65%) scale(1.16)}65%{opacity:1;transform:translate(-50%,-54%) scale(1)}}
@media(max-width:760px){.city-moment{margin-top:2px;padding-top:2px;gap:4px;font-size:9px;line-height:1.15}.city-moment strong{font-size:8px;padding:1px 3px}.life-activity{width:19px;height:19px;font-size:12px}}
@media(max-height:560px) and (orientation:landscape){.city-moment{font-size:9px;margin-top:1px;padding-top:1px}.city-moment strong{font-size:8px}.life-activity{width:17px;height:17px;font-size:11px}}
@media(max-height:660px) and (orientation:portrait){.city-moment{font-size:9px;margin-top:1px;padding-top:1px}}
@media(prefers-reduced-motion:reduce){.life-activity{display:none!important}}
.city-motion-off .life-activity{display:none!important}

/* v0.14.0 — unobtrusive live city dialogue and dwell-at-destination visuals. */
.citizen-voice--refreshed .citizen-voice-copy,
.citizen-voice--refreshed .citizen-voice-face{animation:story-breathe .42s ease-out both}
@keyframes story-breathe{from{opacity:.55;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@keyframes arrival-building-pulse{
  0%,37%,63%,100%{box-shadow:none}
  43%,56%{box-shadow:0 0 0 3px #ffe172,0 0 15px 4px #ffe78d}
}
@media(prefers-reduced-motion:reduce){
  .citizen-voice--refreshed .citizen-voice-copy,
  .citizen-voice--refreshed .citizen-voice-face{animation:none!important}
}

/* v0.15.0 – optional, unscored garden continuation and city observatory. */
.continue-btn--garden{background:linear-gradient(120deg,#288969,#227655);color:#fff}
.observe-btn{border:1px solid #9cc4df;border-radius:8px;background:#eaf7ff;color:#174f7b;font-size:11px;font-weight:900;min-height:25px;padding:3px 7px;cursor:pointer;flex:none;white-space:nowrap}
.observe-btn:hover,.result-observe:hover{background:#d6eeff}
.garden-complete{grid-column:1/-1;align-self:center;text-align:center;background:#f0fff3;border:1px dashed #7aca9c;border-radius:12px;color:#286d45;font-size:14px;font-weight:800;padding:14px 7px;line-height:1.65}
.result-head-actions{display:flex;align-items:center;gap:7px;flex:none}
.result-observe{border:1px solid #92cce8;border-radius:10px;background:#edfbff;color:#125e8c;padding:7px 10px;font-size:12px;font-weight:850;cursor:pointer;white-space:nowrap}
.result-actions button{white-space:normal;line-height:1.1}
.modal.observer-mode .modal-card{width:min(850px,97vw);max-height:94dvh;padding:14px;overflow:hidden;display:flex;flex-direction:column}
.modal.observer-mode #modalTitle{font-size:clamp(18px,3vw,24px);color:#173a56}
.modal.observer-mode .modal-body{min-height:0;max-height:none;flex:1;overflow:auto;color:#17324a;padding:3px}
.modal.observer-mode .modal-actions{flex:none}
.observer-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:15px;align-items:start}
.observer-left{min-width:0;display:flex;justify-content:center}
.observer-board{position:relative;width:100%;max-width:min(440px,65vh);aspect-ratio:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:5px;padding:7px;border-radius:18px;background:linear-gradient(135deg,#e5f8ea,#e6f4ff);box-shadow:inset 0 0 0 2px #c2ddec}
.observer-tile{position:relative;min-width:0;min-height:0;aspect-ratio:1;overflow:hidden;display:grid;align-items:center;justify-items:center;border:1px dashed #c3d9e8;border-radius:10px;background:#fff9;cursor:pointer;padding:0}
.observer-tile.is-built{background:#fff;border-style:solid}
.observer-tile.selected{outline:3px solid #ffb742;outline-offset:-3px}
.observer-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.observer-tile>span:not(.observer-empty){position:absolute;bottom:0;left:0;right:0;text-align:center;background:linear-gradient(transparent,#1c385ba9);color:#fff;font-size:clamp(9px,1.6vw,12px);font-weight:900;padding:7px 0 2px}
.observer-empty{font-size:24px;color:#a0c1ce}
.observer-agents{position:absolute;inset:7px;pointer-events:none;z-index:3}
.observer-agent{position:absolute;left:var(--ox);top:var(--oy);transform:translate(-50%,-50%);font-size:clamp(14px,2vw,22px);background:#ffffffec;border-radius:50%;padding:2px;filter:drop-shadow(0 1px 2px #3b6784);animation:observer-walk var(--od) ease-in-out var(--ol) infinite}
@keyframes observer-walk{0%,12%,100%{left:var(--ox);top:var(--oy)}44%,64%{left:calc(var(--ox) + var(--tx));top:calc(var(--oy) + var(--ty))}}
.observer-right{display:flex;flex-direction:column;gap:12px;align-items:start;min-width:0;padding:8px 2px}
.observer-chip{font-size:12px;font-weight:900;color:#267c52;background:#e8f9ec;border-radius:99px;padding:6px 12px}
.observer-right h3{font-size:clamp(16px,2.4vw,23px);margin:0}
.observer-right p{font-size:14px;line-height:1.6;margin:0;color:#3b5970}
.observer-facts{font-size:13px;font-weight:850;color:#195e8c;padding:8px;border:1px solid #bbdcec;border-radius:9px;background:#eefaff}
.observer-moment{font-size:15px;font-weight:850;line-height:1.45;color:#3d5935;background:#f5ffde;border-left:4px solid #b5d955;padding:11px;border-radius:9px}
.observer-right .observer-hint{font-size:12px;color:#668297}
@media (max-width:700px){
  .observe-btn{font-size:10px;min-height:21px;padding:2px 5px}
  #networkStatus{display:none}
  .result-observe{font-size:10px;padding:6px}
  .result-actions button{font-size:clamp(9px,1.8vw,12px)}
  .modal.observer-mode .modal-card{padding:9px;max-height:96dvh}
  .modal.observer-mode .modal-body{overflow-y:auto}
  .observer-layout{display:flex;flex-direction:column;align-items:center;gap:6px}
  .observer-left{width:100%}
  .observer-board{max-width:min(80vw,44vh);width:100%;gap:3px;padding:4px;border-radius:11px}
  .observer-right{width:100%;gap:5px;padding:0 3px}
  .observer-chip{font-size:10px;padding:3px 8px}
  .observer-right h3{font-size:15px}
  .observer-right p{font-size:12px;line-height:1.35}
  .observer-facts{font-size:11px;padding:5px}
  .observer-moment{font-size:12px;padding:7px}
  .observer-right .observer-hint{display:none}
}
@media(max-width:700px) and (orientation:landscape){
  .observer-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr)}
  .observer-board{max-width:min(43vw,64vh)}
  .observer-right{align-items:start}
  .observer-moment{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.observer-agent{animation:none!important}}
.observer-discoveries{border:1px solid #d1e6c7;border-radius:10px;background:#f5fff1;padding:9px;width:100%}
.observer-discoveries>strong{font-size:12px;color:#396e38}
.observer-discoveries>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px;font-size:11px;color:#67835f}
.observer-discoveries span{font-size:11px;font-weight:700;color:#4c6c41;border:1px solid #b8dda8;background:#fff;padding:4px 6px;border-radius:99px}
#rewardBtn:disabled{opacity:.42;cursor:not-allowed}
@media(max-width:700px){.observer-discoveries{padding:5px}.observer-discoveries>div{margin-top:3px}.observer-discoveries span{font-size:10px;padding:2px 5px}}

/* v0.16.0 – discovery feedback, spectator day cycle and connected mini-combos */
.board-panel{position:relative}
.combo-celebration{position:absolute;z-index:35;left:50%;top:33%;transform:translate(-50%,-16%) scale(.88);width:min(86%,350px);padding:13px 12px;opacity:0;pointer-events:none;display:grid;gap:3px;text-align:center;border-radius:18px;border:2px solid #ffce61;background:linear-gradient(115deg,#fffef2f4,#eafafff5);box-shadow:0 10px 28px #183b5560;color:#16476c;font-size:clamp(12px,1.5vw,17px);line-height:1.25;transition:opacity .2s ease,transform .2s ease}
.combo-celebration strong{font-size:clamp(13px,1.7vw,19px);color:#c47a12}
.combo-celebration.is-visible{opacity:1;transform:translate(-50%,0) scale(1)}
.combo-celebration.is-grand{border-color:#b987ff;background:linear-gradient(110deg,#fff6d9f8,#f2ddfff8);box-shadow:0 6px 30px #8543bd99,0 0 0 5px #fff9c460}
.combo-celebration.is-grand strong{color:#8c3db0}
.day-phase[data-phase="night"]{background:#293c67;color:#fff8dc;border-color:#a3acd3}
.board-wrap[data-dayphase="night"]{background:linear-gradient(130deg,#152d54 0%,#46558a 60%,#756299 100%)!important;border-color:#7684aa!important}
.board-panel[data-dayphase="night"] .tile-bg{filter:brightness(.65) saturate(.91) contrast(1.07)}
.board-wrap[data-dayphase="night"] .board-cell:not([data-building]){background:linear-gradient(135deg,#37496b,#5e7190);border-color:#8191b1}
.board-wrap[data-dayphase="night"] .empty-mark{color:#c6dafa}
.board-wrap[data-dayphase="night"] .board-cell[data-building="house"]::before,
.board-wrap[data-dayphase="night"] .board-cell[data-building="school"]::before,
.board-wrap[data-dayphase="night"] .board-cell[data-building="shop"]::before,
.board-wrap[data-dayphase="night"] .board-cell[data-building="office"]::before,
.board-wrap[data-dayphase="night"] .board-cell[data-building="hospital"]::before{
 content:"✧";position:absolute;z-index:4;top:2px;right:4px;color:#fff59f;font-size:clamp(11px,1.5vw,19px);text-shadow:0 0 8px #ffdb65,0 0 17px #ffdb65;animation:window-glimmer 3.2s ease-in-out infinite;pointer-events:none
}
.observer-intro{font-size:12px;line-height:1.42;color:#245374;background:#edf9ff;border:1px solid #cae0f5;border-radius:12px;padding:7px 10px;margin:0 0 8px}
.observer-timebar{display:flex;align-items:center;flex-wrap:wrap;gap:6px;background:#f9fbff;border:1px solid #dce7f2;border-radius:12px;padding:7px;margin-bottom:9px}
.observer-time-label{font-size:13px;min-width:114px;font-weight:900;color:#28517c}
.observer-phase-tabs{display:flex;gap:4px;flex-wrap:wrap}
.observer-phase-tabs button,.observer-auto{border:1px solid #b3d2e4;border-radius:9px;background:#fff;padding:6px 8px;color:#285777;font-size:11px;font-weight:900;cursor:pointer}
.observer-phase-tabs button.is-active{background:#25588d;color:#fff;border-color:#25588d}
.observer-auto{margin-left:auto;background:#f2fff3;color:#336b47}
.observer-board{transition:background-color .5s ease,box-shadow .5s ease}
.observer-board[data-phase="morning"]{background:linear-gradient(120deg,#d5f4ff,#ecfbdc);box-shadow:inset 0 0 0 3px #9bd8ee}
.observer-board[data-phase="noon"]{background:linear-gradient(120deg,#9de6fa,#ffedb6);box-shadow:inset 0 0 0 3px #63b9e0}
.observer-board[data-phase="evening"]{background:linear-gradient(120deg,#c6addf,#ffa18e);box-shadow:inset 0 0 0 3px #b38bce}
.observer-board[data-phase="night"]{background:radial-gradient(circle at 78% 16%,#9297ca 0,#444f86 32%,#182b4f 90%);box-shadow:inset 0 0 0 3px #8c9ad9}
.observer-board[data-phase="night"] .observer-tile{background:#475a7e99;border-color:#8da7cb}
.observer-board[data-phase="night"] .observer-tile img{filter:brightness(.55) saturate(.84)}
.observer-board[data-phase="evening"] .observer-tile img{filter:brightness(.88) sepia(.14)}
.observer-board[data-phase="night"] .observer-tile.is-built::after{content:"✦";position:absolute;top:4%;right:10%;color:#fff3a0;text-shadow:0 0 8px #ffd66e,0 0 15px #ffe187;font-size:clamp(10px,1.7vw,17px);pointer-events:none}
.observer-board[data-phase="night"] .observer-empty{color:#d1e4ff}
.observer-combo--triple{border:1px solid #ddba55!important;background:linear-gradient(120deg,#fff6cd,#fde4ff)!important;color:#874a3b!important}
.observer-moment{display:grid;grid-template-columns:62px minmax(0,1fr);gap:8px;align-items:center;min-width:0;width:100%;font-weight:500!important}
.observer-moment img{width:62px;height:62px;object-fit:contain;border-radius:12px;background:#fffdf1;border:1px solid #d9e1b6}
.observer-moment strong{display:block;font-size:12px;color:#356327}
.observer-moment p{font-size:13px!important;line-height:1.25!important;margin:2px 0!important;font-weight:800;color:#284c31!important}
.observer-moment small{display:block;font-size:11px;color:#5e7456}
@media(max-width:700px){
 .observer-intro{font-size:10px;line-height:1.35;padding:5px 7px;margin-bottom:5px}
 .observer-timebar{gap:4px;padding:4px;margin-bottom:5px;justify-content:center}
 .observer-time-label{font-size:11px;min-width:auto;text-align:center}
 .observer-phase-tabs button,.observer-auto{padding:4px 6px;font-size:10px}
 .observer-auto{margin-left:0}
 .observer-moment{grid-template-columns:44px minmax(0,1fr);gap:6px;padding:5px!important}
 .observer-moment img{width:44px;height:44px;border-radius:8px}
 .observer-moment strong{font-size:10px}.observer-moment p{font-size:11px!important}.observer-moment small{font-size:10px}
 .observer-right{gap:4px}
 .combo-celebration{padding:9px;top:25%}
}
@media(max-height:460px) and (orientation:landscape){
 .observer-intro{display:none}
 .observer-timebar{padding:3px;margin-bottom:3px}
 .observer-moment{grid-template-columns:35px minmax(0,1fr)}
 .observer-moment img{width:35px;height:35px}
}
@media(prefers-reduced-motion:reduce){.combo-celebration{transition:none}}
/* Small phones: keep the conversation and discoveries above the fold. */
@media(max-width:420px) and (max-height:700px) and (orientation:portrait){
 .observer-board{max-width:min(66vw,29vh)!important}
 .observer-layout{gap:4px}
 .observer-right{gap:3px}
 .observer-chip{display:none}
 .observer-moment{order:-1}
 .observer-facts{display:none}
 .observer-right p{font-size:10px;line-height:1.22}
 .observer-discoveries{padding:4px}
 .observer-discoveries>div{max-height:40px;overflow:auto}
 .observer-intro{font-size:9px;line-height:1.26}
}

/* v0.17.0 — persistent combo districts and continuous road-sidewalk / planting details.
   Pure presentation overlays; never intercept tiles, dragging or observer taps. */
.city-detail-layer{position:absolute;inset:0;z-index:9;pointer-events:none;overflow:hidden;border-radius:inherit;isolation:isolate}
.city-detail-paths{display:block;position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.district-link{stroke-linecap:round;stroke-linejoin:round;fill:none}
.district-link--road{stroke:#3c586f;stroke-width:17;opacity:.93;filter:drop-shadow(0 1px 2px #142f4c88)}
.district-link--road.district-link--center{stroke:#fff7b3;stroke-width:2.1;stroke-dasharray:7 9;opacity:.9}
.district-link--sidewalk{stroke:#e9f3d9;stroke-width:12;opacity:.96;stroke-dasharray:4 4}
.district-link--sidewalk.district-link--center{stroke:#7fa6bd;stroke-width:3;stroke-dasharray:2 7;opacity:.85}
.district-link--green{stroke:#48a86e;stroke-width:9;opacity:.97;stroke-dasharray:2 6}
.district-link--market{stroke:#f8bc60;stroke-width:7;opacity:.9;stroke-dasharray:4 9}
.city-ornament{position:absolute;display:grid;place-items:center;min-width:22px;height:22px;padding:1px 3px;
 transform:translate(-50%,-50%);border:2px solid #fff5cc;border-radius:11px;
 background:linear-gradient(130deg,#fff8e2ed,#fdf7bced);font-size:clamp(12px,1.55vw,19px);line-height:1;
 box-shadow:0 2px 7px #153b5999,0 0 0 1px #c9963999;white-space:nowrap;
 filter:drop-shadow(0 1px 1px #0003);pointer-events:none}
.city-ornament--triple{min-width:28px;height:28px;border:2px solid #fef0a7;background:linear-gradient(120deg,#fff6b3,#f7d0ff);
 box-shadow:0 0 0 2px #a969e5,0 0 12px #ffdd88aa;animation:district-float 4s ease-in-out infinite}
.city-ornament--green{border-color:#b9f2b2;background:#e0fbd8}
.city-ornament--culture{border-color:#e1c6ff;background:#f3e4ff}
.city-ornament--industry{border-color:#b4d4e9;background:#deebf6}
.city-ornament--civic{border-color:#b8efff;background:#e6faff}
.city-ornament--selected{box-shadow:0 0 0 4px #fff59b,0 0 20px 10px #ffe25daa;transform:translate(-50%,-50%) scale(1.22)}
@keyframes district-float{0%,100%{translate:0 0}50%{translate:0 -3px}}
.city-motion-off .city-ornament--triple{animation:none}
.board-wrap[data-dayphase="night"] .city-ornament,.observer-board[data-phase="night"] .city-ornament{
 background:linear-gradient(130deg,#f5df9e,#f4c2f9);box-shadow:0 0 12px 3px #fff0939c;color:#183c62}
.board-wrap[data-dayphase="evening"] .city-ornament,.observer-board[data-phase="evening"] .city-ornament{filter:drop-shadow(0 0 5px #ffe57d)}
.observer-board .city-detail-layer{inset:7px;z-index:5}
.observer-combo{font-size:11px;font-weight:850;color:#4c6c41;border:1px solid #b8dda8;background:#fff;padding:4px 6px;border-radius:9px;cursor:pointer;max-width:100%;white-space:normal;text-align:left}
.observer-combo.is-active{background:#fff1c5;border-color:#e1aa3c;box-shadow:0 0 0 2px #ffe48d}
.observer-tile.combo-highlight{outline:3px solid #ffc54d;outline-offset:-3px;filter:brightness(1.06);z-index:2}
.observer-combo-info{min-height:0;padding:0;margin:4px 0 0!important;font-size:11px!important;line-height:1.3!important;font-weight:750;color:#5c467e!important}
.observer-combo-info:empty{display:none}
.city-link--festive{animation:district-float 3s ease-in-out infinite}
.life-combo-event{position:absolute;z-index:13;display:grid;place-items:center;width:24px;height:24px;
 transform:translate(-50%,-50%);border:1px solid #ffedab;border-radius:50%;background:#fff6d1e9;
 box-shadow:0 0 12px #ffe66faa;font-size:14px;pointer-events:none;animation:combo-life 5s ease-in-out var(--combo-delay,0s) infinite}
@keyframes combo-life{0%,100%{opacity:.55;transform:translate(-50%,-50%) scale(.72)}30%,65%{opacity:1;transform:translate(-50%,-80%) scale(1.08)}}
.city-motion-off .life-combo-event{display:none!important}
@media(max-width:760px){
 .city-ornament{min-width:15px;height:15px;font-size:11px;border-width:1px;padding:1px;border-radius:7px}
 .city-ornament--triple{min-width:19px;height:19px;border-width:1px}
 .district-link--road{stroke-width:13}.district-link--sidewalk{stroke-width:9}
 .district-link--green{stroke-width:6}.district-link--market{stroke-width:6}
 .life-combo-event{width:18px;height:18px;font-size:11px}
 .observer-combo{font-size:10px;padding:3px 5px}
 .observer-board .city-detail-layer{inset:4px}
 .observer-combo-info{font-size:10px!important;margin:2px 0 0!important}
}
@media(max-width:700px) and (orientation:landscape){
 .observer-combo-info{font-size:9px!important}
 .city-ornament--triple{min-width:16px;height:16px}
}
@media(prefers-reduced-motion:reduce){.city-ornament--triple,.life-combo-event{animation:none!important}}

@media(max-height:640px){.observer-combo-info{display:none!important}}

/* v0.18.0: compact audio indicator inside the observation modal */
.observer-audio-row{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#eff7ff;border:1px solid #cfe1f4;border-radius:10px;padding:5px 8px;margin:-3px 0 7px;color:#245776;font-size:12px;font-weight:750;min-height:30px}
.observer-audio-row>span{flex:1;min-width:0}
.observer-music-btn{flex:none;background:#fff;border:1px solid #93bedf;border-radius:8px;color:#245776;font-size:11px;font-weight:900;cursor:pointer;padding:5px 10px}
@media(max-width:760px){.observer-audio-row{padding:3px 6px;margin:0 0 4px;min-height:25px;font-size:10px}.observer-music-btn{font-size:10px;padding:3px 7px}}
@media(max-height:620px){.observer-audio-row{padding:2px 6px;margin-bottom:2px;min-height:22px;font-size:9px}.observer-music-btn{font-size:9px;padding:2px 5px}}

/* v0.20.1: first play guide is a true modal on ALL viewport sizes;
   the compact persistent next-action cue lives in the always-visible card header. */
.helper-badge.quick-start-cue{background:#fff2c7;color:#805011;border:1px solid #e9bf4f;font-weight:900;box-shadow:0 0 0 2px #fffae6}
.first-play-mode .modal-card{width:min(480px,95vw);max-height:92dvh;overflow:auto;padding:clamp(10px,2.5vh,18px)}
.first-play-mode #modalTitle{font-size:clamp(17px,3vw,22px)}
.first-play-mode .modal-body{max-height:65dvh;overflow-y:auto}
.first-play-steps{display:grid;gap:8px;margin:9px 0}
.first-play-step{display:flex;align-items:center;gap:10px;padding:10px;background:#edf8ff;border:1px solid #cde8f9;border-radius:12px;color:#173b57}
.first-play-number{display:grid;place-items:center;flex:none;width:33px;height:33px;background:#2466c9;border-radius:10px;font-size:18px;font-weight:900;color:white}
.first-play-step strong{display:block;font-size:14px;line-height:1.35}
.first-play-step small{display:block;font-size:11px;line-height:1.4;color:#41657f;margin-top:3px}
.first-play-note{margin:10px 0 4px;font-size:12px;color:#385f7c}
.first-play-pause{margin:4px 0 0;font-size:11px;color:#637e91}
.first-play-mode #modalPrimary{min-height:40px;font-size:14px}
@media (max-height:440px) and (orientation:landscape){
 .first-play-mode .modal-card{padding:8px 11px;max-height:98dvh}
 .first-play-steps{gap:5px;margin:5px 0}
 .first-play-step{padding:5px 9px}
 .first-play-step strong{font-size:12px}.first-play-step small{font-size:10px}
 .first-play-number{width:26px;height:26px;font-size:14px}
 .first-play-note,.first-play-pause{margin:3px 0;font-size:10px}
 .first-play-mode .modal-actions{margin-top:6px}
 .first-play-mode #modalPrimary{min-height:30px;font-size:12px}
}

/* v0.21.0: compact next-run encouragement, never stealing space from the board. */
.result-wrap{grid-template-rows:auto minmax(0,31%) auto auto minmax(0,1fr) auto}
.result-replay-banner{display:flex;align-items:center;justify-content:space-between;gap:5px;border:1px solid #ecd78c;border-radius:8px;background:#fff8df;padding:5px 8px;font-size:11px;color:#72511c;font-weight:850;flex-wrap:wrap}
.result-record{white-space:nowrap}.result-progress{font-size:10px;font-weight:700}
.result-next-move{background:#edf8fa;border:1px solid #cee9ed;border-radius:8px;padding:6px}
.result-next-move p{color:#275974!important;font-weight:750}
.record-sidequest{display:block;font-size:9px;color:#446d8a;font-weight:750;margin-top:2px}
.card-income{background:#e8f8ec!important;color:#286b44!important}
@media(max-width:700px){.result-wrap{grid-template-rows:auto minmax(0,26%) auto auto minmax(0,1fr) auto}.result-replay-banner{padding:3px 5px;font-size:9px;gap:2px}.result-progress{font-size:9px}.result-next-move{padding:4px}.result-next-move p{font-size:10px}.record-sidequest{font-size:8px}}
@media(max-height:640px){.result-wrap{grid-template-rows:auto minmax(0,20%) auto auto minmax(0,1fr) auto}.result-replay-banner{padding:2px 4px;font-size:9px}.result-next-move{padding:3px}.result-next-move p{font-size:9px}}

/* v0.22.0: make the running town budget legible without another HUD row. */
.stat-card .label{display:inline-flex;align-items:center;gap:5px;min-width:0}
.budget-trend{font-size:10px;font-weight:800;font-style:normal;color:#526c83;white-space:nowrap;border-radius:5px;padding:1px 3px;background:#ecf3f8}
.budget-trend--minus{background:#fff0df;color:#aa521c}
.budget-trend--plus{background:#e5f8ed;color:#256d4a}
.preview-net{background:#fff7db!important;color:#8b541b!important;font-weight:800}
.result-last-delta{font-size:10px;color:#265d7d;font-weight:900;white-space:nowrap}
@media(max-width:700px){.stat-card .label{gap:2px}.budget-trend{font-size:9px;padding:1px 2px}.result-last-delta{font-size:9px}}
@media(max-width:365px){.budget-trend{font-size:8px;padding:0 1px}.result-last-delta{font-size:8px}}
@media(max-height:440px) and (orientation:landscape){.budget-trend{font-size:8px;padding:0 1px}.result-last-delta{font-size:8px}}

/* v0.23.0 — City Trail: replay and portable JSON archive. */
.secondary-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.replay-page{max-width:1120px;margin:0 auto;padding:5px 4px 24px;display:flex;flex-direction:column;gap:10px}
.replay-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.replay-head .result-title{margin:2px 0 4px;font-size:clamp(20px,3vw,30px)}
.replay-head .replay-intro{margin:0;font-size:12px;line-height:1.4;color:var(--muted)}
.replay-head button{flex:none}
.replay-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);align-items:start;gap:10px}
.replay-stage,.replay-list-panel{display:flex;flex-direction:column;gap:10px;padding:14px}
.replay-current-heading{font-size:14px;font-weight:900;color:#245d84}
.replay-viewer{display:grid;place-items:center;min-height:160px;background:linear-gradient(145deg,#e4f6ff,#edfbea);border:1px solid #cce4ef;border-radius:15px;padding:10px}
.replay-board{width:min(100%,430px,52vh);aspect-ratio:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:4px}
.replay-board .board-cell{cursor:default;border-style:solid;border-radius:7px}
.replay-board .tile-name{font-size:clamp(8px,1.5vw,12px)}
.replay-board .empty-mark{font-size:clamp(12px,2vw,18px)}
.replay-board .replay-fresh{outline:3px solid #ffac17;outline-offset:-4px;box-shadow:0 0 18px #ffdc6699;z-index:1;animation:replay-pop .5s ease-out}
@keyframes replay-pop{0%{filter:brightness(1.4);transform:scale(.94)}100%{filter:brightness(1);transform:scale(1)}}
.replay-stats{text-align:center;font-size:13px;font-weight:900;color:#266080;background:#edf9ff;padding:7px;border-radius:9px}
.replay-caption{text-align:center;font-size:13px;min-height:35px;font-weight:750;line-height:1.4}
.replay-controls{display:flex;flex-direction:column;gap:9px}
#replaySlider{width:100%;accent-color:#2879d2;cursor:pointer}
.replay-transport{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.replay-transport button{min-height:34px;padding:5px 2px;background:#f7fbff;border:1px solid #c2dbe9;border-radius:9px;font-size:11px;font-weight:800;color:#205777}
.replay-transport button.btn-accent{color:#fff;background:#277ed0}
.replay-transport button:disabled{opacity:.45;cursor:default}
.replay-entry{width:100%;text-align:left;padding:10px 11px;line-height:1.4;background:#f5faff;border:1px solid #cfe5f4;border-radius:9px;color:#27506b;font-weight:800;font-size:12px;min-height:43px}
.replay-entry.is-active{border:2px solid #238bdd;background:#e1f4ff}
.replay-library{display:flex;flex-direction:column;gap:5px;max-height:min(54vh,440px);overflow:auto;font-size:13px;color:var(--muted)}
.replay-import-btn{width:100%}
.replay-note{font-size:11px;line-height:1.5;color:var(--muted);margin:0}
.replay-empty{font-size:13px;color:var(--muted);text-align:center}
@media(max-width:700px){
 .replay-layout{grid-template-columns:minmax(0,1fr);gap:7px}
 .replay-stage,.replay-list-panel{padding:9px;gap:6px}
 .replay-viewer{padding:6px;min-height:110px}
 .replay-board{width:min(77vw,38vh,340px)}
 .replay-stats{font-size:11px;padding:4px}
 .replay-caption{font-size:11px;min-height:27px}
 .replay-transport{gap:4px}.replay-transport button{font-size:10px;min-height:31px}
 .replay-head .replay-intro{font-size:10px}
 .replay-entry{font-size:11px;padding:7px;min-height:34px}
 .replay-library{max-height:125px}
 .secondary-actions button{font-size:10px}
}
@media(max-height:440px) and (orientation:landscape){
 .replay-layout{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)}
 .replay-board{width:min(45vh,220px)}
 .replay-page{gap:4px}
 .replay-head .result-title{font-size:19px}
 .replay-head .replay-intro{display:none}
 .replay-stage,.replay-list-panel{gap:4px;padding:6px}
 .replay-library{max-height:160px}
}
@media(prefers-reduced-motion:reduce){.replay-board .replay-fresh{animation:none}}

.replay-board{position:relative;isolation:isolate}
.replay-board .city-detail-layer{pointer-events:none}

/* v0.24.0 — walkable replay snapshots and two-city visual comparison */
.replay-head-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.replay-head-actions button{font-size:12px;padding:8px 10px;border-radius:10px}
.replay-life-status{margin:0;text-align:center;font-size:11px;font-weight:850;color:#2f667b;line-height:1.5}
.replay-board{isolation:isolate;overflow:hidden;padding:3px;box-sizing:border-box;border-radius:12px}
.replay-board[data-phase="morning"]{background:linear-gradient(135deg,#daf6ff,#eafbda)}
.replay-board[data-phase="noon"]{background:linear-gradient(135deg,#b3e9ff,#fff6c1)}
.replay-board[data-phase="evening"]{background:linear-gradient(135deg,#bbace9,#f9bc8d)}
.replay-board[data-phase="night"]{background:linear-gradient(135deg,#27375c,#4d568e);box-shadow:inset 0 0 0 2px #7785c3}
.replay-board[data-phase="evening"] .tile-bg{filter:brightness(.9) sepia(.12)}
.replay-board[data-phase="night"] .tile-bg{filter:brightness(.68) saturate(.88)}
.replay-board[data-phase="night"] .board-cell[data-building="house"]::before,
.replay-board[data-phase="night"] .board-cell[data-building="shop"]::before,
.replay-board[data-phase="night"] .board-cell[data-building="office"]::before{
 content:'✦';position:absolute;right:9%;top:8%;z-index:6;color:#fff5a8;text-shadow:0 0 8px #ffd545;pointer-events:none
}
.trail-life-layer{position:absolute;inset:3px;z-index:10;pointer-events:none;overflow:hidden;border-radius:10px}
.trail-route-svg{position:absolute;inset:0;width:100%;height:100%;opacity:.55;z-index:0}
.trail-route-line{fill:none;stroke:#fffef1;stroke-width:3;stroke-dasharray:5 7;stroke-linecap:round;filter:drop-shadow(0 0 3px #4183b3)}
.trail-agent{position:absolute;z-index:2;transform:translate(-50%,-50%);display:grid;place-items:center;width:clamp(14px,2.4vw,22px);height:clamp(14px,2.4vw,22px);font-size:clamp(12px,1.85vw,17px);border-radius:50%;background:#ffffffde;box-shadow:0 1px 4px #32678988;white-space:nowrap;will-change:left,top}
.trail-agent--car{background:#ffefb0ea}
.replay-compare{display:flex;flex-direction:column;gap:10px;padding:12px}
.replay-compare-head{display:flex;align-items:start;justify-content:space-between;gap:10px}
.replay-compare-head h3{margin:0;font-size:18px;color:#255d83}
.replay-compare-head p{font-size:12px;line-height:1.5;color:var(--muted);margin:3px 0 0}
.replay-compare-head button{flex:none;padding:7px 9px;font-size:11px}
.compare-notice{font-size:12px;color:#825a1c;font-weight:850;line-height:1.5}
.compare-notice:empty{display:none}
.compare-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
.compare-town{display:flex;flex-direction:column;gap:7px;min-width:0;padding:10px;background:linear-gradient(#f3fbff,#fcfefd);border:1px solid #bcddec;border-radius:13px;align-items:center}
.compare-town label{align-self:flex-start;font-size:13px;font-weight:900;color:#245b78}
.compare-town select{width:100%;min-width:0;background:#fff;border:1px solid #aecfe0;border-radius:7px;color:#215674;font-size:12px;font-weight:750;padding:6px;text-overflow:ellipsis}
.compare-town-title{text-align:center;font-size:11px;font-weight:900;color:#35647e;min-height:16px}
.compare-board{width:min(100%,385px,43vh);aspect-ratio:1;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:3px}
.compare-board .tile-name{font-size:clamp(7px,1.3vw,11px)}
.compare-board .trail-agent{font-size:clamp(9px,1.5vw,16px);width:clamp(11px,2vw,20px);height:clamp(11px,2vw,20px)}
.compare-stats{font-weight:900;font-size:12px;color:#245f76;text-align:center;line-height:1.4}
.compare-moment{margin:0;color:#467287;font-size:11px;text-align:center;line-height:1.45;min-height:30px}
.compare-slider-label{text-align:center;font-size:12px;color:#265f80}
#compareSlider{width:100%;accent-color:#3182d3;cursor:pointer}
.compare-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.compare-actions button{min-height:34px;padding:6px;background:#ecf7ff;color:#255976;border:1px solid #b4d8ea;border-radius:9px;font-size:11px;font-weight:850}
.compare-actions .btn-accent{background:#277ed0;color:#fff}
.compare-actions button:disabled{opacity:.5}
.compare-summary{padding:9px;border-radius:9px;background:#eaf6ff;color:#235875;font-size:12px;line-height:1.6;font-weight:750}
@media(max-width:700px){
 .replay-compare{padding:7px;gap:7px}
 .replay-compare-head h3{font-size:15px}
 .replay-compare-head p{font-size:10px}
 .compare-columns{gap:5px}
 .compare-town{padding:5px;gap:4px}
 .compare-town label{font-size:11px}
 .compare-town select{font-size:10px;padding:4px}
 .compare-town-title,.compare-moment{font-size:9px}
 .compare-board{width:100%;gap:2px}
 .compare-board .tile-name{font-size:7px}
 .compare-stats{font-size:9px}
 .compare-actions button{font-size:10px}
 .replay-head-actions button{font-size:10px;padding:5px 7px}
}
@media(max-height:440px) and (orientation:landscape){
 .compare-board{width:min(100%,35vh)}
 .replay-compare-head h3{font-size:14px}
 .replay-compare{gap:4px}
 .compare-town{padding:5px;gap:3px}
}
@media(prefers-reduced-motion:reduce){.trail-life-layer{display:none!important}}
@media(max-width:380px) and (max-height:650px) and (orientation:portrait){
 .replay-head .replay-intro{display:none}
 .replay-head .result-title{font-size:18px;margin:0}
 .replay-compare-head p{display:none}
 .replay-compare-head h3{font-size:12px}
 .replay-compare-head button{font-size:9px;padding:4px 5px}
 .replay-page,.replay-compare{gap:4px}
 .replay-compare{padding:5px}
 .compare-town{gap:2px;padding:3px}
 .compare-town-title{font-size:8px}
 .compare-town select{font-size:9px;padding:3px}
 .compare-board{width:min(100%,130px)}
 .compare-stats{font-size:8px}
 .compare-moment{font-size:8px;max-height:14px;min-height:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}
 .compare-actions button{min-height:27px;padding:3px;font-size:9px}
 .compare-slider-label{font-size:10px}
 #compareSlider{margin:0}
 .compare-summary{font-size:10px;padding:5px}
}
@media(max-width:380px) and (max-height:650px) and (orientation:portrait){
 /* Keep time navigation visible before the miniature boards on compact phones. */
 .replay-compare-head{order:-5}
 .compare-notice{order:-4}
 .compare-slider-label{order:-3}
 #compareSlider{order:-2}
 .compare-actions{order:-1}
 .compare-columns{order:0}
 .compare-summary{order:1}
}

.compare-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:380px){.compare-actions{gap:3px}.compare-actions button{font-size:8px;padding:3px 1px}}

.compare-board .board-cell.compare-different{outline:2px solid #ee8c34;outline-offset:-3px;box-shadow:inset 0 0 9px #ffd78b99;z-index:2}

/* v0.25.0 — cozy, independently saved city album; touch-safe controls */
.secondary-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
.replay-export-actions{display:flex;flex-wrap:wrap;gap:7px}.replay-export-actions button{flex:1;min-width:150px}
.album-page{max-width:1160px;margin:0 auto;padding:10px 8px 32px;display:flex;flex-direction:column;gap:12px}
.album-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.album-head .result-title{margin:0 0 4px}.album-head .replay-intro{font-size:12px;color:var(--muted)}
.album-save-form{display:grid;grid-template-columns:1.2fr 1fr 1.3fr auto;align-items:end;gap:12px;padding:13px}
.album-save-form strong{color:#285e7e}.album-save-form p{font-size:11px;margin:4px 0 0;color:var(--muted);line-height:1.4}
.album-save-form label{font-size:11px;font-weight:900;display:flex;flex-direction:column;gap:5px;color:#255b7d;min-width:0}
.album-save-form input{width:100%;min-width:0;box-sizing:border-box;padding:9px;font:inherit;font-size:13px;border:1px solid #b4d9eb;border-radius:8px;background:#fff;color:#235270}
.album-save-form button{min-height:38px;padding:7px 12px;font-size:12px}.album-save-form button:disabled{opacity:.5}
.album-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;color:#235875;font-size:12px}.album-toolbar span{color:var(--muted);font-size:11px}
.album-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}.album-compare-bar{grid-column:1/-1;display:flex;justify-content:flex-end}
.album-card{display:grid;grid-template-columns:minmax(128px,42%) minmax(0,1fr);gap:12px;padding:12px;border:1px solid #bbd8e8;border-radius:14px;background:linear-gradient(135deg,#f5fcff,#fffaf1);box-shadow:0 3px 13px #10466a16;min-width:0;align-items:center}
.album-board{width:min(100%,250px);align-self:center;justify-self:center;gap:2px;padding:3px}.album-board .tile-name{font-size:clamp(6px,1vw,10px)}
.album-card-body{display:flex;flex-direction:column;gap:7px;min-width:0}.album-city-name{font-size:clamp(14px,1.6vw,19px);margin:0;color:#205675;overflow-wrap:anywhere}
.album-city-info,.album-city-date,.album-city-memo{font-size:11px;line-height:1.45;margin:0;color:#38647b}.album-city-info{font-weight:800}.album-city-memo{background:#fff6de;padding:5px 7px;border-radius:7px}
.album-card-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.album-card-actions button{padding:6px 2px;min-height:31px;border-radius:7px;font-size:10px;overflow-wrap:anywhere}
.album-empty{grid-column:1/-1;text-align:center;padding:40px 12px;color:var(--muted)}
@media(max-width:820px){.album-save-form{grid-template-columns:repeat(2,minmax(0,1fr))}.album-save-form>div:first-child{grid-column:1/-1}.album-grid{grid-template-columns:1fr}.album-card{grid-template-columns:minmax(104px,38%) minmax(0,1fr)}.album-card-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:420px){.secondary-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.album-page{padding:5px 4px 28px;gap:8px}.album-head .result-title{font-size:20px}.album-head .replay-intro{font-size:10px}.album-save-form{gap:7px;padding:8px}.album-save-form label{font-size:10px}.album-save-form input{padding:7px;font-size:12px}.album-card{padding:7px;gap:7px;grid-template-columns:minmax(96px,38%) minmax(0,1fr)}.album-card-body{gap:4px}.album-city-info,.album-city-date,.album-city-memo{font-size:9px}.album-card-actions{gap:3px}.album-card-actions button{font-size:9px;min-height:29px;padding:3px 1px}.album-compare-bar button{font-size:11px}}
@media(max-height:440px) and (orientation:landscape){.album-page{gap:6px;padding-top:3px}.album-head .replay-intro{display:none}.album-save-form{padding:6px}.album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.album-card{grid-template-columns:35% minmax(0,1fr);padding:5px}.album-card-actions button{font-size:9px;min-height:25px}}

/* v0.25.1: actionable first-visit city album. Keep form hidden until a trail exists. */
.album-save-form[hidden]{display:none!important}
.album-empty-guide{grid-column:1/-1;max-width:760px;width:100%;margin:6px auto 0;padding:clamp(14px,2.5vw,26px);border:1px solid #b8ddef;border-radius:18px;background:linear-gradient(125deg,#eaf8ff,#f5fff4 60%,#fff8e9);box-shadow:0 5px 16px #10466a14;color:#244f6a}
.album-empty-guide h3{font-size:clamp(17px,2.2vw,23px);margin:0 0 6px;color:#195f81}
.album-empty-lead{margin:0 0 14px;line-height:1.6;font-size:13px}
.album-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;list-style:none;padding:0;margin:0 0 14px}
.album-steps li{border:1px solid #d7e5ea;background:#fff;border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:5px;min-width:0}
.album-steps strong{font-size:12px;color:#155e83}.album-steps span{font-size:11px;line-height:1.5;color:#405e70}
.album-empty-actions{display:flex;align-items:stretch;gap:8px;flex-wrap:wrap}
.album-empty-actions button{min-height:42px;font-size:12px;flex:1 1 190px}
.album-empty-hint{font-size:10px;margin:11px 0 0;color:#49667c;line-height:1.5}
@media(max-width:600px){.album-steps{grid-template-columns:1fr;gap:6px}.album-steps li{padding:7px 9px;gap:2px}.album-empty-guide{padding:12px}.album-empty-lead{font-size:11px;margin-bottom:9px}.album-steps span{font-size:10px}.album-empty-actions button{flex:1 1 100%;min-height:38px}}
@media(max-height:440px) and (orientation:landscape){.album-empty-guide{margin:0 auto;padding:8px 12px}.album-empty-guide h3{font-size:16px}.album-empty-lead{margin:2px 0 6px}.album-steps{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:7px}.album-steps li{padding:5px}.album-empty-actions button{min-height:33px}.album-empty-hint{margin-top:5px}}
/* Short landscape: show the next-action buttons before the longer explanation. */
@media(max-height:440px) and (orientation:landscape){
  .album-empty-guide{display:flex;flex-direction:column}
  .album-empty-actions{order:1;flex-wrap:nowrap}
  .album-empty-actions button{flex:1 1 0;min-width:0}
  .album-steps{order:2;margin:8px 0 0}
  .album-empty-hint{order:3}
}

/* v0.25.4 — genuine landscape play mode, prioritizing the 4×4 board.
   Existing game elements are rearranged by landscape-layout.js, not duplicated. */
@media (orientation:landscape) and (max-height:560px) and (max-width:980px) {
  .topbar { height:29px; min-height:29px; padding:1px 8px; }
  .brand-mark { width:24px; height:24px; border-radius:8px; }
  .brand-copy { font-size:11px; }
  .top-actions { gap:4px; }
  .icon-btn { height:25px; width:27px; border-radius:8px; }
  .version { font-size:9px; padding:2px 6px; }
  .main-area { padding:3px 4px; }
  #screen-game.game-landscape-compact.is-active { grid-template-rows:minmax(0,1fr); row-gap:0; }
  .game-landscape-compact .play-layout {
    height:100%; grid-template-columns:minmax(0,1fr) minmax(0,1.04fr); gap:5px;
  }
  .game-landscape-compact .board-panel { padding:4px; min-height:0; }
  .game-landscape-compact .board-panel > .section-line { flex:none; min-height:19px; margin-bottom:2px; gap:4px; font-size:11px; }
  .game-landscape-compact .board-panel > .section-line #networkStatus {display:none;}
  .game-landscape-compact .board-panel .observe-btn,
  .game-landscape-compact .board-panel #boardStatus {font-size:9px; padding:2px 5px; min-height:22px; white-space:nowrap;}
  .game-landscape-compact .board-wrap { flex:1; padding:2px; min-height:0; border-radius:8px; }
  .game-landscape-compact .city-board { gap:3px; }
  .game-landscape-compact .side-panel {gap:3px; height:100%; min-height:0;}
  .game-landscape-compact .side-panel > .game-top {flex:none; min-height:24px; height:24px; gap:5px;}
  .game-landscape-compact .game-top .turn-label {font-size:13px; line-height:1;}
  .game-landscape-compact .game-top .mode-label {font-size:8px; margin:0;}
  .game-landscape-compact .game-top .turn-caption {gap:5px;}
  .game-landscape-compact .game-top .clock-box {min-width:71px; padding:2px 5px; line-height:1;}
  .game-landscape-compact .clock-box span {font-size:9px;}
  .game-landscape-compact .clock-box strong {font-size:16px;}
  .game-landscape-compact .side-panel > .hud {flex:none; height:25px; gap:4px;}
  .game-landscape-compact .stat-card {flex:1; width:auto; min-width:0; gap:3px; padding:2px 5px; border-radius:8px;}
  .game-landscape-compact .stat-card .label {font-size:9px;}
  .game-landscape-compact .stat-card .value {font-size:13px;}
  .game-landscape-compact #timeTrack {flex:none; height:3px;}
  .game-landscape-compact .side-panel > .city-growth-panel {
    flex:none; min-height:18px; height:18px; margin:0; padding:1px 5px; gap:5px; overflow:hidden; border-radius:6px;
  }
  .game-landscape-compact .growth-name {font-size:9px;}
  .game-landscape-compact .growth-info {font-size:8px;}
  .game-landscape-compact .commute-summary {font-size:8px; max-width:95px; padding:1px 3px;}
  .game-landscape-compact .growth-meter {min-width:26px;}
  .game-landscape-compact .growth-meter i {height:5px;}
  .game-landscape-compact .cards-panel {flex:1; min-height:0; padding:4px;}
  .game-landscape-compact .cards-panel > .section-line {min-height:15px; margin-bottom:2px;}
  .game-landscape-compact .cards-panel .card-row {flex:1; min-height:0; gap:4px;}
  .game-landscape-compact .card h3 {font-size:11px;}
  .game-landscape-compact .card img {min-height:0;}
  .game-landscape-compact .card .meta-chip {font-size:9px;}
  .game-landscape-compact .action-bar {gap:4px; margin-top:3px;}
  .game-landscape-compact .action-bar button {min-height:27px; font-size:9px; padding:3px;}
  .game-landscape-compact .preview-panel {display:none;}
  .game-landscape-compact .side-panel > .turn-feed {
    flex:none; display:block; min-height:30px; height:30px; max-height:30px; padding:2px 5px;
    margin:0; border-radius:8px; overflow:hidden;
  }
  .game-landscape-compact .turn-feed .citizen-voice-card {display:grid;grid-template-columns:25px minmax(0,1fr);gap:5px;align-items:center;}
  .game-landscape-compact .turn-feed .citizen-voice-face {width:25px;height:25px;border-radius:6px;}
  .game-landscape-compact .turn-feed .citizen-voice-kicker {font-size:8px;line-height:1; margin:0;}
  .game-landscape-compact .turn-feed .citizen-voice-text {font-size:9px;line-height:1.3;white-space:nowrap;text-overflow:ellipsis;display:block;overflow:hidden;}
  .game-landscape-compact .turn-feed .city-moment {display:none;}
  .game-landscape-compact .placement-assist,.game-landscape-compact .board-tip {display:none;}
}

/* Small portrait phones: the same panel-overflow bug used to reduce the board
   to only a few dozen pixels. Preserve a compact citizen ticker on the right
   while allocating enough height for actual 4×4 touch targets. */
@media (orientation:portrait) and (max-width:420px) and (max-height:760px) {
  .game-portrait-compact .play-layout {
    grid-template-rows:minmax(0,61%) minmax(0,39%); gap:3px;
  }
  .game-portrait-compact .board-panel {padding:4px;min-height:0;}
  .game-portrait-compact .board-panel > .section-line {min-height:17px;margin-bottom:2px;}
  .game-portrait-compact .board-panel > .section-line #networkStatus {display:none;}
  .game-portrait-compact .board-wrap {padding:2px;min-height:0;}
  .game-portrait-compact .side-panel {gap:2px;min-height:0;}
  .game-portrait-compact .side-panel > .city-growth-panel {flex:none;min-height:15px;height:15px;padding:1px 4px;margin:0;overflow:hidden;}
  .game-portrait-compact .growth-name {font-size:9px;}
  .game-portrait-compact .growth-meter i {height:5px;}
  .game-portrait-compact .cards-panel {flex:1;min-height:0;padding:4px;}
  .game-portrait-compact .cards-panel > .section-line {margin-bottom:1px;min-height:15px;}
  .game-portrait-compact .card-row {min-height:0;}
  .game-portrait-compact .card h3 {font-size:10px;}
  .game-portrait-compact .card-meta {margin-top:1px;}
  .game-portrait-compact .action-bar {margin-top:2px;}
  .game-portrait-compact .action-bar button {min-height:28px;}
  .game-portrait-compact .preview-panel {display:none;}
  .game-portrait-compact .side-panel > .turn-feed {
     display:block;flex:none;height:26px;min-height:26px;max-height:26px;
     padding:2px 5px;margin:0;border-radius:7px;overflow:hidden;
  }
  .game-portrait-compact .turn-feed .citizen-voice-card {grid-template-columns:22px minmax(0,1fr);gap:4px;}
  .game-portrait-compact .turn-feed .citizen-voice-face {width:22px;height:22px;border-radius:6px;}
  .game-portrait-compact .turn-feed .citizen-voice-kicker {font-size:8px;line-height:1;margin:0;}
  .game-portrait-compact .turn-feed .citizen-voice-text {font-size:9px;line-height:1.2;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .game-portrait-compact .turn-feed .city-moment {display:none;}
}

/* v0.25.5: Non-blocking enlarged municipal card illustration on mobile.
   The popup stays strictly within the card/sidebar region; the 4x4 board
   and active controls remain pointer-accessible while it is visible. */
.card-art-replay-btn{display:none;flex:none;border:1px solid #93c4ea;border-radius:8px;background:#e9f6ff;color:#175083;padding:2px 6px;font-size:14px;font-weight:900;min-width:30px;min-height:25px;line-height:1;cursor:pointer}
.card-art-popup{display:none;box-sizing:border-box;position:fixed;z-index:950;flex-direction:column;align-items:center;gap:2px;padding:7px 8px 5px;background:linear-gradient(165deg,#fffefa,#e9f6ff);border:2px solid #5b9ed1;border-radius:14px;box-shadow:0 6px 22px rgba(15,54,88,.35);pointer-events:none;overflow:hidden;max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
.card-art-popup.is-visible{display:flex}
.card-art-popup-title{flex:none;font-size:13px;line-height:1.25;color:#173c60;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%}
.card-art-popup-image{display:block;width:100%;min-height:0;flex:1;object-fit:contain;background:#fff;border-radius:7px;border:1px solid #d7e8f3}
.card-art-popup-hint{flex:none;font-size:10px;line-height:1.2;color:#27649b;font-weight:850;text-align:center}
@media (max-width:700px) and (orientation:portrait), (max-width:980px) and (max-height:560px) and (orientation:landscape){
 .card-art-replay-btn{display:inline-flex;align-items:center;justify-content:center}
 .cards-panel>.section-line{gap:3px}
 .cards-panel>.section-line .helper-badge{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
}
@media (max-width:380px) and (orientation:portrait){
 .card-art-replay-btn{min-width:27px;padding:2px 4px}
 .card-art-popup-title{font-size:12px}
 .card-art-popup-hint{font-size:9px}
}
@media (max-height:380px) and (orientation:landscape){
 .card-art-popup-title{font-size:11px}
 .card-art-popup-hint{font-size:9px}
}
@media (prefers-reduced-motion:reduce){.card-art-popup{animation:none!important}}
