/* Cute Moon Landing - styles */
:root {
  --bg: #0b0b2a;
  --accent: #ff9ed8;
  --accent2: #7df8c2;
  --text: #f0f0ff;
  --panel: rgba(20, 20, 50, 0.92);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  touch-action: none; /* better mobile game */
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#0b0b2a 0%, #1a1235 100%);
}

canvas {
  display: block;
  border: 4px solid #3a3a6a;
  border-radius: 12px;
  background: #050515;
  box-shadow: 0 0 30px rgba(120, 80, 200, 0.3);
  max-width: 100%;
  max-height: 100%;
  image-rendering: crisp-edges;
}

#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
  z-index: 10;
}

.hud {
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  margin-bottom: 8px;
}

.hud span {
  white-space: nowrap;
}

button {
  pointer-events: auto;
  background: #2a2a55;
  color: var(--text);
  border: 2px solid #5a5a9a;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s, background .1s;
}

button:active {
  transform: scale(0.95);
  background: #3a3a75;
}

button.primary {
  background: var(--accent);
  color: #1a0033;
  border-color: #ffccff;
  font-weight: 600;
}

#start-screen, #end-screen {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,20,0.82);
  z-index: 20;
}

#start-screen.active, #end-screen.active {
  display: flex;
}

.panel {
  background: var(--panel);
  border: 3px solid #5a5a9a;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--accent);
}

.panel .subtitle {
  margin-bottom: 18px;
  opacity: 0.9;
  font-size: 15px;
}

.controls-hint {
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  padding: 10px;
  border-radius: 8px;
  margin: 12px 0;
  text-align: left;
  line-height: 1.35;
}

#end-screen .score {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent2);
  margin: 8px 0;
}

#leaderboard {
  margin: 16px 0;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 8px;
  font-size: 14px;
}

#leaderboard table {
  width: 100%;
  border-collapse: collapse;
}

#leaderboard th, #leaderboard td {
  padding: 4px 6px;
  text-align: left;
}

#leaderboard th {
  color: var(--accent);
  font-size: 12px;
}

#leaderboard .me {
  background: rgba(255, 158, 216, 0.2);
}

.name-input {
  margin: 14px 0;
  display: flex;
  gap: 8px;
}

.name-input input {
  flex: 1;
  background: #111133;
  border: 2px solid #5a5a9a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
}

.name-input input:focus {
  outline: none;
  border-color: var(--accent);
}

#virtual-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* shown on touch */
  gap: 10px;
  z-index: 30;
  pointer-events: auto;
}

#virtual-controls.show {
  display: flex;
}

.vbtn {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: rgba(40,40,80,0.75);
  border: 3px solid #7a7ab8;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 4px 0 #222;
}

.vbtn:active {
  background: var(--accent);
  color: #1a0033;
  transform: translateY(2px);
}

.vbtn.thrust {
  width: 78px;
  height: 78px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
}

.info {
  font-size: 12px;
  opacity: .75;
  margin-top: 6px;
}

.lang-btn {
  font-size: 13px;
  padding: 4px 10px;
}
