* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090c12;
  font-family: "Courier New", Courier, monospace;
  color: #f4efe6;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0d121c;
}

#game-canvas,
#weapon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#weapon-canvas {
  pointer-events: none;
  z-index: 4;
}

#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0.1) 4px
  );
  opacity: 0.12;
}

#damage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle at center, transparent 42%, rgba(190, 12, 20, 0.78) 100%);
  opacity: 0;
  transition: opacity 0.08s linear;
}

/* Crosshair */
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 8;
}

.ch-line {
  position: absolute;
  background: rgba(255, 250, 232, 0.92);
  box-shadow: 0 0 2px #000;
}

.ch-top,
.ch-bottom {
  left: 50%;
  width: 2px;
  height: 6px;
  transform: translateX(-50%);
}
.ch-top { top: 0; }
.ch-bottom { bottom: 0; }

.ch-left,
.ch-right {
  top: 50%;
  height: 2px;
  width: 6px;
  transform: translateY(-50%);
}
.ch-left { left: 0; }
.ch-right { right: 0; }

.ch-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  background: #ff3b3b;
  transform: translate(-50%, -50%);
}

#hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
  z-index: 9;
  opacity: 0;
}
#hitmarker::before,
#hitmarker::after {
  content: "";
  position: absolute;
  background: #ff2626;
  box-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}
#hitmarker::before {
  left: 10px;
  top: 0;
  width: 2px;
  height: 22px;
}
#hitmarker::after {
  top: 10px;
  left: 0;
  width: 22px;
  height: 2px;
}
#hitmarker.active {
  opacity: 1;
}
#hitmarker.kill::before,
#hitmarker.kill::after {
  background: #ffd15c;
}

/* HUD */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* Top Center Wave Box */
.hud-top-center {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wave-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 18, 24, 0.94);
  border: 2px solid #b82525;
  box-shadow: 3px 3px 0 #000;
  padding: 4px 18px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff3b3b;
  text-shadow: 2px 2px 0 #000;
}

.wave-timer {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #d7dce6;
  text-shadow: 2px 2px 0 #000;
}

.wave-motto {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
}

.alert-banner {
  margin-top: 4px;
  background: rgba(168, 22, 22, 0.92);
  border: 2px solid #ffd15c;
  color: #fff5d6;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 3px 3px 0 #000;
}

