/* ============ LEVERAGE.OS Landing — HUD overlays on clean video ============ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body {
  background: #000;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  height: 100vh;
  overflow: hidden;
  font-feature-settings: "ss01","ss02";
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }

/* ============ STAGE (1920x1080 canvas, scaled) ============ */
#stage {
  position: fixed;
  top: 50%; left: 50%;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--stage-scale, 1));
}
#bgVideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #05070d;
}

/* ============ HUD layer (base) ============ */
.hud-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 5;
}
.hud-layer.on {
  opacity: 1;
  pointer-events: auto;
}
#chrome.on { opacity: 1; }
body:not(.started) .hud-layer { opacity: 0 !important; pointer-events: none !important; }

/* ============ Chrome (brand + profile + corner brackets) ============ */
.fc {
  position: absolute;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(255,255,255,0.55);
}
.fc.tl { top: 24px; left: 24px; border-right: none; border-bottom: none; }
.fc.tr { top: 24px; right: 24px; border-left: none; border-bottom: none; }
.fc.bl { bottom: 24px; left: 24px; border-right: none; border-top: none; }
.fc.br { bottom: 24px; right: 24px; border-left: none; border-top: none; }

.brand {
  position: absolute;
  top: 44px; left: 60px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 3px;
  display: flex; align-items: center; gap: 12px;
  pointer-events: auto;
}
.brand-icon {
  display: inline-block;
  width: 26px; height: 26px;
  background: #ffffff;
  clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
}
.profile {
  position: absolute;
  top: 32px; right: 60px;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  cursor: pointer;
  pointer-events: auto;
}
.profile .avatar {
  width: 56px; height: 56px;
  background: linear-gradient(135deg,#2a2a2a,#4a4a4a);
  border: 1px solid rgba(255,255,255,0.4);
}
.profile .p-info { text-align: right; }
.profile .p-num { font-family: 'Space Mono', 'JetBrains Mono', monospace; font-size: 24px; font-weight: 500; letter-spacing: 2px; }
.profile .p-nick { font-size: 15px; font-weight: 500; letter-spacing: 4px; margin-top: 2px; }
.profile .p-id { font-size: 10px; letter-spacing: 3px; color: rgba(255,255,255,0.55); margin-top: 3px; }
.profile .p-bar { margin-top: 6px; height: 3px; width: 140px; background: rgba(255,255,255,0.15); position: relative; }
.profile .p-bar::after { content: ''; position: absolute; inset: 0 28% 0 0; background: #fff; }

.watermark {
  position: absolute; bottom: 30px; right: 60px;
  font-size: 10px; letter-spacing: 3px;
  color: rgba(255,255,255,0.55);
}

/* ============ HUD 1: MAIN MENU ============ */
#hud1 .menu-list {
  position: absolute;
  left: 80px; top: 480px;
  display: flex; flex-direction: column; gap: 22px;
}
.menu-item {
  display: flex; align-items: center; gap: 22px;
  padding: 16px 26px;
  font-size: 22px; letter-spacing: 5px; font-weight: 500;
  min-width: 380px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  cursor: pointer;
  font-family: 'JetBrains Mono';
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.menu-item:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
.menu-item.active {
  background: rgba(255,255,255,0.92);
  color: #0a0a0a;
  border-color: #ffffff;
}
.menu-item.pressed {
  background: rgba(80,80,80,0.85) !important;
  color: rgba(255,255,255,0.7) !important;
}
.menu-item .ico { width: 24px; text-align: center; opacity: 0.85; }

/* ============ Common: panel ============ */
.panel {
  position: absolute;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 24px 26px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}
.p-title {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 18px; letter-spacing: 4px;
  margin-bottom: 20px;
}
.p-title-sub {
  font-size: 10px; letter-spacing: 3px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 16px;
}

/* ============ HUD 2: EQUIPMENT ============ */
.set-section { margin-bottom: 18px; }
.set-section .sec-label {
  font-size: 10px; letter-spacing: 3px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.btn-row { display: flex; gap: 6px; }
.set-btn {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px; letter-spacing: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.25);
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.set-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); color: #fff; }
.set-btn.active {
  background: rgba(255,255,255,0.92);
  color: #0a0a0a;
  border-color: #ffffff;
  font-weight: 700;
}
.set-btn.danger.active {
  background: rgba(255,77,61,0.9);
  color: #ffffff;
  border-color: #ff4d3d;
}

.loc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 4px;
  font-size: 11px; letter-spacing: 2px;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.loc-row:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.04); }
