/* =========================================================================
   WEB BOX SA — global stylesheet
   A dark, cinematic gaming interface with restrained red brand accents.
   Built for vanilla HTML/CSS/JS deployment to Cloudflare Pages.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. CSS RESET
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; }
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; margin: 0; }
:focus-visible { outline: 2px solid var(--accent);
  outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------
   2. DESIGN TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* Surfaces — deep charcoal, not pure black */
  --bg-0: #0A0B0D;
  --bg-1: #0E1014;
  --bg-2: #13151A;
  --bg-3: #1A1D22;
  --bg-elev: #1F232A;

  /* Borders — subtle surface separation, not heavy shadows */
  --border: #232629;
  --border-strong: #2E3236;
  --border-hover: #3A3F45;

  /* Text */
  --text: #E8EAED;
  --text-secondary: #B6BCC4;
  --text-muted: #8B9099;
  --text-dim: #6B7177;

  /* Brand — restrained red */
  --accent: #E11D2A;
  --accent-hover: #F23341;
  --accent-pressed: #B01826;
  --accent-soft: rgba(225, 29, 42, 0.14);
  --accent-line: rgba(225, 29, 42, 0.4);

  /* Status */
  --info: #4C8BBF;
  --success: #3DA668;
  --warning: #C97E2A;
  --error: #E55260;

  /* Typography */
  --font-display: "Sora", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Sizing */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;

  --container: 1200px;
  --header-h: 64px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-elev: 0 1px 0 rgba(255,255,255,0.03) inset, 0 6px 20px rgba(0,0,0,0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* -------------------------------------------------------------------------
   3. BASE / TYPOGRAPHY
   ------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 var(--space-4);
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1rem; }
p { margin: 0 0 var(--space-4); }
small { color: var(--text-muted); }

a { color: var(--text); transition: color 0.18s var(--ease); }
a:hover { color: var(--text); }
a:focus-visible { outline-color: var(--accent); }

strong { color: var(--text); font-weight: 600; }

code, kbd, samp {
  font-family: "JetBrains Mono", "Sarasa Mono SC", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 1px 6px;
}

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

/* Accessible visually-hidden helper */
.is-visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.is-hidden { display: none !important; }

/* -------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
@media (max-width: 600px) {
  .container { padding: 0 var(--space-4); }
}

.section { padding: var(--space-9) 0; }
.section--tight { padding: var(--space-7) 0; }
.section--hero { padding: var(--space-10) 0 var(--space-9); }

.section-head { margin-bottom: var(--space-6); max-width: 720px; }
.section-head h2 { margin-bottom: var(--space-3); }
.section-head p { color: var(--text-secondary); margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent-line);
}

/* -------------------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--bg-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.2;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
              color 0.18s var(--ease), transform 0.18s var(--ease);
  user-select: none;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 2px; }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-bd: transparent;
}
.btn--primary:hover {
  --btn-bg: var(--accent-hover);
  border-color: transparent;
}

.btn--secondary {
  --btn-bg: var(--bg-3);
  --btn-bd: var(--border-strong);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: var(--border);
}
.btn--ghost:hover {
  --btn-bg: var(--bg-2);
}

.btn--lg { padding: 13px 24px; font-size: 1rem; }

.btn.is-disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   6. CHIPS / FILTER PILLS
   ------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-hover); }
.chip.is-active {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.chip:focus-visible { outline-color: var(--accent); }

/* -------------------------------------------------------------------------
   7. HEADER / NAV (Apple-inspired translucent)
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 0 var(--space-5);
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) {
  .site-header { padding: 0 var(--space-4); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: 0 0 auto;
  margin-right: auto;
}
.brand-logo {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.brand-logo__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
}

.nav-desktop { display: flex; align-items: center; }
.nav-desktop__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: rgba(20, 22, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.nav-desktop__item { list-style: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.is-current {
  color: var(--text);
  background: var(--bg-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.nav-link__icon {
  display: inline-flex;
  width: 16px; height: 16px;
  color: var(--accent);
}
.nav-link__icon svg { width: 100%; height: 100%; }

@media (max-width: 899px) {
  .nav-desktop { display: none; }
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle:hover { border-color: var(--border-hover); }
@media (max-width: 899px) {
  .menu-toggle { display: inline-flex; }
}

/* -------------------------------------------------------------------------
   8. MOBILE MENU PANEL
   ------------------------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: min(86vw, 380px);
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 80;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu[data-state] {}
.mobile-menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.mobile-menu__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.mobile-menu__list {
  list-style: none;
  margin: 0; padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.mobile-menu__link:hover { background: var(--bg-2); border-color: var(--border); }
.mobile-menu__link.is-current {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}
.mobile-menu__icon {
  display: inline-flex;
  width: 20px; height: 20px;
  color: var(--accent);
  flex: 0 0 auto;
}
.mobile-menu__icon svg { width: 100%; height: 100%; }

@media (min-width: 900px) {
  .mobile-menu { display: none; }
}

/* Backdrop when menu is open */
body.menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 70;
  pointer-events: auto;
}
body.menu-open { overflow: hidden; }
@media (min-width: 900px) {
  body.menu-open::after { display: none; }
}

