:root {
  /* Steam-inspired palette */
  --bg: #1b2838;
  --bg-deep: #171a21;
  --bg-elevated: #1e2329;
  --bg-card: #2a475e;
  --bg-card-hover: #3d5a73;
  --border: rgba(102, 192, 244, 0.12);
  --border-strong: rgba(102, 192, 244, 0.4);
  --text: #c7d5e0;
  --text-bright: #ffffff;
  --text-muted: #8f98a0;
  --accent: #66c0f4;
  --accent-soft: rgba(102, 192, 244, 0.14);
  --accent-2: #a4d007;
  --warn: #c4a35a;
  --radius: 3px;
  --radius-sm: 2px;
  --shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  --font: "Motiva Sans", Arial, Helvetica, sans-serif;
  --max: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-deep);
  background-image: radial-gradient(
      ellipse 90% 55% at 50% -15%,
      rgba(35, 65, 100, 0.55),
      transparent 55%
    ),
    linear-gradient(180deg, #1b2838 0%, #171a21 40%, #0e141b 100%);
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 20% 0%, rgba(27, 40, 56, 0.9), transparent 50%),
    radial-gradient(ellipse 50% 35% at 85% 10%, rgba(42, 71, 94, 0.35), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(23, 26, 33, 0.8), transparent 50%);
  z-index: -1;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(23, 26, 33, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 8px rgba(102, 192, 244, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-steam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  color: #fff !important;
  text-decoration: none !important;
  background: linear-gradient(145deg, #1b2838, #171a21);
  border: 1px solid rgba(102, 192, 244, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
}

.btn-steam:hover {
  border-color: var(--accent);
  background: linear-gradient(145deg, #2a475e, #1b2838);
}

.header-nav a {
  color: #b8b6b4;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.header-nav a:hover {
  color: #fff;
  text-decoration: none;
}

.header-nav a.header-howto {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(102, 192, 244, 0.45);
  border-radius: 2px;
  color: #fff;
  background: rgba(102, 192, 244, 0.12);
  white-space: nowrap;
}

.header-nav a.header-howto:hover,
.header-nav a.header-howto.is-active,
.header-nav a.header-howto[aria-current="page"] {
  border-color: var(--accent);
  background: rgba(102, 192, 244, 0.22);
  color: #fff;
}

/* Hero */
.hero {
  padding: 3.25rem 0 1.5rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 0.85rem;
  max-width: 18ch;
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text-bright);
  text-shadow: 0 0 20px rgba(102, 192, 244, 0.12);
}

.lede {
  margin: 0;
  max-width: 62ch;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.hero-blog-link {
  margin: 1rem 0 0;
  max-width: 62ch;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-blog-link a {
  color: var(--accent);
  font-weight: 600;
}


.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 200px));
  gap: 0.75rem;
  margin-top: 2rem;
}

.stat {
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(42, 71, 94, 0.45) 0%, rgba(27, 40, 56, 0.85) 100%);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text-bright);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Tooltip help marks */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(102, 192, 244, 0.45);
  background: rgba(102, 192, 244, 0.12);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
}

.help-tip:hover,
.help-tip:focus-visible {
  background: rgba(102, 192, 244, 0.28);
  outline: none;
}

.help-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  /* Below the mark so sticky header / toolbar don't cover it */
  top: calc(100% + 8px);
  bottom: auto;
  transform: translateX(-50%);
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 3px;
  background: #171a21;
  border: 1px solid rgba(102, 192, 244, 0.35);
  color: #c7d5e0;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 120;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
}

.term-with-tip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.term-with-tip .term-label {
  color: inherit;
  font-weight: 700;
}

.term-with-tip .help-tip {
  position: relative;
  top: -1px;
  vertical-align: middle;
}

/* Toolbar */
.toolbar-section {
  position: sticky;
  top: 68px;
  z-index: 40;
  padding: 0.75rem 0 0.5rem;
  background: linear-gradient(
    to bottom,
    rgba(23, 26, 33, 0.97),
    rgba(27, 40, 56, 0.94)
  );
  border-bottom: 1px solid transparent;
}

.toolbar-section.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-field {
  position: relative;
  flex: 1 1 280px;
  min-width: min(100%, 240px);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 40px;
  padding: 0 1rem 0 2.6rem;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  background: #316282;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search-field input::placeholder {
  color: rgba(199, 213, 224, 0.55);
}

.search-field input:focus {
  border-color: #66c0f4;
  background: #3d6d8f;
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.35);
}

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.85rem;
  padding-bottom: 0.35rem;
}