.loc-row.selected {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
}
.loc-row .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); }
.loc-row.selected .dot { background: #fff; border-color: #fff; }
.loc-row .meta { margin-left: auto; font-size: 8.5px; color: rgba(255,255,255,0.4); letter-spacing: 1.5px; }

.attr { margin-bottom: 18px; }
.attr .a-name {
  display: flex; justify-content: space-between;
  font-size: 13px; letter-spacing: 2px;
  margin-bottom: 6px;
}
.attr .a-bar {
  height: 6px;
  background: rgba(255,255,255,0.12);
  position: relative; overflow: hidden;
}
.attr .a-bar > span {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: #ffffff;
  width: 0;
  transition: width 1s cubic-bezier(0.65, 0, 0.35, 1);
}
.total-line {
  display: flex; justify-content: space-between;
  padding-top: 16px; margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.25);
  font-size: 13px; letter-spacing: 3px;
}
.action-row {
  margin-top: 20px;
  display: flex; gap: 12px; align-items: center;
  font-size: 11px; letter-spacing: 2px;
}
.mini-btn {
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.7);
  font-size: 12px; letter-spacing: 3px;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.mini-btn:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.or { opacity: 0.5; }

.perk {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.perk:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.35); }
.perk.equipped { background: rgba(78,201,255,0.08); border-color: rgba(78,201,255,0.55); }
.perk.equipped:hover { background: rgba(78,201,255,0.15); }
.perk.locked { opacity: 0.4; cursor: not-allowed; }
.perk-icon {
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 14px;
}
.perk.equipped .perk-icon { border-color: #4ec9ff; color: #4ec9ff; }
.perk-info { flex: 1; }
.perk-name { font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; letter-spacing: 2px; }
.perk-desc { font-size: 8.5px; letter-spacing: 1.5px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.perk-cd { font-size: 9px; letter-spacing: 1.5px; color: rgba(255,255,255,0.55); text-align: right; line-height: 1.4; }

/* ============ HUD 3: ARMAMENT ============ */
.hud3-title {
  position: absolute; top: 170px; left: 60px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 20px; letter-spacing: 5px;
}
.hud3-tabs {
  position: absolute; top: 210px; left: 60px;
  width: 280px; display: flex; gap: 4px;
}
.hud3-tabs .tab {
  flex: 1; padding: 8px 0;
  text-align: center;
  font-size: 12px; letter-spacing: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.hud3-tabs .tab.active {
  background: rgba(255,255,255,0.9);
  color: #0a0a0a;
  border-color: #ffffff;
}

.weap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.weap-cell {
  position: relative;
  height: 92px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.weap-cell:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.5); }
.weap-cell.active {
  border-color: #ffffff;
  background: rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.weap-cell::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 10px; height: 10px;
  border-left: 1px solid rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.4);
}
.weap-cell.active::before { border-color: #fff; }
.weap-cell img {
  max-width: 88%; max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(78,201,255,0.2));
  transition: transform 0.2s;
}
.weap-cell.big-icon img { max-width: 100%; max-height: 88%; }
.weap-cell:hover img { transform: scale(1.06); }
.weap-cell .n {
  position: absolute; bottom: 4px; left: 6px;
  font-size: 8px; letter-spacing: 1.5px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.weap-cell .st {
  position: absolute; top: 4px; right: 6px;
  font-size: 7.5px; letter-spacing: 1px;
  color: rgba(255,255,255,0.5); text-align: right; line-height: 1.3;
}

/* Selected component */
.sel-preview {
  width: 100%;
  background: #050810;
  border: 1px solid rgba(255,255,255,0.4);
  margin-bottom: 20px;
  overflow: hidden;
  line-height: 0;
}
.sel-preview img { width: 100%; height: auto; display: block; }
.sel-name {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 16px; letter-spacing: 4px;
  margin-bottom: 8px;
}
.sel-desc {
  font-size: 9.5px; letter-spacing: 2px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6; margin-bottom: 18px;
}
.stat-row {
  display: flex; justify-content: space-between;
  font-size: 12px; letter-spacing: 2px;
  margin-bottom: 4px;
}
.stat-bar {
  height: 5px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 10px;
  overflow: hidden;
}
.stat-bar > span { display: block; height: 100%; background: #fff; transition: width 0.4s; }
.confirm-btn {
  padding: 14px 28px;
  background: rgba(255,255,255,0.95);
  color: #0a0a0a;
  border: 1px solid #fff;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 12px; letter-spacing: 3px;
  text-align: center;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.confirm-btn:hover { background: #fff; box-shadow: 0 0 30px rgba(255,255,255,0.4); }

/* ============ HUD 4: LOADING ============ */
.mi {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  margin-bottom: 8px;
  font-size: 11px; letter-spacing: 2px;
  background: rgba(0,0,0,0.3);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.mi-lbl { font-size: 9px; letter-spacing: 3px; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.mi-val { font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; letter-spacing: 2.5px; }
.mi-val.priority { color: #ff4d3d; }
.objs {
  list-style: none; padding: 0; margin: 8px 0 0;
  font-size: 10.5px; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
}
.objs li:before { content: '◇ '; color: rgba(78,201,255,0.7); margin-right: 4px; }
.objs li.done:before { content: '✓ '; color: #b5ff5b; }
.objs li.done { color: rgba(255,255,255,0.5); text-decoration: line-through; }

.loadout-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.loadout-slot:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.5); }
.loadout-slot .li-icon {
  width: 90px; height: 42px;
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
}
.loadout-slot .li-icon img { max-width: 88%; max-height: 82%; object-fit: contain; }
.loadout-slot .li-info { flex: 1; }
.loadout-slot .li-name { font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 11px; letter-spacing: 2.5px; }
.loadout-slot .li-stats { font-size: 8.5px; letter-spacing: 1.5px; color: rgba(255,255,255,0.55); margin-top: 3px; }
.loadout-slot .li-key { font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 10px; letter-spacing: 2px; color: rgba(78,201,255,0.85); }

.deploy-mission-btn {
  padding: 18px 28px;
  background: rgba(78,201,255,0.95);
  color: #000000;
  border: 1px solid #4ec9ff;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 14px; letter-spacing: 4px;
  text-align: center;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.15s;
  box-shadow: 0 0 30px rgba(78,201,255,0.4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.deploy-mission-btn:hover { background: #4ec9ff; box-shadow: 0 0 60px rgba(78,201,255,0.7); }
.deploy-mission-btn.pressed { animation: btnPress 0.4s both; }
@keyframes btnPress {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.96); background: rgba(60,60,60,0.9); color: #ffffff; }
}

.loading-wrap {
  position: absolute;
  bottom: 88px; left: 50%; transform: translateX(-50%);
  width: 780px;
}
.loading-label { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 5px; margin-bottom: 12px; }
.loading-bar { height: 2px; background: rgba(255,255,255,0.2); position: relative; }
.loading-bar > span { position: absolute; inset: 0; background: #fff; }
.loading-bar::after {
  content: ''; position: absolute; top: -3px; bottom: -3px;
  left: 89%; width: 2px; background: #fff;
}

/* ============ HUD 5: GAMEPLAY ============ */
#hud5 .gp-minimap {
  position: absolute; top: 44px; left: 60px;
  width: 200px; height: 200px;
  border: 2px solid rgba(78,201,255,0.85);
  border-radius: 50%;
  background: url('assets/minimap.jpeg') center/cover;
  box-shadow: 0 0 12px rgba(78,201,255,0.35), inset 0 0 20px rgba(0,0,0,0.5);
}
#hud5 .gp-objective {
  position: absolute; top: 260px; left: 60px;
  font-size: 12px; letter-spacing: 3px;
  color: rgba(255,255,255,0.85);
}
#hud5 .gp-objective .obj-label { color: rgba(255,255,255,0.5); font-size: 10px; margin-bottom: 4px; }
#hud5 .gp-topright {
  position: absolute; top: 44px; right: 60px;
  text-align: right;
}
#hud5 .gp-time {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-size: 42px; font-weight: 700; letter-spacing: 4px;
}
#hud5 .gp-money {
  font-size: 20px; letter-spacing: 3px;
  margin-top: 6px; color: #b5ff5b;
}
#hud5 .gp-hp {
  position: absolute; bottom: 60px; left: 60px;
  width: 340px;
}
#hud5 .hp-line { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 3px; margin-bottom: 6px; }
#hud5 .hp-bar {
  height: 8px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative; margin-bottom: 14px;
}
#hud5 .hp-bar > span { position: absolute; inset: 0 auto 0 0; background: #fff; }
#hud5 .hp-bar.stam > span { background: rgba(181,255,91,0.9); }
#hud5 .gp-weapon {
  position: absolute; bottom: 60px; right: 60px;
  display: flex; align-items: center; gap: 20px;
}
#hud5 .w-ammo {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 48px; letter-spacing: 2px;
  color: #fff;
}
#hud5 .w-ammo .ammo-slash, #hud5 .w-ammo .ammo-tot {
  font-size: 36px; color: rgba(255,255,255,0.6);
}
#hud5 .w-icon {
  width: 170px; height: 70px;
  display: flex; align-items: center; justify-content: center;
}
#hud5 .w-icon img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 0 3px rgba(255,255,255,0.2)); }
#hud5 .gp-rocket-label {
  position: absolute;
  bottom: 145px; right: 100px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-size: 15px;
  letter-spacing: 5px;
  color: rgba(255,255,255,0.85);
  display: none;
}
#hud5.rocket .gp-rocket-label { display: block; }
#hud5.rocket .w-icon { width: 260px; height: 100px; }
#hud5.rocket .w-icon img { filter: drop-shadow(0 0 6px rgba(255,167,60,0.55)); }