/* -------------------------------------------------------------------------
   9. INTRO OVERLAY
   ------------------------------------------------------------------------- */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.intro-overlay[data-state="hidden"] {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}
.intro-overlay[data-state="leaving"] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
.intro-overlay[data-state="loading"] {
  opacity: 1;
  visibility: visible;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-0);
}

.intro-brand {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  background: radial-gradient(ellipse at 50% 50%, var(--bg-1), var(--bg-0) 70%);
  text-align: center;
  padding: var(--space-6);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.intro-brand[data-state="visible"] { opacity: 1; }
.intro-brand[data-state="hidden"] { opacity: 0; }
.intro-brand__logo {
  width: 96px; height: 96px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  object-fit: contain;
}
.intro-brand__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0;
}
.intro-brand__title .accent { color: var(--accent); }
.intro-brand__tag {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.intro-skip {
  position: absolute;
  bottom: var(--space-6);
  right: var(--space-6);
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(20,22,26,0.7);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
              background 0.18s var(--ease);
  z-index: 5;
}
.intro-skip:hover { color: var(--text); border-color: var(--border-hover); }
.intro-skip:focus-visible { outline-color: var(--accent); }

body.intro-active { overflow: hidden; }

/* -------------------------------------------------------------------------
   10. HERO SECTION
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-10) 0 var(--space-9);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(225,29,42,0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(60,80,140,0.06), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 0 var(--space-5);
}
.hero h1 {
  margin-bottom: var(--space-4);
}
.hero h1 .accent { color: var(--accent); }
.hero .lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-7);
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
}
.hero-search-form { display: flex; gap: var(--space-2); }
.hero-search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 16px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.hero-search-input:focus-within {
  border-color: var(--accent-line);
  background: var(--bg-3);
}
.hero-search-input svg { width: 18px; height: 18px; color: var(--text-muted); flex: 0 0 auto; }
.hero-search-input input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1rem;
  color: var(--text);
  min-width: 0;
}
.hero-search-input input::placeholder { color: var(--text-dim); }

/* -------------------------------------------------------------------------
   11. FEATURED ROW
   ------------------------------------------------------------------------- */
.featured-wrap {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
}
@media (max-width: 899px) {
  .featured-wrap {
    grid-template-columns: 1fr;
  }
}

.featured-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-5);
}

.featured-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  min-height: 220px;
  transition: border-color 0.18s var(--ease), transform 0.2s var(--ease);
}
.featured-card:hover { border-color: var(--border-hover); }
.featured-card--hero { min-height: 420px; }

.featured-card__link { display: block; height: 100%; }
.featured-card__art {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
}
.featured-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}
.featured-card:hover .featured-card__img { transform: scale(1.02); }

.featured-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8,9,11,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
}
.featured-card__category {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 9px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(225,29,42,0.85);
  border-radius: 4px;
  margin-bottom: var(--space-3);
}
.featured-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  margin: 0 0 var(--space-2);
  color: #fff;
}
.featured-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-3);
  max-width: 460px;
}
.featured-card__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.featured-card__cta::after {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--accent-line);
}
.featured-card--hero .featured-card__title { font-size: clamp(1.4rem, 3vw, 2rem); }

/* -------------------------------------------------------------------------
   12. LIBRARY GRID
   ------------------------------------------------------------------------- */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  min-width: 0;
  flex: 1 1 280px;
  max-width: 420px;
  position: relative;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.library-search:focus-within {
  border-color: var(--accent-line);
  background: var(--bg-3);
}
.library-search svg { width: 18px; height: 18px; color: var(--text-muted); flex: 0 0 auto; }
.library-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
}
.library-search input::placeholder { color: var(--text-dim); }
.library-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.library-search-clear.is-visible { display: inline-flex; }
.library-search-clear:hover { color: var(--text); }

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.result-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.library-status {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.library-status[data-kind="error"] { border-color: var(--error); color: var(--text); }
.library-status[data-kind="success"] { border-color: var(--success); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}
@media (max-width: 460px) {
  .game-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   13. GAME CARD
   ------------------------------------------------------------------------- */
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.2s var(--ease);
}
.game-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.game-card__link { display: block; }
.game-card__art {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--bg-2);
  overflow: hidden;
}
.game-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}
.game-card:hover .game-card__img { transform: scale(1.04); }
.game-card__category {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 9px;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(10,11,13,0.78);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  backdrop-filter: blur(6px);
}

.game-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.game-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.game-card__title-link { color: var(--text); }
.game-card__title-link:hover { color: var(--accent-hover); }
.game-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.game-card__meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   14. GAME DETAIL PAGE
   ------------------------------------------------------------------------- */
