/* "Radiant & Dire" skin: the pixel-art layer over the design system (DESIGN.md › Art). Dark is Dire at night, light
   is Radiant by day; panels are pixel frames (a dark outline, a two-tone Dota red line, a notched corner), controls
   are chunky beveled buttons, headings are pixel type, and the art is Dota 2 pixel art (/assets/art, made with the
   image model and snapped onto its pixel grid). Dota red is the brand and interaction colour. */

/* ---------------------------------------------------------------- pixel geometry */

/* Square corners everywhere, like pixel art... */
*, *::before, *::after { border-radius: 0 !important; }
/* ...spinners stay round: a square turning around reads as a glitch, not as loading. */
.spinner, .vl-footer.loading::after { border-radius: 50% !important; }
/* ...except shapes that carry meaning: on the map an added entity is a circle and a removed one a crossed circle. */
.map-kind-dot.k-added, .map-kind-dot.k-removed, .map-kinds .k-added::before, .map-kinds .k-removed::before,
.cat-trees .map-cat-swatch, .map-cat-swatch.cat-trees { border-radius: 50% !important; }

.emblem, .inspect-art, .logo-img, .pixel-icon { image-rendering: pixelated; }

/* The pixel frame: a 4px border drawn by a tiny SVG per theme (outline, light top-left gold, dark bottom-right gold,
   notched outer corner). The background stays inside it, so the notch shows what is behind the panel. */
.block, .hero-band, .mon-card, .tl-year, .view-switch, .zone-patch, .zone-history, .zone-monitor, .popover, .dialog, .item-panel,
.list-pane, .preview-pane, .ais-result {
  border: 4px solid transparent;
  border-image: var(--px-frame-img) 4 / 4px / 0 stretch;
  background-clip: padding-box;
}
/* A 2px inner bevel: light along the top, dark along the bottom. */
.block, .hero-band, .mon-card, .tl-year, .ais-result {
  box-shadow: inset 0 2px 0 var(--px-bevel-hi), inset 0 -2px 0 var(--px-bevel-lo);
}
/* Floating panels: a hard pixel drop shadow instead of a blur. */
.popover, .dialog { box-shadow: 4px 4px 0 rgba(0, 0, 0, .45); }

/* ---------------------------------------------------------------- frame and top bar */

body {
  /* A banded sky at the top: hard colour steps instead of a smooth gradient. */
  background: linear-gradient(180deg, var(--sky-1) 0 5rem, color-mix(in oklab, var(--sky-1) 66%, var(--bg)) 5rem 9rem,
    color-mix(in oklab, var(--sky-1) 33%, var(--bg)) 9rem 13rem, var(--bg) 13rem) var(--bg);
}
.topbar {
  background: var(--surface-1);
  border-bottom: 2px solid var(--px-outline);
  box-shadow: inset 0 -2px 0 var(--px-frame), 0 2px 0 rgba(0, 0, 0, .25);
}
.brand-mark { width: 1.75rem; height: 1.75rem; }
.logo-img { box-shadow: none; border-radius: 0; object-fit: contain; }
.brand-name .brand-dot { color: var(--brand); }
.primary-nav a { font-weight: 600; }
.primary-nav a.active::after { height: 4px; bottom: -.625rem; background: var(--brand); box-shadow: 0 -2px 0 var(--px-outline) inset; }

/* ---------------------------------------------------------------- type */

/* Press Start 2P fills its em box (every glyph is 8x8 pixels), so display sizes are about 60% of a normal font's and
   it has one weight (no faked bold). Long text set in it would be hard to read: those stay in the UI font. */
.display, .zone-title, .global-title, .block-title, .tl-year-title, .stat-value, .hc-build,
.mon-big, .mon-heading, .dialog-head h2, .brand-name, .view-tab, .mon-days-stat-value, .mon-patch-version, .mon-valve-num,
.empty-title, .hero-monogram, .pn-section-title, .guide-label {
  font-family: var(--font-display); font-weight: 400; font-synthesis: none; letter-spacing: 0;
}
.display { font-size: clamp(1.625rem, 3.4vw, 2.625rem); line-height: 1.2; color: var(--display-color); text-shadow: var(--display-shadow); }
.brand-name { font-size: .8125rem; }
.view-tab { font-size: .75rem; }
.block-title, .mon-heading { font-size: .8125rem; line-height: 1.5; }
.zone-title { font-size: .9375rem; line-height: 1.5; }
.global-title { font-size: 1.1875rem; line-height: 1.4; color: var(--display-color); text-shadow: var(--display-shadow); }
.stat-value { font-size: clamp(1.0625rem, 1.9vw, 1.5rem); line-height: 1.3; }
.hero-stats[data-len="l"] .stat-value { font-size: 1.0625rem; }
.hero-stats[data-len="xl"] .stat-value { font-size: .875rem; }
/* Phones: three tiles side by side hold about three pixel-font digits. Longer totals first step down a size ("l");
   when that is still cut ("xl"), each total gets a row of its own, number then label, at the full size. */
