:root{
  /* Minimal, professional, slightly playful */
  --bg: #0b0f14;
  --surface: #121826;
  --surface2: #0f1522;
  --surface3: #0c111b;

  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.14);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);
  --muted2: rgba(255,255,255,.44);

  --accent: #5b8cff;
  --accent2: #22c55e;
  --warn: #fbbf24;
  --danger: #ff4d7d;

  --shadow: 0 14px 30px rgba(0,0,0,.35);
  --shadow2: 0 10px 20px rgba(0,0,0,.22);

  --r-xl: 26px;
  --r-lg: 20px;
  --r: 16px;

  color-scheme: dark;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: var(--bg);
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }
code{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; }

/* ---------- App layout ---------- */
.app-root{ max-width: 1400px; margin: 0 auto; padding: 22px; }
.app-body{ margin-top: 16px; }
.app-body.with-sidebar{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items:start;
}

@media (max-width: 980px){
  .app-root{ padding: 14px; }
  .app-body.with-sidebar{ grid-template-columns: 1fr; }
}

/* ---------- Topbar ---------- */
.topbar{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.brand{ display:flex; align-items:center; gap: 12px; min-width:0; }
.brand-logo{
  width: 42px; height:42px; border-radius: 18px;
  background: rgba(91,140,255,.14);
  border: 1px solid rgba(91,140,255,.30);
  box-shadow: var(--shadow2);
  position: relative;
  overflow:hidden;
}
/* a tiny playful notch */
.brand-logo::after{
  content:"";
  position:absolute;
  width: 16px; height:16px;
  right:-7px; top:-7px;
  border-radius: 999px;
  background: rgba(91,140,255,.32);
}

.brand-title{ font-weight: 950; letter-spacing: -0.02em; }
.brand-sub{ color: var(--muted); font-size: 13px; margin-top: 2px; }

.topbar-actions{ display:flex; align-items:center; gap: 10px; flex-wrap:wrap; justify-content:flex-end; }

.user-pill{
  display:flex; align-items:center; gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.user-avatar{ width: 34px; height:34px; border-radius: 999px; overflow:hidden; background: rgba(255,255,255,.06); border:1px solid var(--line); }
.user-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.user-name{ font-weight: 900; font-size: 13px; max-width: 150px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; }
.user-sub{ color: var(--muted2); font-size: 11px; margin-top: 1px; }

/* ---------- Buttons / Inputs ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
  transition: transform .08s ease, background .12s ease, border-color .12s ease, filter .12s ease;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,.06); border-color: var(--line2); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }

.btn-primary{
  background: rgba(91,140,255,.20);
  border-color: rgba(91,140,255,.40);
}
.btn-primary:hover{ filter: brightness(1.07); }

.btn-go{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.38);
}

.btn-warn{
  background: rgba(251,191,36,.16);
  border-color: rgba(251,191,36,.38);
}

.btn-ghost{ background: var(--surface3); }
.btn-full{ width: 100%; }

.input{
  width:100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  outline:none;
}
.input:focus{ border-color: rgba(91,140,255,.55); box-shadow: 0 0 0 4px rgba(91,140,255,.14); }

/* ---------- Cards ---------- */
.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 18px;
}

.title{
  font-size: 36px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  margin: 0;
}
.subtitle{ color: var(--muted); font-size: 13px; margin-top: 8px; }

.sep{ height:1px; background: var(--line); margin: 16px 0; }

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1080px){ .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px){ .grid{ grid-template-columns: 1fr; } }

.server-card,
.feature-card{
  position:relative;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface2);
  box-shadow: var(--shadow2);
  overflow:hidden;
  padding: 14px;
}

/* subtle top sheen (not a gradient blob) */
.server-card::after,
.feature-card::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 34%);
  pointer-events:none;
}

.card-top{ display:flex; align-items:center; justify-content:space-between; gap: 12px; }
.card-left{ display:flex; align-items:center; gap: 12px; min-width:0; }

.circle{
  width: 56px; height:56px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  display:grid; place-items:center;
  overflow:hidden;
}
.circle img{ width:100%; height:100%; object-fit:cover; display:block; }

