:root {
  --bg-black: #060709;
  --bg-panel: rgba(14, 16, 20, 0.94);
  --bg-card: rgba(20, 23, 29, 0.96);
  --border-grey: #2b303a;
  --text-main: #e4e7ec;
  --text-dim: #8b93a1;
  --red-alert: #d92626;
  --red-bright: #ff3b3b;
  --red-glow: rgba(217, 38, 38, 0.45);
  --amber: #f59e0b;
  --green-crt: #34d399;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-black);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

#game-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* Atmospheric overlays */
#vignette-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.78) 100%);
}

#damage-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(190, 15, 15, 0.85) 100%);
  transition: opacity 0.12s ease-out;
}

#grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.045;
  background-image: repeating-radial-gradient(circle at 17% 32%, rgba(255,255,255,0.4) 0, rgba(0,0,0,0.4) 1px, transparent 2px);
  background-size: 6px 6px;
}

#fade-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Main Menu */
.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 5vw;
  background: linear-gradient(90deg, rgba(4, 5, 8, 0.92) 0%, rgba(4, 5, 8, 0.72) 55%, rgba(4, 5, 8, 0.25) 100%);
}

.menu-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0, 0, 0, 0.28) 3px);
}

.menu-panel {
  position: relative;
  max-width: 500px;
  width: 100%;
  z-index: 2;
}

.facility-badge {
  display: inline-block;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--red-bright);
  border: 1px solid rgba(255, 59, 59, 0.4);
  background: rgba(217, 38, 38, 0.12);
  padding: 5px 10px;
  margin-bottom: 14px;
}

.game-title {
  margin: 0 0 12px 0;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.08em;
  color: #f3f4f6;
  text-shadow: 0 0 28px rgba(0, 0, 0, 0.9);
}

.game-title span {
  color: var(--red-alert);
  text-shadow: 0 0 24px var(--red-glow);
}

.game-tagline {
  margin: 0 0 28px 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  letter-spacing: 0.03em;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.menu-btn {
  appearance: none;
  background: rgba(18, 21, 26, 0.9);
  border: 1px solid var(--border-grey);
  border-left: 3px solid var(--border-grey);
  color: var(--text-main);
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-btn:hover:not(:disabled) {
  background: rgba(34, 39, 48, 0.95);
  border-color: #555e6e;
  border-left-color: var(--red-bright);
  transform: translateX(4px);
}

.menu-btn.primary {
  background: linear-gradient(90deg, rgba(160, 22, 22, 0.85), rgba(28, 16, 18, 0.92));
  border-color: rgba(217, 38, 38, 0.6);
  border-left-color: var(--red-bright);
}

.menu-btn.primary:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(200, 30, 30, 0.95), rgba(40, 18, 20, 0.95));
  box-shadow: 0 0 18px var(--red-glow);
}

.menu-btn.danger:hover:not(:disabled) {
  border-left-color: var(--red-bright);
  color: #fecaca;
}

.menu-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#continue-info {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.controls-hint {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.controls-hint b {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
}

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

#hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
  max-width: 340px;
}

.zone-badge {
  font-family: Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--red-bright);
  text-shadow: 0 1px 4px #000;
  margin-bottom: 4px;
}

.mission-box {
  background: rgba(10, 12, 16, 0.76);
  border-left: 3px solid var(--red-alert);
  padding: 8px 12px;
  backdrop-filter: blur(4px);
}

.mission-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f3f4f6;
}

.mission-obj {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-top: 3px;
}

.purge-timer {
  margin-top: 8px;
  background: rgba(185, 28, 28, 0.88);
  color: #fff;
  padding: 6px 12px;
  font-family: Consolas, monospace;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
  from { opacity: 0.78; }
  to { opacity: 1; box-shadow: 0 0 14px rgba(255, 59, 59, 0.7); }
}

#hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-icon-btn {
  background: rgba(14, 16, 20, 0.82);
  border: 1px solid var(--border-grey);
  color: var(--text-main);
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.hud-icon-btn:hover {
  border-color: var(--red-bright);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 4px #000;
  transform: translate(-50%, -50%);
}

#crosshair.active {
  width: 8px;
  height: 8px;
  background: var(--red-bright);
  box-shadow: 0 0 8px var(--red-glow);
}

#interact-prompt {
  position: absolute;
  top: calc(50% + 22px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 10, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.key-cap {
  background: var(--red-alert);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 2px;
}

#subtitle-box {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px, 88vw);
  background: rgba(6, 8, 12, 0.88);
  border: 1px solid var(--border-grey);
  border-top: 2px solid var(--red-alert);
  padding: 10px 16px;
  text-align: center;
}

.subtitle-speaker {
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--red-bright);
  margin-bottom: 4px;
}

.subtitle-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #f1f5f9;
}

