/* ============================================================
   Chud — Neon Glass design system
   Frosted midnight glass · magenta→cyan neon accent · energetic
   Drop-in replacement for the old Hextech UI (native/ui/).
   Token *names* mirror the legacy set so profile.js keeps working;
   only the *values* change to the Neon Glass palette.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Medium.ttf') format('truetype');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}

:root {
  /* surfaces (deep midnight) */
  --bg-base:   #0a0a1f;
  --bg-stage:  #0b0b22;
  --bg-panel:  rgba(255,255,255,0.045);
  --bg-raised: rgba(255,255,255,0.07);
  --bg-inset:  rgba(6,6,20,0.55);

  /* glass */
  --glass:        rgba(255,255,255,0.045);
  --glass-strong: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.10);
  --glass-blur:   16px;

  /* text */
  --text-primary:   #f2f2ff;
  --text-secondary: #9a9ac8;
  --text-muted:     #6b6b96;
  --text-dark:      #0a0a1f;

  /* lines */
  --line-soft:   rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.12);
  --line-gold:   rgba(255,61,154,0.42);   /* legacy name → neon magenta edge */

  /* neon accent */
  --magenta:      #ff3d9a;
  --magenta-soft: #ff8ac4;
  --cyan:         #35e4ff;
  --cyan-soft:    #7ceeff;
  --neon-grad:    linear-gradient(135deg, #ff3d9a, #35e4ff);
  --neon-grad-h:  linear-gradient(90deg, #ff3d9a, #35e4ff);

  /* legacy accent names remapped onto the neon palette (profile.js uses these) */
  --gold:        #7ceeff;
  --gold-bright: #f2f2ff;
  --gold-hover:  #9ff1ff;
  --gold-press:  #35e4ff;
  --gold-fill:   rgba(53,228,255,0.10);
  --teal:        #35e4ff;
  --blue:        #6aa0f0;

  /* status */
  --green:      #33e0a0;
  --green-fill: rgba(51,224,160,0.12);
  --red:        #ff5470;
  --red-fill:   rgba(255,84,112,0.12);
  --amber:      #e6a23c;
  --amber-fill: rgba(230,162,60,0.12);
  --purple:     #b768e6;

  /* radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  /* fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui:      'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'Space Mono', 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
a { color: var(--cyan-soft); text-decoration: none; }
a:hover { color: var(--cyan); }

::selection { background: rgba(255,61,154,0.32); color: #fff; }

/* animated ambient backdrop */
.app-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 640px at 84% -12%, rgba(255,61,154,0.18), transparent 60%),
    radial-gradient(1000px 620px at 4% 112%, rgba(53,228,255,0.16), transparent 58%),
    linear-gradient(160deg, #0a0a1f, #100f2e 60%, #0b0b22);
}
.app-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 65%, rgba(124,238,255,.4), transparent 50%),
    radial-gradient(1.5px 1.5px at 42% 80%, rgba(255,138,196,.4), transparent 50%),
    radial-gradient(1.5px 1.5px at 88% 22%, rgba(255,255,255,.3), transparent 50%);
}

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: padding-box; }

/* ============================================================
   App shell — glass top bar + content
   ============================================================ */
.shell { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px; height: 60px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10,10,31,0.55); backdrop-filter: blur(var(--glass-blur));
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: block; object-fit: cover;
  box-shadow: 0 4px 18px rgba(255,61,154,0.35);
}
.brand-title { font-weight: 600; font-size: 16px; color: var(--text-primary); letter-spacing: .01em; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--text-muted); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: var(--r-sm); cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,.05); }
.nav-item.active {
  color: var(--text-primary); background: rgba(255,255,255,.06);
  border-color: var(--glass-border);
  box-shadow: 0 0 0 1px rgba(255,61,154,.12) inset;
}
.nav-item.active .nav-ico { color: var(--magenta-soft); }
.nav-ico { width: 16px; height: 16px; display: inline-flex; opacity: .95; }
.nav-ico svg { width: 100%; height: 100%; }

.topbar .spacer { flex: 1; }
.page-title { display: none; }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 60px; }
.content-inner { max-width: 1180px; margin: 0 auto; }

