body {
  font-family: "Exo 2", sans-serif;
  background-color: #000010;
  color: #e0e0e0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
}
:root {
  --ui-bar-height: 36px;
  --ui-bar-gap: 8px;
  --fuel: 100;
  --indicator-speed: 0;
  --indicator-alignment: 0;
  --indicator-distance: 0;
}

.hidden {
  display: none !important;
}
.game-wrapper {
  border: none;
  background-color: #050515;
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
canvas {
  background-color: transparent;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}
#starfield {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  background-color: #000010;
  width: 100vw;
  height: 100vh;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
}
.ui-bar {
  font-family: "Exo 2", sans-serif;
  background-color: rgba(10, 10, 30, 0.95);
  border-bottom: 2px solid #4f4f4f;
  position: relative;
  z-index: 2;
  padding: 4px 14px;
  min-height: var(--ui-bar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
}

.ui-bar__left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.home-button {
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 4px;
  color: #00bfff;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-button:hover {
  background-color: rgba(0, 191, 255, 0.2);
  border-color: #00bfff;
}

.home-button__icon {
  width: 20px;
  height: 20px;
  display: block;
}

.ui-bar__score-wrap {
  padding: 2px 6px;
}

.ui-bar__center {
  gap: 8px;
}

.ui-bar__message {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fde047;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-bar__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ui-bar__score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 10px;
  background: rgba(0, 25, 55, 0.6);
  border: 1px solid rgba(0, 191, 255, 0.35);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.15);
}

.ui-bar__score-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(0, 191, 255, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.ui-bar__score-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
  line-height: 1.15;
}

.ui-bar__timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px;
  background: rgba(0, 25, 55, 0.6);
  border: 1px solid rgba(0, 191, 255, 0.25);
  border-radius: 3px;
}

.ui-bar__timer-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 191, 255, 0.85);
}

.ui-bar__timer-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #facc15;
}

.ui-bar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.ui-bar__fuel-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ui-bar__fuel-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #e0e0e0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}

.fuel-bar-container {
  background-color: #222;
  border: 1px solid #555;
  width: 140px;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
}

.fuel-bar-container__fill {
  height: 100%;
  width: calc(var(--fuel, 100) * 1%);
  background: linear-gradient(90deg, #34d399, #fde047, #ef4444);
  transition: width 0.3s ease-out;
  border-radius: 3px;
}

.ui-bar span {
  display: inline-block;
  vertical-align: middle;
}

.world-map {
  position: absolute;
  top: calc(var(--ui-bar-height) + var(--ui-bar-gap));
  right: 20px;
  width: 200px;
  height: 170px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid #4f4f4f;
  border-radius: 8px;
  z-index: 3;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
  transition: opacity 0.3s ease;
}

.world-map.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile Touch Controls */
.mobile-controls {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  pointer-events: none;
}

/* Joystick Container */
.joystick-container {
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

.joystick-base {
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.2) 0%,
    rgba(233, 175, 81, 0.1) 70%,
    transparent 100%
  );
  border: 3px solid rgba(233, 175, 81, 0.6);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(233, 175, 81, 0.3),
    inset 0 0 20px rgba(233, 175, 81, 0.1);
  transition: all 0.3s ease;
}

.joystick-base:active,
.joystick-base.is-active {
  transform: scale(0.95);
  box-shadow: 0 0 30px rgba(233, 175, 81, 0.5),
    inset 0 0 30px rgba(233, 175, 81, 0.2);
}

.joystick-center {
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.8) 0%,
    rgba(233, 175, 81, 0.4) 100%
  );
  border: 2px solid rgba(233, 175, 81, 0.9);
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 10px rgba(233, 175, 81, 0.5);
}

.joystick-stick {
  width: 40px;
  height: 40px;
  background: radial-gradient(
    circle,
    rgba(233, 175, 81, 0.9) 0%,
    rgba(233, 175, 81, 0.6) 100%
  );
  border: 2px solid rgba(233, 175, 81, 1);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(233, 175, 81, 0.7),
    inset 0 0 10px rgba(255, 255, 255, 0.2);
  transition: all 0.1s ease;
  cursor: grab;
}

.joystick-stick:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(0.9);
  box-shadow: 0 0 20px rgba(233, 175, 81, 0.9),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Fire Button */
.fire-button-container {
  width: 80px;
  height: 80px;
  pointer-events: auto;
}

