* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --card-bg: rgba(255, 253, 245, 0.95);
  --card-shadow: 0 3px 10px rgba(30, 60, 30, 0.25);
  --green: #3faf4e;
  --green-dark: #2e8f3c;
  --text: #2c3a2e;
  --radius: 14px;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', 'Roboto', -apple-system, sans-serif;
  background: #7ec850;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#game-container {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- Загрузка ---------- */
#loading-screen {
  position: absolute; inset: 0; z-index: 100;
  background: linear-gradient(160deg, #8fd45e 0%, #5cb648 60%, #3f9a3f 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
}
.loading-logo { font-size: 72px; animation: bounce 1.2s ease-in-out infinite; }
.loading-title { font-size: 42px; font-weight: 800; letter-spacing: 3px; margin-top: 12px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.loading-sub { font-size: 18px; opacity: .85; margin-top: 4px; }
.loading-bar { width: 240px; height: 12px; background: rgba(0,0,0,.25); border-radius: 8px; margin-top: 28px; overflow: hidden; }
#loading-fill { width: 0%; height: 100%; background: #ffe066; border-radius: 8px; transition: width .3s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Главное меню ---------- */
#main-menu {
  position: absolute; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: flex-end;
  padding: clamp(24px, 6vw, 100px);
  background: #75c8e5 url('assets/main-menu-bg.png') center top / cover no-repeat;
  isolation: isolate;
}
#main-menu::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 20, 14, .02) 20%, rgba(4, 20, 14, .18) 50%, rgba(4, 20, 14, .72) 100%),
    linear-gradient(0deg, rgba(4, 20, 14, .28), transparent 44%);
}
.main-menu-panel {
  width: min(390px, 92vw);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(155deg, rgba(16, 44, 28, .9), rgba(8, 25, 18, .84));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.main-menu-kicker {
  color: #71ef55; font-size: 12px; font-weight: 900;
  letter-spacing: 2.5px; margin-bottom: 8px;
}
.main-menu-heading {
  font-size: clamp(31px, 3vw, 45px); line-height: .98;
  font-weight: 1000; letter-spacing: -1.5px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .22);
}
.main-menu-heading.small { font-size: 29px; line-height: 1.05; }
.main-menu-copy {
  margin-top: 13px; color: rgba(255, 255, 255, .76);
  font-size: 13px; font-weight: 650; line-height: 1.45;
}
.main-menu-copy.warning {
  padding: 13px; border-radius: 12px; color: #ffe4bd;
  background: rgba(201, 99, 42, .22); border: 1px solid rgba(255, 171, 97, .28);
}
.main-menu-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.main-menu-actions.compact { margin-top: 18px; }
.main-menu-secondary-row { display: flex; flex-direction: column; gap: 10px; }
.main-menu-btn {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 13px;
  padding: 11px 16px; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px; cursor: pointer; text-align: left;
  color: #fff; background: rgba(255, 255, 255, .1);
  font-family: inherit; font-size: 14px; font-weight: 900; line-height: 1.1;
  letter-spacing: .45px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .16);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.main-menu-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.main-menu-btn:active { transform: scale(.98); }