/* ============ LOCK SCREEN ============ */
#lockscreen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(10,10,14,0.72);
  backdrop-filter: blur(4px);
  transition: opacity 0.9s ease, visibility 0.9s;
}
body.started #lockscreen {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.lock-content {
  text-align: center; max-width: 900px;
}
.agent-tag {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-size: 12px;
  letter-spacing: 6px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 22px;
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,0.35);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
h1 {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 130px;
  letter-spacing: -2px;
  line-height: 0.95;
  margin-bottom: 24px;
}
h1 .accent {
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  font-size: 0.55em;
  letter-spacing: 10px;
  display: block;
  margin-top: 12px;
}
.sub {
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-size: 15px; letter-spacing: 4px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 48px;
}
.btn.primary.big {
  padding: 22px 44px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 15px; letter-spacing: 4px;
  background: rgba(255,255,255,0.95);
  color: #0a0a0a;
  border: 1px solid #ffffff;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  transition: all 0.15s;
}
.btn.primary.big:hover { background: #fff; box-shadow: 0 0 60px rgba(255,255,255,0.4); }

.sound-toggle {
  position: absolute;
  bottom: 40px; right: 40px;
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 3px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}
.sound-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.6); }

/* ============ Segment indicator ============ */
.seg-indicator {
  position: absolute;
  top: 175px; right: 60px;
  z-index: 60;
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 3px;
  color: rgba(255,255,255,0.7);
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transition: opacity 0.4s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}
body.started .seg-indicator { opacity: 1; }
.seg-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #b5ff5b;
  box-shadow: 0 0 10px #b5ff5b;
  animation: dotPulse 1.4s infinite;
}
body.paused .seg-dot { background: rgba(255,255,255,0.4); box-shadow: none; animation: none; }
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ============ Bottom nav ============ */
#bottomNav {
  position: absolute;
  bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 60;
  display: flex; gap: 6px;
  opacity: 0; transition: opacity 0.4s 0.4s;
  pointer-events: none;
}
body.started #bottomNav { opacity: 1; pointer-events: auto; }
#bottomNav a {
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 4px;
  padding: 12px 22px;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
