/* The seasonal illustrations and glass controls share one palette per theme. */
:root {
  color-scheme: dark;
  --ground: #000;
  --surface: #101010;
  --surface-raised: #1a1a1a;
  --text: #f5f5f5;
  --text-muted: #bdbdbd;
  --text-dim: #a6a6a6;
  --separator: #ffffff20;
  --control: #ffffff10;
  --control-hover: #ffffff1d;
  --control-selected: #ffffff2b;
  --focus: #fff;
  --glass-tint: #ffffff0a;
  --theme-dot: #ffffff11;
  --theme-snow: #d9e7f0;
  --theme-rail: #151515ed;
  --theme-panel-rim: #ffffff1d;
  --theme-face: #090909;
  --theme-face-light: #252525;
  --theme-edge: #454545;
  --theme-side: #232323;
  --theme-side-shadow: #080808;
  --theme-shadow: #000b;
  --theme-letter-shadow: #0008;
}

:root[data-store-theme="light"] {
  color-scheme: light;
  --ground: #fff;
  --surface: #fff;
  --surface-raised: #f0f0f0;
  --text: #171717;
  --text-muted: #515151;
  --text-dim: #626262;
  --separator: #17171724;
  --control: #1717170b;
  --control-hover: #17171715;
  --control-selected: #17171724;
  --focus: #262626;
  --glass-tint: #ffffff88;
  --ok: #285f3b;
  --bad: #a32732;
  --warning: #745019;
  --theme-dot: #4b68721c;
  --theme-snow: #6d879a;
  --theme-rail: #f4f4f4f5;
  --theme-panel-rim: #11111117;
  --theme-face: #fff;
  --theme-face-light: #f7f7f7;
  --theme-edge: #bbb;
  --theme-side: #eee;
  --theme-side-shadow: #d3d3d3;
  --theme-shadow: #16161640;
  --theme-letter-shadow: #fff8;
}

.market-shell { background: var(--ground); }
.market-shell::before { background: none; }
.market-shell::after {
  background: radial-gradient(circle at 1px 1px, var(--theme-dot) 1px, transparent 1.2px) 0 0 / 32px 32px;
}

.market-shell .store-wordmark::before,
.store-docs .store-wordmark::before { display: none; }

.market-shell .store-wordmark::after { left: -9px; }

.store-theme-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
}

.store-theme-toggle:hover { background: var(--control-hover); }
.store-theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.store-theme-toggle .theme-moon,
[data-store-theme="light"] .store-theme-toggle .theme-sun { display: none; }
[data-store-theme="light"] .store-theme-toggle .theme-moon { display: block; }

.market-hero:not(.config-hero)::before { background: none; }
.market-hero:not(.config-hero) h1 { text-shadow: none; }
.market-hero:not(.config-hero)::after {
  color: var(--theme-snow);
  background-image:
    radial-gradient(circle at 9% 9%, currentColor 1.1px, transparent 3.1px),
    radial-gradient(circle at 28% 24%, currentColor .8px, transparent 2px),
    radial-gradient(circle at 41% 17%, currentColor 1.4px, transparent 4.4px),
    radial-gradient(circle at 75% 8%, currentColor .6px, transparent 2.6px),
    radial-gradient(circle at 85% 30%, currentColor .8px, transparent 2.4px),
    radial-gradient(circle at 8% 43%, currentColor .8px, transparent 2px),
    radial-gradient(circle at 49% 48%, currentColor .9px, transparent 2.5px),
    radial-gradient(circle at 25% 68%, currentColor 1.2px, transparent 2.8px),
    radial-gradient(circle at 92% 59%, currentColor 1.6px, transparent 4px),
    radial-gradient(circle at 61% 72%, currentColor .7px, transparent 2.6px),
    radial-gradient(circle at 36% 87%, currentColor .7px, transparent 2.3px),
    radial-gradient(circle at 80% 93%, currentColor 1px, transparent 2.9px);
}

.market-shell :is(.box-front,.box-back),
.market-shell #grid :is(.box-front,.box-back) {
  background: linear-gradient(145deg, var(--theme-face-light), transparent 70%), var(--theme-face);
  border-color: var(--theme-edge);
  box-shadow: inset 1px 1px var(--theme-panel-rim);
}

.market-shell :is(.box-spine,.box-top) {
  background: linear-gradient(125deg, transparent, var(--theme-side-shadow)), var(--theme-side);
  border-color: var(--theme-edge);
}

.market-shell .box-symbol { text-shadow: 0 2px 2px var(--theme-letter-shadow); }
.market-shell .box-shadow { background: var(--theme-shadow); }
[data-store-theme="light"] .market-shell .game-icon { filter: invert(1); }

.store-docs {
  --panel: var(--ground);
  --pill: var(--control);
  --pill-2: var(--surface-raised);
  --pill-hi: var(--control-hover);
  --ink: var(--text);
  --dim: var(--text-muted);
  --faint: var(--text-dim);
  --line: var(--separator);
  --cream: var(--text);
  --orange: var(--text);
  --polish-line: var(--separator);
  --polish-muted: var(--text-muted);
  background: var(--ground);
  color: var(--text);
}

.store-docs::after { display: none; }
.store-docs .app { background: var(--ground); }
.store-docs .rail { background: var(--theme-rail); }
.store-docs .doc article { background: var(--surface); border-color: var(--separator); }
.store-docs :is(.pillbtn,.pillbtn.dark,.currency-trigger) { background: var(--control); color: var(--text); }
.store-docs .store-wordmark { position: relative; }
.store-docs .store-wordmark::after {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 25px;
  height: 17px;
  background: url("market-winter-hat.webp") center / contain no-repeat;
  pointer-events: none;
}
[data-store-theme="light"] .store-docs .game-icon { filter: invert(1); }

@media (max-width: 820px) {
  .market-shell .store-wordmark::after { left: -7px; }
  .market-shell .rail { background: var(--theme-rail); box-shadow: 0 5px 24px var(--theme-shadow); }
}

@media (max-width: 680px) {
  .market-shell .market-topnav { display: none; }
  .market-shell .store-wordmark { margin-right: auto; }
}

@media (max-width: 480px) {
  .store-docs .locale-tools { gap: 5px; }
  .store-docs .locale-tools .currency-picker { width: 82px; }
  .store-docs .currency-trigger { padding-inline: 6px; gap: 4px; }
  .store-docs .currency-selected-name { display: none; }
  .store-docs .language-picker button { min-width: 28px; }
}

@media (max-width: 359px) {
  .market-shell .locale-tools { gap: 4px; }
  .market-shell .locale-tools .header-cart { width: 36px; }
}