.main-menu-btn > span:first-child {
  width: 30px; flex: 0 0 30px; text-align: center; font-size: 22px;
}
.main-menu-btn small {
  display: block; margin-top: 4px; color: rgba(255, 255, 255, .68);
  font-size: 10px; font-weight: 650; letter-spacing: 0;
}
.main-menu-btn.primary {
  min-height: 66px; border-color: rgba(158, 255, 117, .48);
  background: linear-gradient(180deg, #55d638, #29a91f);
  box-shadow: 0 7px 0 #147b18, 0 14px 26px rgba(0, 0, 0, .24);
}
.main-menu-btn.primary:active { transform: translateY(4px); box-shadow: 0 3px 0 #147b18; }
.main-menu-btn.new-game { background: linear-gradient(180deg, #f5af31, #dd851a); }
.main-menu-btn.leaderboard {
  background: linear-gradient(180deg, rgba(112, 80, 188, .92), rgba(70, 43, 137, .94));
}
.main-menu-btn.settings, .main-menu-btn.back { background: rgba(255, 255, 255, .1); }
.main-menu-btn.danger { background: linear-gradient(180deg, #df6a43, #b93d2c); }
.main-menu-btn:disabled {
  cursor: default; transform: none; filter: grayscale(.75);
  opacity: .52; box-shadow: none;
}
.menu-setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 17px; padding: 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
}
.menu-setting-row > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.menu-setting-row b { font-size: 13px; }
.menu-setting-row small { color: rgba(255, 255, 255, .62); font-size: 10px; line-height: 1.3; }
.menu-setting-row.graphics { align-items: stretch; flex-direction: column; }
.menu-toggle, .menu-segment button {
  border: none; border-radius: 9px; padding: 9px 11px; cursor: pointer;
  color: #d4d9d4; background: rgba(255, 255, 255, .1);
  font-size: 10px; font-weight: 900;
}
.menu-toggle.active, .menu-segment button.active {
  color: #fff; background: #39b82e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.menu-toggle.off { color: #ffc0b1; background: rgba(192, 62, 42, .35); }
.menu-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
#menu-settings-back { margin-top: 17px; min-height: 50px; }
.leaderboard-menu-content {
  margin-top: 16px; max-height: 310px; overflow-y: auto;
  padding-right: 3px;
}
.leaderboard-loading {
  padding: 24px 10px; color: rgba(255, 255, 255, .66);
  font-size: 11px; font-weight: 850; text-align: center; letter-spacing: .7px;
}
.leaderboard-capital {
  padding: 12px 14px; margin-bottom: 9px; border-radius: 13px;
  color: #fff; background: rgba(77, 191, 66, .2);
  border: 1px solid rgba(126, 240, 106, .25);
}
.leaderboard-capital small {
  display: block; color: rgba(255, 255, 255, .64);
  font-size: 9px; font-weight: 700; letter-spacing: .4px;
}
.leaderboard-capital b { display: block; margin-top: 3px; font-size: 22px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 5px; }
.leaderboard-row {
  display: grid; grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  color: #fff; background: rgba(255, 255, 255, .08);
}
.leaderboard-rank { color: #ffd66b; font-size: 12px; font-weight: 950; }
.leaderboard-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.leaderboard-score { font-size: 11px; font-weight: 900; }
.leaderboard-note {
  margin-top: 8px; color: rgba(255, 255, 255, .62);
  font-size: 9px; line-height: 1.4;
}
.leaderboard-auth {
  width: 100%; margin-top: 10px; padding: 10px; border: none; border-radius: 10px;
  color: #fff; background: #d08b24; font: inherit; font-size: 10px; font-weight: 900; cursor: pointer;
}
#menu-leaderboard-back { margin-top: 13px; min-height: 48px; }
.main-menu-credit {
  display: none;
  position: absolute; right: clamp(24px, 6vw, 100px); bottom: 15px;
  color: rgba(255, 255, 255, .66); font-size: 9px; font-weight: 850; letter-spacing: 1.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* ---------- Пауза ---------- */
#pause-menu {
  position: absolute; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(5, 18, 12, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pause-state-badge {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 38px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px;
  color: #fff; background: #d6473b;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .35);
  font-size: 18px; font-weight: 900;
}
.pause-menu-panel {
  width: min(360px, 92vw); padding: 27px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 23px; color: #fff;
  background: linear-gradient(155deg, rgba(18, 49, 31, .97), rgba(7, 24, 16, .96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.pause-menu-hint {
  margin-top: 18px; color: rgba(255, 255, 255, .48);
  font-size: 10px; font-weight: 750; text-align: center; letter-spacing: .6px;
}

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.admin-build-version {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 30; padding: 5px 10px; border: 1px solid rgba(208, 255, 170, .28);
  border-radius: 8px; color: #ddffc4; background: rgba(13, 35, 23, .84);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  font-size: 10px; font-weight: 900; letter-spacing: .55px;
  line-height: 1.2; white-space: nowrap; pointer-events: none;
}
.hud-collapse {
  display: none; align-items: center; justify-content: center;
  align-self: stretch; width: 34px; min-height: 30px; margin-left: auto;
  border: 1px solid rgba(44, 58, 46, .08); border-radius: 10px;
  color: var(--text); background: rgba(44, 58, 46, .06);
  font-family: inherit; font-size: 18px; font-weight: 900; line-height: 1; cursor: pointer;
}
.hud-collapse > span {
  display: block; line-height: 1; transform: translateY(-1px);
}
#hud.hud-collapsed .hud-top-left > .hud-card:not(#card-day),
#hud.hud-collapsed .hud-top-center { display: none; }

.hud-top-left {
  position: absolute; top: 10px; left: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.hud-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 8px 14px; box-shadow: var(--card-shadow);
  color: var(--text); font-weight: 700; font-size: 13px;
  min-width: 150px;
}
.hud-card .hud-icon { font-size: 22px; }
#card-rep { cursor: pointer; }
#card-rep:active { transform: scale(.98); }
.hud-col { display: flex; flex-direction: column; line-height: 1.2; }
.hud-card.task .hud-col { min-width: 0; }
.hud-big { font-size: 18px; font-weight: 800; }
.hud-card.money #hud-money { color: #1d7a2c; }
.mini-bar { width: 90px; height: 6px; background: #d8d8ce; border-radius: 4px; overflow: hidden; margin-top: 3px; }
#hud-rep-fill { height: 100%; width: 80%; background: var(--green); border-radius: 4px; transition: width .4s; }

.hud-top-center {
  position: absolute; top: auto; bottom: 12px; left: 12px; transform: none;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: var(--card-shadow);
}
.fuel-row {
  position: relative;
  display: grid;
  grid-template-columns: 58px 130px;
  width: 196px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.fuel-name { width: 58px; }
.fuel-bar {
  grid-column: 2;
  width: 130px;
  height: 12px;
  background: #d8d8ce;
  border-radius: 8px;
  overflow: hidden;
}
.fuel-fill { height: 100%; border-radius: 8px; transition: width .4s; }
.fuel-fill.petrol92 { background: #75b843; }
.fuel-fill.petrol { background: #43b34f; }
.fuel-fill.petrol98 { background: #d94f70; }
.fuel-fill.diesel { background: #ef8c1f; }
.fuel-fill.gas { background: #2f7fe0; }
.fuel-fill.battery { background: #9b59b6; }
.fuel-val {
  position: absolute;
  left: 66px;
  top: 0;
  z-index: 2;
  width: 130px;
  height: 12px;
  padding: 0 4px;
  color: var(--text);
  font-size: 11px;
  line-height: 12px;
  text-align: right;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  pointer-events: none;
}
.fuel-row.low .fuel-val { color: #d33; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.hud-top-right {
  position: absolute; top: 10px; right: 10px;
  display: grid; grid-template-columns: repeat(2, auto); gap: 8px;
  width: 160px; justify-items: end;
}
.menu-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; height: 62px;
  background: var(--card-bg); border: none; border-radius: var(--radius);
  box-shadow: var(--card-shadow); cursor: pointer;
  font-size: 10px; font-weight: 800; color: var(--text); letter-spacing: .5px;
  transition: transform .1s;
}
.menu-btn.hud-menu-collapse { display: none; }
#hud.hud-menu-collapsed .hud-top-right > .menu-btn:not(.hud-menu-collapse) { display: none; }
#hud.hud-menu-collapsed .hud-menu-collapse { grid-column: -2 / -1; }
.menu-btn span { font-size: 24px; margin-bottom: 2px; }
.menu-btn > .menu-btn-label { font-size: inherit; margin-bottom: 0; }
.menu-btn:active { transform: scale(.93); }
.menu-btn.attention { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 90, 60, .35); } }
.menu-btn.build { background: var(--card-bg); color: var(--text); }
.menu-btn.build.active-mode {
  background: var(--card-bg); color: var(--text);
  box-shadow: 0 0 0 3px #f0a832, var(--card-shadow);
}

/* ---------- Карточка задания ---------- */
.hud-card.task { border: 2px solid #f0a832; max-width: 235px; }
#hud-task-text { font-size: 11px; line-height: 1.25; }
.hud-task-progress { font-size: 12px; font-weight: 800; color: #c07f10; }
.hud-task-reward {
  align-self: flex-start; margin-top: 4px; padding: 3px 7px;
  border-radius: 7px; background: #f0a832; color: #fff;
  font-size: 10px; font-weight: 900; letter-spacing: .25px;
}
.hud-card.task.done { border-color: var(--green); }
.hud-card.task.done .hud-task-progress { color: var(--green-dark); }
.hud-card.task.done .hud-task-reward { background: var(--green); }
/* ---------- Режим стройки ---------- */
#build-bar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: rgba(35, 45, 35, .93); color: #fff;
  padding: 12px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 700;
  z-index: 20;
}
#build-exit, #build-catalog {
  border: none; border-radius: 10px; padding: 10px 18px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer;
}
#build-catalog { background: #f0a832; color: #2f2b20; }

#build-catalog-dock {
  position: absolute; left: 10px; bottom: 78px; z-index: 25;
  width: min(470px, calc(100vw - 20px));
  max-height: min(67vh, 650px);
  display: flex; flex-direction: column;
  overflow: hidden;
  color: var(--text); background: rgba(250, 248, 239, .97);
  border: 1px solid rgba(255, 255, 255, .72); border-radius: 17px;
  box-shadow: 0 14px 40px rgba(20, 40, 22, .34);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.build-dock-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px 9px; color: #fff;
  background: linear-gradient(180deg, #43b853, #318f3e);
  font-size: 13px; letter-spacing: .35px;
}
.build-dock-header > div { display: flex; align-items: center; gap: 7px; }
#build-dock-close {
  width: 29px; height: 29px; border: none; border-radius: 8px;
  color: #fff; background: rgba(255, 255, 255, .2);
  font-weight: 900; cursor: pointer;
}
.build-catalog-tabs {
  display: flex; gap: 5px; padding: 8px 9px;
  overflow-x: auto; flex: 0 0 auto;
  background: #ebe9dd;
}
.build-catalog-tabs button {
  flex: 0 0 auto; padding: 8px 9px; border: none; border-radius: 9px;
  color: #5a6159; background: rgba(255, 255, 255, .72);
  font-size: 10px; font-weight: 900; cursor: pointer; white-space: nowrap;
}
.build-catalog-tabs button.active {
  color: #fff; background: var(--green);
  box-shadow: 0 2px 6px rgba(30, 110, 45, .22);
}
.build-catalog-content {
  padding: 9px; overflow-y: auto; overscroll-behavior: contain;
}
.build-catalog-content .delivery-note { margin-bottom: 8px; }
.build-catalog-content .panel-section:last-child { margin-bottom: 0; }

.catalog-card {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px;
  background: #fff; border-radius: 12px; padding: 11px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.catalog-card.built { opacity: .72; }
.catalog-icon { font-size: 28px; text-align: center; }
.catalog-name { font-size: 14px; font-weight: 800; }
.catalog-desc { font-size: 11px; line-height: 1.35; opacity: .68; margin-top: 2px; }
.catalog-price { font-size: 12px; font-weight: 800; color: var(--green-dark); margin-top: 3px; }
.catalog-action {
  border: none; border-radius: 9px; padding: 9px 10px; min-width: 78px;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer;
}
.catalog-action:disabled { background: #b9b7ab; cursor: default; }
.catalog-action.sell, .upg-buy.sell, .buy-btn.sell-confirm {
  background: #c62828; color: #fff;
}
.catalog-action.sell:hover:not(:disabled),
.upg-buy.sell:hover:not(:disabled), .buy-btn.sell-confirm:hover:not(:disabled) {
  background: #a91f1f;
}
.sale-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sale-confirm-actions .buy-btn { padding: 14px; }
.buy-btn.sale-cancel { background: #e8e6dc; color: var(--text); }
.sell-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border-radius: 10px; padding: 9px 10px; margin-bottom: 7px;
  font-size: 12px; font-weight: 750;
}

/* ---------- Мини-игра VIP ---------- */
#vip-game {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%, rgba(44, 136, 76, .28), transparent 70%),
    linear-gradient(145deg, #243b36, #112824);
  border: 1px solid rgba(244, 210, 111, .4); border-radius: 22px;
  padding: 20px 22px; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  box-shadow: 0 18px 50px #061d2855, inset 0 1px 0 #ffffff18;
  width: min(510px, 92vw);
}
.vip-heading { display: flex; align-items: center; gap: 12px; width: 100%; }
.vip-star { color: #ffdc65; font-size: 40px; text-shadow: 0 3px 0 #ad751e, 0 0 22px #fbc74355; }
.vip-copy { flex: 1; min-width: 0; }
.vip-title { color: #ffdc65; font-size: 24px; font-weight: 900; }
.vip-hint { color: #e2eee6; font-size: 12px; margin-top: 3px; line-height: 1.4; }
.vip-badge { color: #ffdc65; border: 1px solid #ddbc5e; border-radius: 30px; padding: 7px 10px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.vip-bar {
  position: relative; width: 100%; height: 32px;
  background: linear-gradient(90deg,
    #c04e43 0 28%, #e9b73f 28% 39%, #3faf4e 39% 61%,
    #e9b73f 61% 72%, #c04e43 72% 100%);
  border: 2px solid #e5dab3; border-radius: 18px;
  box-shadow: inset 0 3px 6px #0005, 0 0 0 3px #ffffff12;
  touch-action: manipulation; cursor: pointer;
}
.vip-zone.yellow { position: absolute; left: 28%; width: 44%; height: 100%; background: linear-gradient(#fff3, transparent); }
.vip-zone.green {
  position: absolute; left: 39%; width: 22%; height: 100%;
  background: linear-gradient(#8aff9a, #30ba59 55%, #269849);
  box-shadow: inset 0 0 12px #caffc955, 0 0 20px #58eb6166;
}
.vip-marker {
  position: absolute; top: -6px; left: 0; width: 8px; height: 40px;
  background: #fffde9; border: 1px solid #254c39; border-radius: 3px;
  box-shadow: 0 0 8px #fff9; will-change: transform; pointer-events: none;
}
.vip-marker::before { content: ''; position: absolute; top: -12px; left: -5px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #fffde9; }
#vip-stop {
  border: 1px solid #ffb09a; border-radius: 16px; padding: 12px 50px;
  background: linear-gradient(#fa7961, #df4137); color: #fff;
  box-shadow: inset 0 1px 0 #fff4, 0 5px 15px #a0202444;
  font-weight: 900; font-size: 22px; cursor: pointer; letter-spacing: 1px; touch-action: manipulation;
}
#vip-stop:active { transform: scale(.95); }
#vip-stop:focus-visible { outline: 3px solid #fff3a2; outline-offset: 4px; }
#vip-game.vip-success { border-color: #8ae9a5; box-shadow: 0 18px 50px #061d2855, 0 0 32px #46df7133; }
.vip-result { min-height: 52px; display: grid; place-items: center; color: #a8ffbf; font-size: 23px; font-weight: 900; text-align: center; }
#vip-game.vip-miss .vip-result { color: #ffd7aa; }
.vip-banknote {
  position: fixed; z-index: 85; pointer-events: none; width: 42px; height: 24px;
  display: grid; place-items: center; color: #135b39; font-size: 17px; font-weight: 900;
  background: linear-gradient(135deg, #b5f5a3, #62cc7c); border: 2px solid #348557;
  border-radius: 4px; box-shadow: inset 0 0 0 2px #c5ffc080, 0 4px 8px #112c2833;
  will-change: transform, opacity;
}
.vip-banknote::before { content: ''; position: absolute; inset: 3px 11px; border: 1px solid #36825380; border-radius: 50%; }
@media (max-width: 540px) {
  #vip-game { padding: 16px; gap: 18px; }
  .vip-title { font-size: 21px; }
  .vip-star { font-size: 32px; }
  .vip-badge { padding: 6px; font-size: 9px; }
  .vip-hint { font-size: 11px; }
}

.hud-bottom-right {
  position: absolute; bottom: 12px; right: 12px;
  display: flex; gap: 6px;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--card-shadow);
}
.speed-btn {
  width: 48px; height: 44px; border: none; border-radius: 10px;
  background: #e7e5da; font-size: 16px; font-weight: 800; color: var(--text);
  cursor: pointer;
}
.speed-btn.active { background: var(--green); color: #fff; }
.speed-btn.pause-active { background: #d6473b; color: #fff; box-shadow: 0 0 0 2px rgba(255, 224, 102, .55), 0 4px 12px rgba(214, 71, 59, .35); }
.speed-btn:active { transform: scale(.93); }

/* ---------- Тосты ---------- */
#toast-area {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 6px;
  pointer-events: none;
}
.toast {
  background: rgba(35, 45, 35, .92); color: #fff;
  padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  animation: toast-in .25s ease-out, toast-out .4s ease-in forwards;
  animation-delay: 0s, 3.2s;
  max-width: 90vw; text-align: center;
}
.toast.good { background: rgba(40, 130, 60, .94); }
.toast.bad { background: rgba(180, 55, 45, .94); }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

/* ---------- Модальные окна ---------- */
#modal-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(20, 35, 20, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
#modal-window {
  background: #faf8ef; border-radius: 18px;
  width: 100%; max-width: 480px; max-height: 86vh;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  overflow: hidden;
}
#modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--green); color: #fff;
  font-size: 18px; font-weight: 800; letter-spacing: .5px;
}
#modal-close {
  width: 34px; height: 34px; border: none; border-radius: 10px;
  background: rgba(255,255,255,.25); color: #fff;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
#modal-body { padding: 14px 16px; overflow-y: auto; min-height: 0; color: var(--text); }

/* Содержимое модалок */
.panel-section { margin-bottom: 14px; }
.panel-title { font-size: 13px; font-weight: 800; opacity: .6; margin-bottom: 6px; letter-spacing: 1px; }

.price-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.price-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.price-info { flex: 1; }
.price-fuel-name { font-weight: 800; font-size: 14px; }
.price-market { font-size: 11px; opacity: .6; }
.price-controls { display: flex; align-items: center; gap: 6px; }
.price-controls button {
  width: 34px; height: 34px; border: none; border-radius: 9px;
  background: var(--green); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer;
}
.price-controls button:active { transform: scale(.9); }
.price-value { width: 72px; text-align: center; font-weight: 800; font-size: 15px; }
.price-demand { font-size: 11px; font-weight: 700; width: 100%; margin-top: 4px; }
.price-demand .margin-negative { color: #c0392b; font-weight: 900; }

.buy-item {
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.buy-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.buy-fuel-name { font-weight: 800; font-size: 14px; }
.buy-stock { font-size: 12px; opacity: .65; }
.buy-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.buy-btn {
  flex: 1; min-width: 90px; padding: 9px 6px; border: none; border-radius: 10px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 12px; cursor: pointer;
  line-height: 1.3;
}
.buy-btn small { display: block; font-weight: 600; opacity: .85; }
.buy-btn:disabled { background: #b9b7ab; cursor: default; }
.buy-btn:active:not(:disabled) { transform: scale(.96); }
.delivery-note { font-size: 12px; background: #fff4d6; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-weight: 600; }
.delivery-note.warning-note { background: #fde2dc; color: #8a2a1c; }
.manager-automation {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; padding: 11px 12px;
  border: 1px solid #d9dfd3; border-radius: 12px; background: #f3f7f0;
}
.manager-automation > div { min-width: 0; }
.manager-automation b { display: block; margin-bottom: 3px; font-size: 13px; color: var(--text); }
.manager-automation small { display: block; font-size: 10px; line-height: 1.4; color: #687066; }
.manager-automation button {
  flex: 0 0 auto; min-width: 92px; padding: 9px 10px;
  border: none; border-radius: 9px; cursor: pointer;
  color: #8a4a42; background: #ead8d4;
  font-size: 9px; font-weight: 900;
}
.manager-automation button.active { color: #fff; background: var(--green); }
.procurement-budget { display: flex; flex-direction: column; gap: 8px; margin: -4px 0 10px; padding: 10px 12px; border-radius: 12px; background: #f3f6f1; }
.procurement-budget b { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.procurement-budget small { display: block; font-size: 10px; line-height: 1.4; color: #687066; }
.budget-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.budget-chip { flex: 1 1 0; min-width: 48px; padding: 7px 0; border: 0; border-radius: 9px; font-weight: 700; font-size: 12px; background: #e3e8e0; color: #3b4a3e; cursor: pointer; }
.budget-chip.active { background: var(--green); color: #fff; }
.manager-automation button:disabled {
  min-width: 116px; color: #858980; background: #d9dcd5; cursor: default;
}

.upg-item {
  display: flex; gap: 12px; align-items: center;
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.upg-icon { font-size: 30px; width: 42px; text-align: center; flex-shrink: 0; }
.upg-info { flex: 1; min-width: 0; }
.upg-name { font-weight: 800; font-size: 14px; }
.upg-desc { font-size: 11.5px; opacity: .65; line-height: 1.35; margin-top: 2px; }
.upg-level { font-size: 11px; font-weight: 700; color: var(--green-dark); margin-top: 2px; }
.upg-buy {
  border: none; border-radius: 10px; padding: 10px 12px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 12px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.upg-buy.blocked { background: #8b958a; }
.upg-buy:disabled { background: #b9b7ab; }
.upg-buy.maxed { background: #8a8875; }
.upg-buy:active:not(:disabled) { transform: scale(.95); }

.report-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
.report-grid .r-label { font-weight: 600; opacity: .75; }
.report-grid .r-val { font-weight: 800; text-align: right; }
.report-grid > .delivery-note { grid-column: 1 / -1; }
.hud-weather { display: block; font-size: 9px; font-weight: 600; opacity: .8; white-space: nowrap; }
.r-val.plus { color: #1d7a2c; }
.r-val.minus { color: #c0392b; }
.facility-hero {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  padding: 12px; border-radius: 13px; background: #edf7ea;
}
.facility-hero-icon { font-size: 34px; width: 44px; text-align: center; }
.facility-hero-name { font-size: 18px; font-weight: 900; }
.facility-hero-level { margin-top: 3px; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.facility-status {
  border-radius: 10px; padding: 8px 10px; margin-bottom: 12px;
  font-size: 12px; font-weight: 800;
}
.facility-status.good { color: #1d7a2c; background: #e5f4e1; }
.facility-status.bad { color: #a63c2f; background: #fbe5df; }
.facility-upgrade-card { margin-bottom: 10px; }
.modal-secondary-btn {
  width: 100%; border: none; border-radius: 10px; padding: 11px 12px;
  background: #e2e7dc; color: var(--green-dark); font-weight: 900; font-size: 12px; cursor: pointer;
}
.modal-secondary-btn:active { transform: scale(.98); }
.report-details { grid-column: 1 / -1; margin-top: 1px; }
.report-details summary {
  display: flex; align-items: center; gap: 6px; width: fit-content;
  color: var(--green-dark); font-size: 11px; font-weight: 900;
  cursor: pointer; list-style: none;
}
.report-details summary::-webkit-details-marker { display: none; }
.report-details summary::before { content: '+'; font-size: 15px; line-height: 1; }
.report-details[open] summary::before { content: '−'; }
.report-details-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
  margin-top: 7px; padding: 8px 10px; border-radius: 10px;
  background: #f3f7f0;
}
.report-details-grid .r-label { min-width: 0; }
.report-details-grid .r-val { white-space: nowrap; }
.report-details-grid .r-val small { font-size: 10px; font-weight: 700; opacity: .65; }
.report-divider { grid-column: 1 / -1; height: 1px; background: #ddd; margin: 4px 0; }
.report-subhead {
  grid-column: 1 / -1; margin-top: 2px;
  color: #6f776d; font-size: 11px; font-weight: 900; letter-spacing: .7px;
}
.report-auto-option {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid #d9dfd3; border-radius: 11px;
  background: #f3f7f0; color: var(--text);
  font-size: 12px; font-weight: 750; cursor: pointer;
}
.report-auto-option input {
  width: 18px; height: 18px; margin: 0;
  accent-color: var(--green); cursor: pointer;
}
.report-auto-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.report-auto-countdown {
  flex: 1; margin: 0;
}
.report-skip-btn {
  flex: 0 0 auto;
  min-height: 34px; padding: 0 12px;
  border: 1px solid #c5d5be; border-radius: 9px;
  background: #edf5e9; color: var(--green-dark);
  font: inherit; font-size: 11px; font-weight: 900;
  cursor: pointer; touch-action: manipulation;
}
.report-skip-btn:active { transform: scale(.97); }

/* ---------- Мобильная адаптация ---------- */
/* ---------- Ручное обслуживание ---------- */
#service-panel {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  max-height: calc(100% - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: rgba(24, 34, 28, 0.94);
  border: 2px solid #f0a832;
  border-radius: 16px;
  padding: 12px 14px;
  color: #fff;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}
#service-panel > * { flex-shrink: 0; }
.sp-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; }
#sp-close {
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.sp-request { font-size: 14px; color: #ffe08a; font-weight: 700; }
.sp-step-hint { font-size: 12px; font-weight: 800; color: #cfe8d4; margin-bottom: 7px; }
.sp-fuel-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sp-fuel-btn {
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 11px;
  padding: 11px 5px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.sp-fuel-btn small { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; }
.sp-fuel-btn:active { transform: scale(0.96); }
.sp-fuel-btn.selected {
  border-color: #ffd23f;
  box-shadow: 0 0 0 2px rgba(255,210,63,.35), 0 0 12px rgba(255,210,63,.45);
}
.sp-fuel-btn:disabled { opacity: .42; cursor: default; }
#sp-dispense-step { display: flex; flex-direction: column; gap: 8px; }
#sp-dispense-step.awaiting-fuel { opacity: .45; }
.sp-gauge {
  position: relative; height: 26px;
  background: rgba(255,255,255,0.12);
  border-radius: 13px; overflow: hidden;
}
.sp-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, #35b24a, #8dff9a);
  border-radius: 13px;
  transition: none;
}
.sp-fill.over { background: linear-gradient(90deg, #d98324, #ff6b5a); }
.sp-target {
  position: absolute; top: -2px; bottom: -2px; width: 4px;
  background: #ffd23f; border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 210, 63, 0.9);
}
.sp-nums { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: #cfe8d4; }
#sp-hold {
  background: linear-gradient(180deg, #2e9e42, #1d7a2c);
  border: none; border-radius: 12px; color: #fff;
  font-weight: 900; font-size: 16px; padding: 16px;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
#sp-hold:active { transform: scale(0.98); filter: brightness(1.15); }
#sp-hold:disabled, #sp-done:disabled { cursor: default; filter: grayscale(.7); opacity: .55; }
#sp-done {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px; color: #fff;
  font-weight: 800; font-size: 13px; padding: 10px; cursor: pointer;
}

/* ---------- Персонал ---------- */
.staff-item {
  display: flex; align-items: center; gap: 10px;
  background: #f2f0e6; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.staff-item.candidate { background: #eef4ea; border: 1px dashed #9cbf95; }
.staff-icon { font-size: 26px; width: 34px; text-align: center; }
.staff-info { flex: 1; min-width: 0; }
.staff-name { font-weight: 800; font-size: 13px; color: var(--text); }
.staff-meta { font-size: 11px; color: #6b7168; line-height: 1.4; }
.staff-stat { display: inline-block; margin-right: 8px; font-weight: 700; }
.staff-actions { display: flex; flex-direction: column; gap: 4px; }
.staff-btn {
  border: none; border-radius: 8px; padding: 7px 10px;
  font-size: 11px; font-weight: 800; cursor: pointer;
  background: var(--green); color: #fff; white-space: nowrap;
}
.staff-btn.warn { background: #d6473b; }
.staff-btn.ghost { background: #d9d6c8; color: #5c6157; }
.staff-btn:disabled { background: #cfcdc2; color: #8b8f86; cursor: default; }
.mood-bar { height: 5px; background: #d8d8ce; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.mood-fill { height: 100%; border-radius: 3px; }

.menu-btn.bank { background: var(--card-bg); color: var(--text); }
.menu-btn.bank.ready { animation: pulse 1.4s infinite; }
.menu-btn.ads { background: var(--card-bg); color: var(--text); }
.menu-btn.leaderboard { background: var(--card-bg); color: var(--text); }
.menu-btn.network { background: var(--card-bg); color: var(--text); }

.iap-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-rows: auto auto; align-items: center;
}
.iap-item .upg-icon { display: grid; grid-column: 1; grid-row: 1 / 3; place-items: center; min-height: 42px; }
.iap-item .upg-info { display: contents; }
.iap-item .upg-name { grid-column: 2; grid-row: 1; align-self: end; }
.iap-item .upg-desc { grid-column: 2; grid-row: 2; align-self: start; }
.iap-item .upg-buy { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.iap-image { width: 42px; height: 42px; object-fit: contain; border-radius: 9px; }
.iap-emoji { font-size: 30px; }
.iap-buy { min-width: 72px; }
.iap-currency { width: 14px; height: 14px; vertical-align: -2px; object-fit: contain; }

.bank-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 5px; margin-bottom: 11px; border-radius: 12px; background: #e6e8dc;
}
.bank-tab {
  border: none; border-radius: 9px; padding: 10px 8px;
  background: transparent; color: #647064; font-size: 11px; font-weight: 900; cursor: pointer;
}
.bank-tab.active { color: #fff; background: var(--green); box-shadow: 0 2px 7px rgba(35, 122, 55, .25); }
.bank-heading { margin: 2px 0 9px; color: var(--text); font-size: 17px; font-weight: 900; }
.bank-reward-card {
  display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 10px;
  padding: 10px; margin-bottom: 10px; border-radius: 13px;
  background: linear-gradient(135deg, #f0fae9, #fff8df); border: 1px solid #d4e7c8;
}
.bank-reward-visual { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 12px; background: #fff; overflow: hidden; }
.bank-reward-visual img { width: 62px; height: 62px; object-fit: contain; }
.bank-reward-info { min-width: 0; }
.bank-reward-title { color: var(--text); font-size: 12px; font-weight: 900; }
.bank-reward-amount { margin-top: 1px; color: var(--green-dark); font-size: 20px; font-weight: 950; }
.bank-reward-desc { margin-top: 3px; color: #687167; font-size: 10.5px; line-height: 1.3; }
.bank-reward-count { align-self: end; color: #6e756b; font-size: 12px; font-weight: 900; white-space: nowrap; }
.bank-reward-count span { font-size: 17px; vertical-align: -2px; }
.bank-claimed { color: #347441; background: #e6f5e4; }
.bank-ad-btn { background: linear-gradient(180deg, #35b44e, #238a3d); }
.bank-ad-btn:disabled { background: #b9b7ab; }

.leaderboard-modal .leaderboard-capital {
  color: var(--text); background: #eef8ea; border-color: #c9e6c1;
}
.leaderboard-modal .leaderboard-capital small,
.leaderboard-modal .leaderboard-note { color: #697267; }
.leaderboard-modal .leaderboard-row { color: var(--text); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

@media (max-width: 760px) {
  #main-menu {
    align-items: flex-end; justify-content: center;
    padding: 12px 12px 14px; background-position: 53% center;
  }
  #main-menu::before {
    background: linear-gradient(0deg, rgba(3, 17, 11, .9) 0%, rgba(3, 17, 11, .3) 62%, rgba(3, 17, 11, .08) 100%);
  }
  .main-menu-panel { width: min(410px, 100%); padding: 15px 16px; border-radius: 18px; }
  .main-menu-kicker { margin-bottom: 5px; font-size: 10px; }
  .main-menu-heading { font-size: 26px; }
  .main-menu-copy { margin-top: 8px; font-size: 10px; line-height: 1.3; }
  .main-menu-actions { margin-top: 10px; gap: 6px; }
  .main-menu-btn { min-height: 43px; gap: 9px; padding: 7px 10px; font-size: 12px; }
  .main-menu-btn.primary { min-height: 49px; }
  .main-menu-btn > span:first-child { width: 24px; flex-basis: 24px; font-size: 18px; }
  .main-menu-btn small { margin-top: 2px; font-size: 8px; }
  .main-menu-secondary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .main-menu-secondary-row .main-menu-btn { min-width: 0; min-height: 42px; font-size: 10px; }
  .main-menu-secondary-row .main-menu-btn small { display: none; }
  .main-menu-credit { display: none; }
  #service-panel { bottom: 76px; max-height: calc(100% - 88px); }
  .hud-top-left {
    align-items: flex-start; width: min(186px, calc(100vw - 142px));
  }
  .hud-top-left .hud-card { width: 100%; min-width: 0; }
  #card-day { padding-right: 5px; }
  .hud-collapse { display: flex; }
  .hud-top-center {
    top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 8px;
    transform: none; padding: 6px 7px; gap: 2px;
  }
  .fuel-row { gap: 4px; font-size: 10px; line-height: 1; }
  .fuel-name { width: 39px; font-size: 10px; }
  .fuel-bar { width: 58px; height: 8px; }
  .fuel-val { width: 45px; font-size: 10px; }
  .hud-card { min-width: 112px; padding: 5px 8px; gap: 5px; font-size: 10px; }
  .hud-card .hud-icon { font-size: 18px; }
  .hud-big { font-size: 14px; }
  .mini-bar { width: 70px; height: 5px; }
  .hud-top-right { width: 116px; }
  .menu-btn.hud-menu-collapse { display: flex; }
  .menu-btn { width: 54px; height: 48px; font-size: 8px; }
  .menu-btn span { font-size: 18px; }
  .speed-btn { width: 34px; height: 34px; font-size: 12px; }
  .hud-bottom-right { bottom: calc(12px + env(safe-area-inset-bottom)); right: 8px; }
  .hud-card.task { width: 100%; max-width: none; padding: 5px 8px; }
  .hud-card.task .hud-icon { font-size: 17px; }
  #hud-task-text { font-size: 10px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-task-progress { font-size: 10px; }
  .hud-task-reward { margin-top: 2px; padding: 2px 5px; font-size: 8px; white-space: nowrap; }
  #toast-area { bottom: 110px; }
  #modal-overlay {
    padding: 8px;
  }
  #modal-window {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 15px;
  }
  #modal-header { padding: 10px 12px; font-size: 16px; }
  #modal-close { width: 30px; height: 30px; font-size: 14px; }
  #modal-body { padding: 10px 11px; }
  .panel-section { margin-bottom: 8px; }
  .panel-title { margin-bottom: 4px; font-size: 11px; }
  .report-grid { gap: 5px 8px; font-size: 12px; }
  .report-grid .r-label { min-width: 0; overflow-wrap: anywhere; }
  .report-details summary { font-size: 10px; }
  .report-details-grid { gap: 5px 8px; margin-top: 5px; padding: 7px 8px; }
  .report-auto-option { gap: 7px; margin-top: 8px; padding: 8px 9px; font-size: 10px; }
  .report-auto-option input { width: 16px; height: 16px; }
  .manager-automation {
    align-items: stretch; flex-direction: column; gap: 8px;
  }
  .manager-automation button {
    width: 100%; min-width: 0; padding: 8px 9px;
    white-space: normal; line-height: 1.2;
  }
  .upg-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(68px, 38%);
    grid-template-rows: auto auto auto;
    align-items: start; gap: 7px 8px; padding: 10px;
  }
  .upg-item .upg-icon { grid-column: 1; grid-row: 1 / -1; width: 34px; font-size: 24px; align-self: center; }
  .upg-item .upg-info { display: contents; }
  .upg-item .upg-name { grid-column: 2; grid-row: 1; min-width: 0; }
  .upg-item .upg-buy {
    grid-column: 3; grid-row: 1; width: 100%; min-width: 0;
    margin: 0; padding: 8px 6px; font-size: 10px;
    line-height: 1.2; text-align: center; white-space: normal; overflow-wrap: anywhere;
  }
  .upg-item .upg-desc { grid-column: 2 / -1; grid-row: 2; }
  .upg-item .upg-level { grid-column: 2 / -1; grid-row: 3; }
  .loading-title { font-size: 30px; }
  #build-bar { bottom: 130px; font-size: 12px; padding: 10px 12px; }
  #build-bar > span { display: none; }
  #build-exit, #build-catalog { padding: 9px 12px; font-size: 11px; }
  #build-catalog-dock {
    bottom: 178px; left: 8px; width: calc(100vw - 16px);
    max-height: min(48vh, 440px);
  }
  .build-dock-header { padding: 9px 10px 7px; font-size: 11px; }
  .build-catalog-tabs { padding: 6px 7px; }
  .build-catalog-tabs button { padding: 7px 8px; font-size: 9px; }
  .build-catalog-content { padding: 7px; }
  .build-catalog-content .catalog-card {
    grid-template-columns: 34px 1fr auto; gap: 7px; padding: 8px;
  }
  .build-catalog-content .catalog-icon { font-size: 23px; }
  .build-catalog-content .catalog-action { min-width: 68px; padding: 8px 7px; font-size: 9px; }
  #vip-game { bottom: 140px; }
}

/* Очень узкие телефоны: оставляем нижние панели в одной строке. */
@media (max-width: 360px) {
  .hud-top-center { left: 6px; padding-inline: 5px; }
  .fuel-row { gap: 3px; }
  .fuel-name { width: 35px; font-size: 9px; }
  .fuel-bar { width: 45px; }
  .fuel-val { width: 42px; font-size: 9px; }
  .hud-bottom-right { right: 6px; gap: 2px; padding: 4px; }
  .speed-btn { width: 29px; height: 32px; font-size: 11px; }
  .hud-card.task .hud-icon { display: none; }
  #hud-task-text { font-size: 9px; letter-spacing: -.15px; }
}

/* Низкие горизонтальные экраны: освобождаем место над нижней панелью. */
@media (orientation: landscape) and (max-height: 620px) and (min-width: 761px) {
  .hud-top-left {
    top: 8px; left: 8px; gap: 5px;
    align-items: flex-start; width: min(190px, 23vw);
  }
  .hud-top-left .hud-card { width: 100%; min-width: 0; }
  #card-day { padding-right: 5px; }
  .hud-collapse { display: flex; }
  .hud-card {
    min-width: 130px; padding: 5px 8px; gap: 5px; font-size: 10px;
  }
  .hud-card .hud-icon { font-size: 19px; }
  .hud-big { font-size: 15px; }
  .mini-bar { width: 70px; height: 5px; }
  .hud-card.task { max-width: 200px; padding: 5px 8px; }
  #hud-task-text { font-size: 10px; line-height: 1.1; }
  .hud-task-progress { font-size: 10px; }
  .hud-task-reward { margin-top: 2px; padding: 2px 5px; font-size: 8px; white-space: nowrap; }
  .hud-top-right {
    top: 8px; right: 8px; gap: 5px;
    width: 196px; grid-template-columns: repeat(3, auto);
  }
  .menu-btn.hud-menu-collapse { display: flex; }
  .menu-btn {
    width: 62px; height: 48px; font-size: 8px;
  }
  .menu-btn span { font-size: 18px; margin-bottom: 0; }
  .hud-top-center {
    padding: 6px 8px; gap: 2px;
  }
  .fuel-row { gap: 5px; font-size: 10px; }
  .fuel-name { width: 48px; font-size: 10px; }
  .fuel-bar { width: 90px; height: 9px; }
  .fuel-val { width: 50px; font-size: 10px; }
  .hud-bottom-right {
    bottom: 8px; right: 8px; gap: 4px; padding: 5px;
  }
  .speed-btn { width: 36px; height: 34px; font-size: 13px; }
}

/* Итоги и другие модальные окна не выходят за пределы низкого экрана. */
@media (max-height: 620px) {
  #modal-overlay { padding: 8px; }
  #modal-window {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 15px;
  }
  #modal-header { padding: 10px 12px; font-size: 16px; }
  #modal-close { width: 30px; height: 30px; font-size: 14px; }
  #modal-body { padding: 10px 11px; }
  .panel-section { margin-bottom: 8px; }
  .panel-title { margin-bottom: 4px; font-size: 11px; }
  .report-grid { gap: 5px 8px; font-size: 12px; }
  .report-grid .r-label { min-width: 0; overflow-wrap: anywhere; }
  .report-details summary { font-size: 10px; }
  .report-details-grid { gap: 5px 8px; margin-top: 5px; padding: 7px 8px; }
  .report-auto-option { gap: 7px; margin-top: 8px; padding: 8px 9px; font-size: 10px; }
  .report-auto-option input { width: 16px; height: 16px; }
  .manager-automation {
    align-items: stretch; flex-direction: column; gap: 8px;
  }
  .manager-automation button {
    width: 100%; min-width: 0; padding: 8px 9px;
    white-space: normal; line-height: 1.2;
  }
  .upg-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(68px, 38%);
    grid-template-rows: auto auto auto;
    align-items: start; gap: 7px 8px; padding: 10px;
  }
  .upg-item .upg-icon { grid-column: 1; grid-row: 1 / -1; width: 34px; font-size: 24px; align-self: center; }
  .upg-item .upg-info { display: contents; }
  .upg-item .upg-name { grid-column: 2; grid-row: 1; min-width: 0; }
  .upg-item .upg-buy {
    grid-column: 3; grid-row: 1; width: 100%; min-width: 0;
    margin: 0; padding: 8px 6px; font-size: 10px;
    line-height: 1.2; text-align: center; white-space: normal; overflow-wrap: anywhere;
  }
  .upg-item .upg-desc { grid-column: 2 / -1; grid-row: 2; }
  .upg-item .upg-level { grid-column: 2 / -1; grid-row: 3; }
}

/* Главное меню на мобильном экране в горизонтальной ориентации. */
@media (orientation: landscape) and (max-height: 620px) {
  #main-menu {
    align-items: center; justify-content: flex-end;
    padding: 10px clamp(10px, 2vw, 28px);
    background-position: center top;
  }
  #main-menu::before {
    background:
      linear-gradient(90deg, rgba(4, 20, 14, .02) 18%, rgba(4, 20, 14, .2) 52%, rgba(4, 20, 14, .8) 100%),
      linear-gradient(0deg, rgba(4, 20, 14, .3), transparent 55%);
  }
  .main-menu-panel {
    width: min(340px, 44vw);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 12px 14px;
    border-radius: 15px;
  }
  .main-menu-kicker { font-size: 8px; letter-spacing: 1.5px; margin-bottom: 4px; }
  .main-menu-heading { font-size: clamp(22px, 3.4vw, 29px); line-height: .95; }
  .main-menu-heading.small { font-size: 20px; }
  .main-menu-copy { margin-top: 6px; font-size: 9px; line-height: 1.22; }
  .main-menu-copy.warning { padding: 9px; }
  .main-menu-actions { gap: 5px; margin-top: 8px; }
  .main-menu-actions.compact { margin-top: 8px; }
  .main-menu-btn {
    min-height: 36px; gap: 7px; padding: 6px 9px;
    border-radius: 10px; font-size: 10px;
  }
  .main-menu-btn.primary { min-height: 42px; }
  .main-menu-btn > span:first-child { width: 20px; flex-basis: 20px; font-size: 15px; }
  .main-menu-btn small { margin-top: 1px; font-size: 7px; }
  .main-menu-secondary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .main-menu-secondary-row .main-menu-btn { min-width: 0; min-height: 36px; font-size: 8px; }
  .main-menu-secondary-row .main-menu-btn small { display: none; }
  .main-menu-credit { display: none; }
  .menu-setting-row { gap: 8px; margin-top: 9px; padding: 9px; }
  .menu-setting-row b { font-size: 10px; }
  .menu-setting-row small { font-size: 8px; }
  .menu-toggle, .menu-segment button { padding: 7px 8px; font-size: 8px; }
  #menu-settings-back, #menu-leaderboard-back { margin-top: 9px; min-height: 38px; }
  .leaderboard-menu-content { margin-top: 9px; max-height: 190px; }
  .leaderboard-capital { padding: 8px 10px; margin-bottom: 6px; }
  .leaderboard-capital small, .leaderboard-note { font-size: 8px; }
  .leaderboard-capital b { font-size: 17px; }
  .leaderboard-row { gap: 5px; padding: 6px 7px; }
  .leaderboard-rank, .leaderboard-name, .leaderboard-score { font-size: 9px; }
}

/* Вертикальная иллюстрация для главного меню на мобильных телефонах. */
@media (orientation: portrait) and (max-width: 760px) {
  #main-menu {
    background-image: url('assets/main-menu-bg-portrait.png');
    background-position: center top;
    background-size: cover;
  }
}

/* Горизонтальный фон заполняет экран; лишняя часть обрезается только снизу. */
@media (orientation: landscape) {
  #main-menu {
    background-position: left top;
    background-size: cover;
    background-repeat: no-repeat;
  }
}

/* На компьютере отводим панели правую часть, не перекрывая логотип. */
@media (orientation: landscape) and (hover: hover) and (pointer: fine) {
  #main-menu { padding-right: clamp(16px, 2vw, 32px); }
  .main-menu-panel { width: min(350px, 32vw); }
}

/* Компактная панель режима стройки: не заходит под HUD слева и меню справа. */
#build-bar {
  gap: 8px;
  max-width: min(560px, calc(100vw - 460px));
  padding: 8px 10px;
  font-size: 12px;
}
#build-bar > span {
  min-width: 0;
  max-width: 240px;
  line-height: 1.15;
  text-align: center;
}
#build-exit, #build-catalog {
  flex: 0 0 auto;
  padding: 8px 13px;
  font-size: 12px;
  white-space: nowrap;
}

@media (orientation: landscape) and (max-width: 1100px) {
  #build-bar {
    max-width: calc(100vw - 360px);
  }
  #build-bar > span {
    max-width: 180px;
  }
}

@media (max-width: 760px) {
  #build-bar {
    max-width: calc(100vw - 16px);
    gap: 6px;
    padding: 7px 8px;
  }
  #build-exit, #build-catalog {
    padding: 8px 10px;
    font-size: 10px;
  }
}

@media (max-width: 760px) {
  html[lang="en"] #btn-ads .menu-btn-label { display: none; }
  html[lang="en"] #btn-ads::after {
    content: 'AD';
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .5px;
  }
}

/*
 * Узкий горизонтальный телефон (в том числе iPhone 12 в Safari).
 * В landscape у iPhone CSS-ширина около 844px, поэтому он не попадает
 * в обычный max-width: 760px и раньше получал слишком высокий HUD.
 * Две строки слева оставляют нижнюю панель топлива свободной.
 */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 620px) {
  #hud {
    --hud-left-width: min(250px, 31vw);
    --hud-right-width: min(206px, 26vw);
  }

  .hud-top-left {
    top: calc(8px + env(safe-area-inset-top));
    left: calc(8px + env(safe-area-inset-left));
    width: var(--hud-left-width);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
  }
  .hud-top-left .hud-card {
    width: 100%;
    min-width: 0;
    padding: 4px 7px;
    gap: 4px;
    font-size: 9px;
  }
  .hud-top-left #card-day,
  .hud-top-left #card-task { grid-column: 1 / -1; }
  .hud-card .hud-icon { font-size: 17px; }
  .hud-big { font-size: 13px; }
  .mini-bar { width: 62px; height: 5px; }
  #card-day { padding-right: 4px; }
  .hud-collapse { width: 30px; min-height: 28px; font-size: 16px; }

  .hud-card.task {
    max-width: none;
    padding: 4px 7px;
  }
  .hud-card.task .hud-icon { font-size: 16px; }
  #hud-task-text {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.1;
  }
  .hud-task-progress { font-size: 9px; }
  .hud-task-reward {
    margin-top: 1px;
    padding: 2px 4px;
    font-size: 7px;
    white-space: nowrap;
  }

  .hud-top-right {
    top: calc(8px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
    width: var(--hud-right-width);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .menu-btn {
    width: 100%;
    height: 46px;
    min-width: 0;
    font-size: 7px;
    letter-spacing: .25px;
  }
  .menu-btn span { font-size: 17px; margin-bottom: 0; }

  .hud-top-center {
    left: calc(8px + env(safe-area-inset-left));
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 5px 6px;
    gap: 2px;
  }
  .fuel-row {
    grid-template-columns: 43px 76px;
    width: 123px;
    gap: 4px;
    font-size: 9px;
  }
  .fuel-name { width: 43px; font-size: 9px; }
  .fuel-bar { width: 76px; height: 8px; }
  .fuel-val {
    left: 47px;
    width: 76px;
    height: 8px;
    padding: 0 3px;
    font-size: 8px;
    line-height: 8px;
  }

  .hud-bottom-right {
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    gap: 3px;
    padding: 4px;
  }
  .speed-btn { width: 34px; height: 32px; font-size: 12px; }

  /* Уведомления получают коридор между верхним HUD и нижними панелями. */
  #toast-area {
    top: min(164px, 42vh);
    bottom: calc(48px + env(safe-area-inset-bottom));
    max-height: calc(100% - min(164px, 42vh) - 48px - env(safe-area-inset-bottom));
    left: calc(8px + env(safe-area-inset-left) + var(--hud-left-width) + 8px);
    right: calc(8px + env(safe-area-inset-right) + var(--hud-right-width) + 8px);
    width: auto;
    max-width: none;
    align-items: stretch;
    justify-content: center;
    transform: none;
    overflow: hidden;
  }
  .toast {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    overflow: hidden;
  }
}

/* Английские обложки главного меню. Русские варианты остаются базовыми. */
html[lang="en"] #main-menu {
  background-image: url('assets/main-menu-bg-en.png');
}

@media (orientation: portrait) and (max-width: 760px) {
  html[lang="en"] #main-menu {
    background-image: url('assets/main-menu-bg-portrait-en.png');
  }
}

/* Компактная вертикальная плашка топлива: литры читаются прямо на полосе. */
@media (orientation: portrait) and (max-width: 760px) {
  .hud-top-center {
    padding: 5px 6px;
    gap: 2px;
  }
  .fuel-row {
    position: relative;
    display: grid;
    grid-template-columns: 35px 78px;
    width: 116px;
    gap: 3px;
    font-size: 9px;
  }
  .fuel-name { width: 35px; font-size: 9px; }
  .fuel-bar { grid-column: 2; width: 78px; height: 8px; }
  .fuel-val {
    position: absolute;
    left: 38px;
    top: 0;
    z-index: 2;
    width: 78px;
    height: 8px;
    padding: 0 3px;
    color: var(--text);
    font-size: 8px;
    line-height: 8px;
    text-align: right;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
    pointer-events: none;
  }

  /* В portrait уведомления живут в свободной средней зоне, выше нижних панелей. */
  #toast-area {
    top: 54%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(320px, calc(100vw - 24px));
    max-width: none;
    align-items: stretch;
    transform: translate(-50%, -50%);
  }
  .toast {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

/* Offers share the ivory panel and green header of the game. */
#modal-overlay.choice-overlay { padding: 0; }
#modal-window.choice-modal {
  position: absolute; left: var(--choice-x, 50%); top: var(--choice-y, 50%);
  transform: translate(-50%, -50%); width: var(--choice-width, 460px);
  max-width: calc(100% - 16px); max-height: var(--choice-height, 86vh);
  background: #faf8ef; border-radius: 16px;
}
.choice-modal #modal-header { padding: 10px 12px; font-size: 12px; letter-spacing: 0; gap: 8px; }
.choice-modal #modal-title { min-width: 0; }
.choice-modal #modal-close { flex-shrink: 0; width: 34px; height: 34px; }
.choice-modal #modal-body { padding: 12px 12px 0; }
.choice-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.choice-heading h2 { margin: 0; font-size: 19px; line-height: 1.2; color: var(--text); }
.choice-timer { padding: 5px 8px; border-radius: 8px; color: #b63428; background: #fae6de; font-size: 12px; font-weight: 800; white-space: nowrap; }
.choice-intro { margin: 8px 0; font-size: 14px; line-height: 1.3; }
.choice-cards { display: grid; gap: 8px; margin-top: 10px; }
.choice-option { position: relative; width: 100%; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 8px; text-align: left; padding: 10px; border: 2px solid #cedec8; border-radius: 12px; background: #edf5e8; color: var(--text); font-family: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.choice-option.choice-tone-1 { background: #f2efe5; border-color: #ddd7c8; }
.choice-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #e1ecd9; font-size: 23px; }
.choice-tone-1 .choice-icon { background: #e9e3d5; }
.choice-card-body { display: grid; gap: 5px; min-width: 0; }
.choice-card-title { font-size: 13px; font-weight: 800; padding-right: 16px; }
.choice-result { font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.choice-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 700; }
.choice-option:disabled { opacity: .65; cursor: default; }
.choice-unavailable { font-size: 12px; }
.choice-check { position: absolute; top: 7px; right: 7px; display: none; color: #258b32; font-size: 18px; font-weight: 900; }
.choice-option.selected { border-color: var(--green); box-shadow: 0 0 0 2px #35af421a; }
.choice-option.selected .choice-check { display: block; }
.choice-option:focus-visible { outline: 3px solid #358343; outline-offset: 2px; }
.choice-rules { margin: 9px 0; font-size: 13px; line-height: 1.4; }
.choice-rules summary { cursor: pointer; color: #606b5b; font-weight: 700; min-height: 32px; display: list-item; align-content: center; }
.choice-rules p { margin: 8px 0; }
.choice-agreement { margin-top: 8px; padding: 10px; border-radius: 10px; background: #edf4e9; }
.choice-actions { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 8px 0 12px; background: #faf8ef; }
.choice-actions .buy-btn { padding: 10px 8px; font-size: 13px; min-height: 44px; }
.choice-actions #choice-accept { flex: 2; }
@media (max-height: 430px) and (min-width: 700px) {
 .choice-heading h2 { font-size: 17px; }
 .choice-cards { gap: 6px; margin-top: 8px; }
 .choice-option { padding: 8px; }
 .choice-result { font-size: 16px; }
 .choice-card-title { font-size: 12px; }
 .choice-modal #modal-body { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .choice-option { transition: none; } }

.choice-auto-decline { display: flex; align-items: center; gap: 7px; font-size: 12px; min-height: 36px; cursor: pointer; }
.choice-auto-decline input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--green); }
#choice-auto-countdown { font-weight: 800; white-space: nowrap; }

/* Keep day reports inside the game frame, including embedded portal players. */
#modal-window.report-modal { max-height: 100%; }
.report-modal #modal-header { flex-shrink: 0; }
.report-modal #modal-body { overscroll-behavior: contain; }
.report-modal .panel-section { margin-bottom: 8px; }
.report-modal .report-grid { gap: 5px 10px; font-size: 13px; }
.report-modal .report-details summary { min-height: 28px; width: 100%; }
.report-modal .report-details-grid { grid-template-columns: minmax(0, 1fr) auto; }
.report-modal .report-details-grid > .delivery-note { grid-column: 1 / -1; }
.report-modal .r-label { overflow-wrap: anywhere; }
.report-modal .report-auto-option { margin-top: 8px; padding: 8px 10px; }

/* Compact manual fueling in short embedded players and landscape phones. */
@media (max-height: 620px) {
  #service-panel {
    bottom: 8px; max-height: calc(100% - 16px);
    padding: 9px 12px; gap: 6px;
  }
  #service-panel .sp-head { font-size: 14px; }
  #service-panel .sp-request { font-size: 13px; }
  #service-panel .sp-step-hint { font-size: 11px; margin-bottom: 5px; }
  #service-panel .sp-fuel-btn { padding: 8px 4px; font-size: 12px; }
  #service-panel .sp-gauge { height: 20px; }
  #service-panel #sp-dispense-step { gap: 6px; }
  #service-panel #sp-hold { padding: 11px 8px; font-size: 14px; }
  #service-panel #sp-done { padding: 8px; font-size: 12px; }
}

/* ---------- Сеть АЗС ---------- */
.hud-point { display: block; font-size: 9px; font-weight: 800; color: var(--green-dark); white-space: nowrap; }
.net-point.net-active { box-shadow: 0 0 0 2px var(--green), 0 1px 4px rgba(0,0,0,.08); }
.net-point.net-locked { opacity: .92; }
.net-point .upg-buy { min-width: 96px; text-align: center; line-height: 1.25; }
.net-point .upg-buy.confirm { background: #d9822b; }
.net-badge {
  display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 6px;
  background: var(--green); color: #fff; font-size: 9px; font-weight: 900; vertical-align: middle;
}
.net-plus { color: var(--green-dark); }
.net-minus { color: #b4412f; }
.net-warnings { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; grid-column: 2 / -1; grid-row: 5; }
.net-features { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; grid-column: 2 / -1; grid-row: 4; }
.net-feature { padding: 2px 7px; border-radius: 6px; background: #e9efe4; color: #3b4a3e; font-size: 10px; font-weight: 700; }
.net-feature i { font-style: normal; margin-right: 3px; }
.net-warning { padding: 2px 6px; border-radius: 6px; background: #fde2dc; color: #8a2a1c; font-size: 10px; font-weight: 700; }
.net-rules { margin-top: 4px; font-weight: 500; opacity: .85; }
#point-transition {
  position: absolute; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 45%, #2f5d3a 0%, #14281b 100%);
  color: #fff; text-align: center;
  opacity: 0; transition: opacity .35s ease; pointer-events: all;
}
#point-transition.show { opacity: 1; }
.point-transition-icon { font-size: 64px; line-height: 1; }
.point-transition-name { font-size: 28px; font-weight: 900; letter-spacing: 1px; }
.point-transition-sub { font-size: 13px; font-weight: 600; opacity: .75; }

/* ---------- Карта точек ---------- */
.net-map { border-radius: 12px; overflow: hidden; margin-bottom: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.net-map svg { display: block; width: 100%; height: auto; }
.net-marker { cursor: pointer; outline: none; }
.net-marker .m-bg { fill: #fff; stroke: #3faf4e; stroke-width: 3.5; }
.net-m-active .m-bg { fill: #e3f5dc; stroke: #2e8f3c; stroke-width: 6; }
.net-m-open .m-bg { stroke: #d9822b; stroke-dasharray: 6 4; }
.net-m-locked .m-bg { fill: #ecebe3; stroke: #8b958a; stroke-dasharray: 6 4; }
.net-m-locked .net-icon { opacity: .6; }
.net-icon { font-size: 22px; text-anchor: middle; pointer-events: none; }
.net-label {
  font: 800 17px 'Segoe UI', Roboto, sans-serif; fill: #26332a; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: 4.5px; stroke-linejoin: round;
}
.net-cost {
  font: 800 14px 'Segoe UI', Roboto, sans-serif; fill: #8a4a10; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round;
}
.net-ring { fill: none; stroke: #1e6fd9; stroke-width: 3.5; stroke-dasharray: 7 5; pointer-events: none; }
.net-marker:focus-visible .m-bg { stroke: #1e6fd9; }
.net-pulse { fill: rgba(63, 175, 78, .35); transform-box: fill-box; transform-origin: center; animation: netPulse 1.8s ease-out infinite; pointer-events: none; }
@keyframes netPulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.net-alert { fill: #d9534f; stroke: #fff; stroke-width: 2; }
.net-alert-mark { font: 900 12px sans-serif; fill: #fff; text-anchor: middle; pointer-events: none; }
.net-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; font-weight: 700; color: #4c5a4f; margin: 0 2px 4px; }
.net-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; border: 2px solid #3faf4e; background: #fff; vertical-align: -1px; }
.net-legend .lg-active { background: #e3f5dc; border-color: #2e8f3c; }
.net-legend .lg-open { border-color: #d9822b; border-style: dashed; }
.net-legend .lg-locked { border-color: #8b958a; border-style: dashed; background: #ecebe3; }
.net-hint { font-size: 11px; opacity: .7; margin: 0 2px 8px; }
@media (prefers-reduced-motion: reduce) { .net-pulse { animation: none; } }

/* Пикабу: рейтинг Яндекса недоступен */
#menu-leaderboard, #btn-leaderboard { display: none !important; }
/* Pikabu cash packs: keep the reward, description and real-money price distinct. */
.pkb-account { margin-top: 14px; padding: 12px; border-radius: 12px; background: #ffffff10; color: #fff; text-align: left; }
.pkb-account-name { display: block; font-size: 14px; overflow-wrap: anywhere; }
.pkb-account-status { margin: 6px 0 10px; font-size: 12px; line-height: 1.4; color: #e1e9e2; }
.pkb-account button, .pkb-sync-dialog button { border: 0; border-radius: 9px; padding: 10px 14px; background: #38ad49; color: white; font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1.3; cursor: pointer; }
.pkb-account button:disabled { opacity: .55; cursor: default; }
.pkb-account button:focus-visible, .pkb-sync-dialog button:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; }
.pkb-sync-overlay { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: #102015cc; }
.pkb-sync-dialog { width: min(420px, 100%); box-sizing: border-box; border-radius: 18px; padding: 24px; color: #29372c; background: #faf8ee; }
.pkb-sync-dialog h2 { margin: 0 0 12px; font-size: 22px; }
.pkb-sync-dialog p { margin: 0 0 20px; font-size: 15px; line-height: 1.45; }
@media (max-height: 650px) {
  .pkb-account { margin-top: 8px; padding: 8px; }
  .pkb-account-status { font-size: 10px; margin: 4px 0 6px; }
  .pkb-account-name { font-size: 12px; }
  .pkb-account button { padding: 7px 10px; font-size: 11px; }
}
.gold-coin-inline {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  object-fit: contain;
  vertical-align: -.16em;
  margin: 0 .05em;
  flex-shrink: 0;
}
#card-money #hud-money .gold-coin-inline { display: none; }
.vip-banknote {
  width: 32px;
  height: 32px;
  line-height: 32px;
  font-size: 28px;
  background: none;
  border: 0;
  box-shadow: none;
}
.vip-banknote::before { display: none; }
#game-container > #toast-area {
  z-index: 95;
  top: auto;
  bottom: calc(64px + env(safe-area-inset-bottom));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  max-width: none;
  max-height: none;
  overflow: visible;
  align-items: stretch;
  pointer-events: none;
}
#game-container > #toast-area .toast {
  width: 100%;
  max-width: 100%;
  max-height: none;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.35;
  overflow: visible;
}
.upg-item.iap-item {
  grid-template-columns: 60px minmax(0, 1fr) 104px;
  grid-template-rows: auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}
.iap-item .upg-icon,
.iap-item .upg-info,
.iap-item .upg-buy {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
}
.iap-item .upg-icon { width: 60px; min-height: 60px; }
.iap-item .iap-image { width: 60px; height: 60px; }
.iap-item .upg-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.iap-item .upg-name { align-self: stretch; font-size: 18px; line-height: 1.2; }
.iap-item .upg-desc {
  align-self: stretch;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #687365;
  opacity: 1;
}
.iap-item .upg-buy.iap-buy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
.iap-buy-price { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.iap-buy-label { display: block; font-size: 11px; font-weight: 700; line-height: 1.2; }
.iap-buy:focus-visible { outline: 3px solid #1d652c; outline-offset: 3px; }
@media (max-width: 760px), (max-height: 620px) {
  .upg-item.iap-item { grid-template-columns: 44px minmax(0, 1fr) 88px; gap: 10px; padding: 12px; }
  .iap-item .upg-icon { width: 44px; min-height: 44px; }
  .iap-item .iap-image { width: 44px; height: 44px; }
  .iap-item .upg-name { font-size: 16px; }
  .iap-item .upg-desc { font-size: 11px; }
  .iap-item .upg-buy.iap-buy { min-height: 60px; }
  .iap-buy-price { font-size: 20px; }
}
@media (max-width: 380px) {
  .upg-item.iap-item { grid-template-columns: 36px minmax(0, 1fr) 76px; gap: 8px; padding: 10px; }
  .iap-item .upg-icon { width: 36px; min-height: 36px; }
  .iap-item .iap-image { width: 36px; height: 36px; }
  .iap-item .upg-name { font-size: 14px; }
  .iap-item .upg-desc { font-size: 10.5px; }
  .iap-item .upg-buy.iap-buy { padding: 10px 6px; }
}