#bottomNav a:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
#bottomNav a.active {
  color: #0a0a0a; background: rgba(255,255,255,0.9); border-color: #fff;
}

/* ============ Gameplay: hide chrome profile & segment indicator ============ */
body.gameplay #chrome .profile,
body.gameplay #chrome .brand,
body.gameplay #chrome .watermark,
body.gameplay .fc,
body.gameplay .seg-indicator,
body.gameplay #bottomNav {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

/* ============ Exit / enter animations ============ */
.exit-left, .exit-right, .exit-top, .exit-bottom {
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.5s;
}
body.deploying .exit-left { transform: translateX(-120%); opacity: 0; }
body.deploying .exit-right { transform: translateX(120%); opacity: 0; }
body.deploying .exit-top { transform: translateY(-120%); opacity: 0; }
body.deploying .exit-bottom { transform: translateY(120%); opacity: 0; }

/* ============ Button press pulse ============ */
@keyframes buttonPulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.96); filter: brightness(0.7); }
  100% { transform: scale(1); filter: brightness(1); }
}
.pulsing { animation: buttonPulse 0.35s ease-out; }

/* ============ Stat allocation +/- ============ */
.attr .stat-ctrl {
  display: inline-flex; gap: 4px;
  margin-left: 8px;
}
.attr .stat-ctrl .sc {
  width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
  transition: all 0.15s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%);
}
.attr .stat-ctrl .sc:hover { background: rgba(255,255,255,0.15); border-color: #fff; }
.attr .stat-ctrl .sc.disabled { opacity: 0.3; pointer-events: none; }
.a-name .val-line { display: flex; align-items: center; }

/* ============ End overlay ============ */
#endOverlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s;
  padding: 40px;
}
body.ended #endOverlay {
  opacity: 1;
  visibility: visible;
}
.end-inner {
  text-align: center;
}
.end-title {
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 96px;
  letter-spacing: -1px;
  color: #b5ff5b;
  text-shadow: 0 0 60px rgba(181,255,91,0.5);
  margin-bottom: 22px;
  animation: fadeUp 0.9s 0.3s both;
}
.end-sub {
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 5px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 44px;
  animation: fadeUp 1s 0.6s both;
}
#endOverlay .btn {
  animation: fadeUp 1.1s 0.9s both;
}

