/* Appearance only. Every restyled element is scoped to the opt-out theme;
   original layouts, account data, game artwork, and behavior stay in place. */
.site-theme-control {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.site-theme-control select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
  border-radius: 4px;
}

html[data-site-theme="steampunk"] {
  color-scheme: dark;
  /* app.js installs its original launch palette inline. Override only these
     tokens while this theme is active so switching back restores it exactly. */
  --bg: #121717 !important;
  --bg-deep: #0a0e0f !important;
  --bg-glow: #383426 !important;
  --paper: #efdfbc !important;
  --panel: #1e2521 !important;
  --panel-strong: #141b18 !important;
  --ink: #eee7d6 !important;
  --muted: #c0b69f !important;
  --line: #7d68444f !important;
  --accent: #d5b16b !important;
  --accent-deep: #e6c794 !important;
  --accent-soft: #f6dc9e !important;
  --wood-light: #967446 !important;
  --wood-mid: #514536 !important;
  --wood-dark: #232923 !important;
  --moss: #819777 !important;
  --sage: #bac6a0 !important;
  --ember: #d99b67 !important;
  --iron-surface: linear-gradient(145deg, #282d25, #1b221f 45%, #131a18);
  --brass-surface: linear-gradient(160deg, #ddc28b, #ab854e 44%, #8a663d 75%, #c1a16a);
  --metal-frame: inset 0 1px 0 #e4c68b2b, inset 0 0 0 3px #0e16184d, 0 3px 8px #080d1245;
  --corner-rivets: radial-gradient(circle at 7px 7px, #be9d5e 0 1px, #141b19 1.5px 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 7px) 7px, #be9d5e 0 1px, #141b19 1.5px 2.5px, transparent 3px),
    radial-gradient(circle at 7px calc(100% - 7px), #8c754e 0 1px, #141b19 1.5px 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #8c754e 0 1px, #141b19 1.5px 2.5px, transparent 3px);
  background: radial-gradient(ellipse at 35% 0, #5a452b2e, transparent 65%), linear-gradient(#1c211c, #0b1112 75%);

  & ::selection { background: #bc925c; color: #131b19; }
  & :focus-visible { outline-color: #e7c484; }
  & input { accent-color: #d5b16b; }
  & input::placeholder { color: #a99e85; }
  & :is(input:not([type="checkbox"], [type="range"]), select, textarea) {
    color: var(--ink);
    border-color: #82704d80;
    background-color: #101716;
    box-shadow: inset 0 2px 4px #080d1438, 0 1px 0 #ddc18a12;
  }
  & select option { background: #19211d; color: var(--ink); }

  &[data-header-style="clean"] :is(.top-layout, body.has-results .top-layout) {
    border-bottom-color: #b292567a;
    background: linear-gradient(#080e1433, #080e1433), url("/static/brass-grain.svg"), linear-gradient(180deg, #b793540c, transparent);
    box-shadow: 0 2px 0 #080e1580, 0 3px 0 #bc99521a;
  }
  &[data-header-style="clean"] .brand-wordmark {
    font-family: "Fraunces", Georgia, serif;
    color: #eed4a0;
    font-weight: 700;
    letter-spacing: -0.8px;
    text-shadow: 0 2px 1px #080e15, 0 -1px #fff3d22b;
  }
  &[data-header-style="clean"] .brand-wordmark-accent { color: #bda274; font-weight: 600; }
  &[data-header-style="clean"] .view-button {
    --view-accent: #e0bc78;
    border: 1px solid #84694770;
    background: linear-gradient(#34372a, #1d251f 58%, #242d23);
    color: #cfbf9e;
    box-shadow: inset 0 1px #ebd29c20, inset 0 -2px #080e153d;
    text-shadow: 0 1px #080e15;
  }
  &[data-header-style="clean"] .view-button[aria-pressed="true"] {
    border-color: #c49d5e;
    color: #ffeac0;
    background: linear-gradient(#634b2e, #3b3323 55%, #2d3123);
    box-shadow: inset 0 1px #ffe3a945, inset 0 -2px #c29f61, 0 2px 4px #070e1538;
  }
  &[data-header-style="clean"] .view-button:hover:not(:disabled) {
    color: #fff0ce;
    background: linear-gradient(#56452e, #283024);
    border-color: #c3a267;
  }

  & :is(.refine-panel, .recommendations-panel, .privacy-panel, .release-calendar) {
    border-color: #8a704f80;
    background: var(--corner-rivets), var(--iron-surface);
    box-shadow: var(--metal-frame);
  }
  & :is(.refine-panel-head, .release-calendar-toolbar, .library-preferences-header) {
    border-bottom-color: #98774475;
    background: linear-gradient(#080e1433, #080e1433), url("/static/brass-grain.svg"), linear-gradient(#70583a26, transparent);
  }
  & :is(h1, h2, h3, .refine-panel-title) { color: #e9d4ac; }
  & :is(.bucket, .bucket.is-title-power-hovered) {
    border-color: #705d416e;
    background: linear-gradient(#1e271f, #131c19 100px);
    box-shadow: inset 0 1px #cfb07124, inset 0 0 0 3px #0d14153d;
  }
  & .bucket-title-picker {
    color: #efdcad;
    border-color: #b4945e;
    background: linear-gradient(#55472f, #263023 55%, #1d271e);
    box-shadow: inset 0 1px #f4d6a03d, 0 2px 3px #080e15a0;
  }
  & .bucket-title { color: #eed8a6; }
  & .rec-card:not(.is-new):not([data-score="100"]) { border-top-color: #b49a6030; }
  & .rec-card:not(.release-calendar-card):not(.rec-card-drag-ghost) { background-color: #c3a36b04; }
  & .rec-card:not(.rec-card-drag-ghost) .rec-price-badge { background: #101815f2; border-color: #8c714b66; }
  & :is(.rec-score-sub, .rec-price-final, .rec-upcoming-release-date) { color: #dbd2bd; }
  /* Scores, green new-game borders, sale prices, and review sentiment retain
     their meaning. Artwork and trailer/video colors are never filtered. */
  & :is(.removed-panel, .range-field, .rail-checkbox-grid, .focus-game-reference) {
    background: linear-gradient(#2b3025, #1c241f);
    border-color: #8c714b80;
    box-shadow: inset 0 1px #ecd09a1a, inset 0 -1px #080e1560;
  }
  & :is(.removed-chip, .rail-checkbox-grid label) {
    color: #e7dcc4;
    background: linear-gradient(#283023, #1a231d);
    border-color: #76634370;
  }
  & .rail-checkbox-grid label:has(input:checked) {
    background: linear-gradient(#3e3827, #232b1f);
    border-color: #bd9d61a6;
  }
  & :is(.removed-chip-action, #save-bucket-layout, #scan-button, .game-tooltip-preview-play) {
    border-color: #d8b473;
    background: var(--brass-surface);
    color: #1b241f;
    box-shadow: inset 0 1px #fff0c77a, inset 0 -2px #58422e60, 0 2px 3px #07101445;
    text-shadow: 0 1px #f9dca433;
  }
  & :is(.removed-chip-action, #save-bucket-layout, #scan-button, .game-tooltip-preview-play):hover:not(:disabled) {
    background: linear-gradient(#edcf96, #ba975d);
  }
  & :is(.game-search-button, .mobile-filter-toggle, .mobile-bucket-tab, .release-calendar-nav, .release-calendar-today) {
    color: #eed9a9;
    border-color: #8e774b;
    background: linear-gradient(#363827, #1d271f);
  }
  & :is(.filter-autocomplete, .filter-autocomplete-item, .bucket-select-menu, .bucket-context-menu, .context-menu) {
    background-color: #18211b;
    border-color: #93764a;
    color: #e9dfc9;
  }
  & .site-footer { border-color: #7e663f70; color: #b8ad94; }
  & .site-footer a { color: #d6b577; }
  & .site-theme-control select { background: #151e1a; border-color: #9c7f4c; }

  & :is(.game-tooltip, .game-tooltip.game-tooltip--organized, .activity-tooltip, .library-preferences-dialog) {
    color: #e9dfc7;
    border-color: #aa8752;
    background: linear-gradient(145deg, #303325, #1c241d 30%, #131c18 100%);
    box-shadow: inset 0 1px #eac78438, 0 14px 40px #060c1299;
    scrollbar-color: #977c4d #17211f;
  }
  & :is(.game-tooltip-head, .tooltip-section-title, .game-tooltip-scorecard h5, .game-tooltip-review-insights h5, .library-preferences-header h2) {
    color: #f1dcaf;
    font-family: "Fraunces", Georgia, serif;
  }
  & .game-tooltip-score { color: #f0cf91; border-color: #b2915d70; background: #b68e4721; }
  & :is(.game-tooltip-key, .game-tooltip-copy, .game-tooltip-review-ratio small, .game-tooltip-scorecard > p,
    .game-tooltip-scorecard-reason dt, .game-tooltip-scorecard-metric > span, .game-tooltip-review-duration > small,
    .tooltip-original-price, .game-tooltip-hours-per-dollar) { color: #c6baa0; }
  & :is(.game-tooltip-value, .game-tooltip-scorecard-reason dd, .game-tooltip-scorecard-metric strong,
    .game-tooltip-review-duration > strong, .game-tooltip-price-value > span:first-child) { color: #ede4d0; }
  & :is(.tooltip-about-section, .game-tooltip-details, .game-tooltip-scorecard, .game-tooltip-review-insights) { border-color: #b29a6133; }
  & :is(.game-tooltip-scorecard-metric, .game-tooltip-review-duration, .game-tooltip-review-theme) {
    border-color: #8c744d70;
    background: #d0b3750a;
  }
  & .game-tooltip-tag-positive { color: #c4d2a5; background: #617d442e; border-color: #89956350; }
  & :is(.tooltip-details-toggle, .tooltip-tags-toggle) { color: #e1c17c; }
  & :is(.game-tooltip-preview, .game-tooltip-preview-warning) { border-color: #8a71485e; background-color: #141c1b; }
  & .game-tooltip-preview-warning strong { color: #efd1a1; }

  & :is(.library-preferences-description, .library-preferences-empty, .library-preferences-game-title) { color: #e1d5bd; }
  & :is(.library-preferences-game-meta, .library-preferences-count, .library-preferences-empty p) { color: #baaf94; }
  & :is(.library-preferences-tabs, .library-preferences-game, .library-preferences-footer) { border-color: #8c744c66; }
  & .library-preferences-footer { background: #131c17; }
  & .library-preferences-art { background: #252e21; border-color: #8a7147; }
  & .library-preferences-dialog :is(button, select, input) { border-color: #8b744c; background: #1d271d; color: #eadabb; }
  & .library-preferences-dialog button:hover:not(:disabled) { background: #3b3825; border-color: #c7a466; }
  & .library-preferences-dialog .library-preferences-tabs button { background: transparent; }
  & .library-preferences-dialog .library-preferences-tabs button[aria-selected="true"] { color: #efcb88; }
  & .library-preferences-tabs button[aria-selected="true"]::after { background: #cfab68; }
  & :is(.library-preferences-notice, .library-ratings-update) { background: #1d281cf5; border-color: #a38a56; color: #e8ddc1; }

  & .release-calendar-grid { background: #0e1713; border-color: #756445; }
  & .release-calendar-weekday { color: #dec28c; border-color: #927349; background: linear-gradient(#403926, #252e1f); }
  & .release-calendar-day { border-color: #7463437a; background: linear-gradient(#202a20, #141e18); }
  & .release-calendar-day.is-outside-month { background: #101913; }
  & .release-calendar-day.is-today { border-color: #caa463; background: linear-gradient(#403523, #202b1e); }
  & .release-calendar-day-number { color: #dfc995; }
  & .release-calendar-day.is-today .release-calendar-day-number { color: #ffdda0; background: #78633780; }
  & .release-calendar-fan { --fan-light: #e7d39a; --fan-core: #b39960; --fan-deep: #4d5239; --fan-glow: #d1a661; }

  & body:is(.is-scrolling, .is-rendering-constrained) :is(.bucket, .refine-panel, .recommendations-panel) {
    box-shadow: none;
  }

  @media (max-width: 980px) {
    & .refine-panel-body { background-color: #1c241e; }
    & .mobile-results-toolbar { background: #141e18; border-color: #96794c; }
  }
  @media (prefers-reduced-motion: reduce) {
    & .view-button { transition: none; }
  }
}