.fade-in { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Glass surfaces
   ============================================================ */
.glass, .hx, .forge {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur));
  padding: 22px;
}
.glass.lit, .hx.armed, .forge.lit {
  border-color: var(--line-gold);
  box-shadow: 0 0 0 1px rgba(255,61,154,.10), 0 0 40px rgba(255,61,154,.08) inset;
}
.glass.danger, .hx.danger { border-color: rgba(255,84,112,.5); }
/* legacy filigree corners are invisible in neon */
.fcorner, .corner { display: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  color: var(--text-primary); transition: all .15s; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.11); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
.btn.sm { padding: 7px 13px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.primary {
  color: var(--text-dark); border: none; font-weight: 700;
  background: var(--neon-grad);
  box-shadow: 0 6px 22px rgba(255,61,154,.32);
}
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 8px 28px rgba(255,61,154,.42); }
.btn.danger {
  color: #fff; border-color: rgba(255,84,112,.6);
  background: linear-gradient(180deg, rgba(255,84,112,.28), rgba(255,84,112,.16));
}
.btn.danger:hover { background: linear-gradient(180deg, rgba(255,84,112,.4), rgba(255,84,112,.24)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: rgba(255,255,255,.05); color: var(--text-primary); }

/* ============================================================
   Toggle switch (neon)
   ============================================================ */
.tog {
  --w: 46px; --h: 25px;
  position: relative; width: var(--w); height: var(--h);
  border-radius: 999px; cursor: pointer; flex: 0 0 auto;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.tog .knob {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #5a5a86;
  transition: transform .22s cubic-bezier(.4,1.3,.6,1), background .2s;
}
.tog.on {
  background: var(--neon-grad-h); border-color: transparent;
  box-shadow: 0 0 16px rgba(255,61,154,.5);
}
.tog.on .knob { transform: translateX(21px); background: #fff; }
.tog.disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   Status chip / light
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: .08em; padding: 4px 10px; border-radius: 20px;
  border: 1px solid transparent; text-transform: uppercase;
}
.slight { position: relative; flex: 0 0 auto; border-radius: 50%; display: inline-block; }
/* Compositor-friendly pulse: a glow pseudo whose opacity+scale animate (GPU),
   instead of animating box-shadow/filter on the dot (which repaints every
   frame for the whole session while the client is connected). */
.slight.on::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  box-shadow: 0 0 9px 1px currentColor; will-change: opacity, transform;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { opacity: .3; transform: scale(.7); }
  50%     { opacity: 1; transform: scale(1); }
}

/* helpers */
.row { display: flex; align-items: center; gap: 14px; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.spacer { flex: 1; }
.section-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }
.divider { height: 1px; background: var(--line-soft); width: 100%; }

/* ============================================================
   Dashboard — hero glass + module grid  (matches mock 1c)
   ============================================================ */
.dash { display: flex; flex-direction: column; gap: 18px; }

.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 26px;
  padding: 24px 28px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}
.hero.armed { border-color: var(--line-gold); box-shadow: 0 0 50px rgba(255,61,154,.08) inset; }

.core {
  position: relative; width: 108px; height: 108px; flex: 0 0 auto; display: grid; place-items: center;
}
.core-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 300deg, rgba(255,61,154,.35) 350deg, var(--cyan) 360deg);
  -webkit-mask: radial-gradient(circle, #000 62%, transparent 63%);
          mask: radial-gradient(circle, #000 62%, transparent 63%);
  animation: sweep 3.4s linear infinite;
}
.hero.armed .core-ring { animation-duration: 2s; }
.core-idle .core-ring { background: conic-gradient(from 0deg, transparent 300deg, rgba(154,154,200,.2) 350deg, rgba(154,154,200,.4) 360deg); }
.core-inner { position: absolute; inset: 11px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
@keyframes sweep { to { transform: rotate(360deg); } }
.core-label { text-align: center; z-index: 1; }
.core-state {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .06em;
  background: var(--neon-grad-h); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.core-idle .core-state { background: none; color: var(--text-muted); -webkit-text-fill-color: currentColor; }
.core-cap { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; }

.hero-body { flex: 1; min-width: 0; }
.hero-kicker { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }
.hero-title { font-size: 23px; font-weight: 600; color: var(--text-primary); margin-top: 3px; }
.hero-stats { display: flex; gap: 30px; margin-top: 16px; flex-wrap: wrap; }
.hstat .hstat-val { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.hstat .hstat-val.grad { background: var(--neon-grad-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hstat .hstat-val.green { color: var(--green); }
.hstat .hstat-val.uptime { font-size: 21px; }
.hstat .hstat-lab { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; }

.dash-sec { display: flex; align-items: center; gap: 14px; }
.dash-sec .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .modules { grid-template-columns: 1fr; } }

.mod {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: var(--r-md); padding: 20px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)); transition: border-color .2s, box-shadow .2s;
}
.mod.armed { background: rgba(255,61,154,.07); border-color: rgba(255,61,154,.4); }
.mod.armed .mod-flow { display: block; }
.mod.locked { opacity: .96; }
.mod.locked .hazard-stripe { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: repeating-linear-gradient(45deg, rgba(230,162,60,.10) 0 8px, transparent 8px 16px); }
.mod-flow { display: none; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.05); overflow: hidden; }
.mod-flow i { position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--magenta), transparent); animation: flow 2.4s linear infinite; }
@keyframes flow { from { transform: translateX(-120%); } to { transform: translateX(320%); } }