/* ============ NEXT button (bottom-right, prominent cyan) ============ */
#nextBtn {
  position: absolute;
  bottom: 30px; right: 60px;
  z-index: 60;
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px; letter-spacing: 5px;
  padding: 18px 32px;
  color: #000;
  background: rgba(78,201,255,0.95);
  border: 1px solid #4ec9ff;
  box-shadow: 0 0 40px rgba(78,201,255,0.5), inset 0 0 20px rgba(255,255,255,0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 14px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  transition: all 0.15s;
  animation: nextPulse 2s ease-in-out infinite;
}
body.started #nextBtn { display: inline-flex; }
body.gameplay #nextBtn,
body.ended #nextBtn { display: none; }
#nextBtn:hover {
  background: #4ec9ff;
  box-shadow: 0 0 60px rgba(78,201,255,0.9), inset 0 0 25px rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
#nextBtn .next-arrow {
  font-size: 20px;
  animation: arrowSlide 1.4s ease-in-out infinite;
}
#nextBtn .next-step {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.7;
  border-left: 1px solid rgba(0,0,0,0.4);
  padding-left: 12px;
  margin-left: 4px;
}
@keyframes nextPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(78,201,255,0.5), inset 0 0 20px rgba(255,255,255,0.15); }
  50%      { box-shadow: 0 0 70px rgba(78,201,255,0.8), inset 0 0 30px rgba(255,255,255,0.25); }
}
@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}

/* Defensive: prevent text overflow in translated buttons */
.set-btn, .menu-item, .btn, .mini-btn, .confirm-btn, .deploy-mission-btn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.menu-item span[data-i18n] {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
