/* =========================================================
   Demax — design system
   ========================================================= */

:root {
  /* surfaces */
  --bg: #ffffff;
  --surface: #f5f5f3;
  --surface-2: #ecece8;
  --header: #0c0c0d;
  --header-text: #ffffff;
  --header-dim: #a2a5a9;
  --header-line: rgba(255, 255, 255, 0.13);

  /* text */
  --text: #111214;
  --text-secondary: #5f6368;
  --text-muted: #8c9096;

  /* lines */
  --border: #e3e3df;
  --border-strong: #c8c8c2;

  /* accent — brand mark, focus, stock warnings. Nothing else. */
  --accent: #d92b16;
  --accent-dark: #b52111;
  --in-stock: #1a7f37;

  /* spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* radius — deliberately small */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.3125rem;
  --fs-xl: 1.6875rem;

  --shadow-pop: 0 8px 28px rgba(12, 12, 13, 0.14);
  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);
  --wrap: 1260px;
}

/* =========================================================
   Base
   ========================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -48px;
  z-index: 200;
  background: #fff;
  color: var(--text);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: var(--sp-2); }

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header);
  color: var(--header-text);
}

.header-utility {
  border-bottom: 1px solid var(--header-line);
  color: var(--header-dim);
  font-size: var(--fs-xs);
}
.header-utility .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: 32px;
}
.header-utility ul { display: flex; gap: var(--sp-5); }
.header-utility .utility-secondary { margin-left: auto; }

.header-main {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
  translate: 0 -4px;
}

.main-nav ul { display: flex; gap: var(--sp-5); }
.main-nav a {
  display: block;
  padding: 6px 0;
  font-size: 0.875rem;
  color: #c7c9cc;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.main-nav a:hover { color: #fff; }
.main-nav a[aria-current='page'],
.main-nav a.is-active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.search {
  position: relative;
  width: 260px;
}
.search-field { position: relative; display: flex; align-items: center; }
.search-field svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: #9a9da1;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-3) 0 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 0.875rem;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.search-input::placeholder { color: #8e9195; }
.search-input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  z-index: 90;
}
.search-results:empty { display: none; }
.search-result {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover,
.search-result:focus-visible { background: var(--surface); }
.search-result-thumb {
  aspect-ratio: 3 / 4;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
}
.search-result-title {
  font-size: var(--fs-sm);
  font-weight: 550;
  line-height: 1.3;
}
.search-result-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.search-result-price { font-size: var(--fs-sm); font-weight: 650; }
.search-empty {
  padding: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: #d6d8da;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tool-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.tool-btn svg { width: 18px; height: 18px; }
.tool-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.tool-count[hidden] { display: none; }

/* =========================================================
   Buttons, prices, badges
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-outline {
  background: #fff;
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--text); }
.btn-outline[aria-pressed='true'] {
  border-color: var(--text);
  background: var(--surface);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-sm {
  height: 34px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.price {
  font-size: var(--fs-base);
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Sections
   ========================================================= */

