/* ===== 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: #0a0b10;
  --bg-surface: #13151c;
  --bg-elevated: #1b1d26;
  --bg-inset: #080910;
  --text-primary: #e6e7eb;
  --text-secondary: #9b9da6;
  --text-muted: #5d5f69;
  --border-color: #1f2128;
  --border-hover: #33353e;
  --danger: #da373c;
  --danger-bg: rgba(218, 55, 60, 0.08);
  --success: #22c55e;
  --warning: #eab308;
  --gold: #cba969;
  --gold-dim: rgba(203, 169, 105, 0.1);
  --gold-border: rgba(203, 169, 105, 0.25);
  --accent-gold: #cba969;
  --accent-teal: #4aa8d8;
  --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;
  --display: 'DIN', system-ui, -apple-system, sans-serif;
  --body-font: 'DIN', system-ui, -apple-system, sans-serif;
  --mono-font: 'DIN', system-ui, -apple-system, sans-serif;
  --red: #c9707f;
  --text-dim: #4c4d55;
  --transition: 120ms ease;
  --navbar-height: 56px;
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; width: 100%; }
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(--gold); color: #0a0c16; }

/* ===== NAVBAR / TOPBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  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(--gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #0a0c16;
  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;
  position: relative;
  z-index: 2;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: rgba(8, 9, 16, 0.9);
  backdrop-filter: blur(8px);
  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;
  position: relative;
  z-index: 2;
}
.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(--gold);
  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: transparent;
  position: relative;
  z-index: 2;
}
.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(--gold); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(203, 169, 105, 0.1); }
.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  color: var(--gold);
  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(--gold); }
.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(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
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: 8px;
  padding: 11px 22px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { border-color: var(--gold); color: var(--gold); }
.btn-primary:hover { background: var(--gold); color: #0a0b10; }
.btn-ghost { border-color: var(--border-color); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text-primary); }
.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 {
  height: auto;
  overflow-y: scroll;
  display: block;
  min-height: 100vh;
  --gold: #cba969;
  --gold-dim: rgba(203, 169, 105, 0.1);
  --gold-border: rgba(203, 169, 105, 0.25);
}
body.landing-page .layout { display: none; }
body.landing-page .bg-layers,
body.landing-page .bg-grain { z-index: 0; }
.landing-nav, .landing-hero, .landing-section, .landing-footer,
header.site, main, footer.landing-footer,
.hero, .stats-section, .section, .cta-section {
  position: relative;
  z-index: 2;
}

/* --- Site Header (landing) --- */
header.site {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(10, 11, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}
header.site.scrolled {
  background: rgba(10, 11, 16, 0.95);
  box-shadow: 0 1px 0 var(--border-color);
}
.wrap.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-decoration: none;
}
.brand .mark {
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.brand .line {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 10px;
  font-family: var(--mono-font);
  letter-spacing: 0.12em;
  margin-left: 2px;
}
nav.links {
  display: flex;
  align-items: center;
  gap: 44px;
}
nav.links a.nav-link {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--mono-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav.links a.nav-link:hover { color: var(--gold); }
.nav-cta { display: flex; align-items: center; gap: 14px; }

.landing-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #0a0b10;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 22px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.landing-btn-primary:hover { box-shadow: 0 0 0 3px rgba(203,169,105,0.18); color: #0a0b10; transform: translateY(-1px); }
.landing-btn-primary.lg { padding: 14px 32px; font-size: 12px; }
.landing-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 22px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  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(--text-muted); }
.landing-btn-ghost.lg { padding: 13px 31px; font-size: 12px; }
.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 --- */
.hero {
  padding: 140px 0 100px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 36px;
}
.eyebrow .rule { width: 32px; height: 1px; background: var(--gold); opacity: 0.6; }
h1.title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 820px;
  color: var(--text-primary);
}
h1.title .sub-span {
  display: block;
  font-size: 0.28em;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0;
  margin-top: 20px;
  font-family: var(--body-font);
  max-width: 600px;
}
.hero-actions { display: flex; gap: 16px; margin-top: 48px; flex-wrap: wrap; }
.ticket-note {
  margin-top: 32px;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* --- Stats Section --- */
.stats-section { padding: 0 0 120px; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.stat-cell {
  padding: 32px 36px;
  text-align: left;
  border-right: 1px solid var(--border-color);
}
.stat-cell:first-child { padding-left: 0; }
.stat-cell:last-child { border-right: none; padding-right: 0; }
.stat-num {
  font-family: var(--mono-font);
  font-weight: 500;
  font-size: 36px;
  color: var(--gold);
  letter-spacing: 0.01em;
}
.stat-label {
  font-family: var(--mono-font);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
}

.unlocked-section { padding-top: 0; }

.content-eyebrow {
  font-family: var(--mono-font);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.content-eyebrow .rule {
  width: 32px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
  flex-shrink: 0;
}

.unlocked-wrap {
  position: relative;
}
.unlocked-wrap.blurred .stats-row {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}
.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.locked-inner {
  text-align: center;
}
.locked-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
  margin: 0 auto 16px;
  opacity: 0.7;
}
.locked-text {
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.locked-btn {
  font-size: 12px;
  padding: 0.4rem 1rem;
}

/* --- Section Headers --- */
.section { padding: 130px 0; }
.section-head { margin-bottom: 80px; }
.section-eyebrow {
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: -0.01em;
  max-width: 560px;
  color: var(--text-primary);
}

/* --- Route (numbered stops) --- */
.stop {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.stop:last-child { border-bottom: 1px solid var(--border-color); }
.stop.in-view { opacity: 1; transform: translateY(0); }
.stop-num { font-family: var(--mono-font); font-size: 17px; color: var(--text-dim); padding-top: 2px; }
.stop-body h3 { font-family: var(--display); font-size: 19px; font-weight: 500; margin-bottom: 10px; letter-spacing: 0.01em; }
.stop-body p { color: var(--text-secondary); font-size: 14px; max-width: 600px; font-weight: 300; }
.stop-tag {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 14px;
  display: inline-block;
  opacity: 0.75;
}

/* --- Deep Dives --- */
.deep {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
  padding: 80px 0;
  border-top: 1px solid var(--border-color);
}
.deep:last-child { border-bottom: 1px solid var(--border-color); }
.deep.reverse { direction: rtl; }
.deep.reverse > * { direction: ltr; }
.deep-eyebrow { font-family: var(--mono-font); font-size: 12.5px; color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px; }
.deep-title { font-family: var(--display); font-size: 30px; font-weight: 500; margin-bottom: 18px; letter-spacing: -0.005em; color: var(--gold); text-shadow: 0 0 20px rgba(203,169,105,0.3), 0 0 40px rgba(203,169,105,0.15); }
.deep-desc { color: var(--text-secondary); font-size: 15px; line-height: 1.75; margin-bottom: 26px; max-width: 480px; font-weight: 300; }
.deep-list { display: flex; flex-direction: column; gap: 12px; }
.deep-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--body-font);
  font-weight: 300;
}
.deep-list li::before { content: "\2014"; color: var(--gold); flex-shrink: 0; opacity: 0.7; }

/* --- Panel (roster/combat/warp mocks) --- */
.panel { padding: 36px 0 36px 36px; border-left: 1px solid var(--gold-border); width: 100%; min-width: 380px; }
.panel-title {
  font-family: var(--mono-font);
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.roster { display: flex; flex-direction: column; gap: 18px; }
.roster-card { padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.roster-card:last-child { border-bottom: none; padding-bottom: 0; }
.roster-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.roster-name { font-size: 13.5px; font-weight: 400; letter-spacing: 0.01em; }
.roster-lv { font-family: var(--mono-font); font-size: 10px; color: var(--text-dim); margin-left: auto; }
.bar-track { height: 2px; background: var(--border-color); overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); }

/* combat target mock */
.combat-target { padding-bottom: 6px; }
.combat-name-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.combat-name { font-size: 15px; font-weight: 400; }
.combat-weak { font-family: var(--mono-font); font-size: 10px; color: var(--red); letter-spacing: 0.06em; }
.toughness-track { display: flex; gap: 3px; margin-bottom: 18px; }
.toughness-seg { height: 2px; flex: 1; background: var(--gold); }
.toughness-seg.empty { background: rgba(203,169,105,0.12); }
.hp-label { font-family: var(--mono-font); font-size: 10px; color: var(--text-dim); display: flex; justify-content: space-between; margin-bottom: 6px; letter-spacing: 0.05em; }

/* warp mock */
.pity-num { font-family: var(--mono-font); font-size: 32px; font-weight: 500; color: var(--gold); }
.pity-sub { font-family: var(--mono-font); font-size: 10px; color: var(--text-dim); letter-spacing: 0.1em; margin-top: 6px; }
.warp-bar-track { height: 2px; background: var(--border-color); overflow: hidden; margin-top: 22px; }
.warp-bar-fill { height: 100%; background: var(--gold); }
.banner-name { font-family: var(--body-font); font-size: 13px; color: var(--text-secondary); margin-top: 16px; font-weight: 300; }

/* --- CTA --- */
.cta-section { padding: 160px 0; text-align: center; }
.cta-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 44px);
  max-width: 600px;
  margin: 0 auto 22px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.cta-desc { color: var(--text-secondary); font-size: 15px; max-width: 440px; margin: 0 auto 42px; font-weight: 300; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Legacy landing aliases --- */
.landing-section { padding: 100px 24px; }
.landing-hero { padding: 140px 0 100px; text-align: left; }
.landing-hero .hero-content { max-width: 1100px; margin: 0 auto; }
.features-grid { display: none; }
.dual-row { display: none; }

/* --- Footer --- */
.landing-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 40px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer-top {
  display: flex;
  align-items: center;
  width: 100%;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.footer-pfp {
  width: 26px; height: 26px;
  border-radius: 6px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(203, 169, 105, 0.4));
}
.footer-line {
  width: 80%;
  height: 1px;
  background: var(--border-color);
  flex-shrink: 0;
}
.footer-links {
  display: flex;
  gap: 32px;
}
.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(--gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #0a0c16;
  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);
}

/* ===== HSR TRACKER ===== */
.tracker-container {
  max-width: 1200px;
  margin: 0 auto;
}
.tracker-header {
  margin-bottom: 24px;
}
.tracker-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tracker-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.tracker-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(231, 185, 76, 0.1);
  border: 1px solid rgba(231, 185, 76, 0.25);
  padding: 3px 10px;
  border-radius: 100px;
}
.tl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pulse 1.6s infinite;
}
.tracker-slot-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tracker-slot-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.tracker-slot-btns {
  display: flex;
  gap: 6px;
}
.ts-btn {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ts-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.ts-btn.active { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(231,185,76,0.06); }

.tracker-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--text-muted);
}
.tl-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tracker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--text-muted);
  text-align: center;
}
.tracker-empty code {
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--accent-gold);
}

