@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700;800;900&family=Rajdhani:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- gaming-neon palette ---- */
  --bg-deep: #07080f;
  --bg-panel: #0e1220;
  --bg-raised: #121829;
  --bg-raised-2: #182036;
  --line: #1e2740;
  --line-soft: #151c30;
  --line-glow: #2a3a66;
  --text: #e7ecff;
  --text-muted: #7d88b0;
  --text-faint: #4a5578;
  /* neon accents (kept old var names so nothing breaks) */
  --amber: #22e0ff;          /* primary accent -> cyan */
  --amber-dim: #1a4a5c;
  --moss: #adff2f;           /* "on"/success -> lime */
  --moss-dim: #2f5c1a;
  --rust: #ff4d6d;           /* danger -> neon red */
  --rust-dim: #4d1a2a;
  --teal: #22e0ff;
  --magenta: #ff2bd6;
  --violet: #8b5cff;
  --cyan: #22e0ff;
  --lime: #adff2f;
  --neon-amber: #ffb020;     /* the one genuinely-amber accent (schedule/warn) */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
}

body {
  position: relative;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 40% at 92% 15%, rgba(255, 43, 214, 0.09), transparent 60%),
    radial-gradient(ellipse 60% 50% at 8% 92%, rgba(34, 224, 255, 0.09), transparent 60%);
  background-attachment: fixed;
}
/* faint animated grid behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.30;
  background-image:
    linear-gradient(rgba(42, 58, 102, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 58, 102, 0.11) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 25%, transparent 78%);
}
/* keep real content above the grid */
.topbar, .wrap, .intro-overlay, #toast-stack { position: relative; z-index: 1; }

a { color: var(--cyan); }

::selection { background: rgba(34, 224, 255, 0.25); color: var(--text); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-glow); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mono { font-family: var(--font-mono); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand .mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-brand .mark .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime), 0 0 18px var(--lime);
}

.login-brand h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 46px;
  margin-top: 12px;
  color: var(--text);
  letter-spacing: 0.04em;
}

.login-brand h1 span {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card {
  position: relative;
  width: 380px;
  max-width: 100%;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px 28px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.7);
}

/* corner-bracket signature */
.bracket { position: relative; }
.bracket::before, .bracket::after,
.bracket .bk-tl, .bracket .bk-tr, .bracket .bk-bl, .bracket .bk-br { pointer-events: none; }

.bk-tl, .bk-tr, .bk-bl, .bk-br {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--amber-dim);
  transition: border-color 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.bk-tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.bk-tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.bk-bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.bk-br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.bracket:hover .bk-tl, .bracket:hover .bk-tr,
.bracket:hover .bk-bl, .bracket:hover .bk-br,
.bracket:focus-within .bk-tl, .bracket:focus-within .bk-tr,
.bracket:focus-within .bk-bl, .bracket:focus-within .bk-br {
  border-color: var(--cyan);
  width: 22px;
  height: 22px;
}

.login-card .eyebrow { margin-bottom: 4px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 11px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 2px rgba(34,224,255,0.12); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(34,224,255,0.08); box-shadow: 0 0 14px -5px var(--cyan); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--text); background: rgba(255,255,255,0.02); box-shadow: none; }

.btn-primary { background: rgba(34,224,255,0.10); border-color: rgba(34,224,255,0.4); color: var(--cyan); font-weight: 700; }
.btn-primary:hover { background: rgba(34,224,255,0.2); border-color: var(--cyan); box-shadow: 0 0 18px -4px var(--cyan); }

.btn-danger { border-color: var(--rust-dim); color: #ff9db0; }
.btn-danger:hover { background: rgba(255,77,109,0.08); border-color: var(--rust); color: var(--rust); box-shadow: 0 0 14px -5px var(--rust); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); border-color: var(--line); box-shadow: none; }

.btn-block { width: 100%; padding: 12px; margin-top: 6px; }

.login-error {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #ff9db0;
  background: rgba(255,77,109,0.08);
  border: 1px solid var(--rust);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-foot {
  text-align: center;
  margin-top: 18px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* ================================================================
   DASHBOARD SHELL
   ================================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: linear-gradient(90deg, rgba(10,14,26,0.92), rgba(10,14,26,0.72));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-brand .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime), 0 0 18px var(--lime);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.topbar-brand h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.08em;
}
.topbar-brand h1 span {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  padding: 6px 11px;
}
.stat-pill b { color: var(--cyan); font-weight: 600; }
.stat-pill .swatch { width: 7px; height: 7px; border-radius: 50%; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}
.user-chip b { color: var(--text); }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 28px 90px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 16px;
  flex-wrap: wrap;
}

