:root {
  --bg: #05050a;
  --text: #e0e0e0;
  --primary: #00ffcc;
  --danger: #ff3366;
  --warning: #ffcc00;
  --panel: rgba(10, 15, 25, 0.65);
  --atmos-color: rgba(0, 255, 204, 0.2);
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  user-select: none;
}

/* Quality Mode Overrides (High performance) */
body.quality-low .panel,
body.quality-low .modal {
  background: rgba(15, 20, 30, 0.95);
  box-shadow: none;
  border-width: 1px;
  border-style: solid;
}

body.quality-low #planet-sphere {
  box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.8), 0 0 5px var(--atmos-color) !important;
}

body.quality-low #planet-texture {
  opacity: 0.1 !important;
  filter: none !important;
}

body.quality-low .warping #canvas-container {
  animation: none !important;
  filter: none !important;
}

body.quality-low .feat-aurora {
  display: none !important;
}

body.quality-medium .panel {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

body.quality-medium #planet-sphere {
  box-shadow: inset -20px -20px 40px rgba(0, 0, 0, 0.8), 0 0 15px var(--atmos-color) !important;
}

/* Advanced Overrides */
body.disable-blur .panel,
body.disable-blur .modal,
body.disable-blur .screen {
  backdrop-filter: none !important;
}

body.disable-clouds #planet-clouds {
  display: none !important;
}

body.disable-clouds .feat-storm {
  display: none !important;
}

body.disable-particles .type-toxic::after,
body.disable-particles .type-desert::after,
body.disable-particles .type-volcanic::after {
  animation: none !important;
  opacity: 0.2;
}

body.disable-particles #planet-aurora {
  animation: none !important;
}

body.disable-particles .log-msg {
  animation: none !important;
}


.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.screen.active {
  display: flex;
}

#game-screen.active {
  background: transparent;
  backdrop-filter: none;
  display: block;
}

h1,
h2,
h3 {
  margin: 0 0 10px 0;
}

.glow-text {
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary);
  letter-spacing: 5px;
}

.glow-text-small {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary);
  letter-spacing: 2px;
}

.panel {
  position: absolute;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 20;
  transition: all 0.3s ease;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
  letter-spacing: 3px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 255, 204, 0.3);
  padding-bottom: 8px;
  text-transform: uppercase;
}

.top-left-panel {
  top: 20px;
  left: 20px;
  width: 250px;
}

.top-right-panel {
  top: 20px;
  right: 20px;
  width: 250px;
  text-align: right;
  border-right: 3px solid var(--primary);
}

.bottom-left-panel {
  bottom: 20px;
  left: 20px;
  width: 300px;
  height: 200px;
  display: flex;
  flex-direction: column;
}

.bottom-right-panel {
  bottom: 20px;
  right: 20px;
  width: 250px;
}

.bottom-center-panel {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  justify-content: center;
}

.resource {
  margin-bottom: 12px;
}

.res-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
  border: 1px solid #333;
}

.bar-fill {
  height: 100%;
  transition: width 0.4s ease, background-color 0.4s;
}

button {
  background: rgba(0, 255, 204, 0.05);
  color: var(--primary);
  border: 1px solid rgba(0, 255, 204, 0.4);
  padding: 12px 20px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-transform: uppercase;
  border-radius: 6px;
  backdrop-filter: blur(5px);
}

button:hover:not(:disabled) {
  background: rgba(0, 255, 204, 0.2);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.6), inset 0 0 10px rgba(0, 255, 204, 0.2);
  transform: scale(1.05);
  border-color: var(--primary);
}

button:active:not(:disabled) {
  transform: scale(0.95);
}