/* Player Bar */
.t-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.tpb-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.tpb-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.tpb-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}
.tpb-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tpb-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tpb-stat-val {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}
.tpb-stat-val.gold { color: var(--accent-gold); }
.tpb-stat-val.jade { color: #7b68ee; }
.tpb-bar {
  width: 100px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.tpb-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-gold);
  transition: width 0.5s;
}
.tpb-bar-fill.power { background: var(--accent-teal); }
.tpb-location {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* Tabs */
.t-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}
.t-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.t-tab:hover { color: var(--text-primary); }
.t-tab.active { color: var(--accent-gold); border-bottom-color: var(--accent-gold); }

.t-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 20px;
}
.t-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Roster */
.t-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.party-grid { margin-bottom: 8px; }
.cc {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color 0.15s, transform 0.15s;
}
.cc:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.cc-party { border-color: var(--accent-gold); border-width: 1px; }
.cc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cc-avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.cc-info { flex: 1; min-width: 0; }
.cc-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta { font-size: 0.6875rem; color: var(--text-muted); text-transform: capitalize; }
.cc-party-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(231,185,76,0.12);
  padding: 2px 6px;
  border-radius: 4px;
}
.cc-stats { margin-bottom: 8px; }
.cc-stat { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.cc-asc { color: var(--accent-gold); font-size: 0.6875rem; }
.cc-bar { height: 3px; background: var(--bg-elevated); border-radius: 2px; overflow: hidden; margin: 4px 0; }
.cc-bar-fill { height: 100%; background: var(--accent-gold); border-radius: 2px; transition: width 0.5s; }
.cc-hp-label { color: var(--text-muted); }
.cc-lc { font-size: 0.75rem; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.cc-lc-name { font-weight: 600; }
.cc-lc-lv { color: var(--text-muted); }
.cc-relics { display: flex; gap: 4px; flex-wrap: wrap; }
.cc-relic-badge {
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  border: 1px solid;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Inventory */
.inv-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.inv-total { font-weight: 500; }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.inv-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.inv-card:hover { border-color: var(--rarity-color, var(--border-hover)); }
.inv-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.inv-details { flex: 1; min-width: 0; }
.inv-name { font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-meta { font-size: 0.6875rem; }
.inv-rarity { letter-spacing: 1px; }
.inv-qty { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* Express */
.express-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.express-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.ec-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ec-name { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.ec-lv { font-size: 0.75rem; color: var(--accent-gold); font-weight: 600; }
.ec-bar-track { height: 5px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.ec-bar-fill { height: 100%; background: var(--accent-gold); border-radius: 3px; transition: width 0.5s; }
.ec-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* Story / Quests */
.quest-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.qs-item {
  font-size: 0.8125rem;
  font-weight: 500;
}
.qs-item.done { color: var(--accent-teal); }
.qs-item.active { color: var(--accent-gold); }
.qs-item.available { color: var(--text-muted); }
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-item {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.quest-item.completed { opacity: 0.5; }
.qi-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.qi-type { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.qi-status { font-size: 0.6875rem; font-weight: 600; }
.qi-status.active { color: var(--accent-gold); }
.qi-status.done { color: var(--accent-teal); }
.qi-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.qi-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* Dailies */
.dailies-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.daily-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}
.daily-item.done { opacity: 0.5; }
.di-check { color: var(--accent-gold); font-weight: 700; width: 16px; text-align: center; }
.di-type { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; min-width: 60px; }
.di-desc { color: var(--text-secondary); }

/* Achievement bar */
.achievement-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ab-track { flex: 1; height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.ab-fill { height: 100%; background: var(--accent-gold); border-radius: 3px; transition: width 0.5s; }
.ab-label { font-size: 0.75rem; font-weight: 600; color: var(--accent-gold); min-width: 40px; }

/* ===== 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 */
  nav.links { display: none; }
  .nav-cta { 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 { align-items: center; text-align: center; }
  .footer-line { width: 90%; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .cta-actions { flex-direction: column; align-items: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .content-eyebrow { font-size: 20px; }
  .stat-cell { padding: 24px; }
  .stat-cell:nth-child(2n) { border-right: none; padding-right: 0; }
  .stat-cell:nth-child(2n+1) { padding-left: 0; }
  .deep, .deep.reverse { grid-template-columns: 1fr; direction: ltr; gap: 40px; }
  .panel { border-left: none; border-top: 1px solid var(--gold-border); padding: 32px 0 0 0; }
  .stop { grid-template-columns: 50px 1fr; gap: 16px; }
}

/* ===== BACKGROUND LAYERS (parallax) ===== */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-layer {
  position: absolute;
  inset: -10% -10%;
  will-change: transform;
}
.bg-layer.stars {
  background-image:
    radial-gradient(1px 1px at 8% 12%, rgba(238,236,228,0.5), transparent),
    radial-gradient(1px 1px at 22% 68%, rgba(238,236,228,0.35), transparent),
    radial-gradient(1.5px 1.5px at 38% 24%, rgba(203,169,105,0.5), transparent),
    radial-gradient(1px 1px at 54% 82%, rgba(238,236,228,0.3), transparent),
    radial-gradient(1px 1px at 67% 8%, rgba(238,236,228,0.4), transparent),
    radial-gradient(1.5px 1.5px at 78% 55%, rgba(203,169,105,0.45), transparent),
    radial-gradient(1px 1px at 91% 30%, rgba(238,236,228,0.3), transparent),
    radial-gradient(1px 1px at 15% 90%, rgba(238,236,228,0.25), transparent),
    radial-gradient(1px 1px at 84% 78%, rgba(238,236,228,0.35), transparent);
  background-repeat: repeat;
  background-size: 100% 60%;
  opacity: 0.7;
}
.bg-layer.rails {
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0px,
    transparent 220px,
    rgba(203,169,105,0.05) 220px,
    rgba(203,169,105,0.05) 221px,
    transparent 221px,
    transparent 440px
  );
  opacity: 0.8;
}
.bg-layer.glow {
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(203,169,105,0.09), transparent 70%);
}

/* animated grain texture */
.bg-grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.035;
  mix-blend-mode: overlay;
  animation: grain-drift 8s steps(6) infinite;
}
@keyframes grain-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-grain { animation: none; }
  .bg-layer { transform: none !important; }
}

/* ===== WRAP ===== */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ===== FRAME CORNER BRACKETS ===== */
.frame {
  position: relative;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}
.frame::before, .frame::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
  z-index: 2;
}
.frame::before {
  top: -1px; left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
}
.frame::after {
  bottom: -1px; right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

/* ===== ROUTE PROGRESS WIDGET (station dots) ===== */
.route-progress {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 200;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border-color 0.2s ease;
}
.route-progress:hover { border-color: var(--gold-border); }
.rp-label {
  font-family: var(--mono-font);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.rp-count {
  font-family: var(--mono-font);
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.rp-count .of { color: var(--text-dim); }
.rp-dots { display: flex; gap: 5px; }
.rp-dot {
  width: 14px;
  height: 2px;
  background: var(--border-color);
  transition: background 0.3s ease;
}
.rp-dot.filled { background: var(--gold); }

/* ===== SIDEBAR SECTION LABELS & DIVIDERS ===== */
.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 16px 4px 16px;
  opacity: 0.7;
}
.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 16px;
}

/* ===== NAVBAR HOME BTN ===== */
.navbar-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  flex-shrink: 0;
}
.navbar-home-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  text-decoration: none;
}