.section-head h2 { font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; }
.section-head .eyebrow { margin-bottom: 5px; }

/* ---------- toast / errors ---------- */
#toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}
.toast {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 12px 16px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: rgba(14,18,32,0.95);
  color: var(--text);
  max-width: 340px;
  box-shadow: 0 0 22px -8px var(--cyan);
  animation: toast-in 0.25s ease;
}
.toast.ok { border-color: var(--lime); box-shadow: 0 0 22px -8px var(--lime); }
.toast.err { border-color: var(--rust); color: #ff9db0; box-shadow: 0 0 22px -8px var(--rust); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- bot control strip ---------- */
.botbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 20px;
  flex-wrap: wrap;
}
.botbar .status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.botbar .status-dot.on { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.botbar .status-dot.off { background: var(--rust); box-shadow: 0 0 10px var(--rust); }
.botbar-label { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.botbar-actions { margin-left: auto; display: flex; gap: 8px; }
.botlog-toggle { margin-left: 4px; }
.botlog {
  margin-top: 10px;
  flex-basis: 100%;
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  display: none;
}
.botlog.open { display: block; }

/* ================================================================
   server CARDS
   ================================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-glow); box-shadow: 0 14px 42px -14px rgba(34,224,255,0.22); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 19px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.card-title .status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--text-faint); }
.card-title .status-dot.on { background: var(--lime); box-shadow: 0 0 10px var(--lime), 0 0 18px var(--lime); animation: pulse-dot 1.8s infinite; }
.card-title .status-dot.off { background: var(--rust); box-shadow: 0 0 8px var(--rust); }

.card-title h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tag.public { color: var(--cyan); border-color: rgba(34,224,255,0.35); background: rgba(34,224,255,0.07); }
.tag.private { color: var(--magenta); border-color: rgba(255,43,214,0.3); background: rgba(255,43,214,0.07); }

.card-body { padding: 15px 19px 17px; }

/* meta rows (owner / address / players / ver / memory / uptime).
   Kept as a flex-wrap row so the existing JS that fills .c-owner, .c-address,
   .c-players, .c-version, .c-memory, .c-uptime keeps working unchanged. */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.meta-row b { color: var(--text); font-weight: 600; }
.meta-row .addr { color: var(--cyan); }
.meta-row .c-uptime { color: var(--lime); }

/* animated player fill-bar (new). JS sets width via inline style or a
   data-attribute; if absent the bar just stays at 0 and is harmless. */
.player-bar-wrap { flex-basis: 100%; margin: 2px 0 2px; }
.player-bar-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.player-bar-top b { color: var(--text); }
.player-bar {
  height: 7px;
  border-radius: 5px;
  background: #141a2c;
  overflow: hidden;
}
.player-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
.player-bar.hot > i { background: linear-gradient(90deg, var(--neon-amber), var(--magenta)); box-shadow: 0 0 10px var(--neon-amber); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 4px;
}
.card-actions .btn { padding: 8px 12px; font-size: 12px; }

/* drawer toggles now get the SAME real bordered treatment as the action
   buttons (Blood didn't want them looking inert/greyed). They inherit .btn
   fully; only size + active state differ. */
.drawer-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.drawer-toggles .btn { padding: 7px 12px; font-size: 11px; }
.drawer-toggles .btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34,224,255,0.10);
  box-shadow: 0 0 14px -5px var(--cyan);
}

.drawer {
  display: none;
  margin-top: 12px;
  background: #0a0e1a;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  animation: drawer-in 0.2s ease;
}
.drawer.open { display: block; }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.drawer h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 11px;
}

.console-box {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--lime);
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 8px;
  line-height: 1.55;
}

/* Roster viewer (Players List drawer) - structured rows, NOT raw log text, so
   it reads cleanly on a phone. The box keeps its dark frame but drops the
   pre-wrap/mono-green when it holds a .roster-list. Taller than a console tail
   since it's a browsable history. */