@media (max-width: 760px) {
  .hero-stats[data-len="l"] .stat-value { font-size: .875rem; }
  .hero-stats[data-len="xl"] { grid-template-columns: max-content minmax(0, 1fr); gap: .375rem .75rem; }
  .hero-stats[data-len="xl"] .stat { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: baseline; padding: .5625rem 2rem .5625rem .75rem; }
  .hero-stats[data-len="xl"] .stat-value { overflow: visible; font-size: 1.0625rem; }
  .hero-stats[data-len="xl"] .stat-label { margin-top: 0; font-size: .8125rem; }
  .hero-stats[data-len="xl"] .stat::after { top: 50%; margin-top: -5px; }
}
.hc-build { font-size: .6875rem; line-height: 1.6; }
@media (max-width: 480px) { .hc-build { font-size: .5rem; line-height: 2; } }
.tl-year-title { font-size: .8125rem; line-height: 1.4; }
.mon-big { font-size: 1.375rem; line-height: 1.25; }
.mon-days-stat-value, .mon-patch-version { font-size: .8125rem; line-height: 1.5; }
.mon-valve-num { font-size: 1rem; line-height: 1.3; }
.empty-title, .dialog-head h2 { font-size: .8125rem; line-height: 1.6; }
.hero-monogram { font-size: .875rem; }
.pn-section-title { font-size: .8125rem; line-height: 1.6; }
/* The AI headline is a sentence: bold UI type. */
.ai-headline { font-family: var(--font-ui); font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- buttons and controls */

.btn {
  border: 2px solid var(--px-outline); background: var(--surface-3); font-weight: 600;
  box-shadow: inset 0 2px 0 var(--px-bevel-hi), inset 0 -3px 0 var(--px-bevel-lo);
}
.btn:hover { background: var(--surface-4); border-color: var(--px-outline); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 0 var(--px-bevel-lo); }
/* Primary: a soft Dota red button with white type ("Read the whole summary" is one too). */
.btn-primary, .ai-toggle { background: #9a3527; color: #fff; text-shadow: 1px 1px 0 #3a0c06; border-color: var(--px-outline); box-shadow: inset 0 2px 0 #c26553, inset 0 -3px 0 #5e1a12; }
.btn-primary:hover, .ai-toggle:hover { background: #a93d2e; border-color: var(--px-outline); opacity: 1; }
.btn-primary:active, .ai-toggle:active { box-shadow: inset 0 2px 0 #5e1a12; }
/* It floats over the faded preview: a hard pixel shadow under it. */
.ai-toggle { box-shadow: inset 0 2px 0 #c26553, inset 0 -3px 0 #5e1a12, 0 3px 0 rgba(0, 0, 0, .35); }
.btn-ghost, .btn-quiet { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); box-shadow: none; }
.icon-btn:hover, .icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--line-2); }
.input, .select, .search-box, .build-chip, .last-patch { border-width: 2px; }
.seg[aria-pressed="true"] { box-shadow: inset 0 2px 0 var(--px-bevel-hi), inset 0 -2px 0 var(--px-bevel-lo); }
.live-dot { box-shadow: none; animation: px-blink 1.2s steps(1) infinite; }
@keyframes px-blink { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- screen switch */

.view-switch { padding: .25rem; gap: .25rem; background-color: var(--surface-1); }
.view-tab { height: 2.75rem; }
.view-tab:hover { background: var(--surface-3); }
.view-tab[aria-current="page"] {
  color: #fff; background: #8f2e22; text-shadow: 2px 2px 0 #3a0c06;
  box-shadow: inset 0 0 0 2px #3a0c06, inset 0 4px 0 #b9564a, inset 0 -5px 0 #5e1a12;
}
.view-count { box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.view-tab[aria-current="page"] .view-count { background: rgba(40, 6, 2, .55); border-color: #edba4a; color: #ffd98a; text-shadow: none; }
.view-tab .live-dot { order: 3; }
.view-emblem { width: 2rem; height: 2rem; margin: -.5rem -.25rem -.5rem -.5rem; flex: none; }
.view-tab:not([aria-current="page"]) .view-emblem { opacity: .85; }
/* Phones: the short labels at the font's native 8px (crisp), so three tabs fit. */
@media (max-width: 680px) {
  .view-tab { font-size: .5625rem; gap: .375rem; }
  .view-emblem { width: 1.5rem; height: 1.5rem; margin: -.25rem -.125rem -.25rem -.25rem; }
}
@media (max-width: 420px) {
  .view-tab { font-size: .5rem; }
  .view-emblem { display: none; }
}

/* ---------------------------------------------------------------- section guide */

/* The chips under the patch hero are beveled pixel buttons with a hard shadow, so they read as buttons, not as text:
   a lighter fill than the zone inside a dark pixel outline, in both themes. */
.guide-chip:not(.guide-chip-wait) {
  border-color: var(--px-outline); background: var(--surface-4);
  box-shadow: inset 0 2px 0 var(--px-bevel-hi), inset 0 -3px 0 var(--px-bevel-lo), 3px 3px 0 rgba(0, 0, 0, .35);
}
.guide-chip:not(.guide-chip-wait):hover { border-color: var(--brand); background: color-mix(in oklab, var(--surface-4) 88%, var(--brand)); }
.guide-chip:not(.guide-chip-wait):active { transform: translate(2px, 2px); box-shadow: inset 0 2px 0 var(--px-bevel-lo), 1px 1px 0 rgba(0, 0, 0, .35); }
.guide-count { box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }

/* ---------------------------------------------------------------- zones */

.zone-patch, .zone-history, .zone-monitor { background-color: var(--zone-bg); }
/* The patch zone's rail: a pixel vein of the three change colours, inside the frame. */
.zone-patch::before {
  left: .375rem; top: 2.5rem; bottom: 2.5rem; width: 4px;
  background: linear-gradient(var(--added) 0 33.3%, var(--modified) 33.3% 66.6%, var(--removed) 66.6%);
}
/* History and monitor: their pixel scene behind the heading, cut off in hard bands into the frame. */
.zone-history, .zone-monitor {
  background-image:
    linear-gradient(180deg, color-mix(in oklab, var(--zone-bg) 15%, transparent) 0 8rem, color-mix(in oklab, var(--zone-bg) 45%, transparent) 8rem 11rem,
      color-mix(in oklab, var(--zone-bg) 75%, transparent) 11rem 14rem, var(--zone-bg) 14rem),
    var(--art-history);
  background-repeat: no-repeat; background-size: 100% 100%, 100% auto; background-position: top, top right;
  image-rendering: pixelated;
}
.zone-monitor { background-image:
    linear-gradient(180deg, color-mix(in oklab, var(--zone-bg) 15%, transparent) 0 8rem, color-mix(in oklab, var(--zone-bg) 45%, transparent) 8rem 11rem,
      color-mix(in oklab, var(--zone-bg) 75%, transparent) 11rem 14rem, var(--zone-bg) 14rem),
    var(--art-monitor); }
.global-head { position: relative; }
/* The heading needs to stay readable over the scene: a solid plate behind the emblem and the title block. */
.zone-history .global-plate, .zone-monitor .global-plate {
  flex: 0 1 auto; max-width: min(50rem, 100%); padding: .625rem 1rem .75rem .75rem; background: color-mix(in oklab, var(--zone-bg) 86%, transparent);
  border: 2px solid var(--px-outline); box-shadow: inset 0 0 0 2px var(--px-frame);
}
/* Room for the scene above the content. */
.zone-history > .global-head, .zone-monitor > .global-head { min-height: 9.5rem; align-items: flex-end; }
.global-icon { width: 3.5rem; height: 3.5rem; background: none; }
.zone-emblem { width: 3.5rem; height: 3.5rem; }

/* ---------------------------------------------------------------- patch hero */

.hero-band { background-color: var(--surface-1); }
.hero-band::before {
  inset: 0; width: auto; height: auto; transform: none; opacity: 1;
  background: var(--art-hero) 75% center / cover no-repeat; image-rendering: pixelated;
  /* A stepped fade on the left (text side): hard bands, like a dithered edge. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0 22%, rgba(0, 0, 0, .3) 22% 30%, rgba(0, 0, 0, .55) 30% 38%, rgba(0, 0, 0, .8) 38% 46%, #000 46%);
  mask-image: linear-gradient(90deg, transparent 0 22%, rgba(0, 0, 0, .3) 22% 30%, rgba(0, 0, 0, .55) 30% 38%, rgba(0, 0, 0, .8) 38% 46%, #000 46%);
}
@media (max-width: 760px) {
  .hero-band::before { opacity: .4; -webkit-mask-image: none; mask-image: none; }
}
/* Counts as item-slot plaques over the scene: a coloured pixel border and a small pixel gem. */
.hero-stats .stat {
  position: relative; border: 2px solid var(--px-outline);
  background: color-mix(in oklab, var(--surface-1) 86%, transparent);
  box-shadow: inset 0 0 0 2px var(--gem), inset 0 4px 0 var(--px-bevel-hi);
}
.hero-stats .stat::after {
  content: ""; position: absolute; top: .625rem; right: .625rem; width: 10px; height: 10px;
  background: var(--gem);
  /* A pixel diamond: a 10px square with its corners stepped off. */
  clip-path: polygon(40% 0, 60% 0, 60% 20%, 80% 20%, 80% 40%, 100% 40%, 100% 60%, 80% 60%, 80% 80%, 60% 80%, 60% 100%, 40% 100%, 40% 80%, 20% 80%, 20% 60%, 0 60%, 0 40%, 20% 40%, 20% 20%, 40% 20%);
}
.stat-added { --gem: var(--added); }
.stat-modified { --gem: var(--modified); }
.stat-removed { --gem: var(--removed); }
/* A zero count ("+0") steps back: grey, no gem, so the counts that are not zero stand out. */
.hero-stats .stat.is-zero { --gem: var(--line-2); background: color-mix(in oklab, var(--surface-1) 72%, transparent); }
.hero-stats .stat.is-zero .stat-value, .hero-stats .stat.is-zero .stat-label { color: var(--text-3); }
.hero-stats .stat.is-zero::after { display: none; }
.hero-bar { height: .75rem; border: 2px solid var(--px-outline); gap: 0; box-sizing: content-box; }
.hero-compare { border: 2px solid var(--px-outline); box-shadow: inset 0 0 0 2px var(--accent-line); }

/* ---------------------------------------------------------------- blocks, emblems */

.block-head { gap: .375rem .625rem; }
.block-emblem { width: 2.2rem; height: 2.2rem; margin: -.55rem -.09rem -.55rem -.275rem; flex: none; }
.mon-heading { align-items: center; }
.mon-emblem { width: 2.2rem; height: 2.2rem; margin: -.44rem -.11rem -.44rem -.22rem; flex: none; }
/* Release days: the day/night clock instead of the little column mark. */
.mon-days-emblem { width: 2.2rem; height: 2.2rem; margin: -.44rem .11rem -.44rem -.22rem; vertical-align: middle; display: inline-block; }
/* AI summary bullets, timeline and feed nodes as pixel squares. */
.ai-bullet::before { width: 6px; height: 6px; top: .5625rem; opacity: 1; }

/* Lists inside blocks: hover rows as solid pixel bars. */
.file-row:hover, .code-string:hover { box-shadow: inset 2px 0 0 var(--accent); }
.more-row { border-width: 2px; }

/* Hero portraits and art tiles: item-slot frames. */
.hero-card, .art-thumb { border: 2px solid var(--px-outline); box-shadow: inset 0 0 0 1px var(--line-2); }
.hero-card:hover, .art-tile:hover .art-thumb { border-color: var(--px-outline); box-shadow: inset 0 0 0 2px var(--brand); transform: none; }

/* ---------------------------------------------------------------- empty preview: the courier with a chest of files */

.inspect-art { width: 12rem; height: auto; margin: 0 auto .25rem; }

/* ---------------------------------------------------------------- scrollbars */

::-webkit-scrollbar-thumb { border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
