@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

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

:root {
  color-scheme: dark;

  /* Palette – Neon Arcade */
  --bg-primary: #08090f;
  --bg-secondary: #0e1019;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-glass: rgba(255, 255, 255, 0.055);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #e8e8f0;
  --text-secondary: #9494b8;
  --text-muted: #5c5c7a;

  --accent: #00e5ff;
  --accent-alt: #7c4dff;
  --accent-glow: rgba(0, 229, 255, 0.25);
  --accent-dim: rgba(0, 229, 255, 0.08);

  --uno-red: #ef4444;
  --uno-blue: #3b82f6;
  --uno-green: #22c55e;
  --uno-yellow: #eab308;

  --danger: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Card sizes – mobile-first */
  --card-w: 64px;
  --card-h: 92px;

  /* Fonts */
  --font-heading: 'Chakra Petch', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

@media (min-width: 768px) {
  :root {
    --card-w: 86px;
    --card-h: 124px;
  }
}

@media (min-width: 1200px) {
  :root {
    --card-w: 100px;
    --card-h: 144px;
  }
}

html {
  color-scheme: dark;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-tap-highlight-color: rgba(0, 229, 255, 0.08);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(124, 77, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 229, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(239, 68, 68, 0.03) 0%, transparent 60%),
    linear-gradient(160deg, #08090f 0%, #0c0e1a 35%, #110a1e 70%, #08090f 100%);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

#app {
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.hidden {
  display: none !important;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  z-index: 1;
}

.screen.active {
  display: flex;
}

/* ===== Utilities ===== */
.glow-text {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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