/* ============================================================
   PlayRetroArcade — design tokens & shared shell components
   ------------------------------------------------------------
   Every page links this stylesheet BEFORE its own <style>.
   The shell (background, panels, buttons, type, radii) is the
   same everywhere; a game changes ONLY --game-accent and its
   own game art. Third-party games (2048, ADarkRoom) keep their
   upstream look and do not link this file.
   ============================================================ */

:root {
  /* --- palette (the shell) --- */
  --arcade-bg-gradient: linear-gradient(135deg, #0b0b0d 0%, #1a1a1f 50%, #0f0f14 100%);
  --arcade-surface: rgba(255, 255, 255, 0.03);
  --arcade-surface-strong: #18181c;
  --arcade-text: #e8eaed;
  --arcade-muted: #9aa0a6;
  --arcade-line: rgba(255, 255, 255, 0.08);

  /* --- brand colors: ONE cyan, used site-wide --- */
  --arcade-cyan: #00f5ff;
  --arcade-pink: #ff006e;
  --arcade-yellow: #ffbe0b;

  /* --- per-game accent: override this and nothing else --- */
  --game-accent: var(--arcade-cyan);
  --game-accent-ink: #001018; /* text color on accent-filled surfaces */

  /* accent-derived tints (fallbacks first, color-mix below) */
  --accent-line: rgba(0, 245, 255, 0.25);
  --accent-soft: rgba(0, 245, 255, 0.12);
  --accent-deep: #0077aa;

  /* --- radius scale: exactly three steps --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* --- typography --- */
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-retro: 'Courier New', monospace; /* titles & HUD chips only */

  /* --- elevation --- */
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.35);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --accent-line: color-mix(in srgb, var(--game-accent) 25%, transparent);
    --accent-soft: color-mix(in srgb, var(--game-accent) 12%, transparent);
    --accent-deep: color-mix(in srgb, var(--game-accent) 55%, #001822);
  }
}

/* ============================================================
   Shared components (arc- prefix avoids collisions while pages
   migrate; new markup should use these instead of local clones)
   ============================================================ */

/* Top bar: [pill Home] [logo] [title] ... [stats right] */
.arc-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--arcade-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow-card);
}
.arc-topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--game-accent);
}
.arc-topbar .arc-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Primary pill: accent-filled link/button (Home, Start, Play) */
.arc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--game-accent), var(--accent-deep));
  color: var(--game-accent-ink);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.arc-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--accent-line); }

/* Secondary button: soft accent fill */
.arc-btn {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--arcade-text);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.arc-btn:hover { background: var(--accent-line); }

/* Card panel (side panels, menus, score boxes) */
.arc-panel {
  background: var(--arcade-surface);
  border: 1px solid var(--arcade-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.arc-panel h3 { margin: 0 0 10px; font-size: 14px; color: var(--game-accent); }

/* HUD chip (score / lives / wave counters over the play field) */
.arc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-retro);
  font-size: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--arcade-text);
}

/* Leaderboard box injected into game-over overlays (Public/leaderboard.js) */
.arc-lb-box {
  margin: 16px auto 0;
  max-width: 300px;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--arcade-text);
  background: var(--arcade-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.arc-lb-title { color: var(--game-accent); font-weight: 700; margin-bottom: 6px; }
.arc-lb-list { list-style: none; margin: 0; padding: 0; }
.arc-lb-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--arcade-line);
}
.arc-lb-list li span:last-child { font-family: var(--font-retro); color: var(--game-accent); }
.arc-lb-empty { color: var(--arcade-muted); padding: 4px 0; }
.arc-lb-row { display: flex; gap: 8px; margin-top: 10px; }
.arc-lb-name {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  color: var(--arcade-text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-ui);
}
.arc-lb-save {
  background: linear-gradient(135deg, var(--game-accent), var(--accent-deep));
  color: var(--game-accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.arc-lb-msg { font-size: 12px; color: var(--arcade-muted); margin-top: 6px; }

/* Full-screen opaque menu overlay (no HUD bleed-through) */
.arc-overlay {
  position: fixed;
  inset: 0;
  background: #050508;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2000;
}

/* Bug-report button + modal (Public/feedback.js) */
.arc-fb-btn {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 3000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--arcade-surface-strong);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease;
}
.arc-fb-btn:hover { transform: translateY(-2px); }
.arc-fb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3001;
}
.arc-fb-card {
  background: var(--arcade-surface-strong);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  width: 340px;
  max-width: calc(100vw - 40px);
  font-family: var(--font-ui);
  color: var(--arcade-text);
}
.arc-fb-title { color: var(--game-accent); font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.arc-fb-sub { color: var(--arcade-muted); font-size: 12.5px; margin-bottom: 10px; }
.arc-fb-text {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  color: var(--arcade-text);
  font-family: var(--font-ui);
  font-size: 13.5px;
  padding: 10px;
  resize: vertical;
}
.arc-fb-row { display: flex; gap: 8px; margin-top: 10px; }
.arc-fb-send {
  background: linear-gradient(135deg, var(--game-accent), var(--accent-deep));
  color: var(--game-accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}
.arc-fb-cancel {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--arcade-text);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
}
.arc-fb-msg { font-size: 12.5px; color: var(--arcade-muted); margin-top: 8px; min-height: 16px; }
