/* ==========================================================================
   BASE / SHARED STYLES
   Design tokens, reset, ambient background, and button styles used on
   both the opening page and the game page.
   ========================================================================== */
:root {
  /* base surface */
  --bg-deep: #090a12;
  --bg-panel: rgba(255, 255, 255, 0.045);
  --bg-panel-strong: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* player identities */
  --x-1: #22d3ee;
  --x-2: #6366f1;
  --x-glow: rgba(99, 179, 237, 0.55);

  --o-1: #fb923c;
  --o-2: #f43f5e;
  --o-glow: rgba(251, 113, 133, 0.55);

  /* text */
  --text-hi: #eef0f8;
  --text-mid: #a7acc4;
  --text-low: #666c88;

  /* radii + timing */
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg-deep);
  color: var(--text-hi);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  padding: max(20px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Ambient background (shared on both pages) ---- */
.bg-glow {
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.bg-glow--x {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--x-1), transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}

.bg-glow--o {
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, var(--o-2), transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 8vh) scale(1.12); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(1.08); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 90%);
}

/* ---- Shared title treatment ---- */
.title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 7vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
}

.title__letter--x {
  background: linear-gradient(120deg, var(--x-1), var(--x-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title__letter--o {
  background: linear-gradient(120deg, var(--o-1), var(--o-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title__dot {
  color: var(--text-low);
  font-weight: 400;
}

.subtitle {
  margin-top: 6px;
  color: var(--text-mid);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ---- Shared buttons ---- */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  padding: 13px 18px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  transition: transform 0.15s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth),
    background 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  color: #05070d;
  background: linear-gradient(120deg, var(--x-1), var(--o-1));
  border: none;
}

.btn--primary:hover {
  box-shadow: 0 8px 26px -8px rgba(99, 179, 237, 0.55);
}

.btn--ghost {
  color: var(--text-hi);
  background: var(--bg-panel);
}

.btn--ghost:hover {
  background: var(--bg-panel-strong);
  border-color: var(--border-strong);
}

.footer {
  text-align: center;
  color: var(--text-low);
  font-size: 0.75rem;
  line-height: 1.4;
}