button:disabled {
  border-color: #333;
  color: #555;
  background: transparent;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-warn {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-warn:hover {
  background: rgba(255, 204, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
  border-color: var(--warning);
  color: #fff;
}

.glass-select {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid var(--primary);
  padding: 8px;
  border-radius: 4px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

#mission-log-content {
  flex: 1;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1rem;
  line-height: 1.6;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 15px;
  padding-left: 5px;
  scroll-behavior: smooth;
}

.log-msg {
  background: rgba(0, 20, 40, 0.4);
  padding: 12px 15px;
  border-left: 3px solid #555;
  border-radius: 0 6px 6px 0;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.log-msg.highlight {
  border-left-color: var(--primary);
  background: rgba(0, 255, 204, 0.05);
  color: #fff;
}

.log-msg.danger {
  border-left-color: var(--danger);
  color: var(--danger);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.status-line {
  font-size: 0.85rem;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted #333;
  padding-bottom: 2px;
}

.stat-good {
  color: var(--primary);
}

.stat-dmg {
  color: var(--warning);
}

.stat-crit {
  color: var(--danger);
  font-weight: bold;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.5;
  }
}

/* Center Planet Wrapper */
#planet-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

#planet-sphere {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  position: relative;
  box-shadow: inset -40px -40px 80px rgba(0, 0, 0, 0.9), inset 15px 15px 40px rgba(255, 255, 255, 0.2), 0 0 40px var(--atmos-color);
  transition: all 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  pointer-events: auto;
  background-color: #222;
  z-index: 10;
}

.landing-mode #planet-sphere {
  transform: scale(2.5) translateY(20%);
  cursor: grab;
}

.landing-mode #planet-sphere:active {
  cursor: grabbing;
}

/* Visual Addons */
#planet-ring {
  position: absolute;
  width: 500px;
  height: 180px;
  border-radius: 50%;
  border: 20px solid rgba(255, 255, 255, 0.15);
  border-top-color: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.4);
  transform: rotate(-15deg);
  transition: all 1.2s;
  z-index: 15;
  pointer-events: none;
}

.landing-mode #planet-ring {
  transform: translateY(150px) scale(3) rotate(-15deg);
  opacity: 0.3;
}

#planet-aurora {
  position: absolute;
  width: 400px;
  height: 100px;
  top: 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--atmos-color) 0%, transparent 70%);
  filter: blur(15px);
  mix-blend-mode: screen;
  z-index: 15;
  animation: pulseAurora 3s infinite alternate;
  pointer-events: none;
  transition: all 1.2s;
}

.landing-mode #planet-aurora {
  transform: translateY(-50px) scale(2);
  opacity: 0.5;
}

@keyframes pulseAurora {
  from {
    opacity: 0.4;
    transform: scaleY(1);
  }

  to {
    opacity: 0.8;
    transform: scaleY(1.5);
  }
}

/* Procedural Visuals inside Sphere */
#planet-texture {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 100%;
  background-image:
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.2"/></svg>'),
    radial-gradient(circle at 15% 30%, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 5%, transparent 6%),
    radial-gradient(circle at 75% 65%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 8%, transparent 10%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

#planet-clouds {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="c"><feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 1  0 1 0 0 1  0 0 1 0 1  0 0 0 1 0"/></filter><rect width="100%" height="100%" filter="url(%23c)" opacity="0.4"/></svg>');
  mix-blend-mode: screen;
  pointer-events: none;
  display: none;
}

#planet-stormbands {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0px, rgba(0, 0, 0, 0.1) 10px, transparent 20px, rgba(255, 255, 255, 0.05) 30px);
}

/* Biome specific overlays */
.type-toxic #planet-clouds {
  display: block;
  animation: driftClouds 20s linear infinite;
  opacity: 0.3;
}

.type-toxic::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 255, 0, 0.05) 0px, transparent 2px);
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: glitch 3s infinite;
}

.type-frozen::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px rgba(200, 230, 255, 0.7);
  border-radius: 50%;
  pointer-events: none;
}

.type-volcanic #planet-clouds {
  display: block;
  opacity: 0.2;
  mix-blend-mode: color-dodge;
  animation: driftClouds 30s linear infinite;
}

.type-volcanic::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 50, 0, 0.3) 0%, transparent 60%);
  pointer-events: none;
  animation: pulseHeat 2s infinite alternate;
}

.type-desert::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#d4a373 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.5;
  pointer-events: none;
  animation: driftDust 15s linear infinite;
}

