/* ===== DIN FONT FACE ===== */
@font-face { font-family: 'DIN'; src: url('/fonts/din-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'DIN'; src: url('/fonts/din-medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'DIN'; src: url('/fonts/din-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DIN'; src: url('/fonts/din-light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'DIN'; src: url('/fonts/din-black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --primary: #5865f2;
  --primary-hover: #4752c4;
  --primary-dim: rgba(88, 101, 242, 0.08);
  --bg-base: #111214;
  --bg-surface: #1a1b1e;
  --bg-elevated: #222326;
  --bg-inset: #0d0e10;
  --text-primary: #e6e7eb;
  --text-secondary: #9b9da6;
  --text-muted: #5d5f69;
  --border-color: #2b2d32;
  --border-hover: #404249;
  --danger: #da373c;
  --danger-bg: rgba(218, 55, 60, 0.08);
  --success: #22c55e;
  --warning: #eab308;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
  --font: "DIN", system-ui, -apple-system, sans-serif;
  --transition: 120ms ease;
  --navbar-height: 56px;
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; outline: none; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--primary); color: #fff; }

/* ===== NAVBAR / TOPBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  gap: 12px;
}
.navbar .burger {
  display: none;
  width: 32px; height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.navbar .burger:hover { background: var(--bg-elevated); }
.navbar .burger .line {
  width: 18px; height: 2px;
  border-radius: 1px;
  background: var(--text-secondary);
}
.navbar .branding {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-right: 4px;
  flex-shrink: 0;
}
.navbar .branding .logo {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.navbar .nav-links {
  display: flex;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
}
.navbar .nav-link-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.navbar .nav-link-item:hover { color: var(--text-primary); background: var(--bg-elevated); text-decoration: none; }
.navbar .server-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  max-width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}
.navbar .server-selector:hover { border-color: var(--border-hover); }
.navbar .server-selector .icon {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.navbar .server-selector .icon img { width: 100%; height: 100%; object-fit: cover; }
.navbar .server-selector .name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.navbar .server-selector .arrow {
  color: var(--text-muted);
  transition: transform 120ms ease;
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
}
.navbar .spacer { flex: 1; }
.navbar .user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}
.navbar .user:hover { border-color: var(--border-hover); }
.navbar .user .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated);
  overflow: hidden;
  flex-shrink: 0;
}
.navbar .user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.navbar .user .username {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.navbar .user .arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  transition: transform 120ms ease;
}

/* ===== DROPDOWNS ===== */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  z-index: 700;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.dropdown.open { display: block; }
.dropdown .option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.dropdown .option:hover { background: var(--bg-surface); color: var(--text-primary); }
.dropdown .option .opt-icon {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.dropdown .option .opt-icon img { width: 100%; height: 100%; object-fit: cover; }
.dropdown .option .opt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-dropdown { left: 0; }
.user-dropdown-menu { right: 0; min-width: 160px; }
.user-dropdown-menu .dropdown-header {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.user-dropdown-menu .dropdown-username { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.user-dropdown-menu .dropdown-discrim { font-size: 0.75rem; color: var(--text-muted); }
.user-dropdown-menu .dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.user-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}
.user-dropdown-menu .dropdown-item:hover { background: var(--bg-surface); color: var(--text-primary); }

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  margin-top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-inset);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease, min-width .25s ease;
  display: flex;
  flex-direction: column;
}
.sidebar.closed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.sidebar .intro-line {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 8px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}
.sidebar .intro-line .home-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition);
  color: var(--text-secondary);
  border: none;
}
.sidebar .intro-line .home-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidebar .intro-line .reload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sidebar .intro-line .reload-btn:hover { background: var(--bg-surface); color: var(--text-secondary); }
.sidebar .label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 12px 16px 6px 16px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  margin: 0 8px;
  border-radius: var(--radius-sm);
}
.sidebar-item:hover { background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.sidebar-item.selected {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.sidebar-item .bar {
  position: absolute;
  left: -8px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  display: none;
}
.sidebar-item.selected .bar { display: block; }
.sidebar-item .icon {
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.sidebar-item:hover .icon { opacity: 1; }
.sidebar-item .error-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ===== MAIN CONTENT ===== */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
}
.content-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.page-header .icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: .6;
}

/* ===== GUILD PICKER ===== */
.guild-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height) - 48px);
  row-gap: 24px;
  padding: 24px;
}
.guild-picker h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.guild-picker .sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 860px;
}
.guild-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.guild-card:hover { background: var(--bg-elevated); border-color: var(--border-hover); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.guild-card .g-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.guild-card .g-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-card .g-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1); }
.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== SETTINGS PATH TILES ===== */
.path {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: border-color var(--transition);
}
.path:hover { border-color: var(--border-hover); }
.path .top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-height: 56px;
}
.path .text { flex: 1; min-width: 0; }
.path .name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.path .description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.path .right-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.path .right-side .arrow {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform .2s;
}
.path.open .right-side .arrow { transform: rotate(90deg); }
.path .content {
  display: none;
  padding: 0 18px 14px 18px;
  border-top: 1px solid var(--border-color);
  margin-top: 0;
  padding-top: 14px;
}
.path.open .content { display: block; }
.path.clickable { cursor: pointer; }

