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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #c8d6e5;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0a0e1a 0%, #000 70%);
}

#game-canvas {
  display: block;
  cursor: crosshair;
  opacity: 0;
}

#corner-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#corner-ui.hidden {
  display: none;
}

.corner-panel {
  position: absolute;
  width: 22vmin;
  height: 22vmin;
  border: 1px solid rgba(100, 180, 255, 0.15);
  background: rgba(5, 12, 24, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px;
}

.corner-panel.top-left {
  top: 0;
  left: 0;
  border-radius: 0 0 12px 0;
}

.corner-panel.top-right {
  top: 0;
  right: 0;
  border-radius: 0 0 0 12px;
  flex-direction: column;
  gap: 8px;
}

.ui-btn {
  pointer-events: auto;
  padding: 6px 10px;
  font-size: 9px;
  letter-spacing: 1px;
  background: rgba(100, 180, 255, 0.08);
  border: 1px solid rgba(100, 180, 255, 0.25);
  color: rgba(100, 180, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.ui-btn:hover {
  background: rgba(100, 180, 255, 0.18);
  color: #64b4ff;
}

.corner-panel.bottom-left {
  bottom: 0;
  left: 0;
  border-radius: 0 12px 0 0;
}

.corner-panel.bottom-right {
  bottom: 0;
  right: 0;
  border-radius: 12px 0 0 0;
}

.panel-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(100, 180, 255, 0.5);
  font-weight: 600;
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#overlay > * {
  pointer-events: auto;
}

#start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Keep backdrop at game vibrancy — only a light edge for text readability */
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.06) 60%,
    rgba(0, 0, 0, 0.18) 100%
  );
  gap: 16px;
  opacity: 0;
}

#start-screen h1 {
  font-size: 3rem;
  letter-spacing: 12px;
  font-weight: 300;
  color: #64b4ff;
  text-shadow:
    0 0 30px rgba(100, 180, 255, 0.5),
    0 2px 18px rgba(0, 0, 0, 0.85);
}

#start-screen .subtitle {
  font-size: 0.9rem;
  letter-spacing: 4px;
  color: rgba(200, 214, 229, 0.65);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
  margin-bottom: 24px;
}

#start-btn {
  padding: 14px 48px;
  font-size: 1.1rem;
  letter-spacing: 6px;
  background: transparent;
  border: 1px solid #64b4ff;
  color: #64b4ff;
  cursor: pointer;
  transition: all 0.2s;
}

#start-btn:hover {
  background: rgba(100, 180, 255, 0.15);
  box-shadow: 0 0 20px rgba(100, 180, 255, 0.3);
}

.secondary-btn {
  padding: 10px 36px;
  font-size: 0.85rem;
  letter-spacing: 4px;
  background: transparent;
  border: 1px solid rgba(100, 180, 255, 0.35);
  color: rgba(200, 214, 229, 0.75);
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(100, 180, 255, 0.1);
  border-color: #64b4ff;
  color: #64b4ff;
}

.home-icon {
  display: inline-block;
  width: 11px;
  height: 10px;
  margin-right: 8px;
  vertical-align: -1px;
  position: relative;
  background: #3dcf7a;
  clip-path: polygon(50% 0%, 100% 40%, 100% 100%, 62% 100%, 62% 62%, 38% 62%, 38% 100%, 0% 100%, 0% 40%);
  box-shadow: 0 0 8px rgba(61, 207, 122, 0.55);
}

.hangar-launch-btn {
  position: absolute;
  z-index: 8;
  pointer-events: auto;
  padding: 10px 22px;
  min-width: 110px;
  font-size: 0.78rem;
  letter-spacing: 4px;
  font-weight: 600;
  background: rgba(12, 22, 34, 0.92);
  border: 2px solid #c9a020;
  color: #ffe08a;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(201, 160, 32, 0.35);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hangar-launch-btn:hover {
  background: rgba(201, 160, 32, 0.22);
  color: #fff4c2;
  border-color: #ffd24a;
}

.hangar-launch-btn.hidden {
  display: none;
}

#controls-hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#controls-hud.hidden {
  display: none;
}

.controls-banner {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.controls-title {
  font-size: 0.9rem;
  letter-spacing: 5px;
  color: rgba(100, 180, 255, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
}

.controls-sub {
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: rgba(200, 214, 229, 0.45);
}

.controls-panel {
  margin-top: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(200, 214, 229, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  line-height: 1.85;
  background: rgba(5, 12, 24, 0.55);
  border: 1px solid rgba(100, 180, 255, 0.18);
  padding: 14px 28px;
  pointer-events: none;
}

.controls-panel kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 3px;
  font-size: 0.72rem;
  color: rgba(100, 180, 255, 0.75);
}

#controls-back-btn {
  pointer-events: auto;
  position: absolute;
  bottom: 28px;
  min-width: 200px;
  padding: 10px 28px;
  font-size: 0.8rem;
}

#dock-hud {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  padding: 10px 22px;
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: rgba(200, 214, 229, 0.7);
  background: rgba(5, 12, 24, 0.72);
  border: 1px solid rgba(100, 180, 255, 0.28);
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  cursor: default;
  font-family: inherit;
}