.game-detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-7);
  align-items: start;
}
@media (max-width: 899px) {
  .game-detail { grid-template-columns: 1fr; }
}
.game-detail__art {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.game-detail__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.game-detail__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--border);
}
.game-detail__gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.game-detail__body { display: flex; flex-direction: column; gap: var(--space-3); }
.game-detail__category {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
}
.game-detail__title { margin: 0; }
.game-detail__desc { color: var(--text-secondary); }
.game-detail__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0;
  padding: var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.game-detail__meta dt {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.game-detail__meta dd { margin: 0; color: var(--text); font-family: var(--font-body); }
.game-detail__note {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-2);
  border-left: 2px solid var(--border-strong);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.game-detail-skeleton { display: flex; flex-direction: column; gap: var(--space-4); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skeleton-shimmer 1.4s linear infinite;
}
.skeleton--art { aspect-ratio: 16/9; }
.skeleton--line { height: 18px; width: 60%; }
.skeleton--short { width: 30%; }
.skeleton--block { height: 80px; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

.state {
  padding: var(--space-9) var(--space-5);
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-width: 540px;
  margin: 0 auto;
}
.state__title { margin-bottom: var(--space-3); }
.state__text { color: var(--text-secondary); margin-bottom: var(--space-5); }
.state__meta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: var(--space-5); }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--text-dim); }
.crumb { color: var(--text-secondary); }
.crumb:hover { color: var(--text); }

/* -------------------------------------------------------------------------
   15. PROFILE PAGE
   ------------------------------------------------------------------------- */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-7);
  align-items: start;
}
@media (max-width: 899px) {
  .profile-layout { grid-template-columns: 1fr; }
}

.profile-preview {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}
.profile-avatar {
  width: 160px; height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
}
.profile-avatar__img { width: 100%; height: 100%; object-fit: cover; }
.profile-preview__info { display: flex; flex-direction: column; gap: 4px; }
.profile-preview__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  margin: 0;
}
.profile-preview__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.profile-block {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.profile-block h2 {
  font-size: 1.15rem;
  margin-bottom: var(--space-3);
}
.profile-block p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-4);
  font-size: 0.92rem;
}

.profile-name-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.profile-name-input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--bg-3);
}
.profile-name-input::placeholder { color: var(--text-dim); }

.character-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}
.character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.character-card:hover { border-color: var(--border-hover); }
.character-card.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.character-card__img {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-3);
}
.character-card__name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.custom-image-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.profile-status {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.profile-status[data-kind="success"] { border-color: var(--success); color: var(--text); }
.profile-status[data-kind="error"] { border-color: var(--error); color: var(--text); }

.profile-note {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-top: var(--space-5);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* -------------------------------------------------------------------------
   16. SOCIAL ICONS (Support, Creator)
   ------------------------------------------------------------------------- */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}
.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.social-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-3);
}
.social-link__icon {
  display: inline-flex;
  width: 24px; height: 24px;
  color: var(--accent);
  flex: 0 0 auto;
}
.social-link__icon svg { width: 100%; height: 100%; }
.social-link__label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.social-placeholder-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
}

/* -------------------------------------------------------------------------
   17. ABOUT / CREATOR / LEGAL PAGES
   ------------------------------------------------------------------------- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}
.prose h2 {
  font-size: 1.4rem;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 1.1rem;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  color: var(--text);
}
.prose p { margin-bottom: var(--space-4); }
.prose ul { margin: 0 0 var(--space-4) var(--space-5); padding-left: var(--space-3); }
.prose ul li { margin-bottom: var(--space-2); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-hover); }

.notice {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: var(--space-5) 0;
}
.notice p:last-child { margin-bottom: 0; }

.creator-hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-7);
}
@media (max-width: 600px) {
  .creator-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
.creator-avatar {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4rem;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}
.creator-name {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 var(--space-2);
}
.creator-role {
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.project-card.has-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-2);
}
.project-card__role {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.project-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
}
.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}
.project-card__cta {
  margin-top: auto;
  padding-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.project-card.is-link a { color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------------------
   18. 404 PAGE
   ------------------------------------------------------------------------- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-9) var(--space-5);
}
.not-found__code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0;
}
.not-found__code .accent { color: var(--accent); }
.not-found__title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin: var(--space-3) 0 var(--space-3);
}
.not-found__text {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 460px;
}

/* -------------------------------------------------------------------------
   19. FOOTER
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-10);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-7);
}
@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.footer-logo {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  flex: 0 0 auto;
}
.footer-brand-text { display: flex; flex-direction: column; }
.footer-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.footer-brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-credit {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.footer-credit a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
}
.footer-credit a:hover { color: var(--accent); border-color: var(--accent-line); }

.footer-heading {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: var(--space-2); }
.footer-link { font-size: 0.88rem; color: var(--text-secondary); }
.footer-link:hover { color: var(--text); }
.footer-copy {
  margin-top: var(--space-5);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   20. ACCESSIBILITY HELPERS
   ------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  padding: 10px 14px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
}
.skip-link:focus {
  top: var(--space-3);
  color: var(--text);
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   21. RESPONSIVE HEADER OVERRIDES
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root { --header-h: 56px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 0.85rem; }
  .menu-toggle { width: 36px; height: 36px; }
}

/* -------------------------------------------------------------------------
   22. UTILITIES
   ------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
