/* lander.css — Artemis Lander Styles - Full Version v1.2.4 */

/* ---------- Root Container ---------- */
#artemis-lander-root {
  position: relative;
  width: 100%;
  height: min(78vh, 720px);
  background: #050A12;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,.35);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  touch-action: none;
  overscroll-behavior: none;
}

#landerCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  overscroll-behavior: none;
}

/* ---------- UI Container ---------- */
.lander-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 0 14px;
  pointer-events: none;
}

.hud-left { 
  flex: 0 0 auto; 
}

.hud-right { 
  flex: 0 0 auto; 
  text-align: right; 
}

.hud .label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(47, 240, 255, 0.75);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hud .status {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(47, 240, 255, 0.9);
  font-weight: 700;
  text-align: right;
  margin-bottom: 8px;
}

.hud .scoreline { 
  margin-top: 8px; 
}

.hud .score {
  font-size: 28px;
  color: rgba(47, 240, 255, 1);
  text-align: right;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 0 20px rgba(47, 240, 255, 0.4);
}

/* Fuel bar */
.bar {
  width: 180px;
  height: 10px;
  border-radius: 999px;
  background: rgba(47, 240, 255, 0.12);
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(47, 240, 255, 0.2);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(47, 240, 255, 0.9), rgba(47, 240, 255, 1));
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(47, 240, 255, 0.6);
}

/* Readouts */
.readouts {
  margin-top: 12px;
  color: rgba(230, 245, 255, 0.88);
  font-size: 13px;
  line-height: 1.8;
  font-weight: 600;
}

.readouts > div {
  display: flex;
  align-items: center;
}

.readouts .k {
  color: rgba(47, 240, 255, 0.75);
  display: inline-block;
  width: 48px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.readouts .val {
  font-family: 'Courier New', Courier, monospace;
  color: rgba(230, 245, 255, 0.95);
  font-weight: 700;
  min-width: 60px;
  transition: color 0.2s;
}

.readouts .val.warning {
  color: #ff6b35;
  animation: warningPulse 0.8s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Level indicator in HUD */
.level-indicator {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(47, 240, 255, 0.1);
  border: 1px solid rgba(47, 240, 255, 0.25);
  border-radius: 6px;
  text-align: center;
}

.level-indicator .label {
  font-size: 10px;
  color: rgba(47, 240, 255, 0.7);
  margin-bottom: 2px;
}

.level-indicator .value {
  font-size: 14px;
  font-weight: 800;
  color: rgba(47, 240, 255, 1);
}

/* Tilt active indicator */
.tilt-indicator {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(47, 240, 255, 0.15);
  border: 1px solid rgba(47, 240, 255, 0.3);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(47, 240, 255, 1);
  letter-spacing: 0.08em;
  display: none;
  pointer-events: none;
  z-index: 100;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ---------- Countdown Overlay ---------- */
.countdown-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle at 50% 40%, rgba(47,240,255,0.08), rgba(5,10,18,0.78));
  backdrop-filter: blur(4px);
  z-index: 120;
}

.countdown-num {
  font-weight: 1000;
  letter-spacing: 0.08em;
  color: rgba(230, 250, 255, 0.98);
  font-size: clamp(52px, 8vw, 92px);
  text-shadow: 0 0 30px rgba(47, 240, 255, 0.35);
}

.countdown-sub {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(47, 240, 255, 0.9);
  text-transform: uppercase;
}

/* ---------- Center Message Panel ---------- */
.center-msg {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92%);
  padding: 24px 24px 20px;
  border-radius: 18px;
  background: rgba(5, 10, 18, 0.85);
  border: 1px solid rgba(47, 240, 255, 0.25);
  backdrop-filter: blur(12px);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease-out;
  z-index: 110;
}

.center-msg .title {
  font-size: 26px;
  font-weight: 900;
  color: rgba(230, 250, 255, 0.98);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(47, 240, 255, 0.3);
  margin-bottom: 8px;
}