.section { padding: var(--sp-7) 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-note {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* =========================================================
   Hero / spotlight
   ========================================================= */

.hero {
  padding: var(--sp-6) 0 var(--sp-7);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: end;
}
.hero-art {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.hero-art svg,
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

.hero-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}
.hero-title {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.hero-meta {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.hero-desc {
  margin-top: var(--sp-4);
  max-width: 44ch;
  color: var(--text-secondary);
  line-height: 1.6;
}
.hero-buy {
  margin-top: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.hero-buy .price { font-size: var(--fs-md); }

/* =========================================================
   Catalogue grid
   ========================================================= */

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-6) var(--sp-5);
}
.game-grid.is-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.game { min-width: 0; }
.game-media { position: relative; }
.game-cover {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.game-cover svg,
.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s var(--ease);
}
.game:hover .game-cover svg,
.game:hover .game-cover img { transform: scale(1.035); }

.game-quick {
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: var(--sp-2);
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(12, 12, 13, 0.92);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  translate: 0 4px;
  transition: opacity 0.18s var(--ease), translate 0.18s var(--ease), background 0.15s var(--ease);
}
.game-quick:hover { background: #000; }
.game-media:hover .game-quick,
.game-quick:focus-visible { opacity: 1; translate: 0 0; }
@media (hover: none) {
  .game-quick { display: none; }
}

.game-name {
  display: block;
  margin-top: var(--sp-3);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.game:hover .game-name { text-decoration: underline; text-underline-offset: 2px; }
.game-platform {
  margin-top: 3px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.game .price-row { margin-top: var(--sp-2); }

/* value shelf — a list rather than another grid */
.deal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--sp-7);
}
.deal {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}
.deal-thumb {
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.deal-thumb svg { width: 100%; height: 100%; transition: transform 0.25s var(--ease); }
.deal:hover .deal-thumb svg { transform: scale(1.06); }
.deal-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}
.deal:hover .deal-name { text-decoration: underline; text-underline-offset: 2px; }
.deal-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.deal-price { text-align: right; }
.deal-price .price-row { justify-content: flex-end; }

/* new releases — wide key art */
.release-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
}
.release-art {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.release-art svg { width: 100%; height: 100%; transition: transform 0.25s var(--ease); }
.release:hover .release-art svg { transform: scale(1.03); }
.release-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}
.release-name { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.01em; }
.release:hover .release-name { text-decoration: underline; text-underline-offset: 2px; }
.release-date { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* =========================================================
   Catalogue toolbar
   ========================================================= */

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.filters {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 var(--sp-3);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed='true'] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  flex: 0 0 auto;
}
.sort select {
  height: 32px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: var(--fs-sm);
  color: var(--text);
}

.notice {
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* =========================================================
   Product page
   ========================================================= */

.breadcrumb {
  padding: var(--sp-4) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
  padding-bottom: var(--sp-7);
}

.shot-main {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.shot-main svg,
.shot-main img { width: 100%; height: 100%; object-fit: cover; }
.shot-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.shot-thumb {
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.shot-thumb svg { width: 100%; height: 100%; }
.shot-thumb:hover { border-color: var(--border-strong); }
.shot-thumb[aria-current='true'] { border-color: var(--text); }

.buy {
  position: sticky;
  top: 106px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.buy-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.buy-platform {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.buy-price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-1);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.buy-price .price { font-size: 1.5rem; font-weight: 700; }
.buy-vat { font-size: var(--fs-sm); color: var(--text-muted); }
.stock {
  font-size: var(--fs-sm);
  color: var(--in-stock);
  margin-bottom: var(--sp-4);
}
.stock.is-out { color: var(--accent); }
.buy-actions { display: grid; gap: var(--sp-2); }
.buy-facts {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.product-detail { padding: var(--sp-7) 0; border-top: 1px solid var(--border); }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}
.about p {
  max-width: 68ch;
  color: var(--text-secondary);
  line-height: 1.7;
}
.about p + p { margin-top: var(--sp-4); }

.specs { font-size: var(--fs-sm); }
.spec-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}
.spec-row dt { color: var(--text-muted); }
.spec-row dd { color: var(--text); }

.requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5) var(--sp-7);
}
.req-col h3 {
  font-size: var(--fs-base);
  font-weight: 650;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--text);
}
.req-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.req-row dt { color: var(--text-muted); }

.error-state {
  padding: var(--sp-8) 0;
  max-width: 52ch;
}
.error-state h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.error-state p {
  margin: var(--sp-3) 0 var(--sp-5);
  color: var(--text-secondary);
}

/* =========================================================
   Cart / wishlist drawer
   ========================================================= */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 13, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
  z-index: 70;
}
.scrim[data-open='true'] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  translate: 100% 0;
  transition: translate 0.24s var(--ease);
}
.drawer[data-open='true'] { translate: 0 0; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.02em; }
.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.drawer-close:hover { border-color: var(--text); }
.drawer-close svg { width: 15px; height: 15px; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-5);
}
.drawer-empty {
  padding: var(--sp-6) 0;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}

.line-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.line-thumb {
  aspect-ratio: 3 / 4;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
}
.line-title { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.line-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }
.line-side { text-align: right; display: grid; gap: var(--sp-2); justify-items: end; }
.line-price { font-size: var(--fs-sm); font-weight: 650; }
.line-remove {
  background: none;
  border: 0;
  padding: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}
.line-remove:hover { color: var(--accent); }

