:root {
  color-scheme: dark;
  --bg: #060a12;
  --line: rgba(120, 160, 220, 0.16);
  --gold: #478ac9;
  --gold2: #8ec4ff;
  --text: #f0eee7;
  --soft: #969c94;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
  background:
    radial-gradient(800px 500px at 82% -10%, rgba(71, 138, 201, 0.2), transparent),
    radial-gradient(700px 500px at 8% 100%, rgba(20, 40, 70, 0.45), transparent),
    var(--bg);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.hidden { display: none !important; }

.lab-top {
  height: 52px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 8, 0.92);
}

.lab-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.lab-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(71, 138, 201, 0.35));
}

.lab-crumb {
  color: #767d76;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.lab-links {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.lab-links a {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(71, 138, 201, 0.35);
  border-radius: 7px;
  color: var(--gold2);
  background: rgba(71, 138, 201, 0.06);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lab-links a:hover { background: rgba(71, 138, 201, 0.16); }

.skin-page {
  width: min(1900px, 100%);
  height: calc(100vh - 52px);
  margin: 0 auto;
  padding: 8px clamp(12px, 1.5vw, 24px) 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.skin-heading {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.overline {
  color: var(--gold2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.skin-heading h1 {
  margin: 0;
  color: var(--gold2);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 15px rgba(71, 138, 201, 0.22);
}

.skin-heading p {
  margin: 0;
  color: var(--soft);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: right;
}

.skin-studio {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 460px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.skin-studio > h2 {
  grid-column: 1 / -1;
  position: relative;
  margin: 0;
  padding: 10px 14px;
  overflow: hidden;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 10px;
  color: var(--gold2);
  background:
    radial-gradient(130% 140% at 50% -80%, rgba(71, 138, 201, 0.2), transparent 55%),
    linear-gradient(165deg, rgba(16, 28, 48, 0.92), rgba(6, 10, 18, 0.98));
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.skin-studio > h2:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
}

.viewer-frame,
.skin-controls {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 10px;
  background: rgba(8, 14, 26, 0.92);
  box-shadow: var(--shadow);
}

.viewer-frame {
  height: 100%;
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.viewer-top,
.viewer-bottom {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-top > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #75d99d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.viewer-top > span > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75d99d;
  box-shadow: 0 0 8px #75d99d;
}

.model-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 6px 0;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 54%, rgba(67, 88, 68, 0.19) 0, rgba(19, 28, 21, 0.11) 36%, transparent 68%),
    linear-gradient(155deg, #10192c 0%, #0a101c 58%, #060910 100%);
}

.model-viewport:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(71, 138, 201, 0.025), transparent 18%, transparent 82%, rgba(71, 138, 201, 0.025)),
    radial-gradient(circle at 50% 47%, transparent 42%, rgba(0, 0, 0, 0.26) 100%);
}

.viewport-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.viewport-watermark img {
  width: min(220px, 42%);
  opacity: 0.09;
  filter: grayscale(1) brightness(1.7);
  user-select: none;
}

#skinCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-loader,
.viewer-hints,
.skin-viewer-error { z-index: 2; }

.viewer-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  background: #070c16;
}

.viewer-loader i {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--gold2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.viewer-hints {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.viewer-hints > span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(0, 0, 0, 0.65);
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.skin-viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 10, 8, 0.92);
}

.skin-viewer-error-card {
  width: min(420px, 92%);
  padding: 22px;
  text-align: center;
  border: 1px solid rgba(71, 138, 201, 0.34);
  border-radius: 12px;
  background: #0c120e;
}

.skin-viewer-error h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.skin-viewer-error p { margin: 0; color: #c6bfb0; font-size: 12px; }

.skin-viewer-error button {
  margin-top: 16px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(71, 138, 201, 0.45);
  border-radius: 8px;
  color: #f3e9d5;
  background: rgba(71, 138, 201, 0.14);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.viewer-bottom button,
.viewer-bottom label {
  height: 32px;
  border: 1px solid rgba(71, 138, 201, 0.22);
  border-radius: 6px;
  color: var(--gold2);
  background: rgba(0, 0, 0, 0.32);
}

.viewer-bottom button {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.viewer-bottom button:hover { border-color: rgba(71, 138, 201, 0.55); }

.viewer-bottom label {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-bottom label small {
  color: var(--gold2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.viewer-mouth-btn.active {
  border-color: rgba(238, 116, 210, 0.65);
  background: rgba(238, 116, 210, 0.16);
  color: #ffd9f5;
}

.viewer-bottom button:disabled { opacity: 0.4; }

.skin-controls {
  height: 100%;
  overflow-y: auto;
  padding: 12px 14px 14px;
  background:
    radial-gradient(130% 70% at 50% -35%, rgba(71, 138, 201, 0.16), transparent 52%),
    linear-gradient(165deg, rgba(16, 28, 48, 0.92), rgba(6, 10, 18, 0.98));
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 138, 201, 0.25) transparent;
}

.skin-controls::-webkit-scrollbar { width: 4px; }
.skin-controls::-webkit-scrollbar-thumb { background: rgba(71, 138, 201, 0.25); border-radius: 4px; }

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.control-grid > label,
.control-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(71, 138, 201, 0.18);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
}

.control-grid > label > span,
.control-grid legend {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: #ded6c8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.control-grid fieldset { display: flex; flex-direction: column; }
.control-grid fieldset legend { padding: 0; }
.control-grid fieldset > div { display: flex; gap: 4px; }
.control-grid fieldset label { position: relative; flex: 1; }
.control-grid fieldset input { position: absolute; opacity: 0; }

.control-grid fieldset span {
  padding: 6px 4px;
  display: block;
  border: 1px solid rgba(71, 138, 201, 0.25);
  border-radius: 5px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.control-grid fieldset input:checked + span {
  color: #061018;
  background: var(--gold2);
  border-color: var(--gold2);
}

.skin-page select,
.preset-box input[type="text"] {
  width: 100%;
  height: 28px;
  padding: 0 26px 0 8px;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 6px;
  color: #f0eade;
  background-color: #0b110d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23c7923e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 9px 6px;
  font-size: 12px;
  outline: none;
}

.preset-box input[type="text"] {
  padding-right: 10px;
  background-image: none;
  letter-spacing: 0.04em;
}

.preset-box input[type="text"]::placeholder { color: #8d8678; }

.skin-page select:hover,
.preset-box input[type="text"]:hover { border-color: rgba(71, 138, 201, 0.55); }

.skin-page select:focus,
.preset-box input[type="text"]:focus {
  border-color: var(--gold2);
  box-shadow: 0 0 0 3px rgba(71, 138, 201, 0.15);
}

.viewer-bottom select {
  height: 22px;
  padding: 0 16px 0 0;
  border: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23c7923e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/%3E%3C/svg%3E");
  box-shadow: none;
  font-size: 12px;
}

.sun-row { display: flex; align-items: center; justify-content: space-between; }
.sun-row > span { margin: 0; }
.sun-row input { display: none; }

.sun-row i {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid rgba(71, 138, 201, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.sun-row i:after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b3b3ad;
  transition: 0.18s;
}

.sun-row input:checked + i { background: rgba(71, 138, 201, 0.45); }
.sun-row input:checked + i:after { background: var(--gold2); transform: translateX(16px); }

.range-control input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--gold2);
  background: transparent;
}

.range-control b { color: var(--gold2); font-family: ui-monospace, monospace; font-size: 11px; }
.range-control small { color: var(--soft); font-size: 10px; font-weight: 600; }

.skin-divider {
  margin: 12px 0 6px;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(71, 138, 201, 0.18);
  color: #ded6c8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.skin-divider button {
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(221, 92, 187, 0.32);
  border-radius: 4px;
  color: #e284cb;
  background: rgba(221, 92, 187, 0.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.skin-divider button.active {
  color: #160c14;
  border-color: #ee74d2;
  background: #ee74d2;
}

.color-grid,
.glitch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.color-tile {
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(71, 138, 201, 0.2);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(20, 28, 22, 0.65), rgba(8, 12, 9, 0.85));
  cursor: pointer;
}

.color-tile:hover { border-color: rgba(71, 138, 201, 0.48); }

.color-tile input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid rgba(71, 138, 201, 0.45);
  border-radius: 6px;
  background: transparent;
}

.color-tile input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-tile input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }

.color-tile span b,
.color-tile span small { display: block; }
.color-tile span b { color: #fff; font-size: 11px; letter-spacing: 0.03em; }
.color-tile span small { margin-top: 1px; color: var(--soft); font-size: 9px; letter-spacing: 0.04em; }

.color-tile code {
  color: var(--gold2);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(71, 138, 201, 0.2);
}

.glitch-panel {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(238, 116, 210, 0.28);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
}

.glitch-intro {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #ee8bd7;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.glitch-intro small { color: var(--soft); font-size: 10px; }

.glitch-channel {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid rgba(238, 116, 210, 0.16);
  border-radius: 7px;
  background: rgba(8, 12, 9, 0.72);
}

.glitch-channel.disabled { opacity: 0.42; }
.glitch-picker-wrap { position: relative; width: 28px; height: 28px; }

.glitch-color-swatch {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid rgba(238, 116, 210, 0.38);
}

.glitch-color-picker {
  position: absolute;
  inset: 0;
  width: 28px;
  height: 28px;
  opacity: 0;
}

.glitch-channel-content > b { color: #fff; font-size: 11px; }
.glitch-rgb-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.glitch-rgb-row label { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 2px; }
.glitch-rgb-row small { color: #ee8bd7; font-size: 9px; font-weight: 700; }

.glitch-rgb-row input {
  width: 100%;
  height: 18px;
  padding: 0 3px;
  border: 1px solid rgba(238, 116, 210, 0.19);
  border-radius: 4px;
  color: #f6c9ea;
  background: #100b0f;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.glitch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.glitch-actions button {
  height: 28px;
  border: 1px solid rgba(238, 116, 210, 0.25);
  border-radius: 5px;
  color: #f5c5e9;
  background: rgba(238, 116, 210, 0.06);
  font-size: 10px;
  font-weight: 700;
}

.live-grid { margin-bottom: 6px; }

.preset-box { display: flex; flex-direction: column; gap: 5px; }

.preset-box select {
  height: 32px;
  text-align: center;
  text-align-last: center;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f4dfb5;
}

.preset-actions-grid,
.preset-code-grid { display: grid; gap: 5px; }
.preset-actions-grid { grid-template-columns: repeat(3, 1fr); }
.preset-code-grid { grid-template-columns: 1fr 1fr; }

.preset-actions-grid button,
.preset-code-grid button {
  height: 30px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.btn-preset-load { background: rgba(71, 138, 201, 0.1); border: 1px solid rgba(71, 138, 201, 0.3); color: var(--gold2); }
.btn-preset-save { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.12); color: #ded6c8; }
.btn-preset-del { background: rgba(215, 60, 50, 0.07); border: 1px solid rgba(215, 60, 50, 0.25); color: #ff857d; }
.btn-code-export { background: rgba(71, 138, 201, 0.12); border: 1px solid rgba(71, 138, 201, 0.35); color: #f2cb78; }
.btn-code-import { background: rgba(39, 174, 96, 0.1); border: 1px solid rgba(39, 174, 96, 0.32); color: #59d790; }

.apply-skin {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 1px solid var(--gold2);
  border-radius: 7px;
  color: #17130d;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  box-shadow: 0 6px 18px rgba(71, 138, 201, 0.16);
}

.apply-skin span,
.apply-skin small { display: block; }
.apply-skin span { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.apply-skin small { margin-top: 1px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; }
.apply-skin:disabled { filter: grayscale(0.7); }

.lab-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid rgba(71, 138, 201, 0.45);
  border-radius: 8px;
  color: #e7f2ff;
  background: #10192b;
  box-shadow: var(--shadow);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.lab-context {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #d5e6fb;
  font-size: 12px;
}

.lab-context span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-context button,
.sc2-gate-ghost,
.sc2-drawer-actions button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(71, 138, 201, 0.35);
  border-radius: 7px;
  color: var(--gold2);
  background: rgba(71, 138, 201, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.lab-context:not([hidden]) + .lab-links { margin-left: 8px; }

.sc2-gate {
  position: fixed;
  inset: 52px 0 0 0;
  z-index: 16;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(10px);
}

.sc2-gate[hidden],
.sc2-gate-card[hidden],
.sc2-drawer[hidden],
.sc2-modal[hidden],
.lab-context[hidden] { display: none !important; }

.sc2-gate-card {
  width: min(720px, 100%);
  padding: 22px;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 14px;
  background: rgba(10, 16, 28, 0.96);
  box-shadow: var(--shadow);
}

.sc2-gate-card h2 {
  margin: 6px 0 8px;
  color: #eef4ff;
  font-size: 28px;
  font-weight: 600;
}

.sc2-gate-card p { margin: 0 0 14px; color: var(--soft); }

.sc2-gate-go {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: #478ac9;
  text-decoration: none;
  font-weight: 700;
}

.sc2-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

#sc2-step-server.sc2-gate-card {
  width: min(1080px, 100%);
}

#sc2-server-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: min(62vh, 640px);
  overflow: auto;
  padding-right: 2px;
}

.sc2-server-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  font: inherit;
  overflow: hidden;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 16px;
  color: #eef4ff;
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.sc2-server-card:hover,
.sc2-server-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(142, 196, 255, 0.7);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.sc2-server-media {
  position: relative;
  display: block;
  height: 96px;
  background-color: rgba(0, 0, 0, 0.35);
  background-size: cover;
  background-position: center;
}

.sc2-server-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.05), rgba(6, 10, 18, 0.82));
}

.sc2-server-online {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5dffb0;
  box-shadow: 0 0 8px rgba(93, 255, 176, 0.7);
}

.sc2-server-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px 14px;
}

.sc2-server-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sc2-server-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sc2-server-text strong {
  font-size: 14px;
  line-height: 1.35;
}

.sc2-server-text em {
  color: #8ec4ff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sc2-server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.sc2-server-meta span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-size: 11px;
}

.sc2-pick {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid rgba(71, 138, 201, 0.24);
  border-radius: 10px;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.sc2-pick:hover,
.sc2-pick:focus-visible {
  border-color: #8ec4ff;
  background: rgba(71, 138, 201, 0.14);
}

.sc2-pick small { color: var(--soft); font-size: 11px; }

#sc2-mode-toggle {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8ec4ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sc2-mode-note,
.sc2-apply-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--soft);
  font-size: 11px;
}

.skin-page select:disabled { opacity: 0.72; }

.sc2-drawer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sc2-drawer-actions { display: flex; gap: 6px; }
.sc2-drawer-actions button { flex: 1; }

.sc-icon-toolbar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 0 2px;
  background: linear-gradient(180deg, rgba(8, 14, 26, 0), rgba(8, 14, 26, 0.96) 28%);
}

.sc-icon-toolbar-sep {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.12);
}

.sc-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #eef4ff;
}

.sc-icon-btn svg { width: 18px; height: 18px; }
.sc-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.sc-icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 5;
  width: max-content;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c1422;
  color: #eef4ff;
  font-size: 11px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
}

.sc-icon-btn[data-tip]:hover::after { opacity: 1; }

.sc-icon-btn-accent {
  background: rgba(71, 138, 201, 0.2);
  border-color: rgba(71, 138, 201, 0.5);
  color: #b9dcff;
}

.sc-icon-btn-primary {
  background: #478ac9;
  border-color: transparent;
  color: #fff;
}

.sc2-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 16, 0.72);
}

.sc2-modal-card {
  width: min(480px, 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(71, 138, 201, 0.3);
  border-radius: 12px;
  background: #10192b;
}

.sc2-modal-card h3 { margin: 0; font-size: 16px; }
.sc2-modal-card textarea {
  width: 100%;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 8px;
  padding: 8px;
  color: #eef4ff;
  background: #0b1220;
  resize: vertical;
}

@keyframes spin { to { transform: rotate(360deg); } }

.evrima-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.evrima-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid rgba(71, 138, 201, 0.22);
  background: rgba(6, 10, 18, 0.96);
}

.evrima-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.evrima-brand img {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.evrima-brand b {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.evrima-brand small {
  color: #8ec4ff;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.evrima-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.evrima-nav a {
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b7c6da;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.evrima-nav a:hover,
.evrima-nav button:hover { background: rgba(255, 255, 255, 0.04); }

.evrima-nav button {
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b7c6da;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.evrima-nav [hidden] { display: none !important; }

.evrima-nav a.active {
  color: #d7ebff;
  border-color: rgba(71, 138, 201, 0.35);
  background: linear-gradient(90deg, rgba(71, 138, 201, 0.22), transparent);
}

.evrima-side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(71, 138, 201, 0.22);
  color: #9eb0c6;
  font-size: 12px;
}

#sc2-who {
  color: #e7f3ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sc2-context {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(71, 138, 201, 0.28);
  border-radius: 10px;
  background: rgba(71, 138, 201, 0.08);
}

#sc2-context[hidden] { display: none !important; }

#sc2-context-server,
#sc2-context-steam {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sc2-context-server {
  color: #d7ebff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

#sc2-context-steam {
  color: #8ec4ff;
  font-size: 11px;
  white-space: nowrap;
}

#sc2-context-steam:empty { display: none; }

.evrima-side-foot button {
  margin-top: 7px;
  width: 100%;
  height: 30px;
  border: 1px solid rgba(71, 138, 201, 0.4);
  border-radius: 7px;
  color: #d7ebff;
  background: rgba(8, 16, 30, 0.55);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.evrima-main {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.evrima-app .skin-page {
  height: 100%;
  width: 100%;
}

.evrima-app .sc2-gate {
  position: absolute;
  inset: 0;
}

@media (max-width: 1100px) {
  body { overflow: auto; }
  .evrima-app { height: auto; overflow: auto; }
  .evrima-main { height: auto; overflow: visible; }
  .skin-page { height: auto; overflow: visible; }
  .skin-heading { grid-template-columns: 1fr; text-align: left; }
  .skin-heading h1,
  .skin-heading p { text-align: left; }
  .skin-studio { display: flex; flex-direction: column; }
  .viewer-frame { height: 68vh; min-height: 420px; }
  .skin-controls { height: auto; overflow: visible; }
}

@media (max-width: 720px) {
  .evrima-app {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .evrima-side {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(71, 138, 201, 0.22);
  }

  .evrima-brand small,
  .evrima-side-foot { display: none; }

  .evrima-nav { flex-direction: row; }

  .evrima-main { height: auto; overflow: visible; }

  .lab-crumb,
  .skin-heading .overline,
  .skin-heading p { display: none; }
  .viewer-frame { height: 52vh; min-height: 320px; }
  .viewer-bottom { display: grid; grid-template-columns: 1fr 1fr; }
  .viewer-bottom label { grid-column: 1 / -1; }
  .viewer-hints { display: none; }
  .color-grid,
  .glitch-grid { grid-template-columns: 1fr; }
}
