@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --bg: #05060b;
  --panel: #0f172a;
  --accent: #38bdf8;
  --accent-2: #a855f7;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --success: #22c55e;
  --warning: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a {
  color: var(--accent);
}

.game-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 8px;
}

.game-header .back {
  text-decoration: none;
  font-weight: 600;
}

.game-header h1 {
  margin: 8px 0 4px;
  font-size: 32px;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.game-shell {
  max-width: 1100px;
  margin: 0 auto 48px;
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.viewport-wrapper {
  position: relative;
}

.viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(168, 85, 247, 0.12));
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

.webgl-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.fullscreen-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.win-banner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #e5e7eb;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.65), 0 0 30px rgba(168, 85, 247, 0.5);
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08), transparent 45%);
}

.win-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.9));
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.stat .label {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat.wide {
  grid-column: span 2;
}

.controls {
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.controls h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.controls ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.controls li {
  color: var(--muted);
}

.crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.crosshair span {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(229, 231, 235, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transform: translate(-50%, -50%);
  position: absolute;
}

.crosshair.active {
  opacity: 0.9;
}

@media (max-width: 720px) {
  .game-header {
    padding: 24px 16px 8px;
  }

  .game-shell {
    padding: 0 16px 24px;
  }

  .stat.wide {
    grid-column: span 1;
  }
}
