/* =========================================================
   Eaglercraft Launcher — modern stylesheet
   Clean, professional dashboard aesthetic. Mobile-first.
   ========================================================= */

:root {
  /* surfaces */
  --bg:            #0a0e14;
  --bg-grad:       radial-gradient(ellipse 80% 60% at 50% -10%, rgba(34,197,94,.10), transparent 70%),
                   radial-gradient(ellipse 60% 50% at 100% 100%, rgba(56,189,248,.06), transparent 70%),
                   #0a0e14;
  --surface:       #111620;
  --surface-2:     #161c28;
  --surface-3:     #1c2332;
  --elev:          rgba(255, 255, 255, 0.02);

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text:          #f1f5f9;
  --text-dim:      #cbd5e1;
  --muted:         #94a3b8;
  --muted-2:       #64748b;

  /* brand + accents */
  --primary:       #22c55e;
  --primary-hover: #16a34a;
  --primary-soft:  rgba(34, 197, 94, 0.12);
  --primary-glow:  rgba(34, 197, 94, 0.35);
  --accent:        #38bdf8;
  --danger:        #ef4444;
  --danger-soft:   rgba(239, 68, 68, 0.12);
  --warning:       #f59e0b;

  /* type */
  --font:          'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:     ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* spacing + radius */
  --r-sm:          8px;
  --r-md:          12px;
  --r-lg:          16px;
  --r-pill:        999px;

  /* shadows */
  --sh-sm:         0 1px 2px rgba(0,0,0,.4);
  --sh-md:         0 4px 16px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.4);
  --sh-lg:         0 16px 40px rgba(0,0,0,.4), 0 4px 8px rgba(0,0,0,.3);
  --sh-glow:       0 0 0 1px var(--primary-glow), 0 8px 28px rgba(34,197,94,.18);

  /* layout */
  --side-w:        240px;
  --topbar-h:      60px;
  --bottom-h:      64px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  background: var(--bg-grad);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: #7dd3fc; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
code, kbd { font-family: var(--font-mono); font-size: .85em; }
kbd {
  padding: 1px 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.muted { color: var(--muted); }
.is-hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* hide noisy decorative bg from earlier theme */
.bg-panorama { display: none; }

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

/* ---------- sidebar (desktop) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background: rgba(10, 13, 19, 0.78);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 5;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  margin-bottom: 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand:hover { color: var(--text); }

.brand-block {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 60%, #15803d 100%);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255,255,255,.18);
  position: relative;
  overflow: hidden;
}
.brand-block::before {
  /* tiny isometric cube as a discreet product nod */
  content: '';
  width: 16px; height: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.35) 0 50%, transparent 50%),
    linear-gradient(-135deg, rgba(0,0,0,.25) 0 50%, transparent 50%);
  transform: rotate(45deg);
  border-radius: 2px;
}
.brand-block__grass, .brand-block__dirt { display: none; }

.brand-text { line-height: 1.15; display: grid; gap: 1px; }
.brand-text__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-text__sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
  position: relative;
  min-height: 40px;
}
.nav-item__icon {
  width: 18px; height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}
.nav-item:hover {
  color: var(--text);
  background: var(--elev);
  text-decoration: none;
}
.nav-item.is-active {
  color: var(--text);
  background: var(--primary-soft);
}
.nav-item.is-active .nav-item__icon { color: var(--primary); }
.nav-item.is-active::after { content: none; }

.sidebar__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.user-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #0a0e14;
  position: relative;
}
.user-chip__avatar::before,
.user-chip__avatar::after { content: none; }
.user-chip__meta { line-height: 1.2; min-width: 0; }
.user-chip__label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: block; }
.user-chip__name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
  max-width: 140px;
}

/* ---------- main area ---------- */
.main {
  padding: 32px clamp(20px, 4vw, 48px);
  min-width: 0;
  max-width: 1400px;
}

