/* ==========================================================================
   Game Collection — shared design system
   Works alongside the existing Tailwind utility classes; adds polish,
   dark-mode-by-class support, and the new toggle/nav/card components.
   ========================================================================== */

:root {
  --gc-bg: #f7f8fb;
  --gc-surface: #ffffff;
  --gc-border: #e5e7eb;
  --gc-ink: #14151a;
  --gc-ink-soft: #5b5f6b;
  --gc-accent: #4f46e5;
  --gc-accent-hover: #4338ca;
  --gc-accent-soft: #eef0ff;
  --gc-good: #16a34a;
  --gc-warn: #dc2626;
  --gc-radius-lg: 18px;
  --gc-radius: 12px;
  --gc-shadow:
    0 1px 2px rgba(20, 21, 26, 0.04), 0 8px 24px rgba(20, 21, 26, 0.06);
}

html.dark {
  --gc-bg: #0f1115;
  --gc-surface: #171922;
  --gc-border: #2a2d38;
  --gc-ink: #f2f3f7;
  --gc-ink-soft: #a2a6b4;
  --gc-accent: #818cf8;
  --gc-accent-hover: #a5b0fa;
  --gc-accent-soft: #1e2033;
  --gc-good: #4ade80;
  --gc-warn: #f87171;
  --gc-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* smooth theme transition, no flash on toggle */
body,
header,
footer,
nav,
section,
.game-card,
.gc-modal-panel {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* ---------- Top nav ---------- */
.gc-nav {
  background: var(--gc-surface);
  border-bottom: 1px solid var(--gc-border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(8px);
}
.gc-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gc-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gc-nav a.gc-link {
  color: var(--gc-ink-soft);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  padding: 8px 12px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.gc-nav a.gc-link:hover {
  background: var(--gc-accent-soft);
  color: var(--gc-accent);
}
.gc-dropdown-panel {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  box-shadow: var(--gc-shadow);
  border-radius: var(--gc-radius);
}

/* ---------- Toggle buttons (theme / language) ---------- */
.gc-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gc-border);
  border-radius: 999px;
  padding: 4px;
  background: var(--gc-bg);
}
.gc-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--gc-ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
}
.gc-toggle-btn:hover {
  background: var(--gc-surface);
  color: var(--gc-ink);
}
.gc-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Buttons ---------- */
.gc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gc-accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
}
.gc-btn-primary:hover {
  background: var(--gc-accent-hover);
}
.gc-btn-primary:active {
  transform: scale(0.98);
}

/* ---------- Game cards ---------- */
.game-card {
  border-radius: var(--gc-radius-lg) !important;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  box-shadow: var(--gc-shadow);
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 8px rgba(20, 21, 26, 0.06),
    0 16px 32px rgba(20, 21, 26, 0.12);
}
html.dark .game-card:hover {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 16px 32px rgba(0, 0, 0, 0.45);
}
.game-card img {
  transition: transform 0.3s ease;
}
.game-card:hover img {
  transform: scale(1.03);
}

.gc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
}
.gc-badge-sfw {
  background: #dcfce7;
  color: #166534;
}
.gc-badge-nsfw {
  background: #fee2e2;
  color: #991b1b;
}
html.dark .gc-badge-sfw {
  background: #14532d;
  color: #86efac;
}
html.dark .gc-badge-nsfw {
  background: #7f1d1d;
  color: #fca5a5;
}

/* ---------- Age-gate modal ---------- */
.gc-modal-backdrop {
  background: rgba(15, 17, 21, 0.6);
  backdrop-filter: blur(3px);
}
.gc-modal-panel {
  background: var(--gc-surface);
  border-radius: var(--gc-radius-lg);
  box-shadow: var(--gc-shadow);
  border: 1px solid var(--gc-border);
}

/* ---------- Search input ---------- */
.gc-search {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
  color: var(--gc-ink);
}
.gc-search:focus-within {
  border-color: var(--gc-accent);
  box-shadow: 0 0 0 3px var(--gc-accent-soft);
}

/* ---------- Back to top ---------- */
.up-btn {
  background: var(--gc-accent) !important;
  border-radius: 999px !important;
  box-shadow: var(--gc-shadow);
}
.up-btn:hover {
  background: var(--gc-accent-hover) !important;
}

/* ---------- Detail page hero card ---------- */
.gc-detail-card {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius-lg);
  box-shadow: var(--gc-shadow);
}

/* ---------- Footer ---------- */
.gc-footer {
  background: var(--gc-surface);
  border-top: 1px solid var(--gc-border);
}

/* focus ring accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gc-accent);
  outline-offset: 2px;
}