.card-title{ font-weight: 1000; letter-spacing: -0.02em; white-space:nowrap; overflow:hidden; text-overflow: ellipsis; }
.card-sub{ color: var(--muted); font-size: 12px; margin-top: 4px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  border:1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,.10);
  font-weight: 900;
}

.pill.premium{
  border-color: rgba(91,140,255,.45);
  background: rgba(91,140,255,.14);
}

.tag{
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface3);
  color: var(--muted);
}
.tag.locked{ border-color: rgba(251,191,36,.40); color: rgba(251,191,36,.95); background: rgba(251,191,36,.10); }

/* ---------- Sidebar (feature page) ---------- */
.sidebar{
  position: sticky;
  top: 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.guild-chip{
  display:flex; align-items:center; gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.guild-chip-icon{ width: 42px; height:42px; border-radius: 14px; overflow:hidden; background: rgba(255,255,255,.06); border:1px solid var(--line); }
.guild-chip-icon img{ width:100%; height:100%; object-fit:cover; display:block; }
.guild-chip-name{ font-weight: 1000; letter-spacing: -.02em; }
.guild-chip-sub{ color: var(--muted2); font-size: 12px; margin-top: 2px; }

.s-nav{ display:flex; flex-direction:column; gap: 8px; margin-top: 12px; }
.s-nav-item{
  display:flex; align-items:center; gap: 10px;
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--surface2);
}
.s-nav-item:hover{ border-color: var(--line); filter: brightness(1.02); }
.s-nav-item.active{ background: rgba(91,140,255,.18); border-color: rgba(91,140,255,.28); }
.s-nav-item .dot{ width: 10px; height:10px; border-radius: 99px; background: rgba(255,255,255,.22); }
.s-nav-item.active .dot{ background: rgba(91,140,255,.92); box-shadow: 0 0 0 5px rgba(91,140,255,.14); }
.s-nav-item .label{ font-weight: 950; font-size: 13px; flex:1; min-width:0; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; }

.sidebar-foot{ margin-top: 12px; }

/* ---------- Feature editor ---------- */
.editor,
.textarea{
  width:100%;
  min-height: 420px;
  resize: vertical;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}
.editor:focus{ border-color: rgba(91,140,255,.55); box-shadow: 0 0 0 4px rgba(91,140,255,.14); }

.notice{
  border: 1px solid rgba(251,191,36,.40);
  background: rgba(251,191,36,.10);
  border-radius: 18px;
  padding: 12px 12px;
}

.row{ display:flex; align-items:center; gap: 12px; flex-wrap:wrap; }
.row.between{ justify-content: space-between; }
.row-between{ display:flex; align-items:flex-end; justify-content:space-between; gap: 14px; flex-wrap:wrap; }

.muted{ color: var(--muted); }
.muted2{ color: var(--muted2); }

/* ---------- Landing ---------- */
.center{
  min-height: 100vh;
  display:grid;
  place-items:center;
  padding: 24px;
}

.hero{ width: min(620px, 100%); text-align:center; }
.hero-mark{
  width: 76px; height:76px; border-radius: 28px;
  margin: 0 auto 14px;
  background: rgba(91,140,255,.14);
  border: 1px solid rgba(91,140,255,.30);
  box-shadow: var(--shadow2);
  position: relative;
}
.hero-mark::after{
  content:"";
  position:absolute;
  width: 18px; height:18px;
  right:-8px; top:-8px;
  border-radius: 999px;
  background: rgba(91,140,255,.30);
}

.hint{ color: var(--muted); font-size: 13px; }

.guild-mini{ width: 40px; height:40px; border-radius: 14px; overflow:hidden; border:1px solid var(--line); background: var(--surface2); }
.guild-mini img{ width:100%; height:100%; object-fit:cover; display:block; }

.notice-title{ font-weight: 1000; }
.notice-text{ color: var(--muted); font-size: 13px; margin-top: 6px; }

.landing-wrap{
  min-height: 100vh;
  display:grid;
  place-items:center;
  padding: 24px;
}

.landing-card{
  width: min(720px, 100%);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}