.center-msg .sub {
  margin-top: 8px;
  color: rgba(47, 240, 255, 0.88);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.center-msg .hint {
  margin-top: 12px;
  color: rgba(230, 245, 255, 0.7);
  font-size: 13px;
  line-height: 1.6;
}

.center-msg .btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-family: inherit;
}

.center-msg .btn-primary {
  border: 1px solid rgba(47, 240, 255, 0.4);
  background: rgba(47, 240, 255, 0.15);
  color: rgba(47, 240, 255, 1);
  box-shadow: 0 0 20px rgba(47, 240, 255, 0.2);
}

.center-msg .btn-primary:hover {
  background: rgba(47, 240, 255, 0.25);
  box-shadow: 0 0 30px rgba(47, 240, 255, 0.4);
  transform: translateY(-1px);
}

.center-msg .btn-primary:active { 
  transform: translateY(0); 
}

.center-msg .btn-secondary {
  border: 1px solid rgba(230, 245, 255, 0.2);
  background: rgba(230, 245, 255, 0.05);
  color: rgba(230, 245, 255, 0.8);
  margin-top: 8px;
}

.center-msg .btn-secondary:hover {
  background: rgba(230, 245, 255, 0.1);
  color: rgba(230, 245, 255, 1);
}

/* Tilt Control Buttons */
.tilt-toggle-container {
  margin-top: 16px;
  padding: 12px;
  background: rgba(47, 240, 255, 0.05);
  border: 1px solid rgba(47, 240, 255, 0.15);
  border-radius: 8px;
  display: none;
}

@media (max-width: 600px) {
  .tilt-toggle-container {
    display: block;
  }
}

.tilt-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tilt-btn {
  padding: 12px 16px;
  background: rgba(230, 245, 255, 0.05);
  border: 1px solid rgba(230, 245, 255, 0.2);
  border-radius: 8px;
  color: rgba(230, 245, 255, 0.7);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tilt-btn:hover {
  background: rgba(230, 245, 255, 0.1);
  color: rgba(230, 245, 255, 1);
}

.tilt-btn.active {
  background: rgba(47, 240, 255, 0.2);
  border-color: rgba(47, 240, 255, 0.5);
  color: rgba(47, 240, 255, 1);
  box-shadow: 0 0 12px rgba(47, 240, 255, 0.3);
}

/* ---------- Touch Controls ---------- */
.touch-controls {
  pointer-events: auto;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 20px !important;
  display: flex !important;
  justify-content: space-between; /* Changed from center */
  align-items: flex-end; /* Changed to align to bottom */
  gap: 0; /* Removed gap */
  z-index: 10;
  padding: 0 24px; /* Increased side padding */
}

.tc {
  border-radius: 16px;
  border: 1px solid rgba(47, 240, 255, 0.35);
  background: rgba(5, 10, 18, 0.65);
  backdrop-filter: blur(8px);
  color: rgba(47, 240, 255, 1);
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 20px 24px; /* Increased from 16px 20px */
  min-width: 80px; /* Increased from 70px */
  touch-action: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 18px; /* Increased from 16px */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.tc:active {
  background: rgba(47, 240, 255, 0.25);
  border-color: rgba(47, 240, 255, 0.6);
  box-shadow: 0 0 20px rgba(47, 240, 255, 0.4);
  transform: scale(0.95);
}

/* Left side: Rotation controls grouped together */
.tc-left,
.tc-right {
  font-size: 24px; /* Increased from 20px */
  padding: 20px 22px; /* Increased from 16px 18px */
  min-width: 75px; /* Increased from 65px */
  flex: 0 0 auto;
}

/* Group left and right buttons on the left side */
.tc-left {
  margin-right: 12px; /* Space between left and right rotation buttons */
}

.tc-right {
  margin-right: auto; /* Push thrust button to the right */
}

/* Right side: Thrust button */
.tc-thrust {
  padding: 22px 40px; /* Increased from 18px 32px */
  font-size: 17px; /* Increased from 15px */
  min-width: 160px; /* Increased from 140px */
  flex: 0 0 auto;
}

/* Mobile specific adjustments */
@media (max-width: 600px) {
  .touch-controls { 
    gap: 0;
    bottom: 15px;
    padding: 0 20px; /* Slightly less padding on small screens */
  }

  .tc { 
    padding: 18px 20px; /* Slightly smaller on mobile */
    min-width: 70px;
    font-size: 16px;
  }
  
  .tc-left,
  .tc-right {
    font-size: 22px;
    padding: 18px 20px;
    min-width: 70px;
  }
  
  .tc-left {
    margin-right: 10px;
  }
  
  .tc-thrust { 
    min-width: 145px;
    padding: 20px 32px;
    font-size: 16px;
  }
}

/* Tablet landscape */
@media (min-width: 601px) and (max-width: 1024px) {
  .touch-controls {
    padding: 0 32px;
  }
  
  .tc-left {
    margin-right: 14px;
  }
}

/* ---------- Leaderboard Panel ---------- */
.leaderboard-panel {
  pointer-events: auto;
  position: absolute;
  right: -100%;
  top: 0;
  bottom: 0;
  width: min(400px, 90%);
  background: rgba(5, 10, 18, 0.95);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(47, 240, 255, 0.25);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 140;
}

.leaderboard-panel.visible {
  right: 0;
  animation: slideIn 0.3s ease-out;
}

.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(47, 240, 255, 0.2);
}

.lb-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: rgba(47, 240, 255, 1);
  letter-spacing: 0.1em;
}