#hud-bottom-left {
  position: absolute;
  bottom: 18px;
  left: 16px;
  width: 240px;
  background: rgba(10, 12, 16, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vital-row {
  display: grid;
  grid-template-columns: 58px 1fr 38px;
  align-items: center;
  gap: 8px;
}

.vital-label {
  font-family: Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.vital-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.vital-fill {
  height: 100%;
  transition: width 0.12s linear;
}

.vital-fill.health { background: var(--red-alert); }
.vital-fill.stamina { background: #cbd5e1; }
.vital-fill.battery { background: var(--amber); }

.vital-val {
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  text-align: right;
  color: var(--text-main);
}

#hud-bottom-right {
  position: absolute;
  bottom: 18px;
  right: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.quick-slot {
  background: rgba(10, 12, 16, 0.8);
  border: 1px solid var(--border-grey);
  padding: 7px 10px;
  min-width: 68px;
  text-align: center;
  cursor: pointer;
}

.quick-slot:hover {
  border-color: var(--red-bright);
}

.slot-key {
  display: block;
  font-family: Consolas, monospace;
  font-size: 0.64rem;
  color: var(--red-bright);
}

.slot-name {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 2px 0;
}

.slot-count {
  font-family: Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
}

#pointer-notice {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(217, 38, 38, 0.85);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 12px;
}

/* Mobile Touch Controls */
#mobile-controls {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

#touch-move-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  height: 55%;
  pointer-events: auto;
  touch-action: none;
}

#joystick-base {
  position: absolute;
  left: 28px;
  bottom: 98px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 12, 16, 0.35);
}

#joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(217, 38, 38, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
}

#touch-look-zone {
  position: absolute;
  right: 0;
  top: 56px;
  bottom: 0;
  width: 56%;
  pointer-events: auto;
  touch-action: none;
}

#touch-actions {
  position: absolute;
  right: 16px;
  bottom: 92px;
  display: grid;
  grid-template-columns: repeat(2, 62px);
  gap: 8px;
  pointer-events: auto;
}

.touch-btn {
  height: 48px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(16, 18, 24, 0.72);
  color: #f1f5f9;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  touch-action: manipulation;
}

.touch-btn.interact {
  grid-column: span 2;
  background: rgba(217, 38, 38, 0.72);
  border-color: var(--red-bright);
}

.touch-btn.active {
  background: rgba(217, 38, 38, 0.85);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-grey);
  border-top: 3px solid var(--red-alert);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

.modal-card.narrow { max-width: 400px; }
.modal-card.wide { max-width: 820px; }
.modal-card.center { text-align: center; }
.modal-card.center .menu-buttons { margin: 18px auto 0; }

.modal-card h2 {
  margin: 0 0 18px 0;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  color: #f8fafc;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header-row h2 { margin: 0; }

.close-x {
  background: transparent;
  border: 1px solid var(--border-grey);
  color: var(--text-main);
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
}

.close-x:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 20px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.settings-grid select,
.settings-grid input[type="range"] {
  width: 100%;
  background: #0d0f13;
  border: 1px solid var(--border-grey);
  color: var(--text-main);
  padding: 6px;
}

.settings-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red-alert);
}

.modal-footer {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

.toast {
  margin-top: 12px;
  text-align: center;
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  color: var(--green-crt);
}

/* Inventory */
.inv-columns {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}

.inv-col h3 {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--red-bright);
  border-bottom: 1px solid var(--border-grey);
  padding-bottom: 6px;
  margin-top: 0;
}

.inv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-item {
  background: rgba(10, 12, 16, 0.8);
  border: 1px solid var(--border-grey);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}

.inv-item.clickable { cursor: pointer; }
.inv-item.clickable:hover { border-color: var(--red-bright); }

.inv-action-btn {
  background: var(--red-alert);
  border: none;
  color: #fff;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

/* Document Reader */
.modal-card.paper {
  background: #17181c;
  border-top-color: #94a3b8;
  max-width: 560px;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.doc-tag {
  font-family: Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--amber);
}

.doc-body {
  font-family: 'Georgia', serif;
  font-size: 0.96rem;
  line-height: 1.65;
  color: #d8dde6;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Terminal CRT */
.modal-card.crt {
  background: #060b08;
  border: 1px solid #1f4d35;
  border-top: 3px solid var(--green-crt);
  font-family: Consolas, 'Courier New', monospace;
}

.crt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--green-crt);
  border-bottom: 1px solid #1a3d2b;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.crt-output {
  margin: 0 0 16px 0;
  color: #a7f3d0;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 45vh;
  overflow-y: auto;
}

.crt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crt-btn {
  background: rgba(16, 56, 36, 0.6);
  border: 1px solid #2e8555;
  color: #ecfdf5;
  padding: 10px 14px;
  text-align: left;
  font-family: Consolas, monospace;
  font-size: 0.84rem;
  cursor: pointer;
}

.crt-btn:hover { background: rgba(24, 88, 56, 0.85); }
.crt-btn.danger {
  background: rgba(110, 18, 18, 0.65);
  border-color: var(--red-bright);
}

.end-desc {
  color: #cbd5e1;
  line-height: 1.55;
  font-size: 0.92rem;
}