/* Top Right Round + Timer */
.hud-top-right {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.points-box {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(20, 22, 28, 0.88);
  border: 2px solid #d4a644;
  padding: 5px 12px;
  box-shadow: 3px 3px 0 #000;
}

.points-box .label {
  font-size: 12px;
  letter-spacing: 2px;
  color: #d4a644;
  font-weight: bold;
}

.points-num {
  font-size: 24px;
  font-weight: 900;
  color: #ffd15c;
  text-shadow: 2px 2px 0 #000;
}

.score-feed {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.score-entry {
  font-size: 13px;
  font-weight: bold;
  color: #ffd15c;
  text-shadow: 2px 2px 0 #000;
}

.interact-prompt {
  position: absolute;
  left: 50%;
  bottom: 23%;
  transform: translateX(-50%);
  background: rgba(14, 16, 22, 0.9);
  border: 2px solid #ffd15c;
  color: #fff4d2;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 3px 3px 0 #000;
}

/* Bottom Left Biohazard / HP Panel */
.hud-bottom-left {
  position: absolute;
  bottom: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bio-badges {
  display: flex;
  gap: 6px;
}

.mini-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #23262e;
  border: 2px solid #6b7180;
  box-shadow: 2px 2px 0 #000;
  font-size: 16px;
  font-weight: bold;
}
.mini-badge.heart { color: #e83838; }
.mini-badge.bio { color: #95e038; }

.vital-panel {
  background: rgba(18, 20, 26, 0.94);
  border: 2px solid #7d8394;
  box-shadow: 4px 4px 0 #000, inset 0 0 0 2px #0b0d12;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vital-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pixel-icon,
.pixel-icon-sm,
.pixel-bar,
.slot-pixel-canvas,
#weapon-icon-canvas,
#ammo-pips-canvas {
  image-rendering: pixelated;
}

.pixel-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.pixel-icon-sm {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pixel-bar {
  width: 112px;
  height: 14px;
  flex-shrink: 0;
}

.vital-num {
  width: 34px;
  text-align: right;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

/* Right-Side Artistic HD Pixel-Art Arsenal & Utility Bar */
.arsenal-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, rgba(24, 28, 38, 0.96) 0%, rgba(14, 16, 22, 0.98) 100%);
  border: 2px solid #8c96ab;
  box-shadow:
    0 0 0 2px #090b10,
    4px 4px 0 #000,
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.65);
  padding: 5px 6px;
}

.arsenal-divider {
  width: 2px;
  height: 36px;
  background: #090b10;
  border-right: 1px solid #485063;
  margin: 0 2px;
}

.hotbar-slot {
  position: relative;
  width: 46px;
  height: 44px;
  background: linear-gradient(180deg, #232836 0%, #151821 100%);
  border: 2px solid #5d6578;
  box-shadow:
    inset 0 0 0 1px #0b0d12,
    inset 0 2px 0 rgba(255, 255, 255, 0.08),
    2px 2px 0 #080a0e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hotbar-slot.weapon-slot {
  width: 52px;
}

.hotbar-slot.secondary-slot {
  width: 48px;
}

.hotbar-slot.active {
  border-color: #ffd15c;
  background: linear-gradient(180deg, #423622 0%, #241d12 100%);
  box-shadow:
    0 0 0 1px #0b0d12,
    inset 0 0 0 1px #ffea9f,
    inset 0 2px 0 rgba(255, 220, 120, 0.28),
    2px 2px 0 #080a0e;
}

.hotbar-slot.locked {
  opacity: 0.34;
  filter: grayscale(0.6);
}

.slot-key {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  color: #ffd15c;
  text-shadow: 1px 1px 0 #000;
}

.slot-pixel-canvas {
  width: 28px;
  height: 28px;
}

.slot-pixel-canvas.wide {
  width: 44px;
  height: 24px;
}

.slot-pixel-canvas.pistol {
  width: 36px;
  height: 24px;
}

.slot-count {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.slot-badge-inf {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  color: #ffd15c;
  text-shadow: 1px 1px 0 #000;
}

/* Bottom Right Weapon & Ammo Box */
.hud-bottom-right {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.ammo-top-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cash-pill {
  background: linear-gradient(180deg, #2b2416 0%, #14120c 100%);
  border: 2px solid #e0b048;
  box-shadow:
    0 0 0 2px #090b10,
    3px 3px 0 #000,
    inset 0 1px 0 rgba(255, 240, 170, 0.25);
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cash-num {
  font-size: 15px;
  font-weight: 900;
  color: #ffd15c;
  text-shadow: 2px 2px 0 #000;
}

.weapon-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.weapon-name {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #ffd15c;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}

.weapon-role {
  font-size: 8px;
  letter-spacing: 1.2px;
  color: #98a4bd;
  font-weight: 900;
  text-shadow: 1px 1px 0 #000;
}

.reload-hint {
  font-size: 12px;
  font-weight: bold;
  color: #ff5247;
  text-shadow: 2px 2px 0 #000;
}

.ammo-panel {
  background: linear-gradient(180deg, rgba(26, 30, 42, 0.96) 0%, rgba(14, 16, 22, 0.98) 100%);
  border: 2px solid #8c96ab;
  box-shadow:
    0 0 0 2px #090b10,
    4px 4px 0 #000,
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.65);
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.weapon-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#weapon-icon-canvas {
  width: 106px;
  height: 36px;
}

#ammo-pips-canvas {
  width: 150px;
  height: 14px;
}

.ammo-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}

.ammo-lbl {
  font-size: 14px;
  color: #c2c7d4;
  letter-spacing: 1px;
}

.ammo-mag {
  font-size: 24px;
  color: #ffffff;
}

.ammo-sep {
  color: #7d8394;
  font-size: 18px;
}

.ammo-res {
  font-size: 18px;
  color: #b7becf;
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 15, 0.84);
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.panel {
  width: min(580px, 92vw);
  background: #171a21;
  border: 3px solid #d4a644;
  box-shadow: 8px 8px 0 #000;
  padding: 26px 28px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: #8c2323;
  color: #ffd15c;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 4px 10px;
  margin-bottom: 12px;
  border: 1px solid #ffd15c;
}

.panel h1 {
  font-size: 40px;
  letter-spacing: 3px;
  color: #f7eedc;
  text-shadow: 3px 3px 0 #8c2323;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 14px;
  color: #c7bfb3;
  line-height: 1.5;
  margin-bottom: 18px;
}

.stats-summary {
  background: #0f1117;
  border: 2px solid #3c414f;
  padding: 12px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-around;
  font-size: 14px;
}

.stats-summary b {
  color: #ffd15c;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.btn-primary,
.btn-secondary {
  cursor: pointer;
  color: #fff6de;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.08s, background 0.1s;
}

.btn-primary {
  background: #b82525;
  border: 3px solid #ffd15c;
}

.btn-primary:hover {
  background: #d42e2e;
  transform: translate(-1px, -1px);
}

.btn-secondary {
  background: #194a5e;
  border: 3px solid #54f0ff;
}

.btn-secondary:hover {
  background: #236882;
  transform: translate(-1px, -1px);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translate(2px, 2px);
}

.controls-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  text-align: left;
  font-size: 13px;
  color: #b7afa4;
  border-top: 1px solid #2e323d;
  padding-top: 14px;
}

.controls-grid b {
  color: #ffd15c;
}

.neat-badge {
  margin-top: 3px;
  padding: 2px 8px;
  background: #101824;
  border: 2px solid #356082;
  color: #8ce8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-shadow: 2px 2px 0 #000;
  box-shadow: 2px 2px 0 #000;
}

@media (max-width: 820px) {
  .bar-track {
    width: 62px;
  }
  .vital-panel {
    padding: 6px 8px;
  }
  .hotbar-slot {
    width: 38px;
    height: 38px;
  }
  .ammo-panel {
    padding: 6px 9px;
  }
  #weapon-icon-canvas {
    width: 72px;
    height: 25px;
  }
  .ammo-mag {
    font-size: 20px;
  }
  .ammo-res {
    font-size: 15px;
  }
}

/* =========================================================================
   POST-APOCALYPTIC TACTICAL SMARTPHONE ("CEDA FIELD PDA") - RIGHT DOCKED
   ========================================================================= */

.phone-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 26px 16px 16px;
  background: linear-gradient(
    90deg,
    rgba(6, 9, 14, 0.08) 0%,
    rgba(6, 9, 14, 0.34) 55%,
    rgba(6, 9, 14, 0.74) 100%
  );
  user-select: none;
}

.phone-overlay.hidden {
  display: none;
}

@keyframes pdaSlideIn {
  from {
    opacity: 0;
    transform: translateX(48px) rotate(1.5deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
}

.pda-frame {
  position: relative;
  width: min(374px, 92vw);
  max-height: min(650px, 93vh);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 12px;
  border-radius: 14px;
  border: 3px solid #0b0d10;
  background:
    radial-gradient(circle at 14% 12%, rgba(168, 128, 78, 0.14), transparent 28%),
    radial-gradient(circle at 86% 84%, rgba(120, 74, 42, 0.18), transparent 34%),
    linear-gradient(155deg, #3a4033 0%, #242922 46%, #181c19 100%);
  box-shadow:
    inset 0 2px 0 rgba(215, 224, 198, 0.2),
    inset 0 -3px 0 rgba(0, 0, 0, 0.7),
    inset 4px 0 10px rgba(0, 0, 0, 0.45),
    -12px 18px 34px rgba(0, 0, 0, 0.78),
    0 0 0 2px #4c5244;
  animation: pdaSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stubby armored radio antenna on top right */
.pda-antenna {
  position: absolute;
  top: -22px;
  right: 26px;
  width: 14px;
  height: 22px;
  border-radius: 5px 5px 0 0;
  border: 2px solid #0b0d10;
  border-bottom: none;
  background: repeating-linear-gradient(
    0deg,
    #2d3136 0px,
    #2d3136 4px,
    #1b1e22 4px,
    #1b1e22 6px
  );
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.12);
}

/* Exposed hex screws on battered armor casing */
.pda-screw {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8d9387 0%, #3a3f38 65%, #161816 100%);
  border: 1px solid #090b0d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}
.pda-screw::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 1px;
  right: 1px;
  height: 1px;
  background: #101210;
  transform: rotate(-28deg);
}
.pda-screw.tl { top: 6px; left: 6px; }
.pda-screw.tr { top: 6px; right: 6px; }
.pda-screw.bl { bottom: 6px; left: 6px; }
.pda-screw.br { bottom: 6px; right: 6px; }

.pda-top-bezel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 14px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #b7bfa8;
  text-shadow: 1px 1px 0 #000;
}

.pda-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5733;
  border: 1px solid #000;
  box-shadow: 0 0 8px #ff5733;
  animation: pdaLedBlink 2.2s infinite;
}

@keyframes pdaLedBlink {
  0%, 70%, 100% { opacity: 1; }
  80% { opacity: 0.28; }
}

.pda-speaker {
  width: 68px;
  height: 5px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    90deg,
    #0b0d10 0px,
    #0b0d10 3px,
    #353b34 3px,
    #353b34 5px
  );
  border: 1px solid #090b0e;
}

.pda-model-tag {
  font-size: 9px;
  color: #d4a644;
  letter-spacing: 1px;
}

/* Scratched caution hazard trim */
.pda-hazard {
  height: 5px;
  margin: 0 2px 7px;
  border: 1px solid #090b0e;
  background: repeating-linear-gradient(
    -45deg,
    #d4a644 0px,
    #d4a644 7px,
    #191b18 7px,
    #191b18 14px
  );
  opacity: 0.85;
}

/* Inner tempered LCD screen */
.pda-screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid #090b0e;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(28, 52, 46, 0.35), transparent 72%),
    linear-gradient(180deg, #0e1615 0%, #091013 100%);
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(130, 185, 145, 0.14);
}

/* Subtle LCD scanlines inside screen */
.pda-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 4;
}

.pda-crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.pda-statusbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  background: rgba(12, 18, 22, 0.94);
  border-bottom: 2px solid #20312d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #93b8a6;
}

.pda-cash-bar {
  color: #ffd15c;
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
}

.pda-toast {
  position: absolute;
  top: 30px;
  left: 10px;
  right: 10px;
  z-index: 8;
  padding: 6px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  background: #173624;
  border: 2px solid #4fe36c;
  color: #eaffef;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.14s, transform 0.14s;
}

.pda-toast.error {
  background: #3d1517;
  border-color: #f05a5a;
  color: #ffe3e3;
}

.pda-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.pda-viewport {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pda-viewport::-webkit-scrollbar {
  width: 6px;
}
.pda-viewport::-webkit-scrollbar-thumb {
  background: #354742;
  border-radius: 3px;
}

.pda-home-banner {
  background: linear-gradient(180deg, #162224 0%, #10181b 100%);
  border: 2px solid #2e4844;
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pda-telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pda-kicker {
  font-size: 9px;
  color: #7ea398;
  letter-spacing: 1.2px;
  font-weight: 800;
}

.pda-mode-badge {
  font-size: 12px;
  font-weight: 900;
  color: #eef5f2;
  margin-top: 2px;
}

.pda-cash-big {
  font-size: 20px;
  font-weight: 900;
  color: #ffd15c;
  text-shadow: 2px 2px 0 #000;
}

.pda-mini-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed #293e3b;
  font-size: 11px;
  font-weight: 700;
  color: #c2d4cd;
}

.pda-quicksave-card {
  background: #141c22;
  border: 2px solid #594b28;
  padding: 8px 9px;
}

.pda-qs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffd15c;
  margin-bottom: 6px;
  gap: 6px;
}

.pda-qs-meta {
  font-size: 10px;
  font-weight: 600;
  color: #9bb1bd;
  text-align: right;
}

.pda-qs-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pda-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pda-app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px 8px;
  background: linear-gradient(180deg, #1b262c 0%, #11181e 100%);
  border: 2px solid #354752;
  color: #eaf2f7;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 #090c10;
  transition: transform 0.08s, border-color 0.12s, background 0.12s;
}

.pda-app-tile:hover {
  border-color: #d4a644;
  background: linear-gradient(180deg, #243239 0%, #162027 100%);
  transform: translateY(-1px);
}

.pda-app-tile.accent-gold {
  border-color: #8f6b24;
}

.pda-app-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 3px;
  background: rgba(10, 14, 18, 0.9);
  border: 1px solid #445864;
  color: #ffd15c;
}

.pda-icon-canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.pda-app-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-align: center;
}

.pda-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #213432;
}

.pda-section-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #ffd15c;
}

.pda-section-sub {
  font-size: 10px;
  color: #8da69e;
  margin-top: 2px;
}

.pda-cash-pill {
  padding: 3px 8px;
  background: #1a2116;
  border: 2px solid #d4a644;
  color: #ffd15c;
  font-size: 13px;
  font-weight: 900;
}

.pda-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pda-shop-card,
.pda-save-card,
.pda-card,
.pda-key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #131c22;
  border: 2px solid #2b3c46;
}