.type-ocean #planet-clouds {
  display: block;
  opacity: 0.5;
  animation: driftClouds 40s linear infinite reverse;
}

.type-ocean::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  background-size: 100% 200%;
  pointer-events: none;
  animation: wave 5s infinite linear;
}

/* New Biomes */
.type-gas_giant #planet-stormbands {
  display: block;
  opacity: 0.5;
  mix-blend-mode: overlay;
  animation: wave 10s linear infinite;
}

.type-gas_giant #planet-clouds {
  display: block;
  animation: driftClouds 15s linear infinite;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

.type-crystal::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: conic-gradient(from 0deg, rgba(255, 255, 255, 0.3) 0deg, transparent 40deg, rgba(0, 0, 0, 0.3) 80deg, transparent 120deg, rgba(255, 255, 255, 0.4) 160deg);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.type-metallic::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, transparent 40%, rgba(0, 0, 0, 0.8) 60%, rgba(255, 255, 255, 0.3) 100%);
  pointer-events: none;
  mix-blend-mode: hard-light;
  opacity: 0.8;
}

.type-void {
  box-shadow: inset -60px -60px 100px #000, 0 0 50px var(--atmos-color) !important;
}

.type-void #planet-texture {
  opacity: 0.1;
}

@keyframes driftClouds {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes glitch {
  0% {
    transform: translate(0)
  }

  20% {
    transform: translate(-2px, 2px)
  }

  40% {
    transform: translate(-2px, -2px)
  }

  60% {
    transform: translate(2px, 2px)
  }

  80% {
    transform: translate(2px, -2px)
  }

  100% {
    transform: translate(0)
  }
}

@keyframes pulseHeat {
  from {
    opacity: 0.4;
    transform: scale(1);
  }

  to {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes driftDust {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 100px 100px;
  }
}

@keyframes wave {
  from {
    background-position: 0 100%;
  }

  to {
    background-position: 0 -100%;
  }
}

/* Modals */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal {
  background: rgba(5, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 204, 0.5);
  padding: 35px;
  max-width: 500px;
  width: 90%;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 255, 204, 0.15);
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: scale(0.8);
  opacity: 0;
  position: relative;
}

.modal-overlay.active .modal {
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal h2 {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.6);
  border-bottom: 2px solid rgba(0, 255, 204, 0.3);
  padding-bottom: 12px;
  margin-bottom: 5px;
  letter-spacing: 2px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Critical Modal Specifics */
.critical-box {
  border-color: var(--danger);
  box-shadow: 0 0 40px rgba(255, 51, 102, 0.6);
}

.close-x {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  padding: 0 10px;
  box-shadow: none;
  width: auto;
  height: auto;
}

.close-x:hover {
  background: rgba(255, 0, 0, 0.3);
  color: #fff;
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

@keyframes shrinkToStatus {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(30vw, 40vh) scale(0);
    opacity: 0;
  }
}

.shrink-anim {
  animation: shrinkToStatus 0.5s ease-in forwards !important;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  margin-bottom: 5px;
  display: inline-block;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge.common {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid #4ade80;
}

.badge.rare {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid #38bdf8;
}

.badge.legendary {
  background: rgba(250, 204, 21, 0.1);
  color: #facc15;
  border: 1px solid #facc15;
}

/* Toast Notifications */
#toast-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-msg {
  background: rgba(10, 15, 25, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  gap: 10px;
  align-items: center;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
  max-width: 300px;
}

.toast-msg.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-damage {
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
  color: #fff;
}

.toast-damage span:first-child {
  color: var(--danger);
}

.toast-reward {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
  color: #fff;
}

.toast-reward span:first-child {
  color: var(--primary);
}

.toast-neutral {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  color: #fff;
}

.toast-neutral span:first-child {
  color: #38bdf8;
}

/* Warp Animation */
.warping #canvas-container {
  animation: warpBlur 1s ease-in-out forwards;
}

@keyframes warpBlur {
  0% {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
  }

  50% {
    filter: blur(8px);
    opacity: 0.7;
    transform: scale(1.1);
  }

  100% {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
  }
}

.warping #planet-wrapper {
  animation: warpPlanet 1s ease-in-out forwards;
}

@keyframes warpPlanet {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  40% {
    transform: scale(0) translateZ(-500px);
    opacity: 0;
  }

  60% {
    transform: scale(0);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Biological Scan Modal Content */
.bio-scan-content {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 500;
  color: #eaffff;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-left: 4px solid var(--primary);
  text-shadow: 0 0 5px rgba(234, 255, 255, 0.2);
}

/* Cockpit Critical Warning */
body.cockpit-critical::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.4);
  pointer-events: none;
  z-index: 9999;
  animation: pulseCockpit 2s infinite alternate;
}

@keyframes pulseCockpit {
  from {
    box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.2);
  }

  to {
    box-shadow: inset 0 0 150px rgba(255, 0, 0, 0.6);
  }
}