.c-playerslog-box { white-space: normal; color: var(--text); max-height: 340px; }
.roster-list { display: flex; flex-direction: column; gap: 6px; }
.roster-row {
  border: 1px solid var(--line);
  border-left: 3px solid var(--moss);
  border-radius: 6px;
  background: var(--bg-raised);
  padding: 7px 9px;
}
.roster-row.left { border-left-color: var(--rust); }
.roster-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.roster-ev {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--moss);
  flex: 0 0 auto;
}
.roster-row.left .roster-ev { color: var(--rust); }
.roster-name {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.roster-time {
  font-size: 11px;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.roster-detail {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.mini-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mini-form input {
  flex: 1;
  min-width: 120px;
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 11px;
}
.mini-form input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 2px rgba(34,224,255,0.12); }

.player-list, .backup-list, .ban-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.player-list li, .backup-list li, .ban-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
}
.player-list li b, .backup-list li b { color: var(--text); font-weight: 500; }
.empty-note { color: var(--text-faint); font-family: var(--font-mono); font-size: 12px; padding: 14px 0; text-align: center; }

/* Ban rows can hold very long / unbreakable IDs (e.g. a steamid,playerid
   string pasted in by mistake). Let the ID take the remaining width and
   break/wrap inside its own space, and pin the Unban button so it can never
   get shoved off the right edge out of reach. */
.ban-list li { align-items: center; }
.ban-list li > .mono {
  flex: 1;
  min-width: 0;                 /* lets the flex child actually shrink */
  overflow-wrap: anywhere;      /* break the long unbroken string */
  word-break: break-all;
  line-height: 1.4;
}
.ban-list li > .btn { flex: 0 0 auto; }   /* never shrink, never wrap away */

.setting-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.setting-row:last-child { border-bottom: none; }
.setting-row .sname { color: var(--text-muted); font-family: var(--font-mono); }
.setting-row .sval { color: var(--text); font-family: var(--font-mono); }

.toggle-switch {
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: 12px;
  background: #1a2338;
  border: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.toggle-switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all 0.2s ease;
}
.toggle-switch.on { border-color: var(--cyan); background: rgba(34,224,255,0.25); }
.toggle-switch.on .knob { left: 19px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ---------- new server card ---------- */
.card.new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1.5px dashed var(--line-glow);
  background: rgba(255,255,255,0.01);
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 20px;
}
.card.new-card:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(34,224,255,0.04); }
.card.new-card .plus { font-size: 32px; display: block; margin-bottom: 6px; font-family: var(--font-display); font-weight: 700; }

.new-form-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- loading skeleton ---------- */
.skel {
  height: 250px;
  border-radius: 16px;
  background: linear-gradient(100deg, var(--bg-panel) 30%, var(--bg-raised) 50%, var(--bg-panel) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--line);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 60px; }
  .topbar { padding: 12px 16px; }
  .grid { grid-template-columns: 1fr; }
}

/* ================================================================
   INTRO VIDEO OVERLAY  (functional - preserved)
   ================================================================ */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.intro-overlay.intro-fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.intro-tap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 16px 26px;
  font-size: 13px;
  z-index: 2;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.intro-skip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  padding: 9px 14px;
  background: rgba(14, 18, 32, 0.75);
  backdrop-filter: blur(4px);
}

@media (max-width: 640px) {
  .intro-skip { top: max(14px, env(safe-area-inset-top)); right: 14px; }
}

.intro-welcome {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 8vw, 84px);
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 24px var(--cyan), 0 0 60px rgba(34, 224, 255, 0.5);
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
  z-index: 1;
  text-align: center;
  padding: 0 16px;
}
.intro-welcome.show { opacity: 1; }

/* ---------- backups: manual/auto filter + scrollable list ---------- */
.backup-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.backup-filter .btn {
  padding: 5px 12px;
  font-size: 11px;
}
.backup-filter .btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34,224,255,0.10);
}
.backup-list {
  max-height: 240px;
  overflow-y: auto;
}

/* ---------- transient lifecycle state (starting/stopping/...) ---------- */
.tag.state-pending {
  color: var(--neon-amber);
  border-color: var(--neon-amber);
  background: rgba(255,176,32,0.08);
  animation: state-blink 1.4s ease-in-out infinite;
}
@keyframes state-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.card-title .status-dot.pending {
  background: var(--neon-amber);
  box-shadow: 0 0 10px var(--neon-amber);
  animation: pulse-amber 1.4s infinite;
}
@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.card[data-pending="1"] .c-start,
.card[data-pending="1"] .c-stop,
.card[data-pending="1"] .c-restart {
  opacity: 0.4;
  pointer-events: none;
}

/* ================================================================
   ADMIN VIEWS (migrate / ip bindings)
   ================================================================ */

[hidden] { display: none !important; }

.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.view-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 22px;
}
.view-head h2 { font-size: 24px; letter-spacing: 0.05em; text-transform: uppercase; }
.view-head .c-back { font-size: 12px; padding: 9px 14px; }