.pda-card {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.pda-shop-meta,
.pda-save-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.pda-shop-name {
  font-size: 12px;
  font-weight: 800;
  color: #eef5fa;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pda-tag {
  font-size: 9px;
  padding: 1px 4px;
  background: #1e2c35;
  border: 1px solid #415d6e;
  color: #9ed8ff;
}

.pda-shop-desc {
  font-size: 10px;
  color: #8ea5b4;
  margin-top: 2px;
}

.pda-save-btns {
  display: flex;
  gap: 4px;
}

.pda-slider-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #d8e5ea;
}

.pda-slider-row b {
  color: #ffd15c;
}

.pda-slider {
  width: 100%;
  accent-color: #d4a644;
  cursor: pointer;
}

.pda-lang-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pda-key-row {
  font-size: 11px;
  font-weight: 700;
  color: #dce6ed;
}

.pda-key-btn {
  min-width: 88px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  color: #ffd15c;
  background: #1d2730;
  border: 2px solid #4d6272;
  cursor: pointer;
}

.pda-key-btn.listening {
  background: #5c1919;
  border-color: #ff6969;
  color: #fff;
  animation: pdaLedBlink 0.7s infinite;
}

.pda-btn {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  border: 2px solid #090b0f;
  cursor: pointer;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.pda-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pda-btn-amber {
  background: linear-gradient(180deg, #b83227, #7a1c15);
  border-color: #ffd15c;
}
.pda-btn-amber:hover:not(:disabled) {
  background: linear-gradient(180deg, #cf3c2f, #8f231b);
}

.pda-btn-green {
  background: linear-gradient(180deg, #277d3b, #175225);
  border-color: #6ff28d;
}

.pda-btn-steel {
  background: linear-gradient(180deg, #2a3742, #1b242c);
  border-color: #5c7587;
}
.pda-btn-steel:hover:not(:disabled) {
  border-color: #ffd15c;
}

.pda-btn-danger {
  background: #591c1c;
  border-color: #b84a4a;
}

.pda-btn-dim {
  background: #232a30;
  border-color: #3f4a52;
  color: #8c98a3;
}

.pda-full-btn {
  width: 100%;
  padding: 8px 10px;
  text-align: center;
}

.pda-sub-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8bb8aa;
}

.pda-codex {
  font-size: 11px;
  line-height: 1.45;
  color: #c2d4dd;
}

/* Tactile bottom hardware buttons on rugged phone bezel */
.pda-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 7px;
  margin-top: 9px;
}

.pda-hw-btn {
  padding: 8px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #cfd8cc;
  background: linear-gradient(180deg, #323931 0%, #1c201c 100%);
  border: 2px solid #0b0d0e;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 0 #07090b;
  cursor: pointer;
}
.pda-hw-btn:hover {
  color: #ffd15c;
  border-color: #66735f;
}

.pda-hw-play {
  color: #f3ffe9;
  background: linear-gradient(180deg, #2d7c3e 0%, #194d24 100%);
  border-color: #5cd675;
}
.pda-hw-play:hover {
  color: #fff;
  background: linear-gradient(180deg, #36944b 0%, #20612e 100%);
}

@media (max-height: 680px) {
  .phone-overlay {
    padding: 10px 14px;
  }
  .pda-frame {
    max-height: 95vh;
    padding: 10px 10px 9px;
  }
  .pda-app-tile {
    padding: 7px 3px 6px;
  }
  .pda-hw-btn {
    padding: 6px 4px;
  }
}

/* Static Unified Slim Tablet + Right Hand (+30% zoomed in) */
.pda-unit {
  position: fixed;
  right: -28px;
  top: 10px;
  --pda-h: min(1050px, 130vh);
  height: var(--pda-h);
  width: calc(var(--pda-h) * 366 / 481);
  max-width: none;
  pointer-events: auto;
  z-index: 2;
}

.pda-unit-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  filter: drop-shadow(-8px 14px 24px rgba(0, 0, 0, 0.75));
}

#pda-screen-inner {
  position: absolute;
  left: 12.57%;
  top: 16.22%;
  width: 34.97%;
  height: 47.61%;
  min-height: 0;
  border: none;
  border-radius: 3px;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(28, 52, 46, 0.35), transparent 72%),
    linear-gradient(180deg, #0c1415 0%, #080f11 100%);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.85);
}

#pda-screen-inner .pda-statusbar {
  padding: 5px 8px;
  font-size: 10px;
}

#pda-screen-inner .pda-cash-bar {
  font-size: 11px;
}

#pda-screen-inner .pda-viewport {
  padding: 8px;
  gap: 7px;
  overflow-x: hidden;
}

#pda-screen-inner .pda-home-banner,
#pda-screen-inner .pda-quicksave-card {
  padding: 7px 8px;
}

