@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;800;900&family=JetBrains+Mono:wght@400;500;700&family=Press+Start+2P&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background-color: #050614;
  color: #c9ccd8;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  background-color: #050614;
}

a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 8px; }
strong { font-weight: 600; color: #ffffff; }

/* ── Nav ── */
.game-nav {
  background-color: #080a1c;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.game-nav-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-weight: 800;
}

.logo-icon {
  background-color: #fbbf24;
  color: #050614;
  padding: 4px 8px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  border-radius: 4px;
}

.logo-text { font-size: 18px; }
.game-nav-links { display: flex; gap: 24px; }

.game-nav-link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.game-nav-link:hover, .game-nav-link.active { opacity: 1; color: #fbbf24; }

.btn-back {
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  background-color: rgba(251, 191, 36, 0.05);
  color: #ffffff;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background-color: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
}

/* ── Hero ── */
.page-hero {
  padding: 40px 0 20px 0;
  background: radial-gradient(circle at top, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
}

.page-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.page-hero-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.meta-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.page-hero-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: 36px;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
}

.page-hero-sub {
  max-width: 680px;
  margin: 0 auto;
  font-size: 15px;
  color: #9499b3;
  line-height: 1.6;
}

/* ── Main Game ── */
.game-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 60px 24px;
}

.game-board-wrapper {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 28 / 31;
  margin: 0 auto 30px auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  border: 2px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.2), 0 20px 50px rgba(0,0,0,0.8);
}

#gameCanvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: none;
}

#hud-overlay-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
  font-family: 'Press Start 2P', monospace;
}

.hud-score { font-size: 14px; color: #ffffff; text-shadow: 0 0 10px #fbbf24; }
.hud-lives { font-size: 14px; letter-spacing: 2px; }

/* ── Mobile Controls ── */
.mobile-controls-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -10px auto 30px auto;
  max-width: 560px;
  padding: 12px 16px;
  background: rgba(12, 16, 38, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dpad-group-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dpad-lr { display: flex; gap: 12px; }

.touch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 12px;
  font-family: 'Press Start 2P', sans-serif;
  font-size: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.1s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
  transform: scale(0.92);
  background: rgba(251, 191, 36, 0.3);
  border-color: #fbbf24;
}

.touch-btn-action {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.1));
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  font-size: 11px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.info-panel {
  background: rgba(12, 16, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px;
  backdrop-filter: blur(10px);
}

.panel-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
}

.info-panel h2 { font-size: 20px; font-weight: 800; color: #ffffff; margin-bottom: 16px; }
.info-panel ul { list-style: none; padding: 0; }
.info-panel li { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.info-panel li:last-child { border-bottom: none; }

.game-footer { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 30px 24px; text-align: center; font-size: 13px; color: #fbbf24; }

.nav-toggle-cb { display: none; }
.nav-toggle-btn {
  display: none;
  cursor: pointer;
  padding: 8px;
  color: #ffffff;
}

@media (max-width: 768px) {
  .page-hero { padding: 20px 0 10px 0; }
  .page-hero-heading { font-size: 24px; }
  .page-hero-sub { font-size: 13px; max-width: 90%; margin: 0 auto; }
  .game-main { padding: 12px 12px 40px 12px; }

  .game-board-wrapper {
    width: 100%;
    aspect-ratio: 28 / 31;
    max-height: 52vh;
    margin: 0 auto 12px auto;
  }

  .mobile-controls-container {
    margin: 0 auto 20px auto;
    padding: 8px 12px;
  }

  .touch-btn {
    min-width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .info-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }

  .nav-toggle-btn { display: flex; align-items: center; justify-content: center; }
  .game-nav-links {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: #080a1c;
    border-left: 1px solid rgba(251, 191, 36, 0.2);
    flex-direction: column;
    padding: 80px 24px 24px 24px;
    gap: 16px;
    z-index: 2000;
    transition: transform 0.35s ease;
  }
  .nav-toggle-cb:checked ~ .game-nav-links {
    transform: translateX(-300px);
  }
  .game-nav-link { font-size: 16px; width: 100%; }
}