#dock-hud.ready {
  color: #9eefb8;
  border-color: rgba(61, 207, 122, 0.55);
  box-shadow: 0 0 16px rgba(61, 207, 122, 0.2);
  pointer-events: auto;
  cursor: pointer;
}

#dock-hud.ready:hover {
  background: rgba(61, 207, 122, 0.12);
}

#dock-hud.hidden {
  display: none;
}

#hangar-hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hangar-hud.hidden {
  display: none;
}

.hangar-banner {
  margin-top: 28px;
  display: flex;
  gap: 28px;
  align-items: baseline;
  pointer-events: none;
}

.hangar-title {
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: rgba(100, 180, 255, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
  display: inline-flex;
  align-items: center;
}

.hangar-zoom {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: rgba(200, 214, 229, 0.55);
  font-variant-numeric: tabular-nums;
}

.hangar-hint {
  margin-top: 10px;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: rgba(200, 214, 229, 0.45);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.hangar-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 3px;
  font-size: 0.68rem;
  color: rgba(100, 180, 255, 0.7);
}

#hangar-back-btn {
  pointer-events: auto;
  position: absolute;
  bottom: 28px;
  min-width: 200px;
  padding: 10px 28px;
  font-size: 0.8rem;
}

.controls-hint {
  margin-top: 32px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(200, 214, 229, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  line-height: 1.8;
}

.build-meta {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
}

.build-stamp {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: rgba(200, 214, 229, 0.35);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.changelog-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: rgba(200, 214, 229, 0.35);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

.changelog-btn:hover {
  color: rgba(200, 214, 229, 0.7);
}

.changelog-panel {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Keep title starfield visible around the card — no heavy dim */
  background: transparent;
  pointer-events: auto;
}

.changelog-panel.hidden {
  display: none;
}

.changelog-card {
  width: min(560px, 100%);
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  background: #080e16;
  border: 1px solid rgba(100, 180, 255, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 16px 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(100, 180, 255, 0.18);
}

.changelog-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 4px;
  color: #64b4ff;
}

.changelog-close {
  padding: 6px 12px;
  font-size: 0.7rem;
  letter-spacing: 2px;
  background: transparent;
  border: 1px solid rgba(100, 180, 255, 0.35);
  color: rgba(200, 214, 229, 0.75);
  cursor: pointer;
}

.changelog-close:hover {
  border-color: #64b4ff;
  color: #64b4ff;
}

.changelog-body {
  padding: 14px 18px 20px;
  overflow-y: auto;
  color: rgba(200, 214, 229, 0.78);
  font-size: 0.78rem;
  line-height: 1.45;
}

.changelog-entry + .changelog-entry {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(100, 180, 255, 0.12);
}

.changelog-ver {
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: rgba(100, 180, 255, 0.95);
}

.changelog-ver-date {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: rgba(200, 214, 229, 0.4);
  font-variant-numeric: tabular-nums;
}

.changelog-cat {
  margin: 10px 0 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(100, 180, 255, 0.55);
}

.changelog-list {
  margin: 0 0 4px;
  padding-left: 1.15em;
}

.changelog-list li {
  margin: 0.2em 0;
}

.changelog-empty {
  margin: 8px 0;
  color: rgba(200, 214, 229, 0.45);
}

.controls-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 3px;
  font-size: 0.75rem;
  color: rgba(100, 180, 255, 0.7);
  min-width: 24px;
  text-align: center;
}

#hud {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: rgba(100, 180, 255, 0.6);
  pointer-events: none;
  z-index: 5;
}

#pause-menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  gap: 12px;
  z-index: 20;
  pointer-events: auto;
}

#pause-menu h2 {
  font-size: 2rem;
  letter-spacing: 10px;
  font-weight: 300;
  color: #64b4ff;
  margin-bottom: 16px;
}

.menu-btn {
  padding: 12px 40px;
  min-width: 240px;
  font-size: 0.85rem;
  letter-spacing: 3px;
  background: transparent;
  border: 1px solid rgba(100, 180, 255, 0.35);
  color: rgba(200, 214, 229, 0.8);
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover:not(.disabled) {
  background: rgba(100, 180, 255, 0.12);
  border-color: #64b4ff;
  color: #64b4ff;
}

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

.pause-hint {
  margin-top: 20px;
  font-size: 0.75rem;
  color: rgba(200, 214, 229, 0.35);
  letter-spacing: 2px;
}

#hud.hidden {
  display: none;
}

#precision-value.precision-active {
  color: rgba(120, 220, 160, 0.85);
}

#precision-value.precision-standby {
  color: rgba(220, 180, 100, 0.7);
}

#start-screen.hidden {
  display: none;
}

#overlay.hidden {
  display: none;
}

#overlay.changelog-open #start-screen,
#overlay.changelog-open #build-meta {
  visibility: hidden;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

#corner-ui .corner-panel {
  pointer-events: none;
}

#corner-ui .ui-btn {
  pointer-events: auto;
}