.lb-close {
  background: transparent;
  border: none;
  color: rgba(230, 245, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.lb-close:hover { 
  color: rgba(47, 240, 255, 1); 
}

.lb-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid rgba(47, 240, 255, 0.15);
}

.lb-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: rgba(230, 245, 255, 0.6);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}

.lb-tab:hover { 
  color: rgba(230, 245, 255, 0.9); 
}

.lb-tab.active {
  color: rgba(47, 240, 255, 1);
  border-bottom-color: rgba(47, 240, 255, 1);
}

.lb-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.lb-loading,
.lb-empty,
.lb-error {
  text-align: center;
  padding: 40px 20px;
  color: rgba(230, 245, 255, 0.6);
  font-size: 14px;
}

.lb-error { 
  color: rgba(255, 107, 53, 0.8); 
}

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

.lb-entry {
  display: grid;
  grid-template-columns: 32px 1fr auto 80px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(27, 31, 36, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(47, 240, 255, 0.1);
  transition: all 0.2s;
}

.lb-entry:hover {
  background: rgba(27, 31, 36, 0.8);
  border-color: rgba(47, 240, 255, 0.25);
}

.lb-rank {
  font-weight: 900;
  color: rgba(47, 240, 255, 0.9);
  font-size: 16px;
  text-align: center;
}

.lb-entry:nth-child(1) .lb-rank { 
  color: #ffd700; 
  font-size: 18px; 
}

.lb-entry:nth-child(2) .lb-rank { 
  color: #c0c0c0; 
}

.lb-entry:nth-child(3) .lb-rank { 
  color: #cd7f32; 
}

.lb-name {
  color: rgba(230, 245, 255, 0.9);
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: rgba(47, 240, 255, 1);
  font-weight: 800;
  font-size: 16px;
  text-align: right;
}

.lb-time {
  color: rgba(230, 245, 255, 0.5);
  font-size: 11px;
  text-align: right;
}

/* ---------- Name Entry Panel ---------- */
.name-entry-panel {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.9);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.ne-content {
  width: min(420px, 90%);
  padding: 32px 28px;
  background: rgba(27, 31, 36, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(47, 240, 255, 0.3);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.ne-content h3 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 900;
  color: rgba(47, 240, 255, 1);
  letter-spacing: 0.08em;
}

.ne-score {
  margin: 8px 0 20px 0;
  font-size: 16px;
  color: rgba(230, 245, 255, 0.8);
}

.ne-score span {
  font-size: 28px;
  font-weight: 800;
  color: rgba(47, 240, 255, 1);
  margin-left: 8px;
}

.ne-content input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(5, 10, 18, 0.6);
  border: 1px solid rgba(47, 240, 255, 0.3);
  border-radius: 10px;
  color: rgba(230, 245, 255, 1);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.ne-content input:focus {
  border-color: rgba(47, 240, 255, 0.6);
  box-shadow: 0 0 20px rgba(47, 240, 255, 0.2);
}

.ne-content input::placeholder { 
  color: rgba(230, 245, 255, 0.4); 
}

.ne-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.ne-buttons .btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-family: inherit;
}

.ne-buttons .btn-primary {
  border: 1px solid rgba(47, 240, 255, 0.4);
  background: rgba(47, 240, 255, 0.2);
  color: rgba(47, 240, 255, 1);
}

.ne-buttons .btn-primary:hover:not(:disabled) {
  background: rgba(47, 240, 255, 0.3);
  box-shadow: 0 0 20px rgba(47, 240, 255, 0.3);
}

.ne-buttons .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ne-buttons .btn-secondary {
  border: 1px solid rgba(230, 245, 255, 0.2);
  background: rgba(230, 245, 255, 0.05);
  color: rgba(230, 245, 255, 0.7);
}

.ne-buttons .btn-secondary:hover {
  background: rgba(230, 245, 255, 0.1);
  color: rgba(230, 245, 255, 1);
}

/* ---------- Completion Scene ---------- */
.completion-scene {
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #050A12 0%, #0a1520 50%, #1a2332 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInCompletion 1s ease-in-out;
}

.completion-scene.visible {
  display: flex;
  pointer-events: auto;
}

@keyframes fadeInCompletion {
  from { opacity: 0; }
  to { opacity: 1; }
}

.completion-content {
  text-align: center;
  max-width: 90%;
  animation: slideUp 1s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.completion-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  color: #2ff0ff;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(47, 240, 255, 0.6);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(47, 240, 255, 0.6); }
  to { text-shadow: 0 0 40px rgba(47, 240, 255, 0.9); }
}

.completion-subtitle {
  font-size: clamp(18px, 3vw, 28px);
  color: rgba(230, 245, 255, 0.9);
  margin-bottom: 40px;
  font-weight: 600;
}

.flag-container {
  position: relative;
  width: 200px;
  height: 250px;
  margin: 40px auto;
  animation: plantFlag 2s ease-out 0.5s both;
}

@keyframes plantFlag {
  0% {
    transform: translateY(300px) scale(0.5);
    opacity: 0;
  }
  60% {
    transform: translateY(-10px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.flag-pole {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 180px;
  background: linear-gradient(180deg, #c0c8d0 0%, #8090a0 100%);
  border-radius: 2px;
}

.flag {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 120px;
  height: 80px;
  background: linear-gradient(135deg, #2ff0ff 0%, #1a8a99 100%);
  transform-origin: left center;
  animation: flagWave 3s ease-in-out infinite;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 4px 20px rgba(47, 240, 255, 0.4);
}

@keyframes flagWave {
  0%, 100% {
    transform: translateX(0) rotateY(0deg);
  }
  25% {
    transform: translateX(2px) rotateY(-5deg);
  }
  75% {
    transform: translateX(-2px) rotateY(5deg);
  }
}

.flag-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 800;
  color: #050A12;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
  max-width: 600px;
}

.completion-stat {
  background: rgba(47, 240, 255, 0.1);
  border: 1px solid rgba(47, 240, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  animation: fadeInCompletion 1s ease-out;
}

.completion-stat-value {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: #2ff0ff;
  margin-bottom: 8px;
}

.completion-stat-label {
  font-size: clamp(12px, 2vw, 16px);
  color: rgba(230, 245, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.completion-message {
  font-size: clamp(16px, 2.5vw, 22px);
  color: rgba(230, 245, 255, 0.8);
  line-height: 1.6;
  max-width: 600px;
  margin: 30px auto;
  font-style: italic;
}

.completion-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.completion-btn {
  padding: 16px 40px;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid rgba(47, 240, 255, 0.5);
  background: rgba(47, 240, 255, 0.1);
  color: #2ff0ff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.completion-btn:hover {
  background: rgba(47, 240, 255, 0.2);
  border-color: #2ff0ff;
  box-shadow: 0 0 20px rgba(47, 240, 255, 0.4);
  transform: translateY(-2px);
}

.completion-btn.primary {
  background: linear-gradient(135deg, #2ff0ff 0%, #1a8a99 100%);
  color: #050A12;
  border-color: #2ff0ff;
}

.completion-btn.primary:hover {
  box-shadow: 0 0 30px rgba(47, 240, 255, 0.6);
}

.completion-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.completion-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ---------- Scrollbar Styling ---------- */
.lb-content::-webkit-scrollbar { 
  width: 8px; 
}

.lb-content::-webkit-scrollbar-track { 
  background: rgba(5, 10, 18, 0.5); 
}

.lb-content::-webkit-scrollbar-thumb { 
  background: rgba(47, 240, 255, 0.3); 
  border-radius: 4px; 
}

.lb-content::-webkit-scrollbar-thumb:hover { 
  background: rgba(47, 240, 255, 0.5); 
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translate(-50%, -48%); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%); 
  }
}

@keyframes slideIn {
  from { 
    right: -100%; 
  }
  to { 
    right: 0; 
  }
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
  .completion-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .flag-container {
    width: 150px;
    height: 200px;
  }
  
  .flag {
    width: 90px;
    height: 60px;
  }
  
  .flag-text {
    font-size: 18px;
  }
  
  .completion-buttons {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
  }
  
  .completion-btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .hud { 
    padding: 10px 10px 0 10px; 
    gap: 12px; 
  }
  
  .bar { 
    width: 140px; 
  }
  
  .readouts { 
    font-size: 12px; 
  }
  
  .hud .score { 
    font-size: 24px; 
  }

  .center-msg { 
    padding: 20px 18px 18px; 
  }
  
  .center-msg .title { 
    font-size: 22px; 
  }
  
  .center-msg .sub { 
    font-size: 14px; 
  }

  .touch-controls { 
    gap: 16px; 
    bottom: 15px;
  }

  .tc { 
    padding: 14px 16px; 
    min-width: 60px; 
    font-size: 14px; 
  }
  
  .tc-thrust { 
    min-width: 130px; 
    padding: 16px 24px; 
  }
}

@media (max-width: 400px) {
  .ne-buttons {
    flex-direction: column;
  }
  
  .ne-buttons .btn {
    width: 100%;
  }
  
  .center-msg {
    width: 95%;
  }
}

@media (max-height: 600px) {
  #artemis-lander-root { 
    height: 100vh; 
    border-radius: 0; 
  }
  
  .center-msg { 
    padding: 16px; 
  }
  
  .center-msg .title { 
    font-size: 20px; 
  }
  
  .center-msg .sub, 
  .center-msg .hint { 
    font-size: 13px; 
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hud {
    padding: 8px 12px 0 12px;
  }
  
  .center-msg {
    max-height: 90vh;
    overflow-y: auto;
    padding: 16px 20px;
  }
  
  .center-msg .title {
    font-size: 20px;
    margin-bottom: 6px;
  }
  
  .center-msg .sub,
  .center-msg .hint {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .center-msg .btn {
    padding: 10px 14px;
    font-size: 12px;
    margin-top: 10px;
  }
}

/* ---------- Full-Screen Template Overrides ---------- */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.page-template-template-artemis-lander,
body.artemis-lander-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #050A12;
  position: fixed;
  width: 100%;
  height: 100%;
}

body.page-template-template-artemis-lander #artemis-lander-root,
body.artemis-lander-page #artemis-lander-root {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

body.artemis-lander-page #landerCanvas,
body.page-template-template-artemis-lander #landerCanvas {
  width: 100% !important;
  height: 100% !important;
}

body.artemis-lander-page .leaderboard-panel,
body.page-template-template-artemis-lander .leaderboard-panel {
  width: min(420px, 95%) !important;
}

@supports (padding: max(0px)) {
  .touch-controls {
    bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }
  
  .hud {
    padding-top: max(14px, env(safe-area-inset-top)) !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  #artemis-lander-root {
    height: 85vh !important;
    max-height: none !important;
  }
}