#pda-screen-inner .pda-mode-badge {
  font-size: 11.5px;
}

#pda-screen-inner .pda-cash-big {
  font-size: 18px;
}

#pda-screen-inner .pda-mini-stats {
  font-size: 10px;
  flex-wrap: wrap;
  gap: 4px;
}

#pda-screen-inner .pda-app-grid {
  gap: 6px;
}

#pda-screen-inner .pda-app-tile {
  padding: 8px 4px 6px;
  gap: 4px;
}

#pda-screen-inner .pda-icon-canvas {
  width: 30px;
  height: 30px;
}

#pda-screen-inner .pda-app-label {
  font-size: 9.5px;
}

#pda-screen-inner .pda-app-badge {
  font-size: 8px;
  top: 3px;
  right: 3px;
}

#pda-screen-inner .pda-weapon-preview {
  height: 104px;
}

#pda-screen-inner .pda-shop-name {
  font-size: 11px;
}

#pda-screen-inner .pda-shop-desc,
#pda-screen-inner .pda-section-sub {
  font-size: 9.5px;
}

#pda-screen-inner .pda-section-title {
  font-size: 12px;
}

#pda-screen-inner .pda-btn {
  padding: 6px 8px;
  font-size: 10.5px;
}

#pda-screen-inner .pda-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 5px;
  margin-top: 0;
  padding: 6px;
  background: rgba(10, 16, 19, 0.96);
  border-top: 2px solid #20312d;
  position: relative;
  z-index: 6;
}

