/* Site appearance control. Mobile v2 owns its token palette; this file supplies
   the desktop switch and cross-page light/dark adaptations. */

@media (min-width: 769px) {
  .desktop-theme-control {
    order: 3;
    display: grid;
    grid-template-columns: repeat(3, 38px);
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    background: #f4f7fa;
  }
  .desktop-theme-control button {
    min-height: 29px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #6b7b8e;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
  }
  .desktop-theme-control button:hover { color: #246fc1; }
  .desktop-theme-control button.is-active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(25, 55, 90, .1);
    color: #1d65b3;
  }
  .desktop-header > .header-action-btn { order: 4; }
}

html[data-resolved-theme] body,
html[data-resolved-theme] .site-header,
html[data-resolved-theme] .footer,
html[data-resolved-theme] body:not(.mobile-v2-page) :is(.card, .detail-section, .catalog-shelf) {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

/* Deep appearance for the light marketplace/news/collection families. */
html[data-resolved-theme="dark"] body:not(.mobile-v2-page):not(.game-hub-page) {
  --surface-page: #07111f;
  --surface-card: #0d1a2b;
  --surface-hover: #13243a;
  --border-default: #24354b;
  --text-primary: #e7eef8;
  --text-secondary: #c6d2e1;
  --text-muted: #8495aa;
  --text-caption: #9aabbd;
  background: #07111f;
  color: #e7eef8;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .site-header {
  border-bottom: 1px solid #22344a;
  background: rgba(8, 19, 33, .96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .site-search,
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .desktop-theme-control {
  border-color: #2a3d55;
  background: #101e30;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .site-search:focus-within { background: #13243a; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .site-search input { color: #e8eff8; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .desktop-primary-nav a,
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .header-action-btn { color: #a8b7c9; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .desktop-primary-nav .nav-divider { background: #30435a; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .desktop-theme-control button { color: #91a3b8; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .desktop-theme-control button.is-active {
  background: #20334a;
  box-shadow: none;
  color: #7dd9ff;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) .footer {
  border-top: 1px solid #203249;
  background: #091525;
  color: #8495aa;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) :is(.breadcrumb-bar, .site-breadcrumb, .breadcrumb-wrap) {
  border-color: #22354b;
  background: #0a1727;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) :is(.breadcrumb-inner, .site-breadcrumb__list) a,
html[data-resolved-theme="dark"] body:not(.mobile-v2-page) :is(.breadcrumb-inner, .site-breadcrumb__list) span { color: #91a3b8; }

html[data-resolved-theme="dark"] body:not(.mobile-v2-page):not(.game-hub-page) :is(
  .card, .detail-section, .catalog-shelf, .market-shell, .market-panel,
  .collection-card, .publisher-card, .news-card, .sidebar-module,
  .search-summary, .daily-updates-card, .ranking-section
) {
  border-color: #24364d !important;
  background-color: #0d1a2b !important;
  color: #dfe8f4;
}
html[data-resolved-theme="dark"] body:not(.mobile-v2-page):not(.game-hub-page) :is(h1, h2, h3, h4, strong, .detail-section-title) { color: #edf4fc; }
html[data-resolved-theme="dark"] body:not(.mobile-v2-page):not(.game-hub-page) :is(p, small, time, .detail-card-meta) { color: #91a3b8; }

html[data-resolved-theme="dark"] body.detail-family-market { background: #07111f; }
html[data-resolved-theme="dark"] body.detail-family-market .pc-product-hero {
  border-color: #2a3d55;
  background: radial-gradient(circle at 96% 0, #14365a 0, transparent 34%), #0d1a2b;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .24);
}
html[data-resolved-theme="dark"] body.detail-family-market :is(.pc-product-copy h1, .pc-product-specs strong, .pc-software-downloads h2, .pc-software-drive-grid strong) { color: #eaf2fc; }
html[data-resolved-theme="dark"] body.detail-family-market :is(.pc-product-copy p, .pc-product-specs span, .pc-product-actions > span, .pc-software-downloads p) { color: #91a3b8; }
html[data-resolved-theme="dark"] body.detail-family-market :is(.pc-product-specs, .pc-product-actions) { border-color: #2a3d55; }
html[data-resolved-theme="dark"] body.detail-family-market .pc-software-downloads { border-color: #2a3d55; background: #0d1a2b; }
html[data-resolved-theme="dark"] body.detail-family-market .pc-software-downloads > header { border-color: #2a3d55; background: #101f32; }
html[data-resolved-theme="dark"] body.detail-family-market .pc-software-drive-grid { background: #293d55; }
html[data-resolved-theme="dark"] body.detail-family-market .pc-software-drive-grid article { background: #0d1a2b; }

html[data-resolved-theme="dark"] body.detail-family-mobile { background: #07111f; }
html[data-resolved-theme="dark"] body.detail-family-mobile .mobile-store-hero {
  border-color: #254037;
  background: radial-gradient(circle at 94% 4%, rgba(54, 210, 152, .16), transparent 31%), #0b1b1a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}
html[data-resolved-theme="dark"] body.detail-family-mobile :is(.mobile-store-copy h1, .mobile-store-metrics strong, .mobile-store-package-title, .mobile-store-source-panel h2, .mobile-store-source-grid strong) { color: #e8f7f0; }
html[data-resolved-theme="dark"] body.detail-family-mobile :is(.mobile-store-copy p, .mobile-store-metrics span, .mobile-store-source-panel p) { color: #91a99f; }
html[data-resolved-theme="dark"] body.detail-family-mobile :is(.mobile-store-tags span, .mobile-store-package, .mobile-store-source-panel, .mobile-store-source-grid article) {
  border-color: #294239;
  background: #0d211d;
}
html[data-resolved-theme="dark"] body.detail-family-mobile .mobile-store-source-panel > header { border-color: #294239; background: #102721; }
html[data-resolved-theme="dark"] body.detail-family-mobile .mobile-store-source-grid { background: #294239; }

/* Game families already default to deep. Light appearance turns their data and
   reading surfaces into cool editorial cards while retaining dark artwork and
   download panels as deliberate focal areas. */
html[data-resolved-theme="light"] body.game-hub-page {
  --surface-page: #edf4f8;
  --surface-card: #ffffff;
  --surface-hover: #f3f8fb;
  --border-default: #cfdae4;
  --text-primary: #172433;
  --text-secondary: #34485d;
  --text-muted: #6f8193;
  --text-caption: #718396;
  background: #edf4f8;
  color: #172433;
}
html[data-resolved-theme="light"] body.game-hub-page .site-header { border-bottom: 1px solid #d8e2eb; background: rgba(255, 255, 255, .96); }
html[data-resolved-theme="light"] body.game-hub-page :is(.desktop-primary-nav a, .header-action-btn) { color: #53677c; }
html[data-resolved-theme="light"] body.game-hub-page :is(.home-index-panel, .catalog-shelf, .home-games-section, .detail-section, .pc-game-product, .search-summary) {
  border-color: #cfdae4 !important;
  background-color: #fff !important;
  color: #172433;
  box-shadow: 0 14px 34px rgba(36, 63, 86, .08);
}
html[data-resolved-theme="light"] body.game-hub-page :is(.home-panel-title h2, .catalog-shelf__head h2, .pc-game-section-heading h2, .pc-game-product__copy h1, .pc-game-product__facts strong, .detail-section-title) { color: #162536; }
html[data-resolved-theme="light"] body.game-hub-page :is(.home-steam-line, .home-release-line, .home-guide-line, .pc-game-product__facts > div, .pc-game-news a) { border-color: #dce5ed; }
html[data-resolved-theme="light"] body.game-hub-page :is(.home-steam-line span, .home-release-line b, .home-guide-line span, .pc-game-intro__copy, .pc-game-product__edition) { color: #34485d; }
html[data-resolved-theme="light"] body.game-hub-page :is(.home-release-line small, .pc-game-product__summary, .pc-game-product__facts span, .resource-empty) { color: #718396; }
html[data-resolved-theme="light"] body.game-hub-page .pc-game-product__visual { background: #dfeaf2; }
html[data-resolved-theme="light"] body.game-hub-page .footer { border-top: 1px solid #d5e0e8; background: #fff; color: #718396; }

@media (min-width: 769px) and (max-width: 1320px) {
  .desktop-theme-control { grid-template-columns: repeat(3, 31px); }
  .desktop-theme-control button { font-size: 10px; }
}