.view { display: none; animation: viewIn .2s ease-out; }
.view.is-active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view__head { margin: 0 0 24px; }
.view__head h2 {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.view__head .muted { font-size: 14px; max-width: 70ch; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  margin-bottom: 28px;
  padding: 40px 32px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 80% 80% at 0% 0%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(ellipse 80% 80% at 100% 100%, rgba(56,189,248,.12), transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  /* soft orb */
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after { content: none; }
.hero__inner {
  position: relative;
  display: grid;
  gap: 6px;
}
.hero__title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #b5c4d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  display: block;
}
.hero__title::before { content: none; }
.hero__splash {
  position: static;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  transform: none;
  animation: none;
  pointer-events: auto;
  white-space: normal;
  max-width: 56ch;
  text-shadow: none;
}

/* ---------- play deck ---------- */
.play-deck {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}
.play-deck__left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.play-deck__right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.play-deck__options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 4px;
}

/* ---------- buttons ---------- */
.mc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  font: 600 14px/1 var(--font);
  letter-spacing: 0;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  text-shadow: none;
  box-shadow: var(--sh-sm);
  transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease, color .15s ease;
}
.mc-button:hover {
  background: #232a3a;
  border-color: var(--border-strong);
  outline: none;
}
.mc-button:active { transform: translateY(1px); box-shadow: none; }
.mc-button[disabled] { opacity: .5; cursor: not-allowed; }

.mc-button--primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-color: rgba(255,255,255,.12);
  color: #0a0e14;
  text-shadow: none;
  font-weight: 700;
  box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,.18);
}
.mc-button--primary:hover {
  background: linear-gradient(180deg, #2dd06b 0%, #19a956 100%);
  filter: brightness(1.04);
}

.mc-button--danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.mc-button--danger:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

.mc-button--xl {
  min-height: 56px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--r-md);
  letter-spacing: 0;
  width: 100%;
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255,255,255,.18);
}
.mc-button--xl:hover { box-shadow: var(--sh-glow), inset 0 1px 0 rgba(255,255,255,.2); }

.mc-button--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.mc-button--ghost:hover { background: var(--elev); border-color: var(--border-strong); color: var(--text); }

/* ---------- panels (formerly "mc-panel") ---------- */
.mc-panel {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: border-color .15s ease;
}
.mc-panel:hover { border-color: var(--border-strong); }
.mc-panel--stone { background: var(--surface); }
.mc-panel--full { grid-column: 1 / -1; }
.mc-panel h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
}
.mc-panel p { color: var(--text-dim); margin: 0 0 10px; font-size: 14px; }
.mc-panel p:last-child { margin-bottom: 0; }

/* ---------- version select ---------- */
.version-select {
  display: grid;
  gap: 6px;
}
.version-select__label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font);
}
.version-select__wrap { position: relative; }
.version-select__caret {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
}
.version-select__hint {
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}

/* ---------- inputs ---------- */
.mc-input, .mc-select {
  width: 100%;
  padding: 10px 14px;
  font: 500 14px var(--font);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: none;
  min-height: 40px;
}
.mc-input:hover, .mc-select:hover { border-color: var(--border-strong); }
.mc-input:focus, .mc-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface-3);
}
.mc-input::placeholder { color: var(--muted-2); }
.mc-select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea.mc-input { resize: vertical; min-height: 72px; line-height: 1.5; }

/* ---------- toggle ---------- */
.mc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  user-select: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 0;
  min-height: 32px;
}
.mc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mc-toggle__pip {
  position: relative;
  width: 36px; height: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  flex-shrink: 0;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease;
}
.mc-toggle__pip::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: var(--sh-sm);
  transition: transform .18s cubic-bezier(.4,0,.2,1), background .15s ease;
}
.mc-toggle input:checked + .mc-toggle__pip {
  background: var(--primary);
  border-color: var(--primary);
}
.mc-toggle input:checked + .mc-toggle__pip::after {
  transform: translateX(16px);
  background: #fff;
}
.mc-toggle:hover { color: var(--text); }
.mc-toggle:hover .mc-toggle__pip { border-color: var(--border-strong); }
.mc-toggle input:focus-visible + .mc-toggle__pip { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- field ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field > span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.field small { color: var(--muted-2); font-size: 12px; }
.field input[type="color"] {
  width: 56px; height: 36px; padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}

/* ---------- version grid ---------- */
.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.version-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.version-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: var(--border-strong);
}
.version-card__art {
  height: 100px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 30% 40%, rgba(34,197,94,.22), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(56,189,248,.18), transparent 60%),
    linear-gradient(180deg, var(--surface-3), var(--surface-2));
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.version-card__art-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: none;
  background: linear-gradient(180deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font);
}
.version-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.version-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.version-card__author { font-size: 12px; color: var(--muted); }
.version-card__desc { font-size: 13px; color: var(--text-dim); flex: 1; line-height: 1.5; }
.version-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-dim);
}
.tag--gold  { color: var(--warning); border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.08); }
.tag--blue  { color: var(--accent);  border-color: rgba(56,189,248,.3);  background: rgba(56,189,248,.08); }
.tag--green { color: var(--primary); border-color: rgba(34,197,94,.3);   background: rgba(34,197,94,.10); }
.tag--red   { color: #fca5a5;        border-color: rgba(239,68,68,.3);   background: rgba(239,68,68,.08); }
.tag--muted { color: var(--muted);   }
.version-card__actions { display: flex; gap: 8px; margin-top: 4px; }
.version-card__actions .mc-button { flex: 1; }

.version-card.is-default {
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 0 0 1px rgba(34,197,94,.20), var(--sh-sm);
}
.version-card.is-default .version-card__name::after {
  content: ' ✓';
  color: var(--primary);
}
.version-card.is-experimental {
  border-style: dashed;
  opacity: .92;
}
.version-card__warn {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--r-sm);
  line-height: 1.4;
}