#pda-screen-inner .pda-hw-btn {
  padding: 7px 4px;
  font-size: 10.5px;
}

.pda-hands-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* E-Shop 5-Category Icon Navigation + Weapon Preview Cards */
.pda-cat-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.pda-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px 5px;
  background: #141d23;
  border: 2px solid #2e404b;
  color: #aac0cd;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.pda-cat-btn:hover {
  border-color: #d4a644;
  color: #fff;
}

.pda-cat-btn.active {
  background: linear-gradient(180deg, #3c2917 0%, #241910 100%);
  border-color: #ffd15c;
  color: #ffd15c;
}

.pda-cat-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.pda-weapon-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 9px;
  background: linear-gradient(180deg, #172329 0%, #10181d 100%);
  border: 2px solid #354c57;
}

.pda-weapon-preview {
  position: relative;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 55%, rgba(212, 166, 68, 0.16), transparent 68%),
    linear-gradient(180deg, #0d1419 0%, #090e12 100%);
  border: 2px solid #213038;
}

.pda-weapon-img {
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.9));
}

.pda-weapon-slot-pill {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 2px 6px;
  background: rgba(12, 16, 20, 0.92);
  border: 1px solid #d4a644;
  color: #ffd15c;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.pda-weapon-stats {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #9cb6c4;
  padding: 3px 0;
  border-top: 1px dashed #243640;
  border-bottom: 1px dashed #243640;
}

.pda-slot-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

/* === VARIANTA C: ANDROID TACTICAL LAUNCHER & WIDGETS === */
#pda-screen-inner {
  background:
    radial-gradient(circle at 75% 18%, rgba(44, 118, 148, 0.28), transparent 54%),
    radial-gradient(circle at 20% 82%, rgba(212, 166, 68, 0.14), transparent 52%),
    radial-gradient(rgba(120, 190, 215, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #0b141b 0%, #070d12 100%);
  background-size: 100% 100%, 100% 100%, 8px 8px, 100% 100%;
}

.pda-statusbar {
  padding: 3px 8px;
  font-size: 9px;
  background: rgba(6, 11, 15, 0.92);
  border-bottom: 1px solid rgba(90, 150, 175, 0.25);
}

.pda-sig,
.pda-bat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pda-viewport {
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
}

.pda-mini-ico {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: -2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
}

.pda-icon-img {
  width: 42px;
  height: 42px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.and-widget {
  width: 100%;
  box-sizing: border-box;
  border-radius: 7px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(16, 29, 38, 0.9) 0%, rgba(10, 18, 24, 0.92) 100%);
  border: 1px solid rgba(102, 168, 196, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 5px rgba(0, 0, 0, 0.45);
  font-family: inherit;
  color: #e4f2f8;
}

.and-clock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.and-clock-time {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  color: #f4fbff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.and-clock-meta {
  text-align: right;
  min-width: 0;
}

.and-mode-pill {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(212, 166, 68, 0.16);
  border: 1px solid #d4a644;
  color: #ffd56b;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.and-weather-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  color: #9dc2d4;
}

.and-weapon-strip {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px dashed rgba(102, 168, 196, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.and-weapon-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 900;
  color: #e3f3fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.and-weapon-ammo {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(46, 230, 107, 0.14);
  border: 1px solid rgba(76, 224, 122, 0.4);
  color: #7effaa;
  font-size: 8.5px;
  font-weight: 900;
}

.and-vitals-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.and-hp-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 900;
  color: #ff9c9c;
}

.and-vitals-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.and-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(20, 34, 44, 0.95);
  border: 1px solid rgba(95, 140, 162, 0.3);
  font-size: 8.5px;
  font-weight: 800;
  color: #d0e4ee;
}

.and-hp-track {
  height: 6px;
  border-radius: 4px;
  background: #070d12;
  border: 1px solid #213440;
  overflow: hidden;
  margin: 4px 0 5px;
}

.and-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #d84343 0%, #e5b73b 50%, #48dc7d 100%);
  transition: width 0.2s ease;
}

.and-qs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}

.and-qs-meta {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 8px;
  color: #8eb0c0;
}

.and-qs-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.and-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid transparent;
}