.fire-button {
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(239, 68, 68, 0.8) 0%,
    rgba(239, 68, 68, 0.4) 100%
  );
  border: 3px solid rgba(239, 68, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4),
    inset 0 0 20px rgba(239, 68, 68, 0.1);
  position: relative;
  overflow: hidden;
}

.fire-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.fire-button:active {
  transform: scale(0.9);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.7),
    inset 0 0 30px rgba(239, 68, 68, 0.2);
}

.fire-button:active::before {
  width: 100%;
  height: 100%;
}

.fire-button-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
}

.fire-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --ui-bar-height: 34px;
    --ui-bar-gap: 8px;
  }
  .mobile-controls {
    bottom: 15px;
    padding: 0 15px;
  }

  .joystick-container {
    width: 100px;
    height: 100px;
  }

  .fire-button-container {
    width: 70px;
    height: 70px;
  }

  .fire-icon {
    font-size: 20px;
  }

  .ui-bar {
    padding: 4px 12px;
    min-height: var(--ui-bar-height);
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
  }

  .ui-bar__left {
    grid-column: 1 / -1;
    order: 1;
  }

  .ui-bar__center {
    order: 2;
    justify-content: flex-start;
  }

  .ui-bar__right {
    order: 3;
    justify-content: flex-end;
  }

  .ui-bar__score-value {
    font-size: 1rem;
  }

  .ui-bar__message {
    font-size: 0.75rem;
    white-space: normal;
  }

  .fuel-bar-container {
    width: 100px;
    height: 12px;
  }

  .world-map {
    top: calc(var(--ui-bar-height) + var(--ui-bar-gap));
    right: 15px;
    width: 150px;
    height: 130px;
  }
}

@media (max-width: 480px) {
  :root {
    --ui-bar-height: 32px;
    --ui-bar-gap: 6px;
  }
  .mobile-controls {
    bottom: 10px;
    padding: 0 10px;
  }

  .joystick-container {
    width: 90px;
    height: 90px;
  }

  .fire-button-container {
    width: 60px;
    height: 60px;
  }

  .fire-icon {
    font-size: 18px;
  }

  .joystick-stick {
    width: 35px;
    height: 35px;
  }

  .joystick-center {
    width: 15px;
    height: 15px;
  }

  .ui-bar {
    padding: 4px 10px;
    min-height: var(--ui-bar-height);
  }

  .ui-bar__score-value {
    font-size: 0.9rem;
  }

  .ui-bar__message {
    font-size: 0.7rem;
  }

  .fuel-bar-container {
    width: 90px;
    height: 10px;
  }

  .world-map {
    top: calc(var(--ui-bar-height) + var(--ui-bar-gap));
    right: 10px;
    width: 120px;
    height: 100px;
  }
}

/* Hide mobile controls on desktop */
@media (min-width: 769px) {
  .mobile-controls {
    display: none;
  }
}

/* Show mobile controls only on touch devices */
@media (hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

/* Hide on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .mobile-controls {
    display: none;
  }
}

/* Map Toggle Button */
.map-toggle {
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 3px;
  color: #00bfff;
  padding: 3px 8px;
  font-family: "Exo 2", sans-serif;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.map-toggle:hover {
  background-color: rgba(0, 191, 255, 0.2);
  border-color: #00bfff;
}

/* Audio Toggle Button */
.audio-toggle {
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 3px;
  color: #00bfff;
  padding: 3px 6px;
  font-family: "Exo 2", sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 28px;
  text-align: center;
}

.audio-toggle:hover {
  background-color: rgba(0, 191, 255, 0.2);
  border-color: #00bfff;
}

.audio-toggle.muted {
  color: #ff4444;
  border-color: #ff4444;
}

.audio-toggle.muted:hover {
  background-color: rgba(255, 68, 68, 0.2);
}

/* Docking Indicators */
.docking-indicators {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #4f4f4f;
  border-radius: 4px;
  padding: 15px;
  z-index: 3;
}

.docking-indicators.hidden {
  display: none !important;
}

.docking-indicators__title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.indicator__label {
  font-size: 0.75rem;
}

.indicator {
  display: flex;
  align-items: center;
  margin: 5px 0;
}

.indicator-bar {
  width: 150px;
  height: 10px;
  background-color: #333;
  border-radius: 4px;
  margin-left: 15px;
  overflow: hidden;
}

.indicator-fill {
  height: 100%;
  width: calc(var(--indicator-width, 0) * 1%);
  transition: width 0.2s ease;
}

#speed-indicator { --indicator-width: var(--indicator-speed, 0); }
#alignment-indicator { --indicator-width: var(--indicator-alignment, 0); }
#distance-indicator { --indicator-width: var(--indicator-distance, 0); }

.indicator-good {
  background-color: #10b981;
}

.indicator-warning {
  background-color: #f59e0b;
}

.indicator-danger {
  background-color: #ef4444;
}

/* Gravity Warning */
.gravity-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 0, 0, 0.3);
  border: 2px solid #ff0000;
  border-radius: 10px;
  padding: 10px 20px;
  color: #ff0000;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  z-index: 10;
  animation: gravityPulse 1s infinite;
}

