:root {
  color-scheme: dark;
  --bg: #080d18;
  --ink: #f8f4e8;
  --muted: #b9c0c8;
  --line: rgba(248, 244, 232, 0.16);
  --panel: rgba(16, 22, 34, 0.92);
  --cyan: #59dfff;
  --gold: #ffd166;
  --green: #80ed99;
  --pink: #ff6b8a;
  --violet: #9b8cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(89, 223, 255, 0.2), transparent 26%),
    radial-gradient(circle at 82% 22%, rgba(255, 209, 102, 0.16), transparent 24%),
    radial-gradient(circle at 50% 92%, rgba(128, 237, 153, 0.13), transparent 30%),
    linear-gradient(135deg, #070c17, #172033 58%, #080910);
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(89, 223, 255, 0.13), rgba(255, 255, 255, 0.025)), #172033;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.22);
}

button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  color: #111827;
  border-color: rgba(255, 209, 102, 0.58);
  background: linear-gradient(135deg, var(--green), var(--gold));
}

.lunarApp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 14px;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px;
}

.moonWrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

canvas {
  display: block;
  width: min(100%, calc((100dvh - 28px) * 1.548));
  max-width: 100%;
  max-height: calc(100dvh - 28px);
  height: auto;
  aspect-ratio: 48 / 31;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d18;
  box-shadow: 0 0 0 1px rgba(89, 223, 255, 0.12), 0 24px 70px rgba(0, 0, 0, 0.48);
  touch-action: none;
}

.lunarControls {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding-right: 2px;
}

.sideHeader,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)), var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.sideHeader {
  padding: 14px;
  border-color: rgba(89, 223, 255, 0.24);
}

.panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.panel.compact {
  gap: 8px;
}

.panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.42;
}

.welcomeLine {
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.scoreStrip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scoreStrip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.58rem 0.64rem;
  color: var(--muted);
  background: rgba(7, 11, 17, 0.72);
  font-weight: 850;
}

.scoreStrip strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.18rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopPanel {
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.12), rgba(89, 223, 255, 0.06)), var(--panel);
}

.howPanel {
  background: linear-gradient(145deg, rgba(89, 223, 255, 0.12), rgba(128, 237, 153, 0.06)), var(--panel);
}

.shopStatus {
  border: 1px solid rgba(128, 237, 153, 0.22);
  border-radius: 8px;
  padding: 0.58rem 0.68rem;
  color: var(--green);
  background: rgba(128, 237, 153, 0.08);
  font-size: 0.86rem;
  font-weight: 850;
}

.directionsList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.9rem;
  font-weight: 800;
}

.directionsList li::marker {
  color: var(--gold);
  font-weight: 1000;
}

.touchPad {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 520px;
}

.touchPad button {
  justify-content: center;
  min-height: 58px;
}

.gamePageShot {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gameTrustLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gameTrustLinks a {
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 980px) {
  .lunarApp {
    grid-template-columns: 1fr;
  }

  .lunarControls {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  canvas {
    width: min(100%, 760px);
    max-height: none;
  }

  .touchPad {
    display: grid;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .touchPad button {
    min-width: 0;
    padding-inline: 0.5rem;
  }

  .scoreStrip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .lunarApp {
    padding: 10px;
  }

  .scoreStrip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
