﻿:root {
  color-scheme: dark;
  --bg: #0b0f1e;
  --bg-2: #141c33;
  --accent: #7cf7ff;
  --accent-2: #a67cff;
  --accent-3: #5cff89;
  --danger: #ff6b6b;
  --text: #e6f0ff;
  --muted: #97a2c4;
  --glass: rgba(18, 26, 48, 0.55);
  --shadow: 0 24px 60px rgba(4, 8, 20, 0.7);
  --grid: rgba(124, 247, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b2446 0%, #0b0f1e 55%, #070a14 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.wrap {
  width: min(900px, 100%);
  display: grid;
  gap: 18px;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--glass);
  border: 1px solid rgba(124, 247, 255, 0.15);
  padding: 16px 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(124, 247, 255, 0.5), 0 0 40px rgba(166, 124, 255, 0.45);
  position: relative;
}

.logo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background: #0b0f1e;
}

.stats {
  display: flex;
  gap: 16px;
}

.stat {
  background: rgba(8, 12, 25, 0.7);
  padding: 10px 16px;
  border-radius: 14px;
  text-align: center;
  min-width: 90px;
  border: 1px solid rgba(124, 247, 255, 0.1);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat span:last-child {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.stage {
  position: relative;
  border-radius: 26px;
  padding: 20px;
  background: linear-gradient(160deg, rgba(18, 26, 48, 0.75), rgba(9, 12, 24, 0.95));
  border: 1px solid rgba(124, 247, 255, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(124, 247, 255, 0.2), transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(166, 124, 255, 0.22), transparent 45%),
              radial-gradient(circle at 50% 80%, rgba(92, 255, 137, 0.18), transparent 55%);
  pointer-events: none;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background:
    linear-gradient(transparent 23px, var(--grid) 24px),
    linear-gradient(90deg, transparent 23px, var(--grid) 24px);
  background-size: 24px 24px;
  background-color: #0b1024;
  position: relative;
  z-index: 1;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 16, 0.55);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.show {
  opacity: 1;
  pointer-events: all;
}

.card {
  background: rgba(10, 15, 32, 0.85);
  border: 1px solid rgba(124, 247, 255, 0.2);
  border-radius: 20px;
  padding: 24px 30px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.btn {
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f1e;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124, 247, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(124, 247, 255, 0.45);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mobile-controls {
  display: none;
  position: relative;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(12, 18, 35, 0.75);
  border: 1px solid rgba(124, 247, 255, 0.15);
  box-shadow: var(--shadow);
}

.touch-btn {
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 247, 255, 0.35), rgba(166, 124, 255, 0.35));
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  width: 64px;
  height: 64px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(7, 12, 28, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.touch-btn:active {
  transform: scale(0.95);
  box-shadow: 0 6px 14px rgba(7, 12, 28, 0.6);
}

.touch-btn.up {
  grid-column: 2;
  grid-row: 1;
}

.touch-btn.left {
  grid-column: 1;
  grid-row: 2;
}

.touch-btn.down {
  grid-column: 2;
  grid-row: 3;
}

.touch-btn.right {
  grid-column: 3;
  grid-row: 2;
}

.touch-btn.action {
  grid-column: 3;
  grid-row: 3;
  width: 100%;
  height: 64px;
  font-size: 0.95rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f1e;
}

.touch-btn.action + .touch-btn.action {
  grid-column: 1;
  grid-row: 3;
  background: linear-gradient(120deg, var(--accent-3), var(--accent));
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 18, 35, 0.8);
  border: 1px solid rgba(124, 247, 255, 0.1);
}

.hint {
  max-width: 360px;
  text-align: right;
}

@media (max-width: 640px) {
  .hud {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    width: 100%;
    justify-content: space-between;
  }

  .hint {
    text-align: left;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-controls {
    display: grid;
  }
}
