/* ============================================================
   ZOMBIE HORDE: LAST STAND — style.css
   Military-survival UI theme. No external fonts or assets.
   ============================================================ */
:root {
  --amber: #ffd24a;
  --green: #8fe06a;
  --red: #ff5a4a;
  --panel: #1c2018;
  --panel2: #232a1d;
  --line: #3a4430;
  --text: #e8e4d0;
  --dim: #a8a890;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  background: #101208;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#game:active { cursor: grabbing; }
body.placing #game { cursor: copy; }
body.air-targeting #game { cursor: crosshair; }

button { font-family: inherit; }

/* =============== LOADING =============== */
#loading {
  position: absolute; inset: 0; z-index: 200; background: #14160e;
  display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center;
  color: var(--dim); font-weight: 700; letter-spacing: 2px; transition: opacity .4s;
}
#loading.off { opacity: 0; pointer-events: none; }
.spin { width: 44px; height: 44px; border: 5px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =============== TOP BAR =============== */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 6px;
  padding: calc(7px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 7px calc(10px + env(safe-area-inset-left));
  background: linear-gradient(#14170de6, #14170dc0); border-bottom: 2px solid var(--line);
  backdrop-filter: blur(3px);
}
.res { display: flex; align-items: center; gap: 5px; background: #00000055; border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; font-size: 14px; white-space: nowrap; }
.res b { font-variant-numeric: tabular-nums; }
.res-money b { color: var(--amber); }
.res-energy b { color: #6ec8ff; }
.res-pop b { color: var(--green); }
.res-income b { color: var(--green); }
.res-income.neg b { color: var(--red); }
.wave-chip { margin: 0 auto; text-align: center; background: #2c1a14; border: 1px solid #6b3a2c; border-radius: 10px; padding: 3px 14px; line-height: 1.05; }
.wave-chip span { font-weight: 800; font-size: 14px; letter-spacing: 1px; color: #ffb09a; }
.wave-chip small { display: block; font-size: 9px; letter-spacing: 3px; color: var(--dim); }
.tb-right { display: flex; gap: 5px; }
.tb-btn { background: #00000055; color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; font-size: 13px; cursor: pointer; }
.tb-btn:active { transform: scale(0.94); }
#boosts { position: absolute; top: calc(46px + env(safe-area-inset-top)); left: 10px; z-index: 39; display: flex; gap: 6px; flex-wrap: wrap; max-width: 60%; }
.boost { background: #12403bcc; border: 1px solid #2e6b60; color: #9df0dd; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; }

/* =============== RIGHT CARDS =============== */
#rightCard, #battleCard {
  position: absolute; top: 56px; right: 10px; z-index: 40; width: 205px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 6px 22px #000a;
}
.rc-title { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--amber); }
.rc-title.danger { color: var(--red); }
.rc-wave { margin: 6px 0 2px; font-size: 13px; }
.rc-wave b { color: #ffb09a; }
.rc-types { font-size: 10.5px; color: var(--dim); min-height: 14px; }
.rc-timer { font-size: 34px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; margin: 4px 0 8px; text-shadow: 0 2px 0 #000; }
.rc-timer.hot { color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.5; } }
.bc-small { font-size: 11px; color: #ffb09a; font-weight: 700; margin: 4px 0 6px; }
.bc-row { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--dim); margin-top: 6px; }
.bc-row b { color: var(--red); float: right; font-size: 14px; }
.base-track { position: relative; height: 18px; background: #000; border-radius: 9px; overflow: hidden; margin-top: 3px; border: 1px solid var(--line); }
.base-bar { height: 100%; transition: width .3s; }
.base-bar.ok { background: linear-gradient(#9fe06a, #6cae4a); }
.base-bar.mid { background: linear-gradient(#ffd24a, #d09a20); }
.base-bar.low { background: linear-gradient(#ff7a4a, #c93a20); }
.base-track span { position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 800; line-height: 18px; color: #fff; text-shadow: 0 1px 2px #000; }
.bc-hint { margin-top: 8px; font-size: 10px; color: var(--dim); }
.bc-abils { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.bc-ab {
  flex: 1 1 30%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 4px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(180deg, #3a4150, #262b36);
  border: 2px solid #4d5568; color: #fff;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
}
.bc-ab:active { transform: scale(0.92); }
.bc-ab:disabled { opacity: 0.42; cursor: default; }
.bc-ab .ab-ico { font-size: 17px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.bc-ab .ab-name { font-size: 8px; font-weight: 800; letter-spacing: .5px; color: var(--dim); text-transform: uppercase; }
.bc-ab .ab-cost { font-size: 10px; font-weight: 800; color: #ffd54a; }
.bc-ab.afford { border-color: #ffd54a; box-shadow: 0 0 7px rgba(255, 213, 74, .45); animation: abPulse 1.3s infinite; }
@keyframes abPulse { 50% { box-shadow: 0 0 14px rgba(255, 213, 74, .85); border-color: #ffe98a; } }

/* =============== BOTTOM NAV =============== */
#bottombar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(#14170dc0, #14170de8); border-top: 2px solid var(--line);
  justify-content: center;
}
.nav-btn {
  flex: 1; max-width: 110px; background: var(--panel2); color: var(--text);
  border: 2px solid var(--line); border-radius: 12px; padding: 7px 2px 5px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer;
}
.nav-btn span { font-size: 19px; }
.nav-btn small { font-size: 8.5px; font-weight: 800; letter-spacing: 1px; color: var(--dim); }
.nav-btn.on { border-color: var(--amber); background: #3a3017; }
.nav-btn.on small { color: var(--amber); }
.nav-btn.locked { opacity: 0.45; }
.nav-btn:active { transform: scale(0.95); }

/* =============== PANEL (bottom sheet) =============== */
#panelWrap {
  position: absolute; left: 0; right: 0; bottom: 64px; z-index: 41;
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
  background: var(--panel); border-top: 2px solid var(--amber);
}
#panelWrap.open { max-height: min(47vh, calc(100vh - 170px)); box-shadow: 0 -10px 40px #000c; }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px 4px; letter-spacing: 1px; }
.p-close { background: none; border: none; color: var(--dim); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.p-body { overflow-y: auto; max-height: calc(min(47vh, 100vh - 170px) - 40px); padding: 4px 12px 14px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.p-cat { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--amber); margin: 12px 0 6px; }
.p-note { font-size: 12px; color: var(--dim); padding: 6px 2px; line-height: 1.45; flex: 1; }
.p-row { display: flex; gap: 10px; align-items: center; }
.cards { display: flex; gap: 8px; flex-wrap: wrap; padding: 3px 2px 8px; }
.card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  min-width: 148px; max-width: 148px; padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.card b { font-size: 13px; }
.card small { color: var(--dim); font-size: 10.5px; line-height: 1.35; }
.card em { font-style: normal; color: #c8c49f; font-size: 10.5px; line-height: 1.3; flex: 1; }
.c-ico { font-size: 26px; }
.c-own { font-size: 10px; color: var(--dim); }
.c-own b { color: var(--green); }
.c-lock { font-size: 10px; color: var(--red); font-weight: 700; }
.t-own { display: flex; align-items: center; gap: 4px; border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 2px; flex-wrap: wrap; }
.t-hp { font-size: 11px; font-weight: 800; color: var(--green); }
.btn {
  border: 2px solid #00000066; border-radius: 10px; padding: 8px 10px; font-weight: 800;
  font-size: 13px; cursor: pointer; color: #14200f; letter-spacing: .5px;
}
.btn:disabled { opacity: 0.38; cursor: default; filter: grayscale(0.6); }
.btn:not(:disabled):active { transform: scale(0.96); }
.btn-buy { background: linear-gradient(#b8e070, #7fb34a); }
.btn-gold { background: linear-gradient(#ffd24a, #d89a20); }
.btn-danger { background: linear-gradient(#ff8a5a, #d84a2a); color: #fff; }
.btn-energy { background: linear-gradient(#8ad0ff, #4a90d8); color: #08243a; }
.btn-ghost { background: #2c3424; color: var(--text); border-color: var(--line); }
.btn-big { display: block; width: 100%; padding: 13px; font-size: 15px; margin-top: 10px; }
.btn-max { background: #3a4430; color: var(--green); }
.btn-mini { background: #2c3424; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-mini.on { border-color: var(--amber); color: var(--amber); }
.btn-mini.danger { color: var(--red); }
.btn-mini:disabled { opacity: 0.4; }
.cost { opacity: 0.85; font-size: 12px; }

/* =============== UPGRADES =============== */
.tabs { display: flex; gap: 6px; margin: 6px 0; }
.tab { flex: 1; background: var(--panel2); color: var(--dim); border: 1px solid var(--line); border-radius: 9px; padding: 8px; font-weight: 800; font-size: 12px; cursor: pointer; }
.tab.on { color: var(--amber); border-color: var(--amber); }
.up-sec { margin-bottom: 10px; }
.up-name { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #c8c49f; margin: 8px 0 4px; }
.up-row { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 5px; }
.up-row .btn { min-width: 92px; }
.up-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.up-info b { font-size: 12.5px; }
.up-info small { color: var(--dim); font-size: 10.5px; }
.pips { display: inline-flex; gap: 3px; margin-top: 2px; }
.pips i { width: 14px; height: 5px; background: #000; border-radius: 2px; display: inline-block; }
.pips i.on { background: var(--amber); box-shadow: 0 0 5px #ffd24a88; }

/* =============== TECH =============== */
.tech-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; touch-action: pan-x; }
.tech-col { min-width: 132px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.tech-head { font-size: 12px; font-weight: 800; text-align: center; padding-bottom: 6px; letter-spacing: 1px; }
.tech-node { background: #161a12; border: 1px solid var(--line); border-radius: 9px; padding: 6px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; min-height: 66px; }
.tech-node b { font-size: 11px; }
.tech-node small { font-size: 9.5px; color: var(--dim); line-height: 1.25; flex: 1; }
.tech-node.done { border-color: #5a8c3a; background: #1c2c14; }
.tech-node.done .done { color: var(--green); font-weight: 900; }
.tech-node.next { border-color: var(--amber); cursor: pointer; }
.tech-node.next .cost { color: var(--amber); font-weight: 800; font-size: 12px; }
.tech-node.next.poor { opacity: 0.55; cursor: default; }
.tech-node.next:not(.poor):hover { background: #2c2c14; }
.tech-node .lock { color: var(--dim); font-size: 10px; }

.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mini-toggle { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 6px; font-size: 13px; line-height: 1; width: 22px; height: 19px; cursor: pointer; flex: none; padding: 0; font-weight: 900; }
.mini-toggle:hover { color: var(--text); border-color: var(--dim); }
#rightCard.min .rc-body, #battleCard.min .rc-body { display: none; }
#rightCard.min, #battleCard.min { width: auto; min-width: 120px; }
.mini-toggle { pointer-events: auto; }
#selPanel .sel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#selPanel .sel-head b { font-size: 14px; }
#selPanel .sel-body { display: flex; flex-direction: column; gap: 5px; }
#selPanel.min .sel-body { display: none; }
#selPanel.min { width: auto; max-width: 250px; }

/* =============== SELECTION PANEL =============== */
#selPanel {
  position: absolute; bottom: 74px; left: 10px; z-index: 42; width: 250px;
  max-height: min(46vh, calc(100vh - 190px)); overflow-y: auto;
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  display: none; flex-direction: column; gap: 5px; box-shadow: 0 6px 22px #000a;
}
#selPanel.show { display: flex; }
#selPanel b { font-size: 14px; }
#selPanel small { color: var(--dim); font-size: 11px; }
.sel-cmds { display: flex; flex-wrap: wrap; gap: 4px; }

/* =============== TOASTS / BANNER =============== */
#toasts { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); z-index: 140;  /* above modals + title */ display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  background: #161a12ee; border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; text-align: center;
  animation: tin .25s ease; box-shadow: 0 4px 16px #000a; max-width: 100%;
}
.toast small { display: block; font-weight: 400; color: var(--dim); font-size: 11px; }
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.warn { border-left-color: #ff9a3a; }
.toast.tech { border-left-color: #6ec8ff; }
.toast.ach { border-left-color: var(--amber); background: linear-gradient(#2c2410ee, #161a12ee); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
#banner {
  position: absolute; top: 30%; left: 0; right: 0; z-index: 59; text-align: center;
  opacity: 0; pointer-events: none; transform: scale(1.15); transition: all .3s;
}
#banner.show { opacity: 1; transform: scale(1); }
.b-big { font-size: clamp(28px, 6vw, 54px); font-weight: 900; letter-spacing: 3px; color: var(--amber); text-shadow: 0 4px 0 #000, 0 0 30px #ffd24a55; }
.b-sub { font-size: clamp(14px, 3vw, 22px); font-weight: 700; color: var(--text); text-shadow: 0 2px 0 #000; }
#banner.danger .b-big { color: var(--red); text-shadow: 0 4px 0 #000, 0 0 40px #ff2a1a88; }
#redflash { position: absolute; inset: 0; z-index: 58; background: radial-gradient(#ff2a1a22, #ff2a1a44); opacity: 0; pointer-events: none; }
#redflash.on { animation: rflash .9s ease; }
@keyframes rflash { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
#vignette { position: absolute; inset: 0; z-index: 30; pointer-events: none; box-shadow: inset 0 0 140px #000c; }
body.is-night #vignette { box-shadow: inset 0 0 220px #000; }

/* =============== MODALS =============== */
#pauseOv { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 2, .74); display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
#pauseOv.show { display: flex; }
#pauseOv .pbox { text-align: center; background: #181d10; border: 1px solid #6d7c3f; border-radius: 14px; padding: 26px 34px; }
#modalWrap { position: absolute; inset: 0; z-index: 120;  /* above the lobby title (90) — lobby modals must be seen & clicked */ background: #0a0c06b8; display: none; align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(3px); }
#modalWrap.show { display: flex; }
.modal {
  background: var(--panel); border: 2px solid var(--line); border-radius: 18px;
  width: min(480px, 94vw); max-height: 92vh; overflow-y: auto; padding: 20px;
  box-shadow: 0 20px 60px #000d; animation: pop .25s ease; touch-action: pan-y;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.m-title { font-size: 22px; font-weight: 900; letter-spacing: 1px; text-align: center; }
.m-title.warn { color: var(--amber); }
.m-title.doom { color: var(--red); animation: blink 1.2s infinite; }
.m-title.gold { color: var(--amber); }
.m-wave { text-align: center; font-size: 26px; font-weight: 900; margin-top: 6px; letter-spacing: 2px; }
.m-wave small { font-size: 14px; color: var(--dim); }
.m-name { text-align: center; font-size: 16px; color: #ffb09a; font-weight: 700; }
.doom-m .m-name { color: var(--red); font-size: 20px; margin-top: 4px; }
.m-row { margin: 8px 0; font-size: 13.5px; }
.m-rec { background: #12160d; border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; margin: 10px 0; font-size: 12.5px; line-height: 1.5; color: #d8d4b0; }
.m-small { font-size: 10.5px; color: var(--dim); text-align: center; margin-top: 8px; }
.threat { font-weight: 900; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.t-low { background: #2c4a20; color: var(--green); }
.t-mod { background: #4a4020; color: var(--amber); }
.t-high { background: #4a2c20; color: #ff9a6a; }
.t-sev { background: #4a1a20; color: var(--red); }
.t-ext { background: #3a1030; color: #ff6ad0; }
.t-apo { background: #200; color: #ff2a1a; animation: blink 1s infinite; }
.wz-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wz { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 5px 9px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.wz small { color: var(--red); font-weight: 800; }
.stars { text-align: center; font-size: 34px; margin: 6px 0 2px; letter-spacing: 6px; }
.star { color: #2c2c22; display: inline-block; }
.star.on { color: var(--amber); text-shadow: 0 0 14px #ffd24a88; animation: starPop .4s ease backwards; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } }
.m-rating { text-align: center; font-weight: 900; letter-spacing: 3px; font-size: 13px; color: var(--amber); margin-bottom: 8px; }
.horde-survived { text-align: center; font-size: 24px; font-weight: 900; color: var(--green); text-shadow: 0 0 20px #8fe06a55; animation: pop .5s ease; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 12px 0; }
.rep-row { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.rep-row b { font-variant-numeric: tabular-nums; }
.score-ring { margin: 12px auto 4px; width: 110px; height: 110px; border-radius: 50%; border: 6px solid var(--amber); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 30px #ffd24a44; }
.score-ring span { font-size: 34px; font-weight: 900; color: var(--amber); }
.score-ring small { font-size: 8px; letter-spacing: 2px; color: var(--dim); }
.victory-fire { position: relative; height: 40px; }
.victory-fire span { position: absolute; bottom: 0; font-size: 30px; animation: fire 2.4s ease-in-out infinite; }
@keyframes fire { 0%, 100% { transform: translateY(6px) scale(0.7); opacity: 0.6; } 50% { transform: translateY(-8px) scale(1.15); opacity: 1; } }
.ach-list { max-height: 50vh; overflow-y: auto; touch-action: pan-y; }
.ach-row { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.ach-row.done { border-color: #5a8c3a; }
.ach-row > span { font-size: 20px; }
.ach-row > div { flex: 1; }
.ach-row b { font-size: 13px; display: block; }
.ach-row small { color: var(--dim); font-size: 11px; }
.ach-row em { font-style: normal; color: var(--amber); font-size: 11px; font-weight: 800; white-space: nowrap; }
.set-row { margin: 12px 0; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.set-row input[type=range] { flex: 1; }
.danger-zone { border: 1px dashed #6b2a20; border-radius: 10px; padding: 10px; color: #ff9a6a; font-size: 12px; flex-direction: column; align-items: stretch; text-align: center; }
.help-body p { font-size: 13px; line-height: 1.55; margin: 7px 0; color: #d8d4b0; }
.modal.help-m { width: min(1080px, 96vw); max-height: calc(100vh - 30px); }
.help-m .help-body { column-count: 2; column-gap: 34px; max-height: none; }
.help-m .help-body p { margin-top: 0; break-inside: avoid; }
@media (max-width: 760px) { .modal.help-m { width: 94vw; } .help-m .help-body { column-count: 1; } }
.menu-m .btn-big { margin-top: 8px; }

/* =============== TITLE =============== */
#title { position: absolute; inset: 0; z-index: 90; display: none; align-items: safe center; justify-content: center; overflow: hidden; }
#title.show { overflow-y: auto; }   /* short windows: the list scrolls instead of clipping SETTINGS into oblivion */
#title.show { display: flex; }
body.lobby #title { padding: clamp(14px, 4.5vh, 56px) 10px; margin: auto 0; box-sizing: border-box; }
body.lobby #topbar, body.lobby #bottombar, body.lobby #panelWrap,
body.lobby #rightCard, body.lobby #battleCard, body.lobby #selPanel { display: none !important; }
/* No ad SDK ships in this build — the lobby has no ad slots at all, so
   nothing here can ever overlay or steal clicks from the menu. */
.ad-off { filter: grayscale(1) brightness(.55); opacity: .55; }
.title-bg {
  position: fixed; inset: 0;   /* fixed: can never scroll off with the lobby list, the game below stays fully covered */
  background:
    radial-gradient(ellipse at 50% 110%, #4a1a1055, transparent 60%),
    radial-gradient(ellipse at 50% -10%, #2c3a1e66, transparent 55%),
    linear-gradient(#141810, #0c0e08);
}
.title-bg::after {
  content: ''; position: absolute; inset: 0; opacity: 0.5;
  background-image: repeating-linear-gradient(0deg, transparent 0 42px, #ffffff06 42px 43px);
}
.title-inner { position: relative; text-align: center; padding: 20px; width: min(430px, 92vw); }
.title-z { font-size: 66px; animation: zombieWob 3s ease-in-out infinite; display: inline-block; }
@keyframes zombieWob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-8px); } }
#title h1 { font-size: clamp(34px, 8vw, 52px); font-weight: 900; letter-spacing: 4px; color: var(--amber); text-shadow: 0 4px 0 #000, 0 0 40px #ffd24a33; }
#title h2 { font-size: clamp(18px, 4.5vw, 26px); font-weight: 900; letter-spacing: 10px; color: var(--red); text-shadow: 0 3px 0 #000; margin-top: 2px; }
.title-tag { margin: 14px 0 20px; color: var(--dim); font-size: 14px; }
.title-tag b { color: var(--text); }
.title-small { margin-top: 16px; font-size: 10.5px; color: #6a705a; }
#titleButtons .btn-big { margin-top: 9px; }
.tb-pair { display: flex; gap: 8px; }
.tb-pair .btn-big { flex: 1 1 0; min-width: 0; margin-top: 8px; padding: 11px 6px; font-size: 13.5px; }
@media (max-height: 780px) {
  #title h1 { font-size: clamp(28px, 6vw, 40px); }
  #title h2 { font-size: clamp(14px, 3.6vw, 19px); letter-spacing: 7px; }
  .title-tag { margin: 8px 0 12px; font-size: 12.5px; }
  .title-small { margin-top: 10px; }
  #tNew small.lb-best { display: block; margin-top: 3px; }
}

.tb-btn.blitz { border-color: #ffd24a; color: #ffd24a; box-shadow: 0 0 10px #ffd24a44 inset; }
.tb-ad { padding: 2px 7px; font-size: 11px; }
#btnSpeed small { font-size: 9px; color: var(--amber); }

/* =============== RESPONSIVE =============== */
@media (max-width: 760px) {
  .res { padding: 3px 7px; font-size: 12.5px; }
  .wave-chip { padding: 2px 8px; }
  .wave-chip span { font-size: 11px; }
  #rightCard, #battleCard { width: 165px; top: 52px; right: 6px; padding: 8px 9px; }
  .rc-timer { font-size: 26px; }
  #panelWrap { bottom: 58px; }
  .nav-btn span { font-size: 16px; }
  .nav-btn small { font-size: 7px; }
  .card { min-width: 132px; max-width: 132px; }
  #selPanel { width: 228px; bottom: 66px; }
  .rep-grid { grid-template-columns: 1fr; }
  .b-big { letter-spacing: 1px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #rightCard, #battleCard { width: 190px; top: 48px; }
  .rc-timer { font-size: 22px; }
  #panelWrap.open { max-height: min(62vh, calc(100vh - 120px)); }
  .p-body { max-height: calc(min(62vh, 100vh - 120px) - 36px); }
}
/* tablets: roomier cards, panels never swallow the map */
@media (min-width: 761px) and (max-width: 1180px) {
  #rightCard, #battleCard { width: 185px; }
  .card { min-width: 140px; max-width: 140px; }
  #selPanel { max-height: 44vh; overflow-y: auto; }
}

/* yellow "press ESC" note shown for every cancelable mode (placement,
   airstrike, unit/squad selection) */
.esc-chip {
  position: absolute; bottom: 78px; right: 10px; z-index: 45;
  background: #ffd24a; color: #1a1206; border: 2px solid #a8801a;
  border-radius: 10px; font-weight: 800; font-size: 13px; letter-spacing: 0.4px;
  padding: 9px 14px; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,0.45);
  animation: chipPulse 1.6s ease-in-out infinite;
}
.esc-chip:active { transform: scale(0.96); }
@keyframes chipPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,210,74,0.55); } 50% { box-shadow: 0 0 0 8px rgba(255,210,74,0); } }


/* ==================== SPLASH / LANGUAGE PICKER / SELECT TOGGLE ==================== */
/* (intro splash removed by design — the boot screen IS the language picker) */
#langPick { position: fixed; inset: 0; z-index: 9500; background: rgba(5, 6, 10, .94); display: none; align-items: center; justify-content: center; }
#langPick.show { display: flex; }
.lp-box { background: #10131c; border: 2px solid #2a3040; border-radius: 14px; padding: 20px 22px; max-width: 600px; width: 92vw; max-height: 86vh; overflow: auto; text-align: center; }
.lp-box h2 { color: #ffcc4d; font-size: 20px; letter-spacing: 1px; }
.lp-box p { color: #9aa3b5; font-size: 13px; margin: 6px 0 2px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; margin-top: 14px; }
.lp-btn { background: #171b28; border: 1px solid #2a3040; border-radius: 10px; color: #dfe3ee; padding: 10px 8px; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s; }
.lp-btn:hover, .lp-btn.on { border-color: #ffcc4d; background: #232636; }
.lp-btn span { font-size: 20px; }
.lp-btn b { display: block; font-size: 14px; margin-top: 2px; }
.lp-btn small { opacity: .75; }
#selToggle { display: none; }
@media (pointer: coarse) { #selToggle { display: inline-flex; } }
.nav-btn.sel-toggle.on { border-color: #7fd7ff; color: #7fd7ff; box-shadow: 0 0 12px rgba(127, 215, 255, .35); }

/* +$ war-chest ad button (money chip companion) */
.tb-btn.ad-money { color: #ffcc4d; font-weight: 800; font-size: 13px; min-width: 40px; }
.tb-btn.ad-money:disabled { color: #9aa3b5; font-weight: 600; opacity: .8; }

/* ---- first-play tutorial ---- */
#tutOv{position:fixed;inset:0;z-index:95;pointer-events:none;display:none}
.tut-card{position:fixed;max-width:min(360px,86vw);background:rgba(18,24,14,.96);border:2px solid #d8a437;border-radius:12px;padding:12px 14px;pointer-events:auto;color:#eee;font:14px/1.45 system-ui,sans-serif;box-shadow:0 8px 30px rgba(0,0,0,.8)}
.tut-card b{color:#ffd76a;font-size:15px;letter-spacing:.4px}
.tut-card p{margin:6px 0 10px}
.tut-row{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.tut-row span{margin-right:auto;opacity:.7}

/* ---- invisible scrollbars (player request): NO vertical/horizontal bars anywhere —
   mouse wheel, trackpad and touch swipe scroll every panel exactly as before ---- */
* { scrollbar-width: none; }           /* Firefox */
*::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chromium/WebKit */
*::-webkit-scrollbar-track, *::-webkit-scrollbar-thumb, *::-webkit-scrollbar-corner { background: transparent; }

/* lobby best-run readout (under NEW GAME) + garrison hint */
.lb-best { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: rgba(18, 28, 12, .78); text-shadow: none; }
.gar-hint { display: block; width: 100%; margin-top: 4px; opacity: .8; }