.panel {
  position: relative;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-deep));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.panel-head h4 { margin: 0; }

.dim { color: var(--text-faint); font-size: 11.5px; }

.view-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.view-note b { color: var(--cyan); }

.warn-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--neon-amber);
  background: rgba(255,176,32,0.06);
  border: 1px solid rgba(255,176,32,0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
}
.warn-note b { color: #fff; }

/* ---------- migrate ---------- */
.step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) { .step-grid { grid-template-columns: 1fr; } }

.step h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(34,224,255,0.3);
  background: rgba(34,224,255,0.1);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-right: 8px;
}

.select, .num-input {
  width: 100%;
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 11px 12px;
}
.select:focus, .num-input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 2px rgba(34,224,255,0.12); }
.num-input { width: 78px; text-align: center; }

#mig-backups { max-height: 260px; overflow-y: auto; margin-top: 8px; }

.backup-list li.pick { cursor: pointer; transition: border-color 0.15s ease; }
.backup-list li.pick:hover { border-color: var(--line-glow); }
.backup-list li.sel {
  border-color: var(--cyan);
  background: rgba(34,224,255,0.08);
}
.backup-list li.sel b { color: var(--cyan); }

.confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
#mig-summary { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
#mig-summary b { color: var(--text); }

/* ---------- ip bindings ---------- */
.bind-config {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.bind-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bind-bulk .btn { padding: 7px 11px; font-size: 11px; }

.table-scroll { overflow-x: auto; }

.bind-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.bind-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.bind-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  vertical-align: middle;
}
.bind-table tr:last-child td { border-bottom: none; }
.bind-table .col-chk { width: 28px; }
.bind-table .u-name { color: var(--text); font-weight: 500; }
.bind-table .ip-bound { color: var(--cyan); }
.bind-table .ip-free { color: var(--text-faint); font-style: italic; }
.bind-table .btn { padding: 5px 10px; font-size: 10px; }
.bind-table td.empty-note { text-align: center; padding: 22px; }

.bind-table .col-every { white-space: nowrap; }
.every-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 11px;
}
.every-cell .num-input {
  width: 62px;
  padding: 6px 6px;
  font-size: 12px;
}
.every-cell .num-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--line-soft);
}
.bind-table .toggle-switch.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- per-card scheduled power (auto-restart / auto-shutdown) ---------- */
.sched-block {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}
.sched-head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon-amber);
  margin-bottom: 11px;
}
.sched-head .dim {
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.sched-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.sched-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 135px;
}
.sched-note {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.5;
  margin-top: 3px;
}

/* ---------- IP spoiler (functional - preserved) ---------- */
.spoiler {
  cursor: pointer;
  filter: blur(5px);
  user-select: none;
  transition: filter 0.12s ease;
  border-radius: 2px;
}
.spoiler:hover { filter: blur(3.5px); }
.spoiler.revealed {
  filter: none;
  user-select: text;
  cursor: text;
}

/* ---------- catalog-driven settings editor (functional - preserved) ---------- */
.settings-search {
  width: 100%;
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 11px;
  margin-bottom: 6px;
}
.settings-search:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 2px rgba(34,224,255,0.12); }
.settings-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.settings-groups { max-height: 420px; overflow-y: auto; }
.settings-section { margin-bottom: 14px; }
.settings-section h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 0.3s ease;
}
.setting-row.saved { background: rgba(173, 255, 47, 0.14); }
.sr-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-label .sname {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}
.sr-label .sdesc {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.35;
}
.sr-ctrl { flex-shrink: 0; display: flex; align-items: center; }
.sr-input {
  background: #050810;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  width: 120px;
}
.sr-input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 2px rgba(34,224,255,0.12); }
select.sr-input { width: 150px; cursor: pointer; }

.sr-pass { display: flex; align-items: center; gap: 8px; }
.sr-pass-input { width: 130px; }

.setting-row.locked-row { opacity: 0.75; }
.setting-row.locked-row .sname { color: var(--text-muted); }
.sr-locked {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neon-amber);
  white-space: nowrap;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: #050810;
}

/* ---------- server files drawer (functional - preserved) ---------- */
.files-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 10px;
  line-height: 1.5;
}
.files-total { color: var(--text-faint); font-size: 11px; font-weight: normal; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.file-list li .dim { color: var(--text-faint); font-size: 11px; margin-left: 6px; }
.file-list li.file-all {
  border-color: rgba(34,224,255,0.3);
  background: rgba(34,224,255,0.05);
  margin-top: 4px;
}
a.file-dl {
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