.letter-nav a {
  min-width: 1.85rem;
  height: 1.85rem;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.letter-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--border);
}

.letter-nav a.is-empty {
  opacity: 0.28;
  pointer-events: none;
}

/* Game list */
.games-section {
  padding: 1.25rem 0 3.5rem;
}

.status-message {
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.loading {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.letter-group {
  margin-bottom: 2rem;
  scroll-margin-top: 170px;
}

.letter-heading {
  position: sticky;
  top: 168px;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.4rem 0;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-bright);
  text-transform: uppercase;
  background: linear-gradient(
    to bottom,
    rgba(23, 26, 33, 0.98),
    rgba(27, 40, 56, 0.92) 70%,
    transparent
  );
}

.letter-heading span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(42, 71, 94, 0.55) 0%,
    rgba(27, 40, 56, 0.95) 55%,
    rgba(23, 26, 33, 0.98) 100%
  );
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: rgba(102, 192, 244, 0.35);
  box-shadow: 0 0 12px rgba(102, 192, 244, 0.12);
  transform: translateY(-1px);
}

.popular-group .letter-heading {
  color: var(--accent);
}

.game-card-main {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.85rem;
  align-items: start;
  color: inherit;
  text-decoration: none;
}

.game-card-main:hover {
  text-decoration: none;
}

.game-name-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.game-name-row .game-name {
  flex: 1;
  min-width: 0;
}

.game-name-row .game-desc-tip {
  flex-shrink: 0;
  margin-top: 2px;
}


.game-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #0a1017;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.game-icon-fallback {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.game-body {
  min-width: 0;
}

.game-name {
  margin: 0 0 0.2rem;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-bright);
  overflow-wrap: anywhere;
  cursor: help;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.game-name:hover,
.game-name:focus-visible {
  color: #fff;
  border-bottom-color: rgba(102, 192, 244, 0.45);
  outline: none;
}

/* Floating store blurb on name / ? hover (~25% larger for readability) */
.game-desc-tooltip {
  position: fixed;
  z-index: 200;
  max-width: min(400px, calc(100vw - 24px));
  padding: 12px 15px;
  border-radius: 3px;
  background: #171a21;
  border: 1px solid rgba(102, 192, 244, 0.35);
  color: #c7d5e0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.65rem;
}

.appid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.game-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 25, 0.45);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.game-links a:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-soft);
  text-decoration: none;
}

/* About + footer */
.about-section {
  padding-bottom: 3rem;
}

.about-card {
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 28, 39, 0.7);
}

.about-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
}

.about-card p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  max-width: 70ch;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--text-muted) !important;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding-top: 2.25rem;
  }

  .hero h1 {
    max-width: none;
  }

  .toolbar-section {
    top: 64px;
  }

  .letter-heading {
    top: 210px;
  }

  .letter-group {
    scroll-margin-top: 210px;
  }

  .header-nav {
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-nav a.header-howto {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}

@media (max-width: 420px) {
  .game-card-main {
    grid-template-columns: 48px 1fr;
  }

  .game-icon,
  .game-icon-fallback {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }
}

/* —— Game page / Multisell builder —— */
.game-page {
  padding: 2rem 0 3.5rem;
}

.inventory-panel {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.35rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 28, 39, 0.72);
}

.profile-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.profile-field {
  flex: 1 1 280px;
  min-width: min(100%, 240px);
}

.profile-field input {
  width: 100%;
  height: 40px;
  padding: 0 1rem;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  background: #316282;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.profile-field input:focus {
  border-color: #66c0f4;
  background: #3d6d8f;
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.35);
}

/* Guide pages */
.guide-page {
  padding: 2.5rem 0 3.5rem;
}

.guide-content {
  max-width: 720px;
  padding: 1.5rem 1.6rem 2rem;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(42, 71, 94, 0.35),
    rgba(27, 40, 56, 0.9)
  );
  box-shadow: var(--shadow);
}

.guide-content h1 {
  margin: 0 0 0.75rem;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-bright);
}