/* Ship Diagram Overrides */
.ship-part polygon,
.ship-part circle {
  transition: fill 0.3s ease;
}

.ship-part.broken .crack {
  display: block !important;
}

/* Menu Screens & Transitions */
#menu-screen {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

.pulse-btn {
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 255, 204, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 204, 0);
  }
}

/* Cinematic Mode */
body.cinematic-mode .panel,
body.cinematic-mode .modal {
  background: rgba(5, 10, 15, 0.95);
  border-width: 2px;
}

body.cinematic-mode {
  font-size: 1.1rem;
}

body.cinematic-mode button {
  font-size: 1.1rem;
}

body.cinematic-mode .log-msg {
  font-size: 0.95rem;
  padding: 8px 10px;
}

body.cinematic-mode .status-line,
body.cinematic-mode .res-header {
  font-size: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 204, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 204, 0.5);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

/* Biological Scan Styles */
.bio-scan-terminal {
  font-family: 'Consolas', 'Courier New', monospace;
  color: #ddd;
  background: rgba(0, 10, 20, 0.5);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-scan-header {
  border-bottom: 1px dashed rgba(0, 255, 204, 0.4);
  padding-bottom: 8px;
}

.bio-scan-title {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
  margin-bottom: 5px;
}

.bio-scan-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 0.85rem;
}

.scan-stat-val {
  color: #fff;
  font-weight: bold;
}