.mod-head { display: flex; align-items: center; justify-content: space-between; }
.mod-gem {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; padding: 8px;
  color: var(--text-secondary); background: rgba(255,255,255,.06);
}
.mod-gem svg { width: 100%; height: 100%; }
.mod.armed .mod-gem { color: var(--magenta-soft); background: rgba(255,61,154,.14); }
.mod-title { font-weight: 600; font-size: 16px; color: var(--text-primary); margin-top: 15px; }
.mod-sub { font-size: 12px; line-height: 1.5; color: var(--text-secondary); margin-top: 6px; flex: 1; }
.mod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.mod-status { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; }
.mod-metric { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.mod-metric b { color: var(--text-secondary); font-weight: 700; }
.mod-lock { font-size: 11px; color: var(--amber); margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.mod-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* ============================================================
   Risk strip / acknowledgment gate
   ============================================================ */
.riskstrip {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  padding: 15px 20px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,84,112,.14), rgba(255,84,112,.06));
  border: 1px solid rgba(255,84,112,.45);
}
.riskstrip::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.riskstrip .hazard { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--red); }
.riskstrip .hazard svg { width: 100%; height: 100%; }
.risk-title { font-weight: 700; font-size: 14px; color: #ff92a4; }
.risk-body { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }

/* ============================================================
   Settings
   ============================================================ */
.set-wrap { display: flex; flex-direction: column; gap: 16px; }
.set-card { }
.set-card-title { font-weight: 600; font-size: 16px; color: var(--text-primary); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.set-card-title .ci { width: 18px; height: 18px; color: var(--magenta-soft); display: inline-flex; }
.set-card-title .ci svg { width: 100%; height: 100%; }
.set-list { display: flex; flex-direction: column; }
.set-field { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 2px; border-bottom: 1px solid var(--line-soft); }
.set-field:last-child { border-bottom: none; }
.set-flabel { font-size: 13.5px; color: var(--text-primary); }
.set-fhint { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.set-control { display: flex; align-items: center; }
.set-input-wrap { display: inline-flex; align-items: center; gap: 7px; }
.set-input {
  background: var(--bg-inset); border: 1px solid var(--glass-border); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 13px; padding: 8px 12px; border-radius: var(--r-sm);
  width: 100px; text-align: right; outline: none; transition: border-color .15s, box-shadow .15s;
}
.set-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53,228,255,.15); }
.set-input.key { width: 130px; text-align: center; text-transform: lowercase; color: var(--cyan-soft); }
.set-unit { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.set-seg { display: inline-flex; border: 1px solid var(--glass-border); border-radius: var(--r-sm); overflow: hidden; background: var(--bg-inset); }
.seg-btn { background: transparent; border: none; color: var(--text-secondary); font-family: var(--font-mono); font-size: 11.5px; padding: 8px 14px; cursor: pointer; border-right: 1px solid var(--glass-border); transition: all .15s; }
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--text-primary); }
.seg-btn.on { background: var(--neon-grad-h); color: var(--text-dark); font-weight: 700; }

/* ============================================================
   Activity log
   ============================================================ */
