/* ==========================================================
   DeskArcade — Premium Dark Design System
   Loaded by the hub and every game page.
   Each game page overrides --accent (and optionally
   --accent-2) in its own :root to get its identity color.
   ========================================================== */

:root {
  /* Base palette */
  --bg: #0a0a12;
  --bg-deep: #06060c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(22, 22, 36, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f8;
  --text-dim: #9b9bb0;
  --text-faint: #62627a;

  /* Brand accent (hub) — game pages override these */
  --accent: #8b5cf6;
  --accent-2: #22d3ee;

  /* Derived accent tones */
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 36%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 72%, #ffffff);

  /* Shape + depth */
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.55), 0 18px 50px rgba(0, 0, 0, 0.55);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 18% -8%, var(--accent-glow), transparent 60%),
    radial-gradient(900px 480px at 88% -12%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Fine grain texture instead of CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.02 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------
   Shared chrome
   ---------------------------------------------------------- */

/* Glass shell that wraps a whole page / game */
.da-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 38%),
    var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-2);
}

/* Top hairline accent on shells */
.da-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
  pointer-events: none;
}

/* Page header inside a shell */
.da-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.da-header .da-logo {
  display: block;
  height: 72px;
  max-width: min(440px, 60vw);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}

/* Back-to-arcade pill */
.da-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.da-back:hover {
  color: var(--text);
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.da-back::before {
  content: "←";
  font-size: 14px;
  line-height: 1;
}

/* Primary action button */
.da-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.da-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.da-btn:active {
  transform: translateY(0);
}

/* Secondary / ghost button */
.da-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.da-btn-ghost:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Stat chip (score, timer, lives...) */
.da-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 86px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.da-chip .da-chip-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.da-chip .da-chip-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-text);
}

/* Inner panel (sits inside a shell) */
.da-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
}

/* Dark inset well — used behind logos / canvases */
.da-well {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #0b0b15, #07070f);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.55);
}

/* Section label */
.da-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Inputs */
.da-input,
.da-select,
.da-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(10, 10, 20, 0.7);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.da-input:focus,
.da-select:focus,
.da-textarea:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}