/* ===== TOGGLE SWITCH ===== */
.toggle {
  width: 42px; height: 22px;
  border-radius: 11px;
  background: var(--border-color);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--primary); }
.toggle .circle {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on .circle { transform: translateX(20px); }

/* ===== SECTION LABEL ===== */
.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 20px 4px 8px 4px;
}

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: var(--bg-inset);
}
tbody td {
  font-size: 0.8125rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.open { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.badge.closed { background: var(--bg-elevated); color: var(--text-muted); }
.badge.warn, .badge.warning { background: rgba(234, 179, 8, 0.1); color: var(--warning); }
.badge.mute { background: rgba(169, 122, 240, 0.1); color: #a97af0; }
.badge.kick, .badge.ban { background: var(--danger-bg); color: var(--danger); }
.badge.timeout { background: rgba(234, 179, 8, 0.1); color: var(--warning); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
input, select, textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: var(--transition);
  min-height: 36px;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; padding: 10px 12px; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b9da6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  height: 36px;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--border-color); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-success { background: transparent; color: var(--success); border: 1px solid var(--border-color); }
.btn-success:hover { background: rgba(34, 197, 94, 0.08); border-color: var(--success); }
.btn-sm { padding: 4px 10px; font-size: 0.8125rem; height: 30px; }
.btn-tonal { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-tonal:hover { background: var(--bg-surface); border-color: var(--border-hover); }
.btn-outlined { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-outlined:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* ===== EMPTY STATE ===== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
}
.empty .empty-icon { font-size: 32px; opacity: .3; }
.empty p { font-size: 0.875rem; color: var(--text-secondary); }

/* ===== CALLOUT ===== */
.callout {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ===== LANDING PAGE ===== */
body.landing-page {
  overflow: auto;
  display: block;
  min-height: 100vh;
}
.landing-page .layout { display: none; }

/* --- Landing Nav --- */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  z-index: 200;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.landing-nav.scrolled {
  background: rgba(17, 18, 20, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border-color);
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  margin-right: 32px;
}
.landing-logo {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.landing-logo.sm { width: 26px; height: 26px; font-size: 12px; }
.landing-nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.landing-nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease;
}
.landing-nav-links a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.landing-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.landing-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease;
}
.landing-btn-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.landing-btn-primary.lg { padding: 14px 32px; font-size: 1rem; }
.landing-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}
.landing-btn-ghost:hover { color: var(--text-primary); border-color: var(--border-hover); }
.landing-btn-ghost.lg { padding: 13px 31px; font-size: 1rem; }
.landing-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.landing-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.landing-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.landing-burger.open span:nth-child(2) { opacity: 0; }
.landing-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.landing-mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  z-index: 199;
  flex-direction: column;
  gap: 4px;
}
.landing-mobile-menu.open { display: flex; }
.landing-mobile-menu a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease;
}
.landing-mobile-menu a:hover { color: var(--text-primary); background: var(--bg-elevated); }

/* --- Hero --- */
.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 64px;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.hero-stat.visible { opacity: 1; transform: translateY(0); }
.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.hero-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
}

