@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Unbounded:wght@500;700&display=swap");

:root {
  color-scheme: light;
  --bg-deep: #0b0c1f;
  --bg-mid: #14173a;
  --bg-glow: #1d1f4a;
  --accent: #ff9f1c;
  --accent-soft: #ffbf69;
  --ink: #f5f7ff;
  --ink-muted: #c3c7ff;
  --panel: rgba(16, 18, 44, 0.82);
  --panel-border: rgba(138, 145, 255, 0.18);
  --chip: rgba(255, 255, 255, 0.08);
  --danger: #ff6b6b;
  --success: #3be1b0;
  --shadow: 0 20px 50px rgba(3, 5, 18, 0.4);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #2e3163 0%, var(--bg-mid) 35%, var(--bg-deep) 75%);
  display: flex;
  flex-direction: column;
}

.page-game {
  height: 100vh;
  overflow: hidden;
}

.theme-orbit::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 159, 28, 0.12), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(92, 112, 255, 0.18), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(44, 203, 255, 0.12), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
  background: rgba(7, 8, 21, 0.8);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.brand-mark {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff9f1c, #ff6b6b);
  color: #0c0c1d;
  box-shadow: var(--shadow);
}

.brand-title {
  font-family: "Unbounded", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  gap: 18px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.layout-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  gap: 28px;
  padding: 36px 6vw 50px;
  align-items: start;
}

.page-game .layout-grid {
  flex: 1;
  min-height: 0;
  height: calc(100vh - 72px);
  padding: 18px 5vw 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

h1,
h2 {
  font-family: "Unbounded", sans-serif;
  margin: 0 0 8px;
}

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

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

.stat {
  background: var(--chip);
  padding: 10px 14px;
  border-radius: 12px;
  min-width: 90px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.game-frame {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(15, 18, 40, 0.95), rgba(9, 11, 26, 0.9));
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.page-game .game-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-game .game-frame {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hud {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 12px;
  z-index: 2;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 10, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.hud-label {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.65rem;
}

.hud-chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
}

.hud-text {
  width: auto;
  border-radius: 999px;
  padding: 0 10px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--ink);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 18, 0.75);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.overlay-card {
  background: rgba(12, 16, 34, 0.95);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  max-width: 300px;
}

.overlay-title {
  font-family: "Unbounded", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.overlay-copy {
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
}

.legend {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ff9f1c, #ff6b6b);
  color: #111326;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink);
  box-shadow: none;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-block h2 {
  margin-bottom: 6px;
}

.side-block p {
  color: var(--ink-muted);
  margin-top: 0;
}

.list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink-muted);
}

.ad-slot {
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 18px;
  text-align: center;
  color: var(--ink-muted);
  margin-top: 12px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 6vw 30px;
  color: var(--ink-muted);
}

.page-game .site-footer {
  display: none;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.content-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 6vw 60px;
  position: relative;
  z-index: 1;
}

.content-card {
  margin-top: 20px;
  padding: 28px;
  background: rgba(15, 18, 44, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.content-card p {
  color: var(--ink-muted);
  line-height: 1.6;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.notice {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 159, 28, 0.12);
  border: 1px solid rgba(255, 159, 28, 0.3);
  color: var(--ink);
}

.center-stack {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 40px 6vw 60px;
}

.center-card {
  text-align: center;
  max-width: 480px;
  background: rgba(12, 15, 36, 0.9);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.center-card p {
  color: var(--ink-muted);
}

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

  .site-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-header {
    flex-direction: column;
  }

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

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

  .page-game {
    overflow: hidden;
  }

  .page-game .layout-grid {
    padding: 16px 4vw 20px;
    gap: 16px;
    height: calc(100vh - 86px);
  }

  .page-game .panel {
    padding: 16px;
  }

  .page-game .game-frame {
    aspect-ratio: auto;
    height: clamp(360px, 64vh, 560px);
  }

  .page-game .side-panel,
  .page-game .site-footer {
    display: none;
  }
}

@media (max-height: 860px) {
  .page-game .site-header {
    padding: 12px 4vw;
  }

  .page-game .panel {
    padding: 16px;
  }

  .page-game .panel-header {
    margin-bottom: 10px;
  }

  .page-game .stats {
    gap: 8px;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.content-card,
.center-card {
  animation: floatIn 0.6s ease both;
}