.and-pill-amber {
  background: linear-gradient(180deg, #5d4017 0%, #3d280c 100%);
  border-color: #d4a644;
  color: #ffe28a;
}

.and-pill-amber:hover {
  border-color: #ffd56b;
  color: #fff;
}

.and-pill-steel {
  background: linear-gradient(180deg, #213440 0%, #15222b 100%);
  border-color: #48697c;
  color: #d4e8f2;
}

.and-pill-steel:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.and-bounty-widget {
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.1s ease;
}

.and-bounty-widget:hover {
  border-color: #ffd15c;
  transform: translateY(-1px);
}

.and-bounty-widget.is-ready {
  border-color: #4ce07a;
  box-shadow: inset 0 1px 0 rgba(76, 224, 122, 0.22), 0 0 8px rgba(76, 224, 122, 0.25);
}

.and-bounty-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  font-weight: 900;
  color: #ffd15c;
  letter-spacing: 0.4px;
}

.and-bounty-kicker {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.and-bounty-pct {
  color: #7effaa;
}

.and-bounty-title {
  font-size: 9px;
  font-weight: 800;
  color: #eff8fc;
  margin: 2px 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.and-bounty-bar {
  height: 4px;
  border-radius: 3px;
  background: #081016;
  overflow: hidden;
  margin-bottom: 3px;
}

.and-bounty-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a644, #4ce07a);
}

.and-bounty-sub {
  font-size: 8px;
  color: #9cb8c7;
}

.and-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.and-app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px 5px;
  border-radius: 8px;
  background: rgba(13, 23, 31, 0.78);
  border: 1px solid rgba(92, 145, 172, 0.28);
  color: #e4f2f8;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease, background 0.12s ease;
}

.and-app-tile:hover {
  transform: translateY(-1px);
  border-color: #ffd15c;
  background: rgba(23, 39, 50, 0.94);
}

.and-app-tile.accent-gold {
  border-color: rgba(212, 166, 68, 0.48);
}

.and-app-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(7, 13, 18, 0.94);
  border: 1px solid rgba(110, 160, 185, 0.4);
  font-size: 7px;
  font-weight: 900;
  color: #bfe0f0;
  line-height: 1.1;
}

.and-app-tile.accent-gold .and-app-badge {
  border-color: #ffd15c;
  color: #ffd15c;
}

.and-app-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pda-nav {
  background: rgba(6, 11, 15, 0.96);
  border-top: 1px solid rgba(90, 150, 175, 0.28);
}

/* Crisp readable Android sans-serif typography inside phone screen */
#pda-screen-inner {
  font-family: "Segoe UI", "Roboto", "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#pda-screen-inner .pda-statusbar {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15px;
}

#pda-screen-inner .pda-cash-bar {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#pda-screen-inner .and-clock-time {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#pda-screen-inner .and-mode-pill {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.25px;
}

#pda-screen-inner .and-weather-row,
#pda-screen-inner .and-qs-meta,
#pda-screen-inner .and-bounty-sub {
  font-size: 9.5px;
  font-weight: 600;
}

#pda-screen-inner .and-weapon-name,
#pda-screen-inner .and-bounty-title {
  font-size: 10.5px;
  font-weight: 700;
}

#pda-screen-inner .and-weapon-ammo,
#pda-screen-inner .and-stat-chip,
#pda-screen-inner .and-pill-btn {
  font-size: 10px;
  font-weight: 800;
}

#pda-screen-inner .and-hp-label {
  font-size: 11px;
  font-weight: 800;
}

#pda-screen-inner .and-bounty-head {
  font-size: 9.5px;
  font-weight: 800;
}

#pda-screen-inner .and-app-tile {
  padding: 4px 2px 4px;
  gap: 2px;
}

#pda-screen-inner .pda-viewport {
  padding: 5px 7px;
  gap: 4px;
}

#pda-screen-inner .and-widget {
  padding: 4px 7px;
}

#pda-screen-inner .and-weapon-strip {
  margin-top: 3px;
  padding-top: 3px;
}

#pda-screen-inner .and-hp-track {
  margin: 3px 0 3px;
}

#pda-screen-inner .and-app-grid {
  gap: 4px;
}

#pda-screen-inner .pda-icon-img {
  width: 34px;
  height: 34px;
}

#pda-screen-inner .pda-nav {
  padding: 4px 6px;
}

#pda-screen-inner .pda-hw-btn {
  padding: 5px 4px;
}

#pda-screen-inner .and-app-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #f2f9fd;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
}

#pda-screen-inner .and-app-badge {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
}

#pda-screen-inner .pda-section-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #f4fbff;
}

#pda-screen-inner .pda-sub-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.25px;
}

#pda-screen-inner .pda-shop-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #f2f9fd;
}

#pda-screen-inner .pda-shop-desc,
#pda-screen-inner .pda-section-sub {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.32;
  color: #bdd5e3;
}

#pda-screen-inner .pda-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.2;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

#pda-screen-inner .pda-mode-btn {
  justify-content: flex-start;
  text-align: left;
  padding: 8px 10px;
}

#pda-screen-inner .pda-hw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.15px;
}

#pda-screen-inner .pda-key-row,
#pda-screen-inner .pda-slider-row {
  font-size: 11px;
  font-weight: 700;
}

#pda-screen-inner .pda-key-row > span,
#pda-screen-inner .pda-slider-row > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#pda-screen-inner .pda-codex {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  line-height: 1.35;
}

#pda-screen-inner .pda-codex > div {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

/* Muzzle Calibration Debug Overlay (F4) */
.calib-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: auto;
}

.calib-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.calib-panel {
  position: fixed;
  top: 14px;
  left: 14px;
  max-width: 440px;
  padding: 10px 12px;
  background: rgba(11, 16, 20, 0.94);
  border: 2px solid #2ee66b;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85);
  color: #e4f0e8;
  font-family: "Courier New", monospace;
  z-index: 46;
}

.calib-title {
  font-size: 13px;
  font-weight: 900;
  color: #2ee66b;
  letter-spacing: 0.6px;
}

.calib-key {
  color: #ffd15c;
}

.calib-meta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #d4e4f0;
}

.calib-coords {
  margin-top: 5px;
  padding: 5px 7px;
  background: #070a0d;
  border: 1px solid #294636;
  color: #6cff9d;
  font-size: 12px;
  font-weight: 700;
  user-select: all;
}

.calib-hint {
  margin-top: 5px;
  font-size: 11px;
  color: #a6b8c4;
}