.guide-content h2 {
  margin: 1.5rem 0 0.55rem;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guide-content p,
.guide-content li {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.guide-steps {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.guide-steps li {
  margin-bottom: 0.45rem;
}

.guide-back {
  margin-top: 1.75rem;
}

.guide-note {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: rgba(102, 192, 244, 0.1);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.about-card {
  background: linear-gradient(
    180deg,
    rgba(42, 71, 94, 0.4),
    rgba(27, 40, 56, 0.9)
  ) !important;
}

.about-card h2 {
  color: var(--text-bright);
  font-weight: 400;
  font-size: 20px;
}

.panel-title {
  color: var(--text-bright);
  font-weight: 400;
  font-size: 16px;
}

.inventory-panel,
.builder-panel {
  border-color: rgba(0, 0, 0, 0.4) !important;
  background: linear-gradient(
    180deg,
    rgba(42, 71, 94, 0.35),
    rgba(27, 40, 56, 0.92)
  ) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
}

.btn-primary,
.btn-secondary,
.btn-steam,
.btn-link {
  border-radius: 2px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 12px !important;
}

.profile-meta {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-meta a {
  color: var(--accent);
}

.inventory-actions {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.owned-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0 0.65rem;
}

.owned-count-label {
  font-size: 12px;
}

/* Subtle gold “Select all” */
.btn-select-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(200, 160, 60, 0.45);
  border-radius: 2px;
  background: rgba(240, 193, 75, 0.12);
  color: #e6c86a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-select-all:hover:not(:disabled) {
  background: rgba(240, 193, 75, 0.2);
  border-color: rgba(230, 200, 106, 0.65);
  color: #f0d78a;
}

.btn-select-all:disabled {
  opacity: 0.45;
  cursor: default;
}

.owned-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
  max-height: 360px;
  overflow: auto;
  margin-top: 0.25rem;
  padding: 0.25rem;
}

.owned-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(22, 34, 49, 0.9);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.owned-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.owned-item.is-selected {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.owned-text {
  min-width: 0;
}

.owned-count {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.owned-check {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.inventory-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem !important;
}

.inventory-cta p {
  margin: 0;
  max-width: 36ch;
}

.game-hero {
  margin-bottom: 1.5rem;
}

.game-hero-loading {
  color: var(--text-muted);
  padding: 1rem 0;
}

.game-hero-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 28, 39, 0.75);
}

.game-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.game-hero-icon-fallback {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  font-size: 1.4rem;
}

.game-hero-body h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.game-hero-links {
  margin-top: 0.75rem;
}

.builder-panel {
  padding: 1.25rem 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 28, 39, 0.72);
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.panel-help {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.panel-note {
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.selected-header .panel-title {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.panel-title a {
  font-weight: 600;
}

.item-search-wrap {
  position: relative;
}

.item-search-field {
  width: 100%;
}

.item-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #101a25;
  box-shadow: var(--shadow);
}

.suggest-item {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover,
.suggest-item.is-active {
  background: var(--accent-soft);
}

.suggest-item.is-selected {
  opacity: 0.55;
}

.suggest-icon img,
.selected-icon img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #0a1017;
  border: 1px solid var(--border);
}

.selected-icon img {
  width: 40px;
  height: 40px;
}

.suggest-icon-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.suggest-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

.suggest-price {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-status {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.selected-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 120px;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(11, 18, 25, 0.35);
}

.empty-selected {
  padding: 1.5rem 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.selected-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(22, 34, 49, 0.9);
}

.selected-name {
  font-size: 0.9rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.btn-remove:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.btn-primary,
.btn-secondary,
.btn-steam,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.btn-primary {
  background: linear-gradient(90deg, #06bfff 0%, #2d73ff 100%);
  color: #fff;
  border-color: transparent;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary,
.btn-link {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-steam {
  background: linear-gradient(90deg, #a4d007 0%, #6a9a04 100%);
  color: #1b2838;
  border-color: transparent;
}

.btn-steam:hover:not(.is-disabled) {
  filter: brightness(1.05);
  text-decoration: none;
  color: #1b2838;
}

.btn-secondary:hover:not(:disabled),
.btn-link:hover:not(.is-disabled) {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  text-decoration: none;
  color: var(--text);
}

.btn-secondary:disabled,
.btn-link.is-disabled,
.btn-steam.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-text {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  text-decoration: underline;
}

.url-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.url-output {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0a1017;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
}

.url-output:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 860px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .game-page {
    padding: 1.25rem 0 2.5rem;
  }

  .inventory-panel,
  .builder-panel {
    padding: 1rem 1rem 1.15rem;
  }

  .profile-form {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-field {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .profile-form .btn-primary {
    width: 100%;
  }

  .selected-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .owned-list {
    grid-template-columns: 1fr;
    max-height: min(50vh, 320px);
  }

  .url-actions {
    flex-wrap: wrap;
  }

  .url-actions .btn-primary,
  .url-actions .btn-secondary,
  .url-actions .btn-steam,
  .url-actions .btn-link {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1.25rem, var(--max));
  }

  .header-inner {
    min-height: 60px;
    gap: 0.5rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text span {
    display: none;
  }

  .header-nav {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-nav a {
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .game-hero-card {
    grid-template-columns: 56px 1fr;
    gap: 0.85rem;
    padding: 1rem;
  }

  .game-hero-icon,
  .game-hero-icon-fallback {
    width: 56px;
    height: 56px;
  }

  .game-hero-body h1 {
    font-size: 1.25rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .help-tip::after {
    left: auto;
    right: 0;
    transform: none;
    width: min(240px, calc(100vw - 32px));
  }

  /* Prevent iOS zoom-on-focus */
  .profile-field input,
  .search-field input,
  .item-search-field input,
  input[type="search"],
  input[type="text"],
  textarea {
    font-size: 16px !important;
  }

  .panel-title {
    font-size: 15px;
  }

  .owned-item {
    grid-template-columns: 36px 1fr auto;
    gap: 0.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-hero {
    gap: 0.75rem;
  }

  .blog-hero-icon {
    width: 56px;
    height: 56px;
  }
}

/* Global mobile safety */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* Don't use bare `img { height: auto }` — it breaks fixed blog/game icons (wide capsules) */
img,
svg,
video {
  max-width: 100%;
}

.item-suggestions {
  max-width: 100%;
}

@media (max-width: 720px) {
  .letter-heading {
    top: 180px;
  }

  .letter-group {
    scroll-margin-top: 180px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-field {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* —— Blog (same visual system as home) —— */
.blog-main {
  padding: 2.5rem 0 3.5rem;
}
/* Centered reading column without flex side-effects */
.blog-main > .container {
  max-width: 44rem;
}
.blog-article,
.blog-index {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}
.blog-article h1 {
  margin: 0 0 1rem;
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-bright);
}
.blog-article h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-article h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 15px;
  color: var(--text-bright);
}
.blog-article p {
  margin: 0.75rem 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.blog-article ol,
.blog-article ul {
  margin: 0.75rem 0;
  padding-left: 1.35rem;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
.blog-article li {
  margin: 0.4rem 0;
}
.blog-article a {
  color: var(--accent);
}
.blog-article code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text-bright);
}
.blog-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 14px;
}
.blog-article th,
.blog-article td {
  border: 1px solid rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0.65rem;
  text-align: left;
}
.blog-article th {
  background: rgba(42, 71, 94, 0.55);
  color: var(--text-bright);
}
.blog-cta {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: linear-gradient(
    180deg,
    rgba(42, 71, 94, 0.55) 0%,
    rgba(27, 40, 56, 0.9) 100%
  );
  box-shadow: var(--shadow);
}
.blog-cta p {
  margin: 0;
  font-size: 15px;
  color: var(--text-bright);
}
.blog-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b8b6b4;
}
.blog-back:hover {
  color: #fff;
  text-decoration: none;
}
.blog-index .eyebrow {
  margin-bottom: 0.5rem;
}
.blog-index h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 400;
  color: var(--text-bright);
}
.blog-index .lede {
  margin-bottom: 1.5rem;
}
.blog-group {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(42, 71, 94, 0.35) 0%,
    rgba(27, 40, 56, 0.75) 100%
  );
}
.blog-group-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.blog-group > h2,
.blog-group-head h2 {
  margin: 0 0 0.75rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.blog-group-head h2 {
  margin: 0;
}
.blog-hero--text {
  display: block;
  margin-bottom: 1.25rem;
}
.blog-hero--text h1 {
  margin: 0 0 0.4rem;
}
.blog-group-icon {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border);
  background: #0a1017;
  flex-shrink: 0;
  display: block;
}
.blog-group-icon--fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}
.blog-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.blog-group li {
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}
.blog-group li:first-child {
  border-top: 0;
}
.blog-list-link {
  display: block;
  padding: 0.65rem 0.1rem;
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.35;
}
.blog-list-link:hover {
  color: var(--accent);
  text-decoration: none;
}
.blog-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0 0 1.25rem;
}
.blog-hero h1 {
  margin: 0 0 0.4rem;
}
.blog-hero-icon {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border-strong);
  background: #0a1017;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  display: block;
}
.blog-hero-icon--fallback {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}
.blog-hero-text {
  min-width: 0;
}
.blog-game-chip {
  margin: 0;
}
.blog-game-chip a {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}
.blog-game-chip a:hover {
  text-decoration: underline;
}
.header-nav a.is-active {
  color: #fff;
}
