:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #111a2e;
  --bg-card: #16223b;
  --bg-card-hover: #1c2c4c;
  --bg-accent: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #233554;
  --border-light: #334b73;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --gold-text: #fbbf24;
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.2);
  --crimson: #ef4444;
  --crimson-glow: rgba(239, 68, 68, 0.2);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --font-heading: 'Cinzel', serif, Georgia;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 2rem;
  color: var(--gold);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-text);
  line-height: 1.1;
  display: block;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--cyan);
  display: block;
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 360px;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  background: var(--bg-card);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem;
}
.clear-btn:hover { color: var(--text-main); }

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
  border-color: var(--border);
}

.nav-btn.active {
  color: var(--gold-text);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

/* Hero Banners */
.hero-banner {
  background: linear-gradient(135deg, rgba(22, 34, 59, 0.95), rgba(10, 15, 29, 0.85)), radial-gradient(circle at top right, rgba(56, 189, 248, 0.15), transparent 70%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.hero-banner h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.hero-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 900px;
}

/* Tier Selector Bar */
.tier-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: thin;
}

.tier-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tier-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-main);
}

.tier-btn.active {
  background: var(--cyan);
  color: #041226;
  border-color: var(--cyan);
  font-weight: 700;
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* Level Pills */
.level-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.level-pill {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.level-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  color: var(--gold-text);
  transform: translateY(-2px);
}

.level-pill.active {
  background: var(--gold);
  color: #0c1421;
  border-color: var(--gold-text);
  box-shadow: 0 0 14px var(--gold-glow);
  transform: scale(1.06);
}

/* Level Info & Controls */
.level-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.level-info-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.level-info-title h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--text-main);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-text);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-crimson {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.type-filter-group {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.type-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-filter-btn:hover {
  color: var(--text-main);
}

.type-filter-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Quest Card */
.quest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.quest-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.quest-card.exam-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--bg-card));
}

.quest-card.exam-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), #fbbf24);
}

.quest-card.daily-card {
  border-color: rgba(56, 189, 248, 0.35);
}

.quest-card.daily-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cyan);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.quest-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.exam-card .quest-title {
  color: var(--gold-text);
}

/* Givers section */
.givers-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(10, 15, 29, 0.5);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border-left: 3px solid var(--cyan);
}

.giver-item strong {
  color: var(--cyan);
  font-weight: 600;
}

/* Objectives Box */
.objectives-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.objectives-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.task-item {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.35;
}

.task-bullet {
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
}

/* Locations Box */
.where-box {
  font-size: 0.84rem;
  color: #cbd5e1;
  background: rgba(17, 26, 46, 0.6);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.where-box strong {
  color: #38bdf8;
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Admiral Callout Box - HIGH PRIORITY */
.admiral-callout {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.admiral-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.admiral-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admiral-spawn {
  font-size: 0.88rem;
  color: #fef08a;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.admiral-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admiral-stat-item strong {
  color: var(--text-main);
}

/* Rewards Box */
.rewards-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
}

.rewards-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #34d399;
  margin-bottom: 0.4rem;
}

.rewards-content {
  font-size: 0.85rem;
  color: #e2e8f0;
  white-space: pre-line;
  line-height: 1.4;
}

/* NPC Grid & Cards */
.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.npc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.npc-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.npc-card.is-admiral {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}

.npc-header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.npc-avatar {
  width: 68px;
  height: 68px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  overflow: hidden;
  flex-shrink: 0;
}

.npc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.npc-meta {
  flex: 1;
}

.npc-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.is-admiral .npc-title {
  color: #f87171;
}

.npc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(10, 15, 29, 0.6);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.npc-stat strong {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.npc-maps-box {
  font-size: 0.85rem;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.npc-maps-box strong {
  color: var(--cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

.region-info-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Equipment Items */
.equip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  transition: all 0.2s ease;
}

.equip-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.equip-icon {
  width: 54px;
  height: 54px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  overflow: hidden;
}

.equip-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.equip-info h4 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.equip-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Empty & Loading states */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
