/* Echo Reapers game UI — the painted UI kit (ER-0067): painted icons, empty-state art, status gems. The HUD moved to hud.css (ER-1260).
   Images are /art/ui/<name> (tools/cut_ui_kit.py); every rule is gated by an html.kit-<file> class from kit.js, so without
   the kit the CSS look of er.css stays. Loaded after polish.css, before fx.css. Teal only for echoes; amber = mine / primary. */

/* -- painted icons (core.icon swaps in icon-<name>.png where the kit has one) -------------------------------- */
.ico.painted { vertical-align: -.3em; }
.ico.painted :is(img, .kit-atlas-icon) { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); user-select: none; -webkit-user-drag: none; }
.btn .ico.painted, .icon-btn .ico.painted { width: 1.3em; height: 1.3em; }

/* The persistent HUD (plaque, chips, rail, corner, version, toasts) is CSS-only in hud.css (ER-1260). */

/* -- kit-misc-2 (ER-0127): empty-state vignettes, status gems, the icon plate ------------------------ */
html.kit-empty-plots .empty[data-art="plots"]::before, html.kit-empty-pending .empty[data-art="pending"]::before, html.kit-empty-skins .empty[data-art="skins"]::before {
  width: min(240px, 70%); height: 160px; opacity: .95; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); background-size: contain;
}
html.kit-empty-plots .empty[data-art="plots"]::before { background-image: url("/art/ui/empty-plots.png?w=320"); }
html.kit-empty-pending .empty[data-art="pending"]::before { background-image: url("/art/ui/empty-pending.png?w=320"); }
html.kit-empty-skins .empty[data-art="skins"]::before { background-image: url("/art/ui/empty-skins.png?w=320"); }

/* status pills: a painted gem instead of the dot (ok green, warn amber, danger red) */
html.kit-gem-ok .pill.ok::before, html.kit-gem-warn .pill.warn::before, html.kit-gem-danger .pill.danger::before {
  width: 16px; height: 16px; border-radius: 0; background: center / contain no-repeat; margin-right: 2px;
}
html.kit-gem-ok .pill.ok::before { background-image: url("/art/ui/gem-ok.png?w=160"); }
html.kit-gem-warn .pill.warn::before { background-image: url("/art/ui/gem-warn.png?w=160"); }
html.kit-gem-danger .pill.danger::before { background-image: url("/art/ui/gem-danger.png?w=160"); }

/* the icon plate backs the icon buttons */
html.kit-icon-plate .hud .icon-btn { background: url("/art/ui/icon-plate.png?w=160") center / 100% 100% no-repeat; border: 0; }
@media (max-width: 600px) and (orientation: portrait) { .panel-layer .btn.small { min-height: 44px; } }

/* Single demo skin fills its row while preserving a useful art aspect ratio. */
html[data-theme] .skins-grid:has(> .skins-card:only-child) { grid-template-columns: minmax(0, 1fr); }
html[data-theme] .skins-card { background: var(--panel-head-bg); }
html[data-theme] .skins-grid:has(> .skins-card:only-child) .skins-img { height: clamp(260px, 42vh, 460px); aspect-ratio: auto; }
html[data-theme] .skins-img img { width: 100%; height: 100%; object-fit: contain; }
html[data-theme] .skins-info .btn { width: 100%; white-space: normal; }
html[data-theme] .skins-price .num { color: var(--amber-ink); }

/* Shared interaction states for shell controls. */
html[data-theme] :is(.icon-btn, .rail-btn, .pick-tab, .tab, .menu-item, .menu-theme, .pill-toggle, .pick-chip, .pick-sortbtn, button.chip, select, input[type="checkbox"]) {
  transition: transform 150ms ease, filter 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
html[data-theme] :is(.icon-btn, .rail-btn, .pick-tab, .tab, .menu-item, .menu-theme, .pill-toggle, .pick-chip, .pick-sortbtn, button.chip, select, input[type="checkbox"]):hover:not(:disabled) { filter: brightness(1.12); }
html[data-theme] :is(.icon-btn, .rail-btn, .pick-tab, .tab, .menu-item, .menu-theme, .pill-toggle, .pick-chip, .pick-sortbtn, button.chip, select, input[type="checkbox"]):active:not(:disabled) { transform: translateY(1px); filter: brightness(.94); }
html[data-theme] :is(.icon-btn, .rail-btn, .pick-tab, .tab, .menu-item, .menu-theme, .pill-toggle, .pick-chip, .pick-sortbtn, button.chip, select, input[type="checkbox"]):focus-visible { outline: 2px solid var(--amber-glow); outline-offset: 3px; }

/* Image slots have a visible, correctly sized fallback while atlas art is loading. */
.ico.painted:has(> img) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 21 12 12 22 3 12Z' fill='%23b58b45' fill-opacity='.45' stroke='%23e0be7a' stroke-width='1.5'/%3E%3C/svg%3E") center / 70% 70% no-repeat;
}
.ico.painted:has(> .kit-atlas-icon) { background: none; }

/* Paint native form controls with the same iron frame and brass trim as the kit. */
html.kit-loaded .panel :is(select, input[type="search"], input[type="text"], input[type="number"]) {
  color: var(--panel-ink); background: var(--panel-field-bg);
  border: 1px solid var(--brass); border-radius: 5px; box-shadow: inset 0 1px 3px rgba(0,0,0,.65), 0 1px 0 rgba(255,255,255,.05);
  min-height: 42px;
}
@media (max-width: 600px) {
  html.kit-loaded .panel :is(select, input[type="search"], input[type="text"], input[type="number"]) { min-height: 44px; }
}
html.kit-loaded .panel select { color-scheme: dark; padding-inline: 10px 30px; }
html:is([data-theme="light"], [data-theme="wood"]).kit-loaded .panel select { color-scheme: light; }
html.kit-loaded .login-sheet input[type="text"] { color: #efe3c6; background: rgba(14, 12, 10, .72); }
html.kit-loaded .panel :is(input[type="search"], input[type="text"]) { padding-inline: 12px; }
html.kit-loaded .panel :is(select, input):focus-visible { outline: 2px solid var(--amber-glow); outline-offset: 2px; }
html.kit-loaded .panel input[type="range"] {
  appearance: none; height: 24px; background: transparent; cursor: pointer; accent-color: var(--amber);
}
html.kit-loaded .panel input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border: 1px solid var(--brass); border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--masonry) 0 12px, var(--iron) 12px 15px);
  box-shadow: inset 0 1px 2px #000;
}
html.kit-loaded .panel input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; margin-top: -7px; border: 2px solid var(--brass-hi);
  border-radius: 3px; background: linear-gradient(135deg, var(--amber-glow), var(--amber), #744b18); box-shadow: 0 1px 4px #000;
}
html.kit-loaded .panel input[type="range"]::-moz-range-track { height: 8px; border: 1px solid var(--brass); border-radius: 2px; background: var(--masonry); }
html.kit-loaded .panel input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--brass-hi); border-radius: 3px; background: var(--amber); }
html.kit-loaded .panel input[type="checkbox"] { accent-color: var(--amber); }