.calib-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calib-btn {
  padding: 5px 8px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
  color: #e6eff5;
  background: #1a2730;
  border: 1px solid #486375;
  cursor: pointer;
}

.calib-btn:hover {
  background: #253845;
}

.calib-btn-green {
  border-color: #2ee66b;
  color: #6cff9d;
  background: #102a1a;
}

.calib-btn-close {
  border-color: #d9534f;
  color: #ff9c99;
}


/* --- 2D Čtverečkový & Textový Editor mapy --- */
.me-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(8, 12, 18, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-family: "Courier New", monospace;
  color: #e6eff5;
}
.me-overlay.hidden { display: none !important; }

.me-window {
  width: min(1400px, 100%);
  height: min(860px, 100%);
  background: #111824;
  border: 2px solid #3c5468;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
}

.me-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #172130;
  border-bottom: 1px solid #304558;
  flex-wrap: wrap;
}
.me-brand { font-size: 13px; font-weight: 800; color: #ffe46b; letter-spacing: 0.4px; }
.me-top-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.me-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 340px 1fr 290px;
}

.me-left, .me-right {
  padding: 8px;
  background: #131c29;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}
.me-left { border-right: 1px solid #2b3d4f; }
.me-right { border-left: 1px solid #2b3d4f; }

.me-tools-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.me-tool-btn, .me-btn, .me-mini-btn, .me-pal-btn {
  font-family: "Courier New", monospace;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #3e576d;
  background: #1d2b3b;
  color: #e2ecf5;
}
.me-tool-btn { padding: 5px 4px; font-size: 11px; }
.me-tool-btn.active { border-color: #2ee66b; background: #143623; color: #8dffb2; }

.me-rot-box {
  background: #182332;
  border: 1px solid #2c4054;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}
.me-rot-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
.me-rot-steps { display: flex; gap: 3px; }
.me-mini-btn { padding: 2px 5px; font-size: 10px; }
.me-size-row { display: flex; gap: 6px; font-size: 10px; }
.me-size-row input {
  width: 52px;
  background: #0d141d;
  border: 1px solid #354b60;
  color: #fff;
  padding: 2px 4px;
  font-family: inherit;
}

.me-search-row { display: flex; gap: 4px; align-items: center; }
#me-search {
  flex: 1;
  min-width: 0;
  background: #0b1118;
  border: 1px solid #3c5468;
  color: #e6eff5;
  padding: 5px 7px;
  font-family: "Courier New", monospace;
  font-size: 11px;
}
#me-search:focus { outline: none; border-color: #ffe46b; }

.me-palette { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
.me-load-more-btn {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #3e576d;
  background: #1a2736;
  color: #ffe46b;
}
.me-load-more-btn:hover { background: #26384d; border-color: #ffe46b; }

.me-pro-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin-bottom: 5px;
  background: #141e2b;
  border: 1px solid #2b3f52;
}
.me-tb-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.me-tb-lbl { font-size: 10px; color: #8cb2d1; font-weight: 700; margin-right: 2px; }
.me-tb-select {
  background: #0b1118;
  border: 1px solid #3e576d;
  color: #e2ecf5;
  font-family: "Courier New", monospace;
  font-size: 10px;
  padding: 2px 4px;
}
.me-layer-btn {
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  border: 1px solid #3e576d;
  background: #16212e;
  color: #7d96ad;
}
.me-layer-btn.active { border-color: #38bdf8; background: #10324a; color: #bae6fd; }
.me-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.me-cat-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.me-cat-tab {
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
  cursor: pointer;
  border: 1px solid #3e576d;
  background: #17212c;
  color: #b5cbe0;
}
.me-cat-tab.active { border-color: #ffe46b; background: #2c3846; color: #ffe46b; }
.me-cat-title { font-size: 10px; text-transform: uppercase; color: #8cb2d1; margin-bottom: 3px; font-weight: 800; }
.me-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.me-cat-grid-hd { grid-template-columns: repeat(2, 1fr); gap: 6px; }
.me-pal-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  font-size: 10px;
  text-align: left;
  line-height: 1.15;
}
.me-pal-hd-btn {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 6px 4px;
  gap: 5px;
}
.me-thumb {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  image-rendering: pixelated;
  background: rgba(10, 15, 22, 0.8);
  border: 1px solid #2e4254;
}
.me-pal-name {
  font-size: 10px;
  color: #e2e8f0;
  line-height: 1.2;
  word-break: break-word;
}
.me-pal-btn.active { border-color: #ffe46b; background: #2c3846; color: #ffe46b; }
.me-swatch { width: 10px; height: 10px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.45); }

.me-center {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: #0d131c;
  min-width: 0;
  min-height: 0;
}
.me-grid-status {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9cb8d1;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.me-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
#me-grid-canvas {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid #3b5368;
  cursor: crosshair;
  image-rendering: pixelated;
}

.me-right-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; color: #ffe46b; }
.me-cmd-hint { font-size: 10px; color: #9db6cb; line-height: 1.3; }
.me-cmd-hint code { color: #8dffb2; background: #0b1118; padding: 1px 3px; }
.me-quick-row { display: flex; gap: 4px; }
#me-quick-cmd {
  flex: 1;
  min-width: 0;
  background: #0b1118;
  border: 1px solid #3c5468;
  color: #e6eff5;
  padding: 5px 6px;
  font-family: inherit;
  font-size: 11px;
}
#me-text-area {
  flex: 1;
  min-height: 160px;
  resize: none;
  background: #0b1118;
  border: 1px solid #3c5468;
  color: #b8f5cd;
  padding: 6px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 1.35;
}
.me-text-actions { display: flex; gap: 6px; }
.me-btn { padding: 5px 9px; font-size: 11px; }
.me-btn-green { border-color: #2ee66b; background: #123b23; color: #8dffb2; }
.me-btn-amber { border-color: #f59e0b; background: #3b2a10; color: #fde68a; }
.me-btn-danger { border-color: #ef4444; background: #3b1414; color: #fca5a5; }
.me-msg { font-size: 11px; min-height: 15px; }

/* map settings panel (size / ground / sky / weather) */
.me-window { position: relative; }
.me-settings {
  position: absolute; top: 52px; right: 16px; z-index: 30; width: 380px;
  background: #142033; border: 2px solid #f59e0b; padding: 10px 12px; color: #dbe7f5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65); font-size: 13px; display: flex; flex-direction: column; gap: 7px;
}
.me-settings.hidden { display: none; }
.me-set-head { display: flex; justify-content: space-between; align-items: center; color: #fde68a; }
.me-set-row { display: flex; align-items: center; gap: 6px; }
.me-set-row > span, .me-set-row { white-space: nowrap; }
.me-set-row select, .me-set-row input[type="text"] { flex: 1; background: #0c1420; color: #e8f0fa; border: 1px solid #3c5468; padding: 3px 5px; }
.me-set-row input[type="number"] { width: 64px; background: #0c1420; color: #e8f0fa; border: 1px solid #3c5468; padding: 3px 5px; }
.me-set-row input[type="range"] { flex: 1; }
.me-set-info { color: #9fb3c8; font-size: 12px; line-height: 1.35; white-space: normal; }

/* ===== Touch controls (phones / tablets) — HD pixel-art buttons, see src/touchControls.js ===== */
html.touch-mode,
html.touch-mode body {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.tc-layer {
  --tc-s: 1;
  --tc-a: 0.75;
  position: fixed;
  inset: 0;
  z-index: 15;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.tc-layer.hidden {
  display: none;
}
.tc-layer canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.tc-stick {
  position: absolute;
  left: calc(110px * var(--tc-s) + env(safe-area-inset-left));
  top: calc(100% - 150px * var(--tc-s));
  width: 0;
  height: 0;
  opacity: calc(var(--tc-a) * 0.55);
  pointer-events: none;
}
.tc-stick.active {
  opacity: var(--tc-a);
}
.tc-stick-base,
.tc-stick-knob {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}
.tc-stick-base {
  width: calc(120px * var(--tc-s));
  height: calc(120px * var(--tc-s));
}
.tc-stick-knob {
  width: calc(54px * var(--tc-s));
  height: calc(54px * var(--tc-s));
}
.tc-btn {
  position: absolute;
  --sz: 54px;
  width: calc(var(--sz) * var(--tc-s));
  height: calc(var(--sz) * var(--tc-s));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(11, 13, 17, 0.58);
  border: calc(3px * var(--tc-s)) solid #495463;
  box-shadow: inset 0 0 0 calc(2px * var(--tc-s)) rgba(149, 163, 179, 0.28), 0 3px 0 rgba(0, 0, 0, 0.5);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  opacity: var(--tc-a);
  box-sizing: border-box;
}
.tc-btn .tc-glyph {
  width: calc(32px * var(--tc-s));
  height: calc(32px * var(--tc-s));
  pointer-events: none;
}
.tc-btn .tc-label {
  font: bold calc(8px * var(--tc-s)) / 1 "Courier New", monospace;
  letter-spacing: 0.5px;
  color: #c9d3de;
  text-shadow: 1px 1px 0 #0b0d11;
  pointer-events: none;
}
.tc-btn.pressed {
  background: rgba(212, 136, 42, 0.55);
  border-color: #ffd15c;
  transform: translateY(2px);
}
.tc-btn.on {
  border-color: #4cc9f0;
  background: rgba(76, 201, 240, 0.28);
}
.tc-btn.dim {
  opacity: calc(var(--tc-a) * 0.45);
}
/* right-hand cluster: FIRE above the (shrunk) ammo panel, the rest on an arc around it */
.tc-fire {
  --sz: 84px;
  right: calc(40px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(104px * var(--tc-s));
  border-color: #8a3a2a;
}
.tc-fire .tc-glyph {
  width: calc(48px * var(--tc-s));
  height: calc(48px * var(--tc-s));
}
.tc-aim {
  right: calc(147px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(119px * var(--tc-s));
}
.tc-reload {
  right: calc(130px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(190px * var(--tc-s));
}
.tc-dash {
  right: calc(40px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(206px * var(--tc-s));
}
.tc-swap {
  right: calc(184px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(240px * var(--tc-s));
}
.tc-use {
  right: calc(218px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(170px * var(--tc-s));
}
.tc-jump {
  --sz: 62px;
  right: calc(172px * var(--tc-s) + env(safe-area-inset-right));
  bottom: calc(22px * var(--tc-s));
}
.tc-pda {
  --sz: 46px;
  left: calc(12px + env(safe-area-inset-left));
  top: calc(10px + env(safe-area-inset-top));
}
/* compact HUD while the touch controller is shown (thumb room); hotbar moves to bottom-centre */
html.touch-mode .hud-bottom-left {
  zoom: 0.7;
}
html.touch-mode .hud-top-right {
  zoom: 0.75;
}
html.touch-mode .ammo-top-mini,
html.touch-mode .ammo-panel {
  zoom: 0.62;
}
html.touch-mode .arsenal-bar {
  position: fixed;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  zoom: 0.85;
}
.tc-rotate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.86);
  color: #ffd15c;
  font: bold 16px "Courier New", monospace;
  text-align: center;
  padding: 24px;
}
.tc-rotate.hidden {
  display: none;
}
/* phones in landscape: blow the PDA up so its screen fills most of the height (it scrolls inside) */
@media (pointer: coarse) and (max-height: 560px) {
  .pda-unit {
    --pda-h: 178vh;
    top: -21vh;
  }
}
