:root {
  --bg: #070b12;
  --bg-panel: #0d1421;
  --bg-card: #121c2e;
  --bg-hover: #192740;
  --border: #223452;
  --border-bright: #335485;
  --text: #e4edf8;
  --text-dim: #92a7c4;
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.14);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: radial-gradient(circle at top right, #0e1d36 0%, var(--bg) 52%);
  color: var(--text);
  line-height: 1.55;
}

.hidden { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(9, 14, 24, 0.94);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.brand-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.9px;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
  font-weight: 700;
}

.brand h1 { margin: 0; font-size: 19px; }
.brand p { margin: 4px 0 0; font-size: 12px; color: var(--text-dim); }

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin: 6px 0 4px 8px;
  font-weight: 700;
}

.nav-links { display: flex; flex-direction: column; gap: 4px; }

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-links a:hover {
  background: var(--bg-hover);
  border-color: var(--border-bright);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

/* Main */
.main {
  padding: 28px 34px 72px;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(135deg, rgba(18, 34, 60, 0.9), rgba(11, 18, 31, 0.95));
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero h2 { margin: 8px 0; font-size: 24px; color: #fff; }
.hero p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stat-pill {
  background: rgba(7, 11, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.stat-pill strong {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 2px;
}

section {
  margin-bottom: 38px;
  scroll-margin-top: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.section-header h2 { margin: 0; font-size: 21px; color: #fff; }
.section-intro { font-size: 14px; color: var(--text-dim); margin: 0 0 14px; }

.copy-btn {
  background: var(--bg-card);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: var(--cyan-soft);
  color: #fff;
}

/* Ship selector tabs */
.ship-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ship-tab {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.ship-tab:hover {
  border-color: var(--cyan);
}

.ship-tab.active {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card h3 { margin: 0 0 8px; font-size: 16.5px; color: #fff; }
.card p { margin: 0 0 10px; font-size: 14px; }
.card p:last-child { margin-bottom: 0; }

.callout {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0 16px;
  font-size: 13.8px;
  border-left: 4px solid var(--cyan);
  background: var(--cyan-soft);
}

.callout.amber { border-left-color: var(--amber); background: var(--amber-soft); }
.callout.green { border-left-color: var(--green); background: var(--green-soft); }
.callout.red { border-left-color: var(--red); background: var(--red-soft); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge.cyan { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(56, 189, 248, 0.35); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.badge.green { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); }
.badge.red { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.35); }
.badge.purple { background: var(--purple-soft); color: var(--purple); border: 1px solid rgba(192, 132, 252, 0.35); }

code {
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 12.5px;
  background: #080d16;
  border: 1px solid var(--border-bright);
  padding: 1px 6px;
  border-radius: 5px;
  color: #cfe8ff;
}

.weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  margin: 14px 0 16px;
}

.weapon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.weapon-card.recommended {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.weapon-card h4 { margin: 8px 0 6px; font-size: 15.5px; color: #fff; }
.weapon-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.weapon-card li { margin-bottom: 4px; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  padding: 11px 12px;
  background: #0a101b;
  color: var(--text-dim);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(34, 52, 82, 0.55);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(25, 39, 64, 0.45); }

.item-name { font-weight: 700; color: #fff; font-size: 14px; }
.sub { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.search-input {
  flex: 1 1 240px;
  background: #0a101b;
  border: 1px solid var(--border-bright);
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.filter-btn {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--cyan); color: #fff; }
.filter-btn.active { background: var(--cyan-soft); color: var(--cyan); border-color: var(--cyan); }

.bp-filter-btn, .bp-faction-btn {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.bp-filter-btn:hover, .bp-faction-btn:hover { border-color: var(--cyan); color: #fff; }
.bp-filter-btn.active, .bp-faction-btn.active {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: var(--cyan);
}

.toolbar-sep { color: var(--border-bright); margin: 0 2px; }

.sort-select {
  background: #0a101b;
  color: #fff;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  cursor: pointer;
  outline: none;
}

.sort-select:focus { border-color: var(--cyan); }

.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.progress-bar-wrap {
  flex: 1 1 200px;
  max-width: 340px;
  height: 10px;
  background: #080d16;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 0.25s ease;
}

input[type="checkbox"].track-cb {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}

tr.is-done td { opacity: 0.52; }
tr.is-done .item-name { text-decoration: line-through; }

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.quest-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.quest-card h3 { margin: 0; font-size: 16px; color: #fff; }

.quest-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  background: rgba(7, 11, 18, 0.55);
  border: 1px solid rgba(34, 52, 82, 0.7);
  border-radius: 7px;
  padding: 8px 10px;
}

.quest-meta div { margin-bottom: 3px; }
.quest-meta div:last-child { margin-bottom: 0; }
.quest-meta strong { color: var(--cyan); }

ol.steps, ul.clean-list {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 13.8px;
}

ol.steps li, ul.clean-list li { margin-bottom: 6px; }

.ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ext-links a {
  text-decoration: none;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}

.ext-links a:hover { background: rgba(56, 189, 248, 0.25); }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0e243d;
  border: 1px solid var(--cyan);
  color: #fff;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main { padding: 20px 16px 56px; }
}

/* Multi-Game Hub & Back Link */
.back-link {
  display: inline-block;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.15s;
}

.back-link:hover {
  color: #fff;
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.hub-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.game-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.game-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-icon {
  font-size: 28px;
  line-height: 1;
}

.game-card h3 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.game-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.game-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.game-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.game-quick-links a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}

.game-quick-links a:hover {
  border-color: var(--cyan);
  color: #fff;
  background: var(--cyan-soft);
}

.game-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(34, 52, 82, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  text-decoration: none;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

.hub-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