.gravity-warning.hidden {
  display: none !important;
}

.gravity-warning__label {
  color: #f87171;
  font-weight: 700;
}

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

/* ========== Game Modals (Start & Game Over) ========== */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.35s ease-out;
}

.game-modal.hidden {
  display: none;
}

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

.game-modal__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse 80% 50% at 50% 50%,
      rgba(0, 30, 60, 0.85) 0%,
      rgba(0, 10, 25, 0.95) 50%,
      rgba(0, 0, 0, 0.98) 100%
    ),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300bfff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.game-modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(
      165deg,
      rgba(5, 15, 35, 0.98) 0%,
      rgba(8, 20, 45, 0.97) 40%,
      rgba(3, 12, 28, 0.99) 100%
    );
  border: 1px solid rgba(0, 191, 255, 0.35);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 191, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #e0e8f0;
  font-family: "Exo 2", sans-serif;
  animation: panelSlideIn 0.4s ease-out;
}

.game-modal__panel--start {
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Corner accents (HUD style) */
.game-modal__corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(0, 191, 255, 0.6);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}

.game-modal__corner--tl {
  top: -1px;
  left: -1px;
  border-top-width: 3px;
  border-left-width: 3px;
  border-radius: 2px 0 0 0;
}

.game-modal__corner--tr {
  top: -1px;
  right: -1px;
  border-top-width: 3px;
  border-right-width: 3px;
  border-radius: 0 2px 0 0;
}

.game-modal__corner--bl {
  bottom: -1px;
  left: -1px;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-radius: 0 0 0 2px;
}

.game-modal__corner--br {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-radius: 0 0 2px 0;
}

/* Game Over panel variant */
.game-modal__panel--over {
  max-width: 380px;
}

.game-modal__panel--over .game-modal__corner {
  border-color: rgba(255, 100, 80, 0.7);
}

.game-modal__panel--over {
  border-color: rgba(255, 80, 60, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 80, 60, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Content areas */
.game-modal__content {
  padding: 28px 24px;
  position: relative;
  z-index: 1;
}

.game-modal__content--scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 24px 22px 20px;
}

.game-modal__content--scroll::-webkit-scrollbar {
  width: 8px;
}

.game-modal__content--scroll::-webkit-scrollbar-track {
  background: rgba(0, 20, 45, 0.6);
  border-radius: 4px;
}

.game-modal__content--scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.35);
  border-radius: 4px;
}

.game-modal__content--scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 191, 255, 0.5);
}

/* Start modal: brand header */
.game-modal__brand {
  text-align: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 191, 255, 0.2);
}

.game-modal__logo {
  display: inline-block;
  font-size: 2.5rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(0, 191, 255, 0.4));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.game-modal__title--start {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.game-modal__subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: rgba(0, 191, 255, 0.85);
  margin: 0;
}

/* Start modal: sections */
.game-modal__sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-modal__section {
  background: rgba(0, 20, 45, 0.6);
  border: 1px solid rgba(0, 191, 255, 0.18);
  border-radius: 4px;
  padding: 12px 14px;
}

.game-modal__section-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 191, 255, 0.95);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-modal__section-icon {
  font-size: 1rem;
  opacity: 0.9;
}

.game-modal__section-text {
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(220, 230, 240, 0.9);
  margin: 0;
}

.game-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .game-modal__grid {
    grid-template-columns: 1fr;
  }
}

.game-modal__block-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(0, 191, 255, 0.8);
  margin: 0 0 6px 0;
}

.game-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(220, 230, 240, 0.88);
}

.game-modal__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-modal__list--markers .game-modal__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.game-modal__dot--pickup {
  background: #3b82f6;
  color: rgba(59, 130, 246, 0.8);
}