.scan-threat-LOW { color: #4ade80; text-shadow: 0 0 5px #4ade80; }
.scan-threat-MEDIUM { color: #facc15; text-shadow: 0 0 5px #facc15; }
.scan-threat-HIGH { color: #fb923c; text-shadow: 0 0 5px #fb923c; }
.scan-threat-EXTREME { color: #ef4444; text-shadow: 0 0 5px #ef4444; font-weight: bold; }

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

.bio-scan-item {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #555;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
}

.bio-scan-item.threat-harmless, .bio-scan-item.threat-passive { border-left-color: #4ade80; }
.bio-scan-item.threat-territorial { border-left-color: #facc15; }
.bio-scan-item.threat-aggressive { border-left-color: #fb923c; }
.bio-scan-item.threat-venomous, .bio-scan-item.threat-apex { border-left-color: #ef4444; }
.bio-scan-item.threat-unknown { border-left-color: #c084fc; }

.bio-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.bio-item-name {
  font-weight: bold;
  font-size: 0.95rem;
  color: #fff;
}

.threat-harmless .bio-item-name, .threat-passive .bio-item-name { color: #4ade80; text-shadow: 0 0 5px rgba(74,222,128,0.5); }
.threat-territorial .bio-item-name { color: #facc15; text-shadow: 0 0 5px rgba(250,204,21,0.5); }
.threat-aggressive .bio-item-name { color: #fb923c; text-shadow: 0 0 5px rgba(251,146,60,0.5); }
.threat-venomous .bio-item-name, .threat-apex .bio-item-name { color: #ef4444; text-shadow: 0 0 5px rgba(239,68,68,0.5); }
.threat-unknown .bio-item-name { color: #c084fc; text-shadow: 0 0 5px rgba(192,132,252,0.5); }

.bio-item-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.bio-item-desc {
  font-size: 0.85rem;
  line-height: 1.3;
  color: #bbb;
}

.bio-scan-footer {
  border-top: 1px dashed rgba(0, 255, 204, 0.4);
  padding-top: 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
}

.bio-warning { color: #ef4444; text-shadow: 0 0 5px #ef4444; }
.bio-safe { color: #4ade80; text-shadow: 0 0 5px #4ade80; }

/* Sector Scan Styles */
.sector-scan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-family: 'Consolas', 'Courier New', monospace;
}

.stat-card {
  background: rgba(0, 20, 40, 0.4);
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.stat-card-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card-val {
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff;
}

.status-aman { color: #4ade80; text-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }
.status-sedang { color: #facc15; text-shadow: 0 0 5px rgba(250, 204, 21, 0.5); }
.status-bahaya { color: #fb923c; text-shadow: 0 0 5px rgba(251, 146, 60, 0.5); }
.status-ekstrem { color: #ef4444; text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (NO DESKTOP MODIFICATIONS)
   ========================================================================= */

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (max-width: 768px) {
  body {
    font-size: clamp(12px, 3.5vw, 15px);
  }

  .panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 95% !important;
    max-width: none !important;
    margin: 10px auto !important;
    box-sizing: border-box !important;
  }

  #game-screen {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    height: 100vh !important;
    box-sizing: border-box;
    padding: 10px;
    justify-content: flex-start;
  }

  #planet-wrapper {
    position: relative !important;
    margin: 20px auto !important;
    width: 200px !important;
    height: 200px !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
  }

  #planet-sphere {
    width: 150px !important;
    height: 150px !important;
  }

  .bottom-left-panel {
    height: 130px !important;
  }

  #mission-log-content {
    max-height: 80px !important;
  }

  .bottom-center-panel {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 95% !important;
    margin: 10px auto 30px auto !important;
  }

  .bottom-center-panel button {
    width: 100% !important;
    min-height: 44px !important;
    padding: 12px !important;
    font-size: 1rem !important;
  }

  .modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
  }

  .modal-overlay .modal {
    width: 100% !important;
    max-width: 95% !important;
    height: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 25px 15px 15px 15px !important;
    border-radius: 12px !important;
    position: relative !important;
  }

  .modal .close-x {
    position: fixed !important;
    top: 15px !important;
    right: 20px !important;
    z-index: 10000 !important;
    font-size: 2rem !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--primary) !important;
    color: var(--primary) !important;
    cursor: pointer;
  }
}

@media (max-width: 480px) {
  body {
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .glow-text.title-large {
    font-size: 2.2rem !important;
  }

  .subtitle {
    font-size: 0.9rem !important;
  }

  .menu-buttons {
    width: 90% !important;
  }

  .btn-main {
    padding: 12px !important;
    font-size: 1rem !important;
  }

  #planet-sphere {
    width: 120px !important;
    height: 120px !important;
  }

  #planet-wrapper {
    width: 160px !important;
    height: 160px !important;
  }
}

/* Landscape Mode for Mobile Devices */
@media (max-width: 900px) and (orientation: landscape) {
  #game-screen {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    height: 100vh !important;
    overflow-y: auto !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  #planet-wrapper {
    display: none !important;
  }

  .panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    margin: 5px 0 !important;
    box-sizing: border-box !important;
  }

  .top-left-panel {
    grid-column: 1 !important;
  }

  .bottom-right-panel {
    grid-column: 1 !important;
  }

  .top-right-panel {
    grid-column: 2 !important;
  }

  .bottom-left-panel {
    grid-column: 2 !important;
    height: 110px !important;
  }

  #mission-log-content {
    max-height: 60px !important;
  }

  .bottom-center-panel {
    grid-column: 2 !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    width: 100% !important;
    margin: 5px 0 !important;
    padding: 10px !important;
  }

  .bottom-center-panel button {
    flex: 1 1 45% !important;
    min-height: 40px !important;
    padding: 8px !important;
    font-size: 0.9rem !important;
  }

  .modal-overlay .modal {
    max-height: 95vh !important;
    padding: 20px 15px 15px 15px !important;
  }
}