/* Shared single-row header; the catalog opens from the primary actions. */
.site-header {
  --header-height: 96px;
  position: relative;
  z-index: 20;
  height: var(--header-height);
  color: #f5f7f8;
  background: #17262f;
  border: 0;
  box-shadow: 0 4px 20px rgba(15, 30, 40, .12);
}
.site-header + main { min-height: calc(100vh - 96px); }
.site-header .header-inner {
  position: relative;
  z-index: 3;
  display: grid;
  /* Match the desktop content grid: search above the main column. */
  grid-template-columns: minmax(0, 1fr) 472px;
  align-items: center;
  width: calc(100% - 80px);
  max-width: var(--page);
  height: var(--header-height);
  margin-inline: auto;
  gap: 34px;
  white-space: nowrap;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  flex: none;
  gap: 12px;
  padding-right: 22px;
  border-right: 1px solid #d6e0e5;
  min-width: 0;
  color: #203642;
  font-size: inherit;
  letter-spacing: 0;
}
.site-header a.brand:hover { color: #36576a; }
.site-header .brand > svg { width: 42px; height: 42px; flex: none; }
.site-header .brand-lockup { display: grid; gap: 5px; line-height: 1; }
.site-header .brand-lockup strong { font-size: 26px; font-weight: 800; letter-spacing: -.045em; }
.site-header .brand-domain { color: #718895; font-size: .64em; font-weight: 550; letter-spacing: -.025em; }
.site-header .brand-lockup small { color: #687f8d; font-size: 10px; font-weight: 450; letter-spacing: .015em; }
.site-header .search {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 62px;
  margin: 0;
  padding: 8px 8px 8px 18px;
  border: 1px solid #d9e1e6;
  border-radius: var(--radius-control);
  background: #f0f4f6;
  color: #273c4b;
  overflow: visible;
  transition: border-color .18s, box-shadow .18s;
}
.site-header .search:hover { background: #fff; border-color: #fff; }
.site-header .search:focus-within { background: #fff; border-color: #b6d687; box-shadow: 0 0 0 3px #b6d68726; }
.site-header .search-field { position: relative; display: flex; align-items: center; flex: 1; gap: 13px; min-width: 0; height: 44px; }
.site-header .search-field > .icon { width: 21px; height: 21px; flex: none; color: #657f8e; }
.site-header .search input { flex: 1; width: 100%; min-width: 0; padding: 0; font-size: 14px; color: #1b303e; opacity: 1; pointer-events: auto; }
.site-header .search input:focus-visible { outline: 0; box-shadow: none; }
.site-header .search input::placeholder { color: #758994; }
.site-header .search kbd { flex: none; padding: 4px 5px; border: 1px solid #d7e0e6; border-radius:var(--radius-detail); color: #8496a1; font: 11px "Onest", sans-serif; }
.site-header .search:focus-within kbd { visibility: hidden; }

.site-header .header-actions { display: flex; align-items: center; justify-self: start; gap: 24px; margin: 0; }
.site-header :is(a,button):focus-visible { outline: 2px solid #b8db82; outline-offset: 4px; }
.site-header .catalog-toggle { position: relative; display: inline-flex; align-items: center; justify-content: flex-start; flex: none; gap: 10px; width: auto; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #e0e9ee; font-size: 13px; font-weight: 550; transition: color .15s; }
.site-header .catalog-toggle > span { white-space: nowrap; }
.site-header .catalog-toggle .icon { width: 17px; height: 17px; color: #8faab9; }
.site-header .catalog-toggle .catalog-chevron { margin-left: 3px; width: 14px; height: 14px; transition: transform .18s, color .15s; }
.site-header .catalog-toggle[aria-expanded="true"] .catalog-chevron { transform: rotate(180deg); }
.site-header button.catalog-toggle:hover,
.site-header .catalog-toggle[aria-expanded="true"] { background: transparent; color: #fff; }
.site-header .catalog-toggle:hover > .icon,
.site-header .catalog-toggle[aria-expanded="true"] > .icon { color: #c4dfa1; }
.site-header .catalog-toggle::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #b9da80; transform: scaleX(0); transform-origin: left; transition: transform .18s; }
.site-header .catalog-toggle[aria-expanded="true"]::after { transform: scaleX(1); }
.site-header .header-ranking { display: inline-flex; align-items: center; flex: none; gap: 10px; min-height: 44px; padding-left: 24px; border-left: 1px solid #ffffff14; color: #d9e5ec; white-space: nowrap; }
.header-ranking-icon { display: grid; place-items: center; width: 28px; height: 38px; }
.site-header .header-ranking .header-ranking-icon > .icon { width: 23px; height: 23px; color: #dbbb87; }
.header-ranking strong { color: #f2e7d4; font-size: 14px; font-weight: 650; line-height: 1.2; }
.site-header .header-ranking:hover strong,
.site-header .header-ranking[aria-current="page"] strong { color: #fff2cc; }
.site-header .header-ranking[aria-current="page"] .header-ranking-icon { background: #d6b77d18; border-radius: var(--radius-detail); }
.header-backdrop[hidden], .catalog-drawer[hidden] { display: none; }
.header-backdrop { position: fixed; z-index: 1; inset: var(--header-height) 0 0; background: rgba(12, 24, 32, .32); }
.catalog-drawer { position: absolute; z-index: 4; top: 100%; left: var(--catalog-left, max(40px, calc((100% - var(--page)) / 2))); right: var(--catalog-right, max(40px, calc((100% - var(--page)) / 2))); width: auto; overflow: auto; max-height: calc(100dvh - var(--header-height) - 16px); border: 1px solid #dbe3e8; border-radius: 0 0 var(--radius-surface) var(--radius-surface); background: #fff; box-shadow: 0 16px 32px #0c1a2926; color: #243a49; overscroll-behavior: contain; }
.catalog-drawer { container-type: inline-size; }
.catalog-drawer-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 24px; padding: 16px; }
.header-genre-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
.site-header .header-genre-grid a { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-control); color: #334e60; font-size: 13px; line-height: 1.35; white-space: normal; transition: background-color .15s, color .15s; }
.header-genre-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-detail); background: #f0f4f6; transition: background-color .15s; }
.header-genre-grid .icon { width: 18px; height: 18px; color: #728c9b; stroke-width: 1.6; }
.header-genre-grid small { margin-left: auto; padding-left: 4px; color: #7c91a0; font-size: 11px; font-variant-numeric: tabular-nums; }
.site-header .header-genre-grid .header-all-games { font-weight: 650; }
.header-all-games .header-genre-icon { background: #e7eef2; }
.header-all-games .icon { color: #405f70; }
.site-header .header-genre-grid a:hover { background: #edf3f6; color: #193c50; }
.site-header .header-genre-grid a:hover .header-genre-icon { background: #dfe9ee; }
.site-header .header-genre-grid a[aria-current="page"] { background: #edf3e6; color: #385428; }
.header-genre-grid a[aria-current="page"] .header-genre-icon { background: #dde9cf; }
.header-genre-grid a[aria-current="page"] .icon { color: #507338; }
.header-genre-grid a[aria-current="page"] small { color: #678056; }
.site-header .header-genre-grid a:focus-visible { outline: 2px solid #597c40; outline-offset: -2px; background: #edf3f6; }

.breadcrumbs a:hover {
  text-decoration: underline;
}

.site-shell-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 17px;
  border-radius:var(--radius-surface);
  background: #1c282f;
  box-shadow: 0 8px 28px rgba(9, 20, 27, .22);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.site-shell-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1320px) {
  .site-header .header-inner { grid-template-columns: minmax(0, 1fr) 424px; gap: 27px; }
}
@media (max-width: 1280px) {
  .site-header .header-actions { gap: 20px; }
  .site-header .header-ranking { padding-left: 20px; }
  .site-header .search kbd { display: none; }
}
@media (max-width: 1100px) {
  .site-header .header-inner { width: calc(100% - 48px); grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; }
}
@media (max-width: 1060px) {
  .site-header .brand { gap: 10px; padding-right: 18px; }
  .site-header .brand-lockup strong { font-size: 24px; }
  .site-header .brand > svg { width: 38px; height: 38px; }
  .site-header .search { gap: 18px; }
  .site-header .header-ranking { gap: 7px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .site-header .brand { padding-right: 12px; gap: 8px; }
  .site-header .brand > svg { width: 32px; height: 32px; }
  .site-header .brand-lockup strong { font-size: 21px; }
  .site-header .brand-lockup small { display: none; }
  .site-header .search { gap: 12px; padding-left: 10px; }
  .site-header .search-field { gap: 8px; }
  .site-header .search-field > .icon { display: none; }
  .site-header .search input { font-size: 16px; }
  .site-header .search input::placeholder { font-size: 13px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .site-header .header-inner { width: calc(100% - 40px); grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .site-header .header-actions { gap: 14px; }
  .site-header .header-ranking { padding-left: 14px; }
  .site-header .header-ranking strong { font-size: 13px; }
}
@media (max-width: 700px) {
  .site-header { --header-height: 126px; }
  .site-header + main { min-height: calc(100vh - 126px); }
  .site-header .header-inner { width: calc(100% - 32px); padding-block: 12px; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .site-header .brand { grid-row: 1; gap: 8px; padding: 0; margin: 0; border: 0; width: max-content; }
  .site-header .brand > svg { width: 30px; height: 30px; }
  .site-header .brand-lockup strong { font-size: 21px; }
  .site-header .brand-lockup small { display: none; }
  .site-header .header-actions { position: absolute; z-index: 1; top: 19px; right: 10px; gap: 12px; margin: 0; }
  .site-header .catalog-toggle { gap: 4px; height: 38px; font-size: 12px; color: #375464; }
  .site-header .catalog-toggle > .icon:first-child,
  .site-header .catalog-label-suffix { display: none; }
  .site-header .catalog-toggle .catalog-chevron { width: 12px; height: 12px; margin: 0; color: #718895; }
  .site-header button.catalog-toggle:hover,
  .site-header .catalog-toggle[aria-expanded="true"] { color: #193b50; }
  .site-header .catalog-toggle:hover > .icon,
  .site-header .catalog-toggle[aria-expanded="true"] > .icon { color: #496f86; }
  .site-header .catalog-toggle::after { height: 2px; background: #7897a8; }
  .site-header .header-ranking { min-height: 38px; padding-left: 12px; gap: 5px; border-color: #d6e0e5; }
  .site-header .header-ranking-icon { width: 18px; height: 28px; }
  .site-header .header-ranking .header-ranking-icon > .icon { width: 17px; height: 17px; color: #977345; }
  .site-header .header-ranking strong { color: #375464; font-size: 12px; font-weight: 600; }
  .site-header .header-ranking:hover strong,
  .site-header .header-ranking[aria-current="page"] strong { color: #193b50; }
  .site-header .search,
  .site-header .search:focus-within { position: relative; inset: auto; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px 42px; height: 102px; gap: 6px; padding: 6px 8px; }
  .site-header .search-field { position: static; grid-row: 2; gap: 10px; height: 42px; padding-top: 5px; border-top: 1px solid #dce4e9; }
  .site-header .search-field > .icon { margin-left: 3px; width: 19px; height: 19px; }
  .site-header .search input { font-size: 16px; }
  .site-header .search input::placeholder { font-size: 13px; }
  .header-genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 4px; }
  .catalog-drawer-inner { padding: 10px; }
  .site-header .header-genre-grid a { gap: 7px; padding: 8px 6px; font-size: 12px; }
  .header-genre-icon { width: 24px; height: 26px; border-radius: var(--radius-detail); }
  .header-genre-grid .icon { width: 16px; height: 16px; }
  .header-genre-grid small { padding-left: 0; font-size: 10px; }
  .site-shell-notice { right: 16px; bottom: 16px; }
}
@media (max-width: 380px) {
  .site-header .brand { gap: 6px; }
  .site-header .brand-lockup strong { font-size: 20px; }
  .site-header .brand > svg { width: 28px; height: 28px; }
  .site-header .brand-domain { display: none; }
  .site-header .header-actions { gap: 8px; }
  .site-header .header-ranking { padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header *, .site-shell-notice { transition: none !important; }
}

/* Compact game recommendations complete the widened catalog. */
.header-game-picks { min-width: 0; padding-left: 20px; border-left: 1px solid #e3eaee; }
.header-game-picks h2 { padding: 4px 8px 8px; color: #718390; font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .02em; }
.header-game-picks-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.site-header .header-game-pick { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 52px; padding: 6px 8px; border-radius: var(--radius-control); color: #263f50; white-space: normal; transition: background-color .15s, color .15s; }
.header-game-pick-icon { flex: none; width: 40px; height: 40px; object-fit: contain; }
.header-game-pick-icon.is-cover { border-radius: var(--radius-detail); object-fit: cover; }
.header-game-pick-copy { display: grid; gap: 4px; min-width: 0; }
.header-game-pick strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: inherit; font-size: 13px; font-weight: 600; line-height: 1.35; white-space: normal; }
.header-game-pick small { color: #7c8f9c; font-size: 11px; line-height: 1.4; }
.site-header .header-game-pick:hover { background: #edf3f6; color: #193c50; }
.site-header .header-game-pick:focus-visible { outline: 2px solid #597c40; outline-offset: -2px; background: #edf3f6; }
@container (min-width: 901px) and (max-width: 1180px) {
  .catalog-drawer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .header-genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-game-picks { padding-left: 16px; }
  .site-header .header-game-pick { gap: 10px; padding-inline: 6px; }
}
@container (max-width: 900px) {
  .catalog-drawer-inner { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .header-game-picks { padding: 12px 0 0; border-left: 0; border-top: 1px solid #e3eaee; }
  .header-game-picks-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
}
@container (max-width: 540px) {
  .header-game-picks-list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