/* --- Sections --- */
.landing-section {
  padding: 100px 24px;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-dim);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color 200ms ease, transform 200ms ease;
  opacity: 0;
  transform: translateY(16px);
}
.feature-card.visible { opacity: 1; transform: translateY(0); transition: opacity 500ms ease, transform 500ms ease, border-color 200ms ease; }
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-card.visible:hover { transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px;
  background: var(--primary-dim);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 20px;
}
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Dual Rows --- */
.landing-dual { padding-bottom: 60px; }
.dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
}
.dual-row.visible { opacity: 1; transform: translateY(0); transition: opacity 600ms ease, transform 600ms ease; }
.landing-dual.reverse .dual-row { direction: rtl; }
.landing-dual.reverse .dual-row > * { direction: ltr; }
.dual-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.dual-text p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.dual-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dual-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}
.dual-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* --- Visual Cards --- */
.visual-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.visual-card.visible { opacity: 1; transform: translateY(0); }

/* Party Visual */
.party-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pv-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}
.pv-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.pv-avatar.fire { background: #e04e2a; }
.pv-avatar.ice { background: #4aa8d8; }
.pv-avatar.wind { background: #47a863; }
.pv-avatar.physical { background: #8a7e6b; }
.pv-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.pv-lv { font-size: 0.75rem; color: var(--text-muted); }

/* Combat Visual */
.combat-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cv-bar { display: flex; flex-direction: column; gap: 6px; }
.cv-bar-label { font-size: 0.75rem; color: var(--text-muted); }
.cv-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.cv-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 1s ease;
}
.cv-bar-fill.hp { background: var(--success); }
.cv-bar-fill.pity { background: var(--warning); }
.cv-enemy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-top: 8px;
}
.cv-enemy-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.cv-enemy-weak { font-size: 0.75rem; color: var(--text-muted); }

/* Warp Visual */
.warp-visual { display: flex; flex-direction: column; gap: 16px; }
.wv-banner {
  padding: 20px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(88, 101, 242, 0.05));
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: var(--radius-md);
}
.wv-banner-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.wv-banner-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.wv-pity { display: flex; flex-direction: column; gap: 6px; }
.wv-pity span { font-size: 0.8125rem; color: var(--text-secondary); }

/* --- CTA --- */
.landing-cta {
  text-align: center;
  padding: 120px 24px;
  background: linear-gradient(180deg, var(--bg-base) 0%, rgba(88, 101, 242, 0.06) 50%, var(--bg-base) 100%);
}
.landing-cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.landing-cta p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --- Footer --- */
.landing-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}
.footer-links a:hover { color: var(--text-primary); }
.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===== LOGIN PAGE ===== */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-inset);
}
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}
.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-card .branding {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-card .branding .logo {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.login-card .branding .name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.login-card h1 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.login-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}
.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865F2;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-discord:hover { background: #4752c4; color: #fff; box-shadow: 0 4px 20px rgba(88, 101, 242, 0.25); transform: translateY(-1px); }
.btn-discord svg { width: 20px; height: 20px; }
.login-card .footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .navbar .burger { display: flex; }
  .navbar .nav-links { display: none; }
  .navbar .server-selector .name { max-width: 100px; }
  .navbar .user .username { display: none; }
  .content-inner { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 32px 24px; }

  /* Landing */
  .landing-nav { padding: 0 20px; }
  .landing-nav-links { display: none; }
  .landing-nav-actions { display: none; }
  .landing-burger { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .dual-row { grid-template-columns: 1fr; gap: 32px; }
  .landing-dual.reverse .dual-row { direction: ltr; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-stat-value { font-size: 1.25rem; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .cta-actions { flex-direction: column; align-items: center; }
}
