@font-face{font-family:Fredoka;src:url('../assets/fonts/fredoka.woff2') format('woff2');font-display:swap;font-weight:400 700}

:root{--ink:#edf7fa;--muted:#9bb9cc;--navy:#0b1c30;--panel:#102b43;--edge:#376a83;--cyan:#55d7ec;--green:#72ec9b;--gold:#ffd56b;--red:#ff6b75;--radius:18px;--gap:12px;--fast:160ms;--shadow:0 8px 0 #06131f80,0 22px 60px #0004;color-scheme:dark;font-family:Fredoka,system-ui,sans-serif;font-weight:400}

*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--navy);color:var(--ink)}
button,input,select{font:inherit}
button{cursor:pointer;color:inherit}
button:disabled{cursor:default;opacity:.42;transform:none!important;box-shadow:none!important}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:4px}
button{touch-action:manipulation}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(40px,5.4vw,78px);line-height:.94;letter-spacing:-2px;font-weight:650}
h2{font-size:clamp(25px,3vw,38px);font-weight:600}
h3{font-size:21px;font-weight:550}
p{line-height:1.5;color:var(--muted)}
.sprite{position:absolute;width:0;height:0}
.ic{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;vertical-align:middle}
[hidden]{display:none!important}
#app{position:relative;height:100dvh;width:100%;isolation:isolate}
#city{position:absolute;inset:0;width:100%;height:100%;touch-action:none;user-select:none}
#screen{position:absolute;inset:0;display:grid;place-items:center;padding:max(22px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:linear-gradient(90deg,#071725ed,#07172588 52%,#07172530);overflow:auto}
#screen:empty{display:none}
.panel{border:1px solid var(--edge);background:linear-gradient(150deg,#15334eee,#0b2035fa);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px}
.page{width:min(1050px,100%);margin:auto;animation:enter .24s ease-out}
.page-head{display:flex;align-items:center;gap:16px;margin-bottom:24px}
.page-head>div{flex:1}
.eyebrow{color:var(--cyan);font-size:12px;font-weight:600;letter-spacing:2px;text-transform:uppercase;margin-bottom:9px}
.page-head .eyebrow{margin-bottom:5px}
.hero{width:min(1120px,100%);margin:auto;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:60px}
.hero-copy{max-width:470px}
.hero-copy h1 span{color:var(--cyan);display:block}
.hero-copy .tagline{color:#d9e8ed;font-size:20px;margin:18px 0 28px}
.hero-copy .traffic-logo{margin-bottom:20px}
.hero-stats{display:flex;gap:24px;margin-top:30px}
.hero-stats strong{display:block;font-size:24px;color:var(--ink)}
.hero-stats small{font-size:12px;color:var(--muted)}
.hero-side{align-self:end;text-align:right;padding:20px;color:#d5e5e8;text-shadow:0 2px 6px #071725}
.hero-side p{color:#e4f1f3}
.hero-side strong{display:block;font-size:27px}
.hero-side .pill{margin-bottom:10px;background:#0b2035cc}
.menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.menu-tools{display:flex;gap:12px;margin-top:16px}
.btn,.icon-btn{display:inline-flex;justify-content:center;align-items:center;gap:10px;border:1px solid var(--edge);border-radius:12px;min-height:50px;padding:12px 20px;background:#15354e;color:var(--ink);transition:transform var(--fast),background var(--fast),box-shadow var(--fast);font-weight:500;text-decoration:none}
.btn:hover,.icon-btn:hover{transform:translateY(-2px);background:#204760}
.btn:active,.icon-btn:active{transform:translateY(1px) scale(.98)}
.btn.primary{background:var(--cyan);color:#082334;border-color:#a7effa;box-shadow:0 5px 0 #25788e}
.btn.primary:hover{background:#82e5f2}
.btn.large{width:100%;min-height:64px;font-size:23px}
.btn.secondary{background:#15354edb}
.icon-btn{width:50px;min-width:50px;padding:10px}
.icon-btn[aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.actions>.btn{flex:1;min-width:140px}
.pill{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--edge);border-radius:99px;padding:7px 12px;font-size:12px;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.card{text-align:left;position:relative;padding:20px;min-height:175px;border:1px solid var(--edge);border-radius:16px;background:linear-gradient(140deg,#17354eea,#0b2035f7);transition:transform var(--fast),border-color var(--fast)}
button.card:hover{transform:translateY(-3px);border-color:var(--cyan)}
.card .number{color:var(--accent,var(--cyan));font-size:35px;font-weight:600;display:block;margin-bottom:18px}
.card h3{font-size:19px;margin-bottom:7px}
.card p{font-size:13px}
.card .meta{margin-top:13px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted);gap:8px}
.card .lock{position:absolute;top:18px;right:18px}
.district-art{height:45px;display:flex;gap:5px;align-items:end;margin-bottom:15px;border-bottom:3px solid #405c70}
.district-art i{display:block;width:22px;height:var(--h);background:var(--accent);opacity:.6;border-radius:3px 3px 0 0;box-shadow:4px -3px 0 #ffffff22}
.level-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.stars{display:inline-flex;gap:5px;color:#446074}
.stars .earned{color:var(--gold)}
.stars .ic{width:19px;height:19px}
.brief{max-width:640px;text-align:center}
.brief>.ic{height:52px;width:52px;color:var(--cyan);margin:10px auto 16px}
.brief p{margin-top:12px}
.brief .rules{text-align:left;margin-top:20px;background:#06182666;border-radius:12px;padding:16px}
.rules ul{margin:0;padding-left:20px;color:#d5e3ed;line-height:1.75}
.star-rules{display:grid;gap:8px;margin-top:14px;font-size:13px;text-align:left;color:var(--muted)}
.star-rules>div{display:flex;gap:8px}
.star-rules .ic{width:17px;height:17px;color:var(--gold)}
.hint{margin-top:16px!important;color:var(--cyan);font-size:14px}
.traffic-logo{display:flex;align-items:center;justify-content:center;gap:7px;width:87px;background:#081421;border:2px solid #4a697c;border-radius:24px;padding:9px;box-shadow:0 5px 0 #0004}
.traffic-logo i{width:16px;height:16px;border-radius:50%;background:#f06c73;box-shadow:0 0 12px #f06c7355}
.traffic-logo i:nth-child(2){background:#ffd56b;box-shadow:0 0 12px #ffd56b55}
.traffic-logo i:nth-child(3){background:#72ec9b;box-shadow:0 0 12px #72ec9b55}
.loading{text-align:center}
.loading .traffic-logo{margin:0 auto 25px}
.loading h1{font-size:46px}
.loading h1 span{display:block;color:var(--cyan)}
.loading p{margin-top:20px}
.load-track{width:180px;height:4px;background:#183b54;margin:20px auto;overflow:hidden;border-radius:4px}
.load-track:after{content:'';display:block;width:60px;height:100%;background:var(--cyan);animation:load 1.1s infinite ease-in-out}
.loading .traffic-logo i{animation:signal 1.2s infinite}
.loading .traffic-logo i:nth-child(2){animation-delay:.4s}
.loading .traffic-logo i:nth-child(3){animation-delay:.8s}

#hud{position:absolute;inset:0;pointer-events:none;display:flex;flex-direction:column;padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));gap:8px}
#hud button{pointer-events:auto}
.hud-top{display:flex;align-items:stretch;gap:8px}
.hud-box{background:linear-gradient(135deg,#102f45f5,#081c30f5);border:1px solid #4b8097;border-radius:12px;box-shadow:0 3px 0 #04121da0;padding:10px 15px;min-width:88px}
.hud-box small{display:block;color:#a0bfcd;font-size:10px;letter-spacing:1px;text-transform:uppercase;margin-bottom:3px}
.hud-box strong{font-size:24px;line-height:1}
.hud-level{min-width:160px}
.hud-level strong{font-size:19px}
.hud-level .stars{float:right;margin-left:18px}
.hud-level .stars .ic{width:14px;height:14px}
.hud-score{flex:1;max-width:220px;color:var(--gold)}
.hud-time{margin-left:auto}
.hud-time strong{color:var(--gold)}
.hud-top .icon-btn{background:#102b43f5}
.hud-sub{display:flex;justify-content:space-between;gap:10px}
.mission{background:#081e32e8;border:1px solid #3c647a;border-radius:9px;padding:7px 12px;font-size:13px;color:#cfdee6;max-width:70%;line-height:1.4}
.mission strong{color:var(--cyan)}
.combo{background:#081e32e8;border:1px solid #456d7c;border-radius:10px;padding:7px 15px;font-size:16px;color:var(--green);white-space:nowrap;align-self:start}
.notice{max-width:380px;padding:9px 13px;border-radius:8px;border-left:3px solid var(--gold);background:#082035e8;font-size:12px;color:#ffdf92;line-height:1.4}
.emergency-banner{border-left-color:var(--red);color:#ffdce1}
.hud-bottom{margin-top:auto;display:flex;gap:12px;align-items:end;justify-content:space-between}
.pressure-box{width:220px}
.pressure-line{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px}
.pressure-line strong{font-size:16px}
.pressure-track{background:#071928;border:1px solid #548096;border-radius:5px;height:13px;margin-top:7px;overflow:hidden}
.pressure-track span{display:block;height:100%;background:linear-gradient(90deg,#64e794,#bee760,#ffd15b,#ff9852,#ff546c);background-size:220px 100%;transition:width .15s linear}
.pressure-box .state{font-size:10px;color:var(--cyan);margin-top:5px}
.signal-strip{display:flex;gap:8px;pointer-events:auto}
.signal-card{width:76px;min-height:82px;padding:8px 6px;border:1px solid #528393;border-radius:12px;background:linear-gradient(145deg,#133b4ef5,#0b1c31fa);display:grid;justify-items:center;gap:4px;color:#c3d7e1}
.signal-card[aria-pressed=true]{border-color:#90e2ec;box-shadow:0 0 0 2px #59d9e325}
.signal-card:hover{background:#254c5d}
.signal-card .lamps{display:flex;gap:4px;background:#06151f;border-radius:9px;padding:5px}
.lamp{height:9px;width:9px;border-radius:50%;background:#29434c}
.lamp.on.red{background:#fa6977;box-shadow:0 0 7px #fa697799}
.lamp.on.amber{background:#ffd56b;box-shadow:0 0 7px #ffd56b99}
.lamp.on.green{background:#72ec9b;box-shadow:0 0 7px #72ec9b99}
.signal-card b{font-size:12px}
.signal-card small{font-size:9px;color:#acc7d3}
.stop-btn{min-height:52px;color:#ffbac2;max-width:140px;font-size:12px}
.controls-note{font-size:10px;color:#b2c8d2;text-align:center;background:#061725bb;padding:4px 9px;border-radius:6px;align-self:center}
.tutorial{position:absolute;top:40%;left:50%;transform:translate(-50%,-50%);background:#0e3049ed;border:2px solid var(--cyan);padding:10px 18px;border-radius:40px;font-size:17px;text-align:center;color:#fff;pointer-events:none;animation:pulse 1.5s infinite}
.tutorial small{font-size:12px;display:block;color:var(--cyan)}
#countdown{position:absolute;inset:0;display:grid;place-content:center;text-align:center;font-size:90px;font-weight:600;background:#06172450;pointer-events:none;color:#fff;text-shadow:0 5px 0 #0c263d}
#countdown small{font-size:15px;letter-spacing:4px}
.pause-panel{width:min(400px,100%);text-align:center}
.pause-panel .actions{flex-direction:column}
.pause-panel p{margin-top:12px}
.result{max-width:650px;text-align:center}
.result-score{font-size:64px;line-height:1.1;color:var(--gold);margin:12px 0}
.result .stars{margin:14px 0}
.result .stars .ic{width:46px;height:46px}
.result .stars .earned{animation:star-in .45s both;animation-delay:var(--delay)}
.result-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.result-metrics>div{background:#081b2dcc;padding:13px 6px;border-radius:10px}
.result-metrics strong{font-size:23px;display:block}
.result-metrics small{color:var(--muted);font-size:12px}
.result .reason{color:#ffb2ba;font-size:16px;margin:12px 0}
.record-tag{color:var(--green);letter-spacing:1px;font-size:13px}
.reward-choice{margin-top:18px;border-top:1px solid #34576f;padding-top:16px}
.reward-choice .actions{margin-top:12px}
.reward-choice p{font-size:12px}
.settings{max-width:620px}
.setting{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:15px 0;border-bottom:1px solid #315068}
.setting label{flex:1}
.setting small{display:block;color:var(--muted);margin-top:4px;font-size:12px}
input[type=range]{accent-color:var(--cyan);width:170px}
input[type=checkbox]{accent-color:var(--cyan);width:25px;height:25px}
select{background:#0b2238;border:1px solid #568097;padding:8px;border-radius:8px}
.achievement .ic{width:34px;height:34px;color:var(--cyan);margin-bottom:12px}
.achievement.unlocked{border-color:#69bb94}
.achievement.unlocked .ic{color:var(--gold)}
.progress{height:5px;background:#071a2c;border-radius:4px;overflow:hidden;margin-top:13px}
.progress span{display:block;height:100%;background:var(--cyan)}
.daily-detail{margin:18px 0;display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.page-footer{margin-top:22px;display:flex;align-items:center;gap:15px;color:var(--muted);font-size:13px}
#toasts{position:fixed;left:50%;bottom:max(22px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;display:grid;gap:8px;pointer-events:none;width:min(420px,90%)}
.toast{padding:13px 18px;border:1px solid var(--cyan);border-radius:12px;background:#102d44f5;box-shadow:0 8px 24px #0006;font-size:14px;animation:enter .2s}
.toast strong{color:var(--gold)}
#ad-shield{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:#06111fd9;text-align:center}
.spinner{border:3px solid #315b72;border-top-color:var(--cyan);border-radius:50%;width:34px;height:34px;margin:0 auto 15px;animation:spin 1s linear infinite}
.high-contrast{--muted:#d1e1ec;--edge:#8bb1c5}
.high-contrast .signal-card{border-width:2px}
.reduced-motion *, .reduced-motion *:before,.reduced-motion *:after{animation:none!important;transition:none!important}
.reduced-motion .btn:hover{transform:none}

@keyframes enter{from{opacity:0;transform:translateY(12px)}
to{opacity:1;transform:none}
}
@keyframes star-in{from{opacity:0;transform:scale(.25) rotate(-20deg)}
to{opacity:1;transform:scale(1)}
}
@keyframes load{from{transform:translateX(-60px)}
to{transform:translateX(180px)}
}
@keyframes signal{50%{opacity:.35}
}
@keyframes pulse{50%{box-shadow:0 0 0 8px #55d7ec18}
}
@keyframes spin{to{transform:rotate(360deg)}
}

@media(min-width:1600px){.hero{max-width:1300px}
.hero-copy{max-width:520px}
.page{max-width:1200px}
.card{padding:25px;min-height:195px}
.hud-box{padding:14px 21px}
.signal-card{width:88px;min-height:92px}
}

@media(max-width:1000px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.level-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.hero{gap:25px}
.hero-side{padding:0}
.hud-box{padding:9px 11px;min-width:70px}
.hud-box strong{font-size:20px}
.hud-level{min-width:145px}
.signal-strip{gap:5px}
.signal-card{width:62px;min-height:74px}
.pressure-box{width:180px}
.stop-btn{max-width:100px;padding:10px}
.hud-level .stars{float:none;display:flex;margin:4px 0 0}
}

@media(max-height:550px) and (min-width:600px){#screen{padding:16px 22px;place-items:start center}
.hero{max-width:850px;gap:30px}
.hero h1{font-size:42px}
.hero-copy .traffic-logo{margin-bottom:10px}
.hero-copy .tagline{margin:10px 0 14px;font-size:16px}
.hero-stats{margin-top:14px}
.hero-stats strong{font-size:20px}
.btn.large{min-height:48px;font-size:20px}
.menu-grid .btn{min-height:40px;padding:8px 12px;font-size:14px}
.menu-tools{margin-top:10px}
.menu-tools .btn,.menu-tools .icon-btn{min-height:40px;height:40px}
.hero-side{font-size:13px}
.page-head{margin-bottom:15px}
.panel{padding:20px}
.brief{max-width:780px}
.brief>.ic{display:none}
.brief .rules{margin-top:12px;padding:10px;font-size:13px}
.brief .star-rules{font-size:12px;gap:4px}
.brief p{font-size:14px;margin-top:6px}
.actions{margin-top:15px}
.card{min-height:140px;padding:15px}
.district-art{height:25px}
#hud{padding:6px 9px;gap:5px}
.hud-box{padding:6px 10px;border-radius:9px}
.hud-box strong{font-size:18px}
.hud-box small{font-size:8px}
.hud-level{min-width:130px}
.hud-level .stars{display:none}
.hud-top .icon-btn{height:42px;min-height:42px;width:44px;min-width:44px}
.mission{font-size:11px;padding:5px 9px}
.combo{font-size:13px;padding:5px 10px}
.notice{font-size:10px;padding:5px 10px;max-width:320px}
.pressure-box{width:165px}
.signal-card{min-height:59px;width:60px;padding:5px;gap:2px}
.signal-card small{font-size:8px}
.signal-card .lamps{padding:3px}
.stop-btn{min-height:42px}
.controls-note{display:none}
.result-score{font-size:42px}
.result .stars{margin:8px}
.result .stars .ic{height:32px;width:32px}
.result-metrics{margin-top:10px}
.result-metrics>div{padding:8px}
.result-metrics strong{font-size:20px}
.result{max-width:700px}
.result h2{font-size:26px}
}

@media(max-width:599px){#screen{padding:22px 16px;background:linear-gradient(180deg,#071725cf,#071725f0)}
h1{font-size:59px}
.hero{display:block;max-width:440px}
.hero-copy{max-width:none}
.hero-side{display:none}
.hero-copy .tagline{font-size:18px}
.hero-stats{justify-content:space-between;gap:10px}
.grid{gap:10px}
.card{padding:15px;min-height:170px}
.card h3{font-size:17px}
.card p{font-size:12px}
.card .number{font-size:30px;margin-bottom:12px}
.level-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.panel{padding:22px 17px}
.page-head{gap:12px}
.page-head h2{font-size:26px}
.page-head p{font-size:12px}
.page-head .icon-btn{width:44px;min-width:44px;height:44px;min-height:44px}
.brief p{font-size:14px}
.actions{gap:10px}
.actions>.btn{min-width:120px}
.menu-tools{gap:8px}
.menu-tools .btn{padding:12px;font-size:14px}
.hud-top{flex-wrap:wrap;gap:5px}
.hud-box{padding:8px 10px;min-width:0;flex:1}
.hud-level{flex-basis:37%}
.hud-score{flex-basis:26%;max-width:none}
.hud-time{flex-basis:25%;margin:0}
.hud-level strong{font-size:16px}
.hud-level .stars{display:none}
.hud-detail{order:5}
.hud-top .icon-btn{width:44px;min-width:44px;min-height:40px;height:40px}
.hud-box strong{font-size:19px}
.hud-sub{gap:5px}
.mission{max-width:78%;font-size:11px;padding:6px 9px}
.combo{font-size:12px;padding:6px 9px}
.notice{font-size:11px;max-width:90%}
.hud-bottom{display:grid;grid-template-columns:1fr auto;gap:8px}
.pressure-box{width:auto;grid-column:1}
.signal-strip{grid-row:2;grid-column:1/-1;display:grid;grid-template-columns:repeat(var(--signals,1),minmax(0,1fr));gap:4px}
.signal-card{width:100%;min-height:73px;gap:3px;padding:7px 2px}
.signal-card small{font-size:8px}
.signal-card .lamps{gap:3px;padding:4px}
.lamp{width:8px;height:8px}
.stop-btn{grid-column:2;grid-row:1;max-width:none;min-height:63px}
.controls-note{font-size:9px}
.tutorial{font-size:14px;top:42%;width:230px}
.result-score{font-size:54px}
.result-metrics{gap:8px}
.result-metrics strong{font-size:21px}
.result-metrics small{font-size:10px}
.result .stars .ic{width:37px;height:37px}
.setting{gap:12px}
input[type=range]{width:135px}
.setting label{font-size:15px}
.page-footer{flex-wrap:wrap}
.reward-choice .btn{font-size:13px;min-width:110px;padding:10px}
}

@media(prefers-reduced-motion:reduce){body:not(.motion-enabled) *{animation:none!important;transition:none!important}
}


/* ============================================================================
   Integration layer — markup generated by ui/screens.js + main.js.
   Layered on top of the base design system above; no base rule is rewritten.
   ============================================================================ */

/* --- HUD top cluster: one measured band so the renderer can never place a
       junction under the HUD. Sub-row, notice band and tutorial are children
       of .hud-top so their height is part of the gameplay safe area. --------- */
.hud-top{flex-wrap:wrap}
.hud-top>.hud-sub,.hud-top>.hud-notices,.hud-top>.tut-wrap{flex:1 0 100%;min-width:0}
.hud-sub{align-items:flex-start}
.hud-sub>.mission{height:calc(2 * 1.4em + 14px);overflow:hidden}
.hud-sub>.combo{align-self:flex-start}
.hud-notices{display:flex;align-items:center;min-height:34px}
.hud-notices .notice{max-width:min(560px,92%)}
.hud-notices .notice .ic{width:14px;height:14px;vertical-align:-2px}

.tut-wrap{display:flex;justify-content:center}
.hud-top>.tut-wrap .tutorial{position:static;transform:none;margin:0 auto;max-width:460px;font-size:15px}

/* --- HUD bottom: pressure + signal panel + all-stop, plus the controls note -->
.hud-bottom{flex-wrap:wrap}
.hud-bottom>.controls-note{flex:1 0 100%}
.pressure-track span{background-size:calc(10000% / var(--p,100)) 100%;background-repeat:no-repeat}
.pressure-box .state{font-weight:600;letter-spacing:1px}
.pressure-box .state.normal{color:var(--green)}
.pressure-box .state.busy{color:var(--cyan)}
.pressure-box .state.warning{color:var(--gold)}
.pressure-box .state.critical{color:var(--red);animation:pulse .9s infinite}
.signal-card.warn small{color:var(--red)}
.signal-card.warn{border-color:#a4525f}
.signal-card{cursor:pointer}

/* --- countdown --------------------------------------------------------- */
#countdown small{display:block}

/* --- cards / meta helpers --------------------------------------------- */
.card .meta .stars{display:inline-flex}
.card .achievement,.card .ic{margin-bottom:12px}
.card.achievement .progress{margin-top:10px}
.card.achievement .meta{justify-content:flex-start}
.challenge-note{margin-top:10px;color:var(--muted);font-size:12px}

/* --- results / failure / reward --------------------------------------- */
.result .stars>span{display:inline-block}
.result .reason{margin:10px 0;color:#ffb2ba}
.reward-choice .eyebrow{display:flex;align-items:center;gap:7px;justify-content:center;color:var(--cyan)}
.reward-choice .eyebrow .ic{width:16px;height:16px;width:16px}
.reward-choice .actions>.btn{flex:1;min-width:170px}
.result-metrics strong{overflow-wrap:anywhere}

/* --- settings ---------------------------------------------------------- */
.settings .setting .btn{min-height:44px}
.settings .setting select{min-width:120px}

/* --- pills with icons -------------------------------------------------- */
.pill .ic{width:14px;height:14px}
.hero-stats .ic{width:14px;height:14px}
.page-footer .ic,.card .meta .ic{width:14px;height:14px;vertical-align:-2px}
.hero-copy h1{overflow-wrap:anywhere}
.hero-copy .btn.large{width:100%}

/* --- compact landscape phones (height limited) ------------------------- */
@media (max-height:550px) and (min-width:600px){
  .hud-sub>.mission{height:calc(2 * 1.4em + 10px);font-size:11px}
  .hud-notices{min-height:26px}
  .hud-notices .notice{font-size:10px;padding:4px 9px}
  .hud-top>.tut-wrap .tutorial{font-size:13px;padding:7px 13px}
  .card.achievement{padding:14px}
}

/* --- portrait phones --------------------------------------------------- */
@media (max-width:599px){
  .hud-sub>.mission{height:calc(2 * 1.4em + 12px);font-size:11px}
  .hud-notices{min-height:28px}
  .hud-top>.tut-wrap .tutorial{font-size:13px;padding:8px 12px;width:auto}
  .hud-bottom>.controls-note{grid-column:1/-1}
  .signal-card{cursor:default}
  .reward-choice .actions>.btn{min-width:120px;font-size:13px}
  .result-metrics{grid-template-columns:repeat(3,1fr)}
  .settings .setting label{font-size:14px}
  .settings .setting select{min-width:96px}
}

/* ============================================================================
   Integration fixes (round 2)
   ============================================================================ */

/* HUD stays visible during pause but must never be clickable or focusable
   while a modal (#screen) is on top. */
#hud.hud-inert{pointer-events:none}
#hud.hud-inert button,#hud.hud-inert [data-act]{pointer-events:none}
#hud.hud-inert .signal-strip{opacity:.55}

/* Compact menu centred over the procedural city — no sidebar / dashboard. */
.menu-wrap{width:min(520px,100%);margin:auto;display:grid;justify-items:center;gap:14px;text-align:center;padding:24px 18px}
.menu-wrap h1{font-size:clamp(30px,7vw,54px);margin:0}
.menu-stats{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.menu-wrap .menu-grid{width:100%}
.menu-wrap .menu-tools{justify-content:center}
.menu-wrap>.btn.large{width:100%}

/* Signal panel: explicit N-S / E-W phase chips, so the state is never colour-only. */
.signal-card .axis{display:flex;gap:3px;margin:2px 0 1px}
.signal-card .axis i{font-style:normal;font-size:9px;line-height:1;padding:2px 4px;border-radius:4px;background:#0e2436;color:#7f9db0;letter-spacing:.5px}
.signal-card .axis i.on{background:#123c2c;color:var(--green)}
.signal-card .axis i.amber{background:#3d3413;color:var(--gold)}
.signal-card.hold{border-color:#a4525f}
.signal-card.hold .axis i{opacity:.4}
.signal-card small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