.game-modal__dot--delivery {
  background: #22c55e;
  color: rgba(34, 197, 94, 0.8);
}

.game-modal__dot--fuel {
  background: #eab308;
  color: rgba(234, 179, 8, 0.8);
}

.game-modal__list--compact {
  gap: 4px;
}

.game-modal__list kbd,
.game-modal__list .game-modal__dot {
  margin-right: 2px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7em;
  font-family: "Exo 2", sans-serif;
  background: rgba(0, 191, 255, 0.2);
  border: 1px solid rgba(0, 191, 255, 0.4);
  border-radius: 3px;
  color: rgba(200, 230, 255, 0.95);
}

/* Controls: one row — label on top, keys below */
.controls-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.controls-row__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.controls-row__cell--center {
  flex: 1.2;
  min-width: 100px;
}

.controls-row__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(0, 191, 255, 0.9);
}

/* Move cell: W on top, then A S D in one row */
.controls-row__keys {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 4px;
  justify-items: center;
}

.controls-row__keys .keycap:nth-child(1) {
  grid-column: 1 / -1;
}

.controls-row__mobile {
  font-size: 0.75rem;
  color: rgba(220, 230, 240, 0.8);
  margin: 12px 0 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 191, 255, 0.15);
  text-align: center;
}

/* Keycap: game-style key */
.keycap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 4px 6px;
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: rgba(220, 235, 255, 0.95);
  background: linear-gradient(
    180deg,
    rgba(30, 50, 80, 0.9) 0%,
    rgba(15, 28, 50, 0.95) 100%
  );
  border: 1px solid rgba(0, 191, 255, 0.4);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.keycap--action {
  flex-direction: column;
  gap: 0;
}

.keycap__main {
  display: block;
  font-size: 0.85rem;
  line-height: 1.1;
}

.keycap__alt {
  display: block;
  font-size: 0.6rem;
  opacity: 0.85;
  margin-top: 1px;
}

.keycap--single {
  min-width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.keycap--wide {
  min-width: 72px;
  height: 36px;
  padding: 6px 12px;
  font-size: 0.72rem;
}

/* Start modal: actions */
.game-modal__actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 191, 255, 0.2);
  text-align: center;
}

/* Buttons */
.game-modal__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-family: "Exo 2", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.game-modal__btn:active {
  transform: scale(0.98);
}

.game-modal__btn--launch {
  background: linear-gradient(
    180deg,
    rgba(0, 180, 220, 0.9) 0%,
    rgba(0, 120, 180, 0.95) 100%
  );
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(0, 191, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.game-modal__btn--launch:hover {
  box-shadow: 0 0 32px rgba(0, 191, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.game-modal__btn-glow {
  position: absolute;
  inset: -2px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 191, 255, 0.4) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.game-modal__btn--launch:hover .game-modal__btn-glow {
  opacity: 1;
}

.game-modal__btn--primary {
  background: linear-gradient(
    180deg,
    rgba(220, 80, 60, 0.9) 0%,
    rgba(180, 50, 40, 0.95) 100%
  );
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 80, 60, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 260px;
}

.game-modal__btn--primary:hover {
  box-shadow: 0 0 28px rgba(255, 80, 60, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.game-modal__btn-text {
  position: relative;
  z-index: 1;
}

/* Game Over content */
.game-modal__content:not(.game-modal__content--scroll) {
  text-align: center;
}

.game-modal__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 100, 80, 0.9);
  border: 2px solid rgba(255, 100, 80, 0.5);
  border-radius: 50%;
  background: rgba(255, 60, 40, 0.12);
  box-shadow: 0 0 20px rgba(255, 80, 60, 0.25);
}

.game-modal__title--over {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 80, 60, 0.4);
  margin: 0 0 12px 0;
}

.game-modal__message {
  font-size: 0.9rem;
  color: rgba(220, 230, 240, 0.9);
  margin: 0 0 18px 0;
  line-height: 1.4;
}

.game-modal__score-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  margin-bottom: 20px;
  background: rgba(0, 20, 45, 0.7);
  border: 1px solid rgba(0, 191, 255, 0.25);
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 191, 255, 0.08);
}

.game-modal__score-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(0, 191, 255, 0.9);
}

.game-modal__score-value {
  font-size: 2rem;
  font-weight: 800;
  color: #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

/* Gravity Warning Content */
.gravity-warning-content {
  display: flex;
  align-items: center;
  justify-content: center;
}