.end-stats {
  font-family: Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.credits-body p {
  margin: 8px 0;
  color: #cbd5e1;
}
.credits-body .dim { color: var(--text-dim); font-size: 0.85rem; }

/* Update System, Co-op & DevTools Additions */
.menu-top-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.menu-top-badges .facility-badge { margin-bottom: 0; }

.version-badge {
  font-family: Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #475569;
  color: #cbd5e1;
  cursor: default;
}

.update-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(153, 27, 27, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.55);
  padding: 7px 12px;
  margin-bottom: 14px;
  font-family: Consolas, monospace;
  font-size: 0.76rem;
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.banner-btn {
  margin-left: auto;
  background: var(--red-alert);
  border: none;
  color: #fff;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.mode-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  margin-bottom: 12px;
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.mode-select-row select {
  flex: 1;
  background: rgba(18, 21, 26, 0.92);
  border: 1px solid var(--border-grey);
  color: var(--text-main);
  padding: 6px 8px;
}

.badge-tag {
  font-family: Consolas, monospace;
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.update-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid var(--border-grey);
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.upd-latest-box {
  background: rgba(160, 22, 22, 0.14);
  border: 1px solid rgba(217, 38, 38, 0.45);
  padding: 14px;
  margin-bottom: 16px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.upd-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.upd-columns h3 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--red-bright);
  border-bottom: 1px solid var(--border-grey);
  padding-bottom: 6px;
  margin-top: 0;
}

.upd-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 38vh;
  overflow-y: auto;
}

.upd-card {
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid var(--border-grey);
  padding: 10px 12px;
  font-size: 0.82rem;
}

.upd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 4px;
}

.upd-card ul {
  margin: 6px 0 0 18px;
  padding: 0;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.coop-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.coop-join-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.coop-join-group input,
.settings-grid input[type="text"],
.dev-row select {
  flex: 1;
  background: #0d0f13;
  border: 1px solid var(--border-grey);
  color: var(--text-main);
  padding: 8px 10px;
}

.coop-lobby-status {
  padding: 10px 12px;
  background: rgba(10, 12, 16, 0.8);
  border: 1px solid var(--border-grey);
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  color: #93c5fd;
}

.coop-hud-box {
  margin-top: 8px;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid var(--border-grey);
  padding: 7px 10px;
  pointer-events: auto;
  font-size: 0.75rem;
}

.coop-chat-log {
  max-height: 70px;
  overflow-y: auto;
  margin: 4px 0;
  color: #cbd5e1;
  font-family: Consolas, monospace;
}

.coop-chat-input-row {
  display: flex;
  gap: 6px;
}

.coop-chat-input-row input {
  flex: 1;
  background: #090b0f;
  border: 1px solid var(--border-grey);
  color: #f1f5f9;
  padding: 4px 7px;
  font-size: 0.74rem;
}

.dev-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-row label {
  width: 145px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Version 3.0 Menu Grid, Modals, Keypad & Achievements */
.menu-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(175px, 1fr));
  gap: 8px;
  max-width: 420px;
}

.menu-buttons-grid .menu-btn.span-2 {
  grid-column: span 2;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.select-card {
  background: rgba(12, 14, 19, 0.9);
  border: 1px solid var(--border-grey);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.select-card.unlocked {
  border-color: #22c55e;
  background: rgba(16, 48, 30, 0.25);
}

.select-card h4 {
  margin: 0;
  color: #f8fafc;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.select-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
}

.ach-bar-wrap {
  height: 10px;
  background: #0d1015;
  border: 1px solid var(--border-grey);
  margin: 8px 0 14px;
}

.ach-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #22c55e);
  transition: width 0.3s ease;
}

.keypad-display {
  font-family: Consolas, monospace;
  font-size: 1.7rem;
  letter-spacing: 0.35em;
  text-align: center;
  background: #050a07;
  border: 1px solid #1f4d35;
  color: #34d399;
  padding: 12px;
  margin-bottom: 14px;
}

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

.keypad-btn {
  background: rgba(18, 22, 28, 0.95);
  border: 1px solid var(--border-grey);
  color: #f1f5f9;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 0;
  cursor: pointer;
}

.keypad-btn:hover {
  border-color: var(--green-crt);
  background: rgba(20, 50, 35, 0.7);
}

.cctv-banner {
  position: fixed;
  top: 76px;
  right: 20px;
  background: rgba(4, 14, 10, 0.92);
  border: 1px solid #22c55e;
  color: #86efac;
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  padding: 8px 12px;
  z-index: 25;
  pointer-events: auto;
}

@media (max-width: 720px) {
  .inv-columns, .upd-columns, .menu-buttons-grid { grid-template-columns: 1fr; }
  .menu-buttons-grid .menu-btn.span-2 { grid-column: span 1; }
  #hud-bottom-left { width: 175px; padding: 7px 9px; bottom: 10px; left: 10px; }
  #hud-bottom-right { display: none; }
  #hud-top-left { max-width: 220px; top: 10px; left: 10px; }
  .controls-hint { display: none; }
}