/* ---------- version sections (Eaglercraft / MCPE groups) ---------- */
/* When the host renders grouped sections, override the grid layout. */
#versionGrid:has(.version-section) {
  display: block;
}
/* Fallback for browsers without :has() — apply via class as a backup */
.version-host { display: block !important; }
.version-section { margin-bottom: 28px; }
.version-section:last-child { margin-bottom: 0; }
.version-section__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.version-section__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.version-section__sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.version-grid--inline { margin: 0; }
.version-host__hint {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

/* ---------- server browser ---------- */
.server-add {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
}
.server-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.server-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  transition: border-color .15s ease, transform .12s ease;
}
.server-item:hover {
  transform: none;
  border-color: var(--border-strong);
}
.server-item__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: var(--r-md);
  color: #0a0e14;
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  text-shadow: none;
  border: none;
  box-shadow: var(--sh-sm);
}
.server-item--custom .server-item__icon {
  background: linear-gradient(135deg, var(--accent), #0284c7);
}
.server-item__name { font-weight: 600; color: var(--text); margin: 0 0 2px; font-size: 14px; }
.server-item__url {
  font: 500 12px var(--font-mono);
  color: var(--muted);
  word-break: break-all;
}
.server-item__meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 6px;
  flex-wrap: wrap;
}
.server-item__meta span:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 3px; height: 3px;
  background: var(--muted-2);
  border-radius: 50%;
  margin-left: 12px;
  vertical-align: middle;
}
.server-item__actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- skins page ---------- */
.skins-deck {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 18px;
}
.skin-preview {
  display: grid; place-items: center; min-height: 320px;
  background:
    radial-gradient(circle, rgba(34,197,94,.10), transparent 70%),
    var(--surface);
}
.skin-figure { position: relative; width: 80px; height: 200px; --skin: #c08762; }
.skin-figure > div {
  position: absolute;
  background: var(--skin);
  border-radius: 4px;
  box-shadow: inset 0 -8px 12px rgba(0,0,0,.18), inset 0 4px 6px rgba(255,255,255,.06);
}
.skin-figure__head { width: 40px; height: 40px; left: 20px; top: 0; border-radius: 6px;
  background:
    radial-gradient(circle at 30% 45%, #0a0e14 0 3px, transparent 4px),
    radial-gradient(circle at 70% 45%, #0a0e14 0 3px, transparent 4px),
    var(--skin);
}
.skin-figure__torso { width: 40px; height: 60px; left: 20px; top: 40px; background: var(--accent); }
.skin-figure__armL  { width: 16px; height: 56px; left: 4px; top: 40px; }
.skin-figure__armR  { width: 16px; height: 56px; right: 4px; top: 40px; }
.skin-figure__legL  { width: 20px; height: 56px; left: 20px; top: 100px; background: #1e3a8a; }
.skin-figure__legR  { width: 20px; height: 56px; left: 40px; top: 100px; background: #1e3a8a; }

.skin-controls { display: flex; flex-direction: column; }

/* ---------- tip card ---------- */
.tip-card kbd { color: var(--text); }
.server-quick code { font-size: 12px; color: var(--muted); }

/* ---------- news ---------- */
.news-feed {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  gap: 12px;
}
.news-feed li {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .15s ease;
}
.news-feed li:hover { border-color: var(--border-strong); }
.news-feed time { font-size: 12px; color: var(--muted); font-weight: 500; }
.news-feed h4 {
  margin: 6px 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  font-family: var(--font);
  text-shadow: none;
}
.news-feed p { font-size: 14px; color: var(--text-dim); margin: 0; line-height: 1.55; }

/* ---------- settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.mirror-list { display: grid; gap: 12px; }
.mirror-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
}
.mirror-row__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}
.mirror-row .mc-input {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.credit-list {
  padding-left: 18px;
  color: var(--text-dim);
  display: grid;
  gap: 8px;
  font-size: 14px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--sh-lg);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  text-shadow: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--ok  { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.10); color: #bbf7d0; }
.toast--err { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.10); color: #fecaca; }

/* =========================================================
   MOBILE
   ========================================================= */

/* Mobile / tablet (<= 900px): top app bar + bottom nav */
@media (max-width: 900px) {
  :root { --side-w: 0; }

  .app { grid-template-columns: 1fr; min-height: 100dvh; }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    background: rgba(10,13,19,.92);
    border-right: none;
    border-bottom: 1px solid var(--border);
    z-index: 10;
    /* IMPORTANT: backdrop-filter creates a containing block for
       position:fixed descendants. Use only on the nav itself, not here. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sidebar__brand {
    padding: 0;
    margin: 0;
    border: none;
    flex-shrink: 0;
  }
  .brand-text__sub { display: none; }
  .sidebar__nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
    background: rgba(10,13,19,.92);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--border);
    z-index: 20;
  }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 8px 6px;
    border-radius: var(--r-sm);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    min-height: 52px;
    min-width: 48px;
    text-align: center;
    flex: 1;
    max-width: 80px;
  }
  .nav-item span {
    display: block;
    font-size: 10px;
    line-height: 1.1;
  }
  .nav-item__icon { width: 20px; height: 20px; }
  .nav-item.is-active { background: transparent; color: var(--primary); }
  .nav-item.is-active .nav-item__icon { color: var(--primary); }

  .sidebar__foot {
    margin: 0 0 0 auto;
    padding: 0;
    border: none;
  }
  .user-chip { padding: 4px 8px 4px 4px; background: transparent; border: none; }
  .user-chip__avatar { width: 28px; height: 28px; font-size: 12px; }
  .user-chip__meta { display: none; }

  .main {
    padding: 20px 16px calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom));
    max-width: 100%;
  }

  .hero { padding: 28px 22px; border-radius: var(--r-md); }
  .hero__title { font-size: clamp(26px, 8vw, 36px); }
  .hero__splash { font-size: 14px; }

  .play-deck { grid-template-columns: 1fr; gap: 16px; }
  .play-deck__left { padding: 18px; }
  .server-add { grid-template-columns: 1fr; }
  .skins-deck { grid-template-columns: 1fr; }
  .skin-preview { min-height: 280px; }
  .mirror-row { grid-template-columns: 1fr; gap: 6px; }
  .mirror-row__label { font-size: 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }

  .server-item {
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon info" "actions actions";
    gap: 12px;
    padding: 14px;
  }
  .server-item > div:nth-child(1) { grid-area: icon; }
  .server-item > div:nth-child(2) { grid-area: info; }
  .server-item__actions { grid-area: actions; justify-content: flex-start; }
  .server-item__actions .mc-button { flex: 1; min-width: 0; }

  .version-grid { grid-template-columns: 1fr; gap: 12px; }

  .toast { bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .main { padding: 16px 14px calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom)); }
  .hero { padding: 24px 18px; }
  .view__head { margin-bottom: 18px; }
  .view__head h2 { font-size: 22px; }
  .play-deck__left { padding: 16px; }
  .mc-panel { padding: 16px; }
  .nav-item span { display: none; }
  .nav-item { min-height: 44px; }
  .brand-text__name { font-size: 14px; }
}

/* Larger screens: more breathing room */
@media (min-width: 1280px) {
  .main { padding: 40px 56px; }
  .play-deck { gap: 24px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
