/* ═══════════════════════════════════════════════════════════════════
   Gravity Pong — Design Tokens & Shared Components
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Colors */
  --gp-green: #00ff41;
  --gp-green-60: rgba(0, 255, 65, 0.6);
  --gp-green-30: rgba(0, 255, 65, 0.3);
  --gp-green-06: rgba(0, 255, 65, 0.06);
  --gp-bg: #0a0a0a;
  --gp-accent: #f5a623;
  --gp-accent-60: rgba(245, 166, 35, 0.6);
  --gp-accent-30: rgba(245, 166, 35, 0.3);
  --gp-error: #ff4444;

  /* Text tiers */
  --gp-text-primary: rgba(255, 255, 255, 0.9);
  --gp-text-secondary: rgba(255, 255, 255, 0.6);
  --gp-text-tertiary: rgba(255, 255, 255, 0.4);
  --gp-text-muted: rgba(255, 255, 255, 0.25);

  /* Fonts */
  --gp-font-display: 'Space Mono', 'Courier New', Courier, monospace;
  --gp-font-mono: 'Courier New', Courier, monospace;

  /* Spacing scale (8px grid) */
  --gp-space-1: 4px;
  --gp-space-2: 8px;
  --gp-space-3: 12px;
  --gp-space-4: 16px;
  --gp-space-6: 24px;
  --gp-space-8: 32px;
  --gp-space-12: 48px;
  --gp-space-16: 64px;
}

/* Page flash fix — background on body, not html, so stars.js z-index:-1 canvas stays visible */
html {
  background: transparent !important;
}
body {
  background: var(--gp-bg);
}

/* ── Focus styles ── */

:focus-visible {
  outline: 2px solid var(--gp-green);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--gp-green);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.2);
}

/* ── Shared navigation header ── */

.gp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0;
  pointer-events: none;
}

.gp-header-back {
  display: block;
  min-height: 44px;
  padding: 12px 16px;
  pointer-events: auto;
  cursor: pointer;
  color: var(--gp-green);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  font-family: var(--gp-font-mono);
  font-size: 18px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.5);
  border-bottom-right-radius: 6px;
  border: 1px solid rgba(0, 255, 65, 0.4);
  border-top: none;
  border-left: none;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.15);
  transition: background 0.15s, box-shadow 0.15s;
}

.gp-header-back:hover {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.3);
}

.gp-header-title {
  flex: 1;
  text-align: center;
  padding: 12px 24px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  border: 1px solid rgba(0, 255, 65, 0.1);
  border-top: none;
}

.gp-header-title .title {
  margin: 0;
  font-family: var(--gp-font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gp-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.2);
}

.gp-header-title .subtitle {
  margin: 4px 0 0;
  font-family: var(--gp-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gp-text-secondary);
}

.gp-header-share {
  display: block;
  min-height: 44px;
  padding: 12px 16px;
  cursor: pointer;
  pointer-events: auto;
  color: var(--gp-green);
  white-space: nowrap;
  line-height: 0;
  border: 1px solid rgba(0, 255, 65, 0.4);
  background: rgba(0, 0, 0, 0.7);
  border-bottom-left-radius: 6px;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.15);
  transition: background 0.15s, box-shadow 0.15s;
}

.gp-header-share:hover {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.3);
}

.gp-header-share img {
  display: block;
  filter: brightness(0) saturate(100%) invert(73%) sepia(74%) saturate(3926%) hue-rotate(88deg) brightness(113%) contrast(119%);
}

/* ── Copied popover ── */

.copied-popover {
  position: fixed;
  z-index: 999;
  padding: 8px 16px;
  font-family: var(--gp-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gp-green);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(0, 255, 65, 0.4);
  border-radius: 4px;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.copied-popover.visible {
  opacity: 1;
}

/* ── Button base ── */

.gp-btn {
  display: inline-block;
  min-height: 44px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--gp-green);
  color: var(--gp-green);
  font-family: var(--gp-font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 8px var(--gp-green);
  box-shadow: 0 0 10px var(--gp-green-30), inset 0 0 10px rgba(0, 255, 65, 0.05);
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.gp-btn:hover {
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5), inset 0 0 15px rgba(0, 255, 65, 0.1);
  transform: scale(1.05);
}

.gp-btn:active {
  background: rgba(0, 255, 65, 0.2);
  transform: scale(0.98);
}

.gp-btn-secondary {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--gp-text-secondary);
  text-shadow: none;
  box-shadow: none;
  font-size: 12px;
  padding: 12px 24px;
  letter-spacing: 0.15em;
}

.gp-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  background: transparent;
}

.gp-btn-accent {
  border-color: var(--gp-accent);
  color: var(--gp-accent);
  background: rgba(245, 166, 35, 0.08);
  text-shadow: 0 0 8px var(--gp-accent-60);
  box-shadow: 0 0 10px var(--gp-accent-30), inset 0 0 10px rgba(245, 166, 35, 0.05);
}

.gp-btn-accent:hover {
  background: rgba(245, 166, 35, 0.15);
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.5), inset 0 0 15px rgba(245, 166, 35, 0.1);
}

.gp-btn-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Input / Select base ── */

.gp-input,
.gp-select {
  font-size: 16px;
  font-family: var(--gp-font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  color: #fff;
  padding: 12px;
  -webkit-appearance: none;
  appearance: none;
}