.act-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.act-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 12px; }
.act-list { display: flex; flex-direction: column; max-height: 64vh; overflow-y: auto; }
.act-row { display: grid; grid-template-columns: 22px 76px 1fr; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.act-row:last-child { border-bottom: none; }
.act-ico { width: 16px; height: 16px; display: inline-flex; }
.act-ico svg { width: 100%; height: 100%; }
.act-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.act-text { color: var(--text-primary); }

/* ============================================================
   Diagnostics
   ============================================================ */
.diag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .diag-grid { grid-template-columns: 1fr; } }
.diag-card-title { font-weight: 600; font-size: 15px; color: var(--text-primary); margin-bottom: 8px; }
.diag-list { display: flex; flex-direction: column; }
.diag-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 2px; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.diag-row:last-child { border-bottom: none; }
.diag-k { color: var(--text-secondary); font-size: 12.5px; }
.diag-v { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-primary); }
.diag-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.diag-capout { font-family: var(--font-mono); font-size: 12px; margin-top: 12px; line-height: 1.5; }
.kbd { font-family: var(--font-mono); font-size: 12px; color: var(--cyan-soft); background: var(--bg-inset); border: 1px solid var(--line-gold); border-radius: var(--r-sm); padding: 3px 9px; }

/* ============================================================
   Ready-check overlay
   ============================================================ */
.rc-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5,5,20,.72); backdrop-filter: blur(6px); animation: fadeIn .25s ease both; }
.rc-card {
  position: relative; width: 340px; padding: 34px 30px 30px; text-align: center;
  background: var(--glass-strong); border: 1px solid var(--line-gold); border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 0 60px rgba(255,61,154,.28), 0 20px 60px rgba(0,0,0,.6);
  animation: rcPop .3s cubic-bezier(.3,1.4,.5,1) both;
}
.rc-card.ok { border-color: var(--green); box-shadow: 0 0 60px rgba(51,224,160,.28), 0 20px 60px rgba(0,0,0,.6); }
@keyframes rcPop { from { transform: scale(.86); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rc-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--text-primary); letter-spacing: .02em; margin-top: 12px; }
.rc-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 5px; }
.rc-bar { margin-top: 18px; height: 6px; background: var(--bg-inset); border-radius: 4px; overflow: hidden; border: 1px solid var(--glass-border); }
.rc-fill { height: 100%; background: var(--neon-grad-h); transition: width .35s linear; }

/* ============================================================
   Toasts
   ============================================================ */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 360px; padding: 13px 16px; border-radius: var(--r-md);
  background: var(--glass-strong); border: 1px solid var(--glass-border); backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: toastIn .3s cubic-bezier(.3,1.2,.5,1) both;
  display: flex; gap: 12px; align-items: flex-start;
}
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--cyan); flex: 0 0 auto; }
.toast.success .toast-bar { background: var(--green); }
.toast.danger .toast-bar { background: var(--red); }
.toast.warning .toast-bar { background: var(--amber); }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }

body.no-motion *, body.no-motion *::before, body.no-motion *::after { animation: none !important; }

/* ── In-app updater ─────────────────────────────────────────────────────── */
.update-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; margin-right: 4px;
  font: 600 12px/1 inherit; letter-spacing: .2px;
  color: #0a0a1f; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--neon-grad-h);
  box-shadow: 0 4px 16px rgba(255,61,154,.38);
  animation: updatePulse 2.4s ease-in-out infinite;
}
.update-pill:hover { filter: brightness(1.08); }
.update-pill svg { width: 13px; height: 13px; }
@keyframes updatePulse {
  0%,100% { box-shadow: 0 4px 16px rgba(255,61,154,.30); }
  50%     { box-shadow: 0 4px 22px rgba(53,228,255,.55); }
}

.update-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(5,5,20,.72); backdrop-filter: blur(6px);
  animation: fadeIn .25s ease both;
}
.update-card {
  width: min(420px, 92vw); padding: 30px 30px 24px; text-align: center;
  background: var(--bg-stage); border: 1px solid var(--glass-border);
  border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.55);
  position: relative; overflow: hidden;
}
.update-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--neon-grad-h);
}
.update-mark { width: 54px; height: 54px; margin-bottom: 14px; filter: drop-shadow(0 4px 14px rgba(255,61,154,.4)); }
.update-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.update-sub { margin-top: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.update-track {
  margin: 20px 0 8px; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.08);
}
.update-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--neon-grad-h); transition: width .25s ease;
}
.update-pct { font-size: 12px; color: var(--text-muted); min-height: 16px; }
.update-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* ── Favorite skins picker ─────────────────────────────────────────────── */
/* NOTE: the list uses BLOCK layout, not flex-column. A flex column with a
   max-height shrinks its children (flex-shrink defaults to 1) to fit the box,
   which collapsed all 173 rows to ~0 height (invisible) and clipped expanded
   skin lists. Block + margins + overflow-y:auto scrolls correctly. */