.drawer-foot {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--border);
}
.drawer-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.drawer-total strong { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.drawer-note {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* =========================================================
   Sign-in dialog
   ========================================================= */

.auth {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(12, 12, 13, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.auth[data-open='true'] { opacity: 1; pointer-events: auto; }

.auth-card {
  width: min(380px, 100%);
  padding: var(--sp-5);
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  translate: 0 8px;
  transition: translate 0.2s var(--ease);
}
.auth[data-open='true'] .auth-card { translate: 0 0; }

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.auth-head h2 {
  font-size: var(--fs-md);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.auth-note {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.auth-google {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin: var(--sp-5) 0 var(--sp-4);
}
.auth-fallback {
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.auth-legal {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.6;
}
.auth-legal a { text-decoration: underline; text-underline-offset: 2px; }

.account-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0 var(--sp-4);
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: var(--surface-2) center / cover no-repeat;
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text-secondary);
}
.account-name { display: block; font-size: var(--fs-base); font-weight: 600; }
.account-mail { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
#auth-account .btn { margin-top: var(--sp-4); }

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  z-index: 100;
  translate: -50% 12px;
  padding: 10px var(--sp-4);
  background: var(--header);
  color: #fff;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), translate 0.18s var(--ease);
}
.toast[data-open='true'] { opacity: 1; translate: -50% 0; }

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  margin-top: var(--sp-7);
  background: var(--header);
  color: var(--header-dim);
  font-size: var(--fs-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--sp-6);
  padding: var(--sp-7) 0 var(--sp-6);
}
.footer-grid .brand { color: #fff; margin-bottom: var(--sp-3); }
.footer-about { max-width: 38ch; line-height: 1.6; }
.footer-legal {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: #8b8e92;
}
.footer-col h2 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--sp-3);
}
.footer-col li + li { margin-top: 7px; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--header-line);
  font-size: var(--fs-xs);
}

/* =========================================================
   One orchestrated entrance, on the spotlight only
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {
  [data-enter] {
    opacity: 0;
    animation: enter 0.5s var(--ease) forwards;
  }
  [data-enter='1'] { animation-delay: 0.04s; }
  [data-enter='2'] { animation-delay: 0.12s; }
  @keyframes enter {
    from { opacity: 0; translate: 0 10px; }
    to { opacity: 1; translate: 0 0; }
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .game-grid.is-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search { width: 210px; }
}

@media (max-width: 980px) {
  .legal { grid-template-columns: 1fr; gap: var(--sp-5); }
  .legal-nav { position: static; }
  .legal-nav ul { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
  .legal-nav li + li { margin-top: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero-desc { max-width: 60ch; }
  .product,
  .detail-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .buy { position: static; }
  .game-grid,
  .game-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .release-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-list { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: var(--sp-4); }
  .header-main {
    flex-wrap: wrap;
    gap: var(--sp-3) var(--sp-4);
    padding-block: var(--sp-2);
  }
  .header-tools { gap: 0; }
  .tool-btn span.tool-label { display: none; }
  .main-nav { order: 3; width: 100%; }
  .main-nav ul { gap: var(--sp-5); overflow-x: auto; scrollbar-width: none; }
  .search {
    order: 4;
    width: 100%;
    margin-bottom: var(--sp-2);
  }
  .header-utility .utility-secondary { display: none; }
  .section { padding: var(--sp-6) 0; }
  .requirements { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 110px minmax(0, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .sort { margin-left: 0; }
}

@media (max-width: 600px) {
  .game-grid,
  .game-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); }
  .release-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero { padding-top: var(--sp-5); }
}

/* =========================================================
   Legal pages
   ========================================================= */

.page-head {
  padding: var(--sp-7) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.page-lead {
  margin-top: var(--sp-3);
  max-width: 60ch;
  color: var(--text-secondary);
}

.legal {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
  padding: var(--sp-7) 0;
}
.legal-nav {
  position: sticky;
  top: 106px;
  font-size: var(--fs-sm);
}
.legal-nav li + li { margin-top: var(--sp-2); }
.legal-nav a { color: var(--text-secondary); }
.legal-nav a:hover { color: var(--text); text-decoration: underline; }

.legal-body { max-width: 70ch; }
.legal-body section + section {
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}
.legal-body h2 {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.legal-body h3 {
  margin-top: var(--sp-5);
  font-size: var(--fs-base);
  font-weight: 650;
}
.legal-body p,
.legal-body li {
  color: var(--text-secondary);
  line-height: 1.7;
}
.legal-body p { margin-top: var(--sp-3); }
.legal-body ul {
  margin-top: var(--sp-3);
  padding-left: var(--sp-5);
  list-style: disc;
}
.legal-body li { margin-top: var(--sp-2); }
.legal-body a { text-decoration: underline; text-underline-offset: 2px; }
.legal-facts { margin-top: var(--sp-4); font-size: var(--fs-sm); }
.legal-facts .spec-row { grid-template-columns: 170px minmax(0, 1fr); }
.legal-updated {
  margin-top: var(--sp-6);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* =========================================================
   Small utilities used by rendered markup
   ========================================================= */

.about-lead { margin-top: var(--sp-4); }
.detail-title { margin-bottom: var(--sp-5); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.notice code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