.fav-list { max-height: 60vh; overflow-y: auto; display: block; padding-right: 4px; }
.fav-champ { border-radius: var(--r-sm); margin-bottom: 4px; }
.fav-champ-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer;
  background: var(--bg-inset); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  transition: border-color .15s ease, background .15s ease;
}
.fav-champ-head:hover { border-color: var(--line-strong); }
.fav-caret { width: 12px; flex: 0 0 auto; color: var(--text-muted); font-size: 11px; }
.fav-cname { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.fav-cbadge { margin-left: auto; display: flex; align-items: center; }
.fav-badge {
  font-size: 11px; padding: 2px 9px; border-radius: 999px; color: var(--magenta-soft);
  background: color-mix(in srgb, var(--magenta) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--magenta) 40%, transparent);
}
.fav-clear { margin-left: 8px; flex: 0 0 auto; }
.fav-skinlist { display: block; padding: 4px 6px 8px 22px; }
.fav-skin {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px; margin-bottom: 2px; cursor: pointer;
  border-radius: var(--r-sm); border: 1px solid transparent; font-size: 12.5px; color: var(--text-secondary);
  transition: background .12s ease, color .12s ease;
}
.fav-skin:hover { background: var(--bg-inset); color: var(--text-primary); }
.fav-skin.on { color: var(--magenta-soft); background: color-mix(in srgb, var(--magenta) 10%, transparent); }
.fav-skin.undl { opacity: .5; cursor: not-allowed; }
.fav-skin.undl:hover { background: transparent; color: var(--text-secondary); }
.fav-dot { width: 12px; flex: 0 0 auto; color: var(--magenta-soft); font-size: 11px; }
.fav-sname { flex: 1 1 auto; }

/* Favorite skins — champ icons + skin thumbnails */
.fav-cicon {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  object-fit: cover; background: var(--bg-inset);
  border: 1px solid var(--line-soft);
}
.fav-cicon.broken { visibility: hidden; }
.fav-thumb {
  width: 46px; height: 27px; flex: 0 0 auto; border-radius: 4px;
  object-fit: cover; background: var(--bg-inset);
  border: 1px solid var(--line-soft);
}
.fav-thumb.broken { visibility: hidden; }

/* ── Skin Library (BETA) ───────────────────────────────────────────────── */
.beta-pill {
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px; padding: 2px 7px; margin-left: 8px;
  border-radius: 999px; vertical-align: middle;
  color: var(--cyan-soft); background: color-mix(in srgb, var(--cyan) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
}
.lib-count { font-size: 12px; margin-bottom: 10px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lib-card {
  display: flex; flex-direction: column; background: var(--bg-inset);
  border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.lib-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.lib-thumb-wrap { width: 100%; height: 118px; background: var(--bg-stage); overflow: hidden; }
.lib-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb.broken { display: none; }
.lib-body { padding: 8px 11px; flex: 1 1 auto; }
.lib-name { font-weight: 600; font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-install { margin: 0 11px 11px; }
.lib-ready { position: absolute; top: 6px; right: 6px; font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 6px; background: rgba(10,10,31,.7); backdrop-filter: blur(4px); }
.lib-thumb-wrap { position: relative; }

/* Featured champion packs (dashboard) */
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pack-card { text-align: left; cursor: pointer; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; overflow: hidden; padding: 0; transition: border-color .15s, transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.pack-card:hover { border-color: rgba(255,61,154,0.42); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.pack-collage { position: relative; aspect-ratio: 16/10; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--bg-inset, #0a0f1e); }
.pack-cell { background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #0a0f1e; }
.pack-n { position: absolute; right: 6px; bottom: 6px; font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 700; color: #0a0a1f; background: var(--neon-grad-h, linear-gradient(90deg,#ff3d9a,#7ceeff)); border-radius: 999px; padding: 1px 8px; }
.pack-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 2px; }
.pack-name { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: #f2f2ff; }
.pack-ci { width: 22px; height: 22px; border-radius: 50%; }
.pack-sub { font-family: var(--font-mono, monospace); font-size: 10px; color: #7ceeff; }
.pack-loading { font-family: var(--font-mono, monospace); font-size: 12px; color: #6b6b96; padding: 14px; }
@media (max-width: 1000px) { .packs { grid-template-columns: repeat(2, 1fr); } }
