@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #c9a44a;
  --gold-light: #e8d48b;
  --gold-dark: #8b6914;
  --crimson: #8b1a1a;
  --crimson-deep: #5a0f0f;
  --bg-dark: #0a0705;
  --bg-panel: rgba(15, 10, 5, 0.85);
  --text-light: #e8dcc8;
  --text-dim: #9a8b72;
  --ember: #ff6b35;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cinzel', serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== AMBIENT PARTICLES ========== */
.embers {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ember {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--ember);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255, 107, 53, 0.6);
  animation: float-up linear infinite;
  opacity: 0;
}

@keyframes float-up {
  0% { transform: translateY(100vh) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) translateX(80px) scale(0.3); opacity: 0; }
}

/* ========== NAVIGATION ========== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(10, 7, 5, 0.95) 0%, rgba(10, 7, 5, 0.7) 70%, transparent 100%);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(201, 164, 74, 0.15);
}

nav.nav-solid {
  background: rgba(10, 7, 5, 0.97);
}

.nav-brand {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 164, 74, 0.3);
  letter-spacing: 2px;
  text-decoration: none;
}

.nav-brand span {
  color: var(--crimson);
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: color 0.3s, text-shadow 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(201, 164, 74, 0.4);
}

.nav-links a:hover::after { width: 100%; }

.nav-discord {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7289da !important;
}
.nav-discord:hover {
  color: #fff !important;
  text-shadow: 0 0 10px rgba(114, 137, 218, 0.6) !important;
}
.nav-discord svg { vertical-align: middle; }
.nav-discord::after { display: none !important; }

.nav-user {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 2px;
}

/* ========== BUTTONS ========== */
.btn-war {
  display: inline-block;
  padding: 1rem 3rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 40%, var(--gold-light) 60%, var(--gold) 100%);
  border: none;
  text-decoration: none;
  position: relative;
  cursor: pointer;
  transition: all 0.4s;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

.btn-war:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201, 164, 74, 0.4);
  filter: brightness(1.1);
}

.btn-ghost {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(201, 164, 74, 0.4);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s;
}

.btn-ghost:hover {
  background: rgba(201, 164, 74, 0.1);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 164, 74, 0.15);
}

.btn-ghost-sm {
  display: inline-block;
  padding: 0.3rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(201, 164, 74, 0.4);
  text-decoration: none;
  transition: all 0.3s;
}
.btn-ghost-sm:hover {
  background: rgba(201, 164, 74, 0.1);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(201, 164, 74, 0.15);
}

/* ========== PAGE CONTAINER ========== */
.page-container {
  max-width: none;
  margin: 0 auto;
  padding: 120px 4rem 60px;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 2;
}
.page-container.narrow {
  max-width: 520px;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
}
.dashboard-grid > .server-status-bar {
  grid-column: 1 / -1;
}
.dashboard-bottom-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 66%;
  margin: 0 auto;
}
@media (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom-row { max-width: 100%; }
}
@media (max-width: 640px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-bottom-row { grid-template-columns: 1fr; max-width: 100%; }
}

/* ========== CARD / PANEL ========== */
.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(201, 164, 74, 0.12);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold), var(--gold-dark), transparent);
}

.panel h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
  text-shadow: 0 0 20px rgba(201, 164, 74, 0.3);
}

.panel h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 0 0 15px rgba(201, 164, 74, 0.2);
}

.panel-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  /* Cinzel renders glyphs as small-caps, which makes typed credentials look
     like ALL CAPS even when they aren't. Use a normal sans-serif here so
     usernames/emails/passwords read as the user actually typed them. */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-light);
  background: rgba(201, 164, 74, 0.06);
  border: 1px solid rgba(201, 164, 74, 0.2);
  outline: none;
  transition: all 0.3s;
}

.form-group input:focus {
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.1);
  box-shadow: 0 0 15px rgba(201, 164, 74, 0.1);
}

.form-group input::placeholder {
  color: rgba(154, 139, 114, 0.4);
}

.form-actions {
  margin-top: 1.5rem;
}

.form-actions .btn-war {
  width: 100%;
  text-align: center;
}

/* ========== ALERTS ========== */
.alert {
  padding: 10px 14px;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-left: 3px solid;
}

.alert-error {
  background: rgba(139, 26, 26, 0.3);
  border-color: #cc4444;
  color: #ff8888;
}

.alert-success {
  background: rgba(26, 100, 26, 0.3);
  border-color: #44aa44;
  color: #88dd88;
}

/* ========== PANEL FOOTER ========== */
.panel-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}

.panel-footer a {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.panel-footer a:hover {
  color: var(--gold);
}

.panel-footer-center {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.7rem;
}

.panel-footer-center a {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.panel-footer-center a:hover {
  color: var(--gold);
}

/* ========== ACCOUNT INFO ========== */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(201, 164, 74, 0.08);
}

.info-row:last-child { border-bottom: none; }

.info-row .label {
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.info-row .value {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-light);
}

.status-online {
  color: #44cc44;
  text-shadow: 0 0 10px rgba(68, 204, 68, 0.3);
}

.status-offline {
  color: var(--text-dim);
}

/* ========== CHARACTER LIST ========== */
.character-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.character-card {
  background: rgba(201, 164, 74, 0.04);
  border: 1px solid rgba(201, 164, 74, 0.1);
  border-left: 3px solid var(--gold-dark);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
  flex-wrap: wrap;
}

.character-card:hover {
  border-left-color: var(--gold);
  background: rgba(201, 164, 74, 0.08);
  box-shadow: 0 0 20px rgba(201, 164, 74, 0.05);
}

.char-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.char-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
}

.char-details {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  letter-spacing: 1px;
}

.char-level { color: var(--gold); font-weight: 700; }
.char-class { color: #8a9ab0; }
.char-build-btn {
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.35rem 0.9rem;
}
.char-country { font-weight: 700; }

.country-wei { color: #dd4444; }
.country-shu { color: #44bb44; }
.country-wu { color: #4488dd; }

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 1.5rem;
  font-style: italic;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

/* ========== ACTIONS ========== */
.actions {
  display: flex;
  gap: 12px;
}

/* ========== SERVER STATUS ========== */
.server-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  background: rgba(15, 10, 5, 0.7);
  border: 1px solid rgba(201, 164, 74, 0.12);
  position: relative;
}

.server-status-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.server-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.server-status-dot.online {
  background: #44cc44;
  box-shadow: 0 0 8px rgba(68, 204, 68, 0.6);
  animation: status-pulse 2s ease-in-out infinite;
}

.server-status-dot.starting {
  background: #ddaa44;
  box-shadow: 0 0 8px rgba(221, 170, 68, 0.6);
  animation: status-pulse 1s ease-in-out infinite;
}

.server-status-dot.maintenance {
  background: #ffcc44;
  box-shadow: 0 0 10px rgba(255, 204, 68, 0.65);
  animation: status-pulse 1.2s ease-in-out infinite;
}

.server-status-dot.offline {
  background: #cc4444;
  box-shadow: 0 0 8px rgba(204, 68, 68, 0.4);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.server-status-text {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.server-status-text.online { color: #44cc44; }
.server-status-text.starting { color: #ddaa44; }
.server-status-text.maintenance { color: #ffcc44; }
.server-status-text.offline { color: #cc4444; }

/* ========== NATION PIE CHART ========== */
.nation-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
}

.nation-chart-wrap {
  position: relative;
  width: 100px;
  height: 100px;
}

.nation-chart {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(201, 164, 74, 0.3);
  box-shadow: 0 0 15px rgba(201, 164, 74, 0.1), inset 0 0 10px rgba(0, 0, 0, 0.5);
  position: relative;
}

.nation-chart-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid rgba(201, 164, 74, 0.2);
  z-index: 1;
}

.nation-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nation-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nation-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nation-legend-swatch.wei { background: #dd4444; }
.nation-legend-swatch.wu { background: #4488dd; }
.nation-legend-swatch.shu { background: #44bb44; }

.nation-legend-name {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* Index page server status section */
.server-status-section {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 2;
}

.server-status-section .server-status-bar {
  max-width: 300px;
  margin: 0 auto 1.5rem;
}

.server-status-section .nation-widget {
  max-width: 320px;
  margin: 0 auto;
}

/* ========== POLLS ========== */
.poll-dashboard-panel {
  grid-column: 1 / -1;
}

.poll-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.poll-card {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1.5rem;
  align-items: center;
  background: rgba(201, 164, 74, 0.035);
  border: 1px solid rgba(201, 164, 74, 0.1);
  padding: 1.2rem;
}

.poll-results {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
}

.poll-pie {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 2px solid rgba(201, 164, 74, 0.35);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 0 22px rgba(201, 164, 74, 0.08), inset 0 0 12px rgba(0,0,0,0.55);
}

.poll-pie-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid rgba(201, 164, 74, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poll-pie-inner span {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 1rem;
}

.poll-pie-inner small {
  color: var(--text-dim);
  font-size: 0.48rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.poll-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.poll-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 42px;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.68rem;
}

.poll-swatch,
.poll-option-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.12);
}

.poll-legend-name {
  overflow-wrap: anywhere;
}

.poll-legend-value {
  color: var(--gold-light);
  text-align: right;
  font-weight: 700;
}

.poll-question h3 {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.poll-question p,
.poll-note {
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.5;
}

.poll-local-clock {
  margin-top: 0.45rem;
  color: var(--gold-light) !important;
  font-size: 0.7rem !important;
  letter-spacing: 1px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.poll-option {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(201, 164, 74, 0.18);
  background: rgba(201, 164, 74, 0.04);
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}

.poll-option:hover,
.poll-option.selected,
.poll-option.current-window {
  border-color: rgba(201, 164, 74, 0.55);
  background: rgba(201, 164, 74, 0.08);
}

.poll-option.current-window {
  box-shadow: inset 3px 0 0 var(--gold);
}

.poll-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(201, 164, 74, 0.11);
  z-index: 0;
}

.poll-option-main,
.poll-option-meta {
  position: relative;
  z-index: 1;
}

.poll-option-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.poll-option-meta {
  color: var(--gold-light);
  font-size: 0.68rem;
  white-space: nowrap;
}

.poll-current-badge {
  border: 1px solid rgba(201, 164, 74, 0.4);
  color: var(--gold-light);
  font-size: 0.55rem;
  letter-spacing: 1px;
  padding: 0.12rem 0.35rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.poll-note {
  margin-top: 0.8rem;
}

.poll-login {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--gold);
  border: 1px solid rgba(201, 164, 74, 0.35);
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.poll-login:hover {
  background: rgba(201, 164, 74, 0.1);
}

@media (max-width: 760px) {
  .poll-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .poll-results {
    flex-direction: column;
    align-items: flex-start;
  }
  .poll-pie {
    width: 112px;
    height: 112px;
  }
  .poll-option {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
  .poll-option-meta {
    white-space: normal;
  }
}

/* ========== FOOTER ========== */
footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(201, 164, 74, 0.1);
  background: rgba(5, 3, 2, 0.8);
  position: relative;
  z-index: 2;
}

footer p {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  opacity: 0.6;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ========== WIKI LANDING & HUB ========== */
.wiki-landing, .wiki-hub {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 16px 60px;
  text-align: center;
}
.wiki-landing-title, .wiki-hub-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.wiki-landing-sub, .wiki-hub-sub {
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}
.wiki-landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .wiki-landing-grid { grid-template-columns: 1fr; }
}
.wiki-edition-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem 2.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.wiki-edition-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(201, 164, 74, 0.15);
}
.wiki-edition-icon {
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.wiki-edition-card h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.4rem;
  margin-bottom: 0.7rem;
}
.wiki-edition-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.wiki-edition-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--gold-dark);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.wiki-edition-active {
  border-color: var(--gold);
  color: var(--gold);
}
.wiki-edition-classic:hover .wiki-edition-badge {
  border-color: var(--crimson);
  color: var(--crimson);
}
.wiki-edition-global:hover .wiki-edition-badge {
  background: var(--gold);
  color: var(--bg-dark);
}

/* Hub featured card (map) */
.wiki-hub-featured {
  display: block;
  text-decoration: none;
  margin-bottom: 2rem;
}
.wiki-hub-featured-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.wiki-hub-featured:hover .wiki-hub-featured-inner {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201, 164, 74, 0.15);
}
.wiki-hub-featured svg {
  color: var(--gold);
  flex-shrink: 0;
}
.wiki-hub-featured h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  text-align: left;
}
.wiki-hub-featured p {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: left;
}

/* Hub category grid */
.wiki-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.wiki-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.8rem 1.2rem;
  background: var(--bg-panel);
  border: 1px solid rgba(139, 105, 20, 0.3);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.2s;
}
.wiki-hub-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}
.wiki-hub-card svg {
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.wiki-hub-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}
.wiki-hub-card p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Classic hub coming soon */
.wiki-hub-coming-soon {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-dim);
}
.wiki-hub-coming-soon svg {
  color: var(--gold-dark);
  margin-bottom: 1.5rem;
}
.wiki-hub-coming-soon h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
.wiki-hub-coming-soon p {
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ========== WIKI DROP TABLES ========== */
.wiki-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 120px 16px 60px;
  width: 100%;
  position: relative;
  z-index: 2;
  flex: 1;
}

.wiki-header {
  text-align: center;
}

.wiki-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.wiki-tab {
  padding: 0.6rem 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(201, 164, 74, 0.2);
  cursor: pointer;
  transition: all 0.3s;
}

.wiki-tab:first-child { border-right: none; }

.wiki-tab.active {
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
  border-color: var(--gold);
}

.wiki-tab:hover:not(.active) {
  color: var(--gold);
  background: rgba(201, 164, 74, 0.08);
}

.wiki-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1rem;
}

.wiki-filter {
  padding: 0.35rem 1.2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(201, 164, 74, 0.15);
  cursor: pointer;
  transition: all 0.3s;
}

.wiki-filter.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.1);
}

.wiki-filter:hover:not(.active) {
  color: var(--text-light);
  border-color: rgba(201, 164, 74, 0.3);
}

.wiki-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wiki-search {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text-light);
  background: rgba(201, 164, 74, 0.06);
  border: 1px solid rgba(201, 164, 74, 0.2);
  outline: none;
  transition: all 0.3s;
}

.wiki-search:focus {
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.1);
  box-shadow: 0 0 15px rgba(201, 164, 74, 0.1);
}

.wiki-search::placeholder {
  color: rgba(154, 139, 114, 0.4);
}

.wiki-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
}

.wiki-loading {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.wiki-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(201, 164, 74, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: wiki-spin 0.8s linear infinite;
}

@keyframes wiki-spin {
  to { transform: rotate(360deg); }
}

.wiki-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiki-row {
  background: var(--bg-panel);
  border: 1px solid rgba(201, 164, 74, 0.08);
  transition: all 0.2s;
}

.wiki-row:hover {
  border-color: rgba(201, 164, 74, 0.2);
}

.wiki-row.expanded {
  border-color: rgba(201, 164, 74, 0.3);
  box-shadow: 0 0 20px rgba(201, 164, 74, 0.05);
}

.wiki-row-header {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  cursor: pointer;
  gap: 12px;
  transition: background 0.2s;
}

.wiki-row-header:hover {
  background: rgba(201, 164, 74, 0.04);
}

.wiki-row-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.wiki-row-meta {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.wiki-row-chevron {
  font-size: 0.6rem;
  color: var(--gold-dark);
  width: 16px;
  text-align: center;
}

.wiki-row-detail {
  padding: 0 1rem 1rem;
  overflow-x: auto;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.wiki-table th {
  text-align: left;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.15);
}

.wiki-table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.05);
  color: var(--text-light);
}

.wiki-table tbody tr:hover {
  background: rgba(201, 164, 74, 0.04);
}

.wiki-link {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
}

.wiki-link:hover {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(201, 164, 74, 0.3);
}

.wiki-ntype {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 2px;
}

.wiki-ntype-sm {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  vertical-align: middle;
}

.ntype-monster { background: rgba(201, 164, 74, 0.15); color: var(--gold); }
.ntype-boss { background: rgba(170, 80, 220, 0.2); color: #d4a0ff; }

.wiki-location {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  background: rgba(100, 180, 140, 0.15);
  color: #8ad4b0;
  margin-left: 4px;
}

.wiki-loc-cell {
  color: #8ad4b0;
  font-size: 0.75rem;
}

.wiki-tier {
  display: inline-block;
  padding: 1px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 2px;
}

.tier-quest { background: rgba(139, 26, 26, 0.4); color: #ff8888; }
.tier-normal { background: rgba(201, 164, 74, 0.15); color: var(--gold); }
.tier-trash { background: rgba(100, 140, 200, 0.2); color: #8ab4f8; }
.tier-collect { background: rgba(80, 180, 120, 0.2); color: #7fdf8f; }
.ntype-chest { background: rgba(201, 164, 74, 0.15); color: var(--gold); border-color: var(--gold); }
.ntype-destroy { background: rgba(180, 100, 50, 0.2); color: #d4a070; border-color: #d4a070; }

.prob-guaranteed { color: #88dd88; font-weight: 700; }
.prob-high { color: #88dd88; }
.prob-mid { color: var(--gold); }
.prob-low { color: var(--text-dim); }
.prob-rare { color: #ff8888; font-size: 0.75rem; }

.wiki-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.wiki-page-info {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.wiki-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

/* ========== NAV DROPDOWN ========== */
.nav-dropdown {
  position: relative;
}

.nav-lang .nav-dropdown-menu {
  left: auto;
  right: 0;
  transform: none;
  min-width: 160px;
}

.nav-lang-toggle {
  font-variant: small-caps;
}

.nav-dropdown-menu {
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 7, 5, 0.97);
  border: 1px solid rgba(201, 164, 74, 0.15);
  list-style: none;
  padding: 0.4rem 0;
  min-width: 160px;
  z-index: 200;
  /* Extend hover target upward into the nav link so there's no gap to cross */
  margin-top: 0;
  transition: opacity 0.12s ease 0s, visibility 0s linear 0.25s;
}

/* Invisible bridge between nav item and menu so hover stays continuous */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  display: none;
}

.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
  display: block;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.12s ease 0s, visibility 0s linear 0s;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.5rem 1.2rem;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover {
  background: rgba(201, 164, 74, 0.08);
}

.nav-dropdown-menu li a::after {
  display: none;
}

.dropdown-section-label {
  padding: 0.5rem 1.2rem 0.2rem;
  font-size: 0.55rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #c9a44a;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  pointer-events: none;
}

.dropdown-divider {
  height: 1px;
  background: rgba(201, 164, 74, 0.15);
  margin: 0.3rem 0.8rem;
}

.wiki-mega-menu {
  min-width: 190px;
}

/* ========== ITEM DATABASE ========== */
.item-cat-filters {
  flex-wrap: wrap;
}

/* Career filter row */
.career-filter-row {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.career-filter-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.career-filter-label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 0.35rem;
  min-width: 55px;
}
.career-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.career-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  background: rgba(201, 164, 74, 0.06);
  border: 1px solid rgba(201, 164, 74, 0.15);
  color: var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.career-btn:hover {
  background: rgba(201, 164, 74, 0.12);
  border-color: rgba(201, 164, 74, 0.3);
  color: var(--text-main);
}
.career-btn.active {
  background: rgba(201, 164, 74, 0.18);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.career-btn-soldier {
  background: rgba(139, 69, 19, 0.15);
  border-color: rgba(139, 69, 19, 0.3);
  color: #c49a6c;
}
.career-btn-soldier:hover {
  background: rgba(139, 69, 19, 0.25);
  border-color: rgba(139, 69, 19, 0.5);
}
.soldier-btn {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
}

/* Browse: item cards */
.item-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.7rem 1rem;
  background: var(--bg-panel);
  border: 1px solid rgba(201, 164, 74, 0.08);
  border-left: 3px solid rgba(201, 164, 74, 0.15);
  margin-bottom: 3px;
  transition: all 0.2s;
  cursor: pointer;
}

.item-card:hover {
  border-color: rgba(201, 164, 74, 0.3);
  border-left-color: var(--gold);
  background: rgba(201, 164, 74, 0.05);
  box-shadow: 0 0 20px rgba(201, 164, 74, 0.05);
  transform: translateX(2px);
}

.item-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-card-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.item-card-arrow {
  font-size: 1.2rem;
  color: var(--gold-dark);
  transition: color 0.2s, transform 0.2s;
}

.item-card:hover .item-card-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

.item-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.item-card-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.item-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.item-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(201, 164, 74, 0.08);
  border: 1px solid rgba(201, 164, 74, 0.25);
  letter-spacing: 0.5px;
}

.item-stat-chip-lbl {
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.item-stat-chip-val {
  color: var(--gold-light);
  font-weight: 700;
}

.wiki-sort {
  background: rgba(15, 10, 5, 0.85);
  border: 1px solid rgba(201, 164, 74, 0.35);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.wiki-sort:focus {
  outline: none;
  border-color: var(--gold);
}

.stat-range-note {
  font-size: 0.72em;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

.item-level {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}

.item-price {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.item-drop-badge {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 1px 6px;
  background: rgba(170, 80, 220, 0.15);
  color: #d4a0ff;
  border-radius: 2px;
}

.item-formula-badge {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 1px 6px;
  background: rgba(80, 170, 120, 0.15);
  color: #88e6a8;
  border-radius: 2px;
}

/* Category badges */
.item-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}

.cat-weapon    { background: rgba(139, 26, 26, 0.4);   color: #ff8888; }
.cat-armor     { background: rgba(40, 100, 180, 0.35); color: #88c8ff; }
.cat-mount     { background: rgba(80, 140, 60, 0.35);  color: #a0e080; }
.cat-cosmetic  { background: rgba(160, 60, 180, 0.35); color: #d88aef; }
.cat-luckybag  { background: rgba(180, 130, 20, 0.35); color: #ffd060; }
.cat-soul      { background: rgba(120, 60, 180, 0.35); color: #cc99ff; }
.cat-consumable{ background: rgba(26, 120, 26, 0.3);   color: #88dd88; }
.cat-crafting  { background: rgba(160, 90, 20, 0.35);  color: #ffb060; }
.cat-soldier   { background: rgba(180, 60, 60, 0.35);  color: #ff9966; }
.cat-siege     { background: rgba(100, 60, 140, 0.35);  color: #c080ff; }
.cat-material  { background: rgba(40, 80, 160, 0.3);   color: #8ab4f8; }
.cat-quest     { background: rgba(160, 120, 40, 0.3);  color: var(--gold-light); }
.cat-function  { background: rgba(60, 160, 160, 0.3);  color: #80e0e0; }
.cat-gem       { background: rgba(170, 80, 220, 0.2);  color: #d4a0ff; }
.cat-other     { background: rgba(100, 100, 100, 0.3); color: #b0b0b0; }

/* Item type ID tag in detail view */
.item-type-id {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(201, 164, 74, 0.1);
  border: 1px solid rgba(201, 164, 74, 0.2);
  color: var(--text-dim);
  border-radius: 2px;
  font-family: monospace;
}

/* Sub-filter row (weapon types, armor slots) */
.sub-filter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.sub-filter-label {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 0.3rem;
  min-width: 40px;
}
.sub-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.sub-filter-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(201, 164, 74, 0.06);
  border: 1px solid rgba(201, 164, 74, 0.15);
  color: var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.sub-filter-btn:hover {
  background: rgba(201, 164, 74, 0.12);
  border-color: rgba(201, 164, 74, 0.3);
  color: var(--text-main);
}
.sub-filter-btn.active {
  background: rgba(201, 164, 74, 0.18);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* Soldier weapon sub-filter row */
.soldier-weapon-row .sub-filter-btn {
  background: rgba(139, 69, 19, 0.1);
  border-color: rgba(139, 69, 19, 0.2);
  color: #c49a6c;
  font-size: 0.72rem;
}
.soldier-weapon-row .sub-filter-btn:hover {
  background: rgba(139, 69, 19, 0.2);
  border-color: rgba(139, 69, 19, 0.4);
}
.soldier-weapon-row .sub-filter-btn.active {
  background: rgba(139, 69, 19, 0.25);
  border-color: #c49a6c;
  color: #e8c08a;
  font-weight: 600;
}

/* NPC weapon toggle */
.npc-toggle-row {
  display: flex;
  align-items: center;
  margin-top: 0.4rem;
  padding-left: 0.2rem;
}
.npc-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.npc-toggle-label input[type="checkbox"] {
  display: none;
}
.npc-toggle-check {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(201, 164, 74, 0.25);
  border-radius: 2px;
  background: rgba(201, 164, 74, 0.06);
  transition: all 0.2s;
  position: relative;
  flex-shrink: 0;
}
.npc-toggle-label input:checked + .npc-toggle-check {
  background: rgba(201, 164, 74, 0.25);
  border-color: var(--gold);
}
.npc-toggle-label input:checked + .npc-toggle-check::after {
  content: "\2713";
  position: absolute;
  top: -1px;
  left: 1px;
  font-size: 11px;
  color: var(--gold);
}
.npc-toggle-hint {
  color: rgba(154, 139, 114, 0.5);
  font-size: 0.65rem;
}

/* Source badges */
.item-src-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  background: rgba(100, 100, 100, 0.2);
  color: var(--text-dim);
}

.src-weapon { background: rgba(139, 26, 26, 0.3); color: #ff8888; }
.src-item { background: rgba(26, 100, 26, 0.3); color: #88dd88; }
.src-function { background: rgba(40, 80, 160, 0.3); color: #8ab4f8; }
.src-nameonly { background: rgba(80, 80, 80, 0.2); color: #888; }

/* ========== ITEM DETAIL PAGE ========== */

/* Navigation bar (top and bottom) */
.item-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.item-nav-bottom {
  margin-top: 1rem;
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(201, 164, 74, 0.1);
}

.item-nav-back {
  font-size: 0.7rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.item-nav-back:hover {
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(201, 164, 74, 0.3);
}

.item-nav-arrows {
  display: flex;
  gap: 1rem;
}

.item-nav-prev,
.item-nav-next {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-nav-prev:hover,
.item-nav-next:hover {
  color: var(--gold);
}

/* Detail panel */
.item-detail-panel {
  text-align: left;
}

.item-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.item-detail-header h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.4rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 164, 74, 0.3);
  margin: 0;
}

.item-detail-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.item-description {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
  letter-spacing: 0.3px;
}

/* Info grid (basic properties) */
.item-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(201, 164, 74, 0.1);
}

.item-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.06);
}

.item-info-row:nth-child(odd) {
  border-right: 1px solid rgba(201, 164, 74, 0.06);
}

.item-info-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.item-info-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Stat panels */
.item-stat-panel {
  margin-bottom: 1.2rem;
  border: 1px solid rgba(201, 164, 74, 0.1);
  background: rgba(201, 164, 74, 0.02);
}

.item-stat-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
  margin: 0;
}

.item-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.item-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.04);
}

.item-stat-row:nth-child(odd) {
  border-right: 1px solid rgba(201, 164, 74, 0.04);
}

.item-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.item-stat-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

.stat-positive { color: #88dd88; }
.stat-negative { color: #ff8888; }

/* Career/Soldier type pill tags */
.career-pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.career-pill {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(201, 164, 74, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 164, 74, 0.2);
  border-radius: 3px;
  white-space: nowrap;
}
.item-stat-row:has(.career-pill-wrap) {
  grid-column: 1 / -1;
}

/* "Dropped By" section */
.item-drops-panel {
  text-align: left;
}

.item-section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0 0 1rem;
  text-shadow: 0 0 15px rgba(201, 164, 74, 0.2);
}

.item-drop-total {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 400;
  margin-left: 8px;
}

/* Drop source cards */
.item-drops-cards {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drop-source-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.6rem 0.8rem;
  background: rgba(201, 164, 74, 0.02);
  border: 1px solid rgba(201, 164, 74, 0.08);
  border-left: 3px solid rgba(170, 80, 220, 0.3);
  transition: all 0.2s;
}

.drop-source-card:hover {
  border-color: rgba(201, 164, 74, 0.25);
  border-left-color: #d4a0ff;
  background: rgba(201, 164, 74, 0.05);
  transform: translateX(2px);
}

.drop-source-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.drop-source-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.3px;
}

.drop-source-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drop-source-loc {
  font-size: 0.65rem;
  color: #8ad4b0;
  letter-spacing: 0.5px;
}

.drop-source-rate {
  font-size: 0.7rem;
}

.drop-source-qty {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* Item detail link arrow in drops page */
.item-detail-link {
  font-size: 0.7rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.item-detail-link:hover {
  opacity: 1;
}

/* ========== BAG CONTENTS ========== */
.item-bag-panel {
  text-align: left;
}

.bag-reward-info {
  font-size: 0.8rem;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

.bag-drops-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.bag-drops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.bag-drops-table thead tr {
  border-bottom: 1px solid rgba(201,164,74,0.3);
}

.bag-drops-table th {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
}

.bag-drops-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.bag-drops-table tbody tr:hover {
  background: rgba(201,164,74,0.05);
}

.bag-item-link {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.bag-item-link:hover {
  color: var(--gold-light);
}

.bag-qty {
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
  text-align: center;
}

.bag-prob {
  position: relative;
  min-width: 120px;
  height: 20px;
  vertical-align: middle;
}

.bag-prob-bar {
  position: absolute;
  left: 0;
  top: 3px;
  height: 14px;
  border-radius: 2px;
  background: rgba(201,164,74,0.25);
  pointer-events: none;
}

.bag-prob-text {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--gold-light);
  padding-left: 4px;
}

.bag-rnd-note {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 8px;
}

.bag-no-data {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.5rem 0;
}

.bag-select-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0.5rem;
}

.bag-select-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}

.bag-select-item:hover {
  background: rgba(201,164,74,0.1);
  border-color: rgba(201,164,74,0.3);
  color: var(--gold-light);
}

/* ========== MARTIAL SPIRITS ========== */

.spirit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.spirit-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.8rem 1rem;
  background: var(--bg-panel);
  border: 1px solid rgba(120, 60, 180, 0.12);
  border-left: 3px solid rgba(120, 60, 180, 0.25);
  transition: all 0.2s;
  cursor: pointer;
}

.spirit-card:hover {
  border-color: rgba(120, 60, 180, 0.35);
  border-left-color: #cc99ff;
  background: rgba(120, 60, 180, 0.05);
  box-shadow: 0 0 20px rgba(120, 60, 180, 0.08);
  transform: translateY(-1px);
}

.spirit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.spirit-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.spirit-card-total {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cc99ff;
  letter-spacing: 1px;
}

.spirit-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.spirit-stat-str { color: #ff8888; font-size: 0.7rem; font-weight: 600; }
.spirit-stat-int { color: #88c8ff; font-size: 0.7rem; font-weight: 600; }
.spirit-stat-agi { color: #88dd88; font-size: 0.7rem; font-weight: 600; }
.spirit-stat-spi { color: #d4a0ff; font-size: 0.7rem; font-weight: 600; }
.spirit-stat-sta { color: #ffd060; font-size: 0.7rem; font-weight: 600; }

.spirit-stat-filters { flex-wrap: wrap; }

/* Stat bars */
.spirit-bars, .spirit-detail-bars {
  margin: 4px 0;
}

.spirit-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 16px;
}

.spirit-bar-row.spirit-bar-lg {
  height: 22px;
  margin-bottom: 2px;
}

.spirit-bar-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  width: 28px;
  text-align: right;
}

.spirit-bar-lg .spirit-bar-label {
  font-size: 0.65rem;
  width: 36px;
}

.spirit-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.spirit-bar-lg .spirit-bar-track {
  height: 6px;
}

.spirit-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.spirit-bar-str { background: linear-gradient(90deg, #ff6666, #ff8888); }
.spirit-bar-int { background: linear-gradient(90deg, #4488ff, #88c8ff); }
.spirit-bar-agi { background: linear-gradient(90deg, #44aa44, #88dd88); }
.spirit-bar-spi { background: linear-gradient(90deg, #9944cc, #d4a0ff); }
.spirit-bar-sta { background: linear-gradient(90deg, #cc9900, #ffd060); }

.spirit-bar-val {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-dim);
  width: 28px;
}

.spirit-bar-lg .spirit-bar-val {
  font-size: 0.7rem;
  width: 36px;
}

.spirit-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.spirit-skill-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(120, 60, 180, 0.15);
  color: #d4a0ff;
  border-radius: 2px;
}

.spirit-card-sp {
  font-size: 0.6rem;
  color: var(--gold);
  margin-top: 3px;
  font-weight: 600;
}

.spirit-detail-bars {
  margin: 1rem 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(120, 60, 180, 0.1);
  background: rgba(120, 60, 180, 0.02);
}

.spirit-skills-detail {
  padding: 0.4rem 0.8rem;
}

.spirit-skill-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(201, 164, 74, 0.04);
}

.spirit-skill-name {
  font-size: 0.85rem;
  color: var(--text-light);
}

.spirit-skill-id {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: monospace;
}

a.spirit-skill-link {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, padding 0.15s;
}

a.spirit-skill-link:hover {
  background: rgba(201, 164, 74, 0.06);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

a.spirit-skill-link:hover .spirit-skill-name {
  color: var(--gold-light);
}

a.spirit-skill-link:hover .spirit-skill-id {
  color: var(--gold);
}

/* ========== SOLDIER TREE ========== */

.sol-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-node {
  margin-left: calc(var(--depth, 0) * 20px);
}

.tree-child {
  border-left: 2px solid rgba(201, 164, 74, 0.12);
  padding-left: 8px;
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.6rem;
  background: var(--bg-panel);
  border: 1px solid rgba(201, 164, 74, 0.06);
  transition: all 0.15s;
  flex-wrap: wrap;
}

.tree-node-header:hover {
  background: rgba(201, 164, 74, 0.04);
  border-color: rgba(201, 164, 74, 0.15);
}

.tree-dim {
  opacity: 0.5;
}

.tree-toggle {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.6rem;
  padding: 2px 4px;
  transition: color 0.2s;
  line-height: 1;
}

.tree-toggle:hover {
  color: var(--gold-light);
}

.tree-leaf-dot {
  color: rgba(201, 164, 74, 0.3);
  font-size: 0.6rem;
  padding: 2px 4px;
}

.tree-node-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.tree-node-name:hover {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(201, 164, 74, 0.3);
}

.tree-node-lvl {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}

.tree-node-type {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(100, 180, 140, 0.15);
  color: #8ad4b0;
  border-radius: 2px;
}

.tree-node-skills {
  font-size: 0.55rem;
  color: #d4a0ff;
  letter-spacing: 0.5px;
}

.tree-detail-toggle {
  background: none;
  border: 1px solid rgba(201, 164, 74, 0.15);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 2px;
  transition: all 0.2s;
  margin-left: auto;
  line-height: 1.2;
}

.tree-detail-toggle:hover,
.tree-detail-toggle.detail-open {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.08);
}

.tree-children {
  margin-top: 1px;
}

/* Rank badges */
.rank-badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 2px;
  white-space: nowrap;
}

.rank-badge-lg {
  font-size: 0.65rem;
  padding: 2px 10px;
}

/* Inline detail panel */
.tree-inline-detail,
.tree-inline-bars {
  margin: 2px 0 4px calc(var(--depth, 0) * 0px);
  padding: 0.6rem 0.8rem;
  background: rgba(201, 164, 74, 0.02);
  border: 1px solid rgba(201, 164, 74, 0.1);
  border-top: none;
}

/* Bar toggle button (next to info toggle) */
.tree-bar-toggle {
  background: none;
  border: 1px solid rgba(201, 164, 74, 0.15);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 2px;
  transition: all 0.2s;
  line-height: 1.2;
}
.tree-bar-toggle:hover,
.tree-bar-toggle.bar-open {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.08);
}

/* Stat bar rows */
.stat-bar-row { display: flex; align-items: center; padding: 3px 0.8rem; gap: 8px; }
.stat-bar-label { width: 40px; font-size: 0.65rem; color: var(--text-dim); flex-shrink: 0; }
.stat-bar-track { display: block; flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; border-radius: 2px; transition: width 0.3s; min-width: 2px; }
.stat-bar-value { width: 40px; text-align: right; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }

.stat-bar-section h4 {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 8px 0.8rem 2px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
  padding-bottom: 3px;
}
.stat-bar-section:first-child h4 { margin-top: 0; }

/* Detail page bar toggle */
.detail-bar-toggle {
  background: none;
  border: 1px solid rgba(201, 164, 74, 0.2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 3px;
  transition: all 0.2s;
  margin-bottom: 0.6rem;
}
.detail-bar-toggle:hover,
.detail-bar-toggle.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.08);
}

.tree-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tree-detail-grid h4 {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
  padding-bottom: 3px;
}

.tree-d-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 1px 0;
}

.tree-d-row span:first-child {
  color: var(--text-dim);
  font-size: 0.65rem;
}

.tree-d-row span:last-child {
  font-weight: 600;
  color: var(--text-light);
}

.tree-detail-skills {
  margin-top: 8px;
}

.tree-detail-skills h4 {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.tree-detail-equip {
  margin-top: 8px;
}

.tree-detail-equip h4 {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
  padding-bottom: 3px;
}

.tree-detail-promo {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tree-node-weapon {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(139, 26, 26, 0.2);
  color: #ff8888;
  border-radius: 2px;
}

.sol-skill-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sol-skill-link:hover {
  background: rgba(120, 60, 180, 0.3);
  color: #e0c0ff;
}

.sol-learnable-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0.5rem 0.8rem;
}

.sol-learnable-item {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  background: rgba(120, 60, 180, 0.1);
  border: 1px solid rgba(120, 60, 180, 0.2);
  color: #d4a0ff;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.2s;
}

.sol-learnable-item:hover {
  background: rgba(120, 60, 180, 0.25);
  border-color: rgba(120, 60, 180, 0.4);
  color: #e0c0ff;
}

.sol-learnable-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sol-learnable-book {
  font-size: 0.6rem;
  color: #888;
  text-decoration: none;
  white-space: nowrap;
}

.sol-learnable-book:hover {
  color: #c9a44a;
}

.sol-learnable-lv {
  font-size: 0.65rem;
  color: #e8d48b;
  white-space: nowrap;
  font-weight: 600;
}

.sol-learnable-lv-inline {
  font-size: 0.75em;
  color: #e8d48b;
  font-weight: 600;
  margin-left: 3px;
}

/* Promotion chain in detail view */
.sol-promo-chain {
  padding: 0.6rem 0.8rem;
}

.sol-chain-item {
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.sol-chain-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.sol-chain-current {
  color: var(--gold);
  padding: 0.4rem 0.6rem;
  background: rgba(201, 164, 74, 0.05);
  border-left: 3px solid var(--gold);
}

.sol-chain-arrow {
  font-size: 0.6rem;
  margin-right: 4px;
}

.sol-chain-children {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sol-chain-child {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(201, 164, 74, 0.05);
  border: 1px solid rgba(201, 164, 74, 0.15);
  border-radius: 2px;
  font-size: 0.8rem;
}

/* ========== ADMIN PANEL ========== */

.admin-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 60px;
}

.admin-sidebar {
  width: 220px;
  background: #0e0b08;
  border-right: 1px solid rgba(201, 164, 74, 0.2);
  padding: 1.5rem 0;
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.5);
}

.admin-sidebar-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9rem;
  color: var(--gold);
  padding: 0 1.2rem 1rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0;
  flex: 1;
}

.admin-nav-link {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.admin-nav-link:hover {
  color: var(--gold-light);
  background: rgba(201, 164, 74, 0.05);
  border-left-color: rgba(201, 164, 74, 0.3);
}

.admin-sidebar-footer {
  border-top: 1px solid rgba(201, 164, 74, 0.1);
  padding-top: 0.5rem;
}

.admin-back-link {
  font-size: 0.7rem !important;
  color: var(--text-dim) !important;
}

.admin-content {
  flex: 1;
  margin-left: 220px;
  padding: 2rem 2.5rem 3rem;
  width: calc(100vw - 220px);
  max-width: none;
  box-sizing: border-box;
}

.admin-page-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(201, 164, 74, 0.2);
}

/* Stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--bg-panel);
  border: 1px solid rgba(201, 164, 74, 0.12);
  padding: 1.2rem 1rem;
  text-align: center;
}

.admin-stat-card .stat-value {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.admin-stat-card .stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.stat-card-danger .stat-value {
  color: #ff6b6b;
}

/* Sections */
.admin-section {
  margin-bottom: 2rem;
}

.admin-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.15);
}

/* Tables */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table thead tr {
  border-bottom: 2px solid rgba(201, 164, 74, 0.2);
}

.admin-table th {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0.6rem;
  text-align: left;
}

.admin-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(201, 164, 74, 0.03);
}

.admin-table a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

.admin-table a:hover {
  color: var(--gold-light);
}

.td-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.td-details {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.td-ip {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}

.badge-online { background: rgba(40, 167, 69, 0.2); color: #88dd88; }
.badge-offline { background: rgba(100, 100, 100, 0.2); color: #888; }
.badge-banned { background: rgba(220, 53, 69, 0.25); color: #ff6b6b; }
.badge-clean { background: rgba(40, 167, 69, 0.15); color: #88dd88; }
.badge-admin { background: rgba(201, 164, 74, 0.2); color: var(--gold); }
.badge-ban { background: rgba(220, 53, 69, 0.25); color: #ff6b6b; }
.badge-unban { background: rgba(40, 167, 69, 0.2); color: #88dd88; }

/* Search form */
.admin-search-form {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.admin-search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 164, 74, 0.2);
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 164, 74, 0.1);
}

.admin-search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

/* Buttons */
.btn-admin {
  padding: 0.6rem 1.5rem;
  background: rgba(201, 164, 74, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-admin:hover {
  background: rgba(201, 164, 74, 0.25);
  box-shadow: 0 0 15px rgba(201, 164, 74, 0.15);
}

.btn-admin-sm {
  padding: 0.3rem 0.8rem;
  background: rgba(201, 164, 74, 0.1);
  border: 1px solid rgba(201, 164, 74, 0.3);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-admin-sm:hover {
  background: rgba(201, 164, 74, 0.2);
  border-color: var(--gold);
}

.btn-danger {
  background: rgba(220, 53, 69, 0.15);
  border-color: #dc3545;
  color: #ff6b6b;
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.3);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.15);
}

.btn-unban {
  background: rgba(40, 167, 69, 0.15);
  border-color: #28a745;
  color: #88dd88;
}

.btn-unban:hover {
  background: rgba(40, 167, 69, 0.25);
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.15);
}

/* Info grid (player detail) */
.admin-info-grid {
  border: 1px solid rgba(201, 164, 74, 0.1);
}

.admin-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.06);
}

.admin-info-row:last-child { border-bottom: none; }

.admin-info-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.admin-info-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Ban form */
.admin-ban-form {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(201, 164, 74, 0.08);
}

.ban-form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.ban-form-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  width: 80px;
  flex-shrink: 0;
}

.ban-reason-input {
  max-width: 400px;
}

.admin-select {
  padding: 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 164, 74, 0.2);
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  outline: none;
}

.admin-select option {
  background: #1a1410;
  color: var(--text-light);
}

.ban-status-text {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.8rem;
}

/* Alerts */
.admin-alert {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  border-left: 3px solid;
}

.admin-alert-success {
  background: rgba(40, 167, 69, 0.1);
  border-color: #28a745;
  color: #88dd88;
}

.admin-alert-error {
  background: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  color: #ff6b6b;
}

.admin-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.5rem 0;
}

/* Admin nav highlight */
.nav-admin {
  color: var(--gold) !important;
}

/* Admin nav active state */
.admin-nav-link.active {
  color: var(--gold-light);
  background: rgba(201, 164, 74, 0.08);
  border-left-color: var(--gold);
}

/* 5-column stat grid (auto-fit for when fewer cards are shown) */
.admin-stats-5 {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Stat card color variants */
.admin-stat-card.stat-green .stat-value { color: #88dd88; }
.admin-stat-card.stat-amber .stat-value { color: #ffd54f; }
.admin-stat-card.stat-red .stat-value { color: #ff6b6b; }

/* Machine info bar */
.machine-info {
  display: flex;
  gap: 2rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: #888;
  flex-wrap: wrap;
}
.machine-info span { color: #ccc; }

/* Server controls */
.server-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-restart {
  background: rgba(255, 193, 7, 0.15) !important;
  border: 1px solid #ffc107 !important;
  color: #ffd54f !important;
}
.btn-start {
  background: rgba(40, 167, 69, 0.15) !important;
  border: 1px solid #28a745 !important;
  color: #88dd88 !important;
}
.btn-stop {
  background: rgba(220, 53, 69, 0.15) !important;
  border: 1px solid #dc3545 !important;
  color: #ff6b6b !important;
}
.btn-restart:hover { background: rgba(255, 193, 7, 0.3) !important; }
.btn-start:hover { background: rgba(40, 167, 69, 0.3) !important; }
.btn-stop:hover { background: rgba(220, 53, 69, 0.3) !important; }

/* Process status dot */
.process-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-running {
  background: #88dd88;
  box-shadow: 0 0 4px #88dd88;
}
.dot-stopped {
  background: #ff6b6b;
  box-shadow: 0 0 4px #ff6b6b;
}

/* Mono-spaced table cells */
.td-mono {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Mini CPU/Mem bars in process table */
.cpu-bar-mini, .mem-bar-mini {
  position: relative;
  width: 80px;
  height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.cpu-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(40, 167, 69, 0.35);
  border-radius: 2px;
  transition: width 0.3s;
}
.mem-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(100, 149, 237, 0.35);
  border-radius: 2px;
  transition: width 0.3s;
}
.cpu-bar-text, .mem-bar-text {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  color: #ccc;
  line-height: 18px;
  padding-left: 4px;
}

/* Log viewer */
.log-viewer {
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: #aaa;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 4px;
  line-height: 1.5;
}
.log-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.log-controls select {
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #333;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
}
.log-controls select option {
  background: #1a1a1a;
  color: #ccc;
}

/* Admin button on dashboard */
.admin-btn {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

/* Game Logs — grouped tabs */
.log-tab-groups {
  margin-bottom: 1.5rem;
}
.log-tab-group {
  margin-bottom: 0.5rem;
}
.log-tab-group-label {
  font-size: 0.6rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  padding-left: 2px;
}
.log-tab-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.log-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.65rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid rgba(201, 164, 74, 0.1);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}
.log-tab:hover {
  border-color: rgba(201, 164, 74, 0.3);
  color: var(--gold-light);
  background: rgba(201, 164, 74, 0.05);
}
.log-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 164, 74, 0.1);
}
.log-tab.has-data {
  color: var(--gold-light);
  border-color: rgba(201, 164, 74, 0.2);
}
.log-tab.alert {
  border-color: rgba(220, 60, 60, 0.4);
  color: #e55;
}
.log-tab.alert .log-tab-count {
  background: rgba(220, 60, 60, 0.2);
  color: #f66;
}
.log-tab-count {
  font-size: 0.55rem;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #888;
  font-family: 'Courier New', monospace;
}
.log-tab.active .log-tab-count {
  background: rgba(201, 164, 74, 0.15);
  color: var(--gold);
}
.log-info {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.log-pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 164, 74, 0.1);
}
.log-page-info {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  nav { padding: 0.6rem 1rem; flex-wrap: wrap; }
  .nav-links { gap: 0.8rem; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-links a { font-size: 0.65rem; letter-spacing: 2px; }

  .page-container { padding: 100px 12px 40px; }
  .panel { padding: 1.5rem; }

  .character-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
  .char-build-btn {
    align-self: flex-start;
  }

  .wiki-container { padding: 100px 8px 40px; }
  .wiki-tab { padding: 0.5rem 1.2rem; font-size: 0.65rem; letter-spacing: 2px; }
  .wiki-search-row { flex-direction: column; }
  .wiki-location { font-size: 0.4rem; padding: 1px 5px; }
  .wiki-table { font-size: 0.7rem; }
  .wiki-table th { font-size: 0.55rem; padding: 0.4rem 0.5rem; }
  .wiki-table td { padding: 0.35rem 0.5rem; }

  .item-info-grid { grid-template-columns: 1fr; }
  .item-info-row:nth-child(odd) { border-right: none; }
  .item-stat-grid { grid-template-columns: 1fr; }
  .item-stat-row:nth-child(odd) { border-right: none; }
  .item-detail-header { flex-direction: column; align-items: flex-start; }
  .item-detail-header h1 { font-size: 1.1rem; }
  .nav-dropdown-menu { left: 0; transform: none; }
  .item-nav-bar { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .item-nav-arrows { width: 100%; justify-content: space-between; }
  .item-nav-prev, .item-nav-next { max-width: 120px; }
  .item-card-name { font-size: 0.8rem; }
  .spirit-grid { grid-template-columns: 1fr; }
  .tree-node { margin-left: calc(var(--depth, 0) * 12px); }
  .tree-detail-grid { grid-template-columns: 1fr 1fr; }
  .tree-node-header { gap: 5px; padding: 0.35rem 0.4rem; }
  .tree-node-name { font-size: 0.78rem; }

  /* Admin responsive */
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; width: 100%; padding: 1.5rem 1rem; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-stats-5 { grid-template-columns: repeat(2, 1fr); }
  .admin-search-form { flex-direction: column; }
  .ban-form-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .machine-info { flex-direction: column; gap: 0.3rem; }
  .server-controls { flex-direction: column; }
  .cpu-bar-mini, .mem-bar-mini { width: 60px; }
  .log-controls { flex-wrap: wrap; }
  .tael-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tael-form-grid { grid-template-columns: 1fr; }
  .tael-inline-form { flex-wrap: wrap; }
}

/* ─── Tael Management ──────────────────────────────────── */

.tael-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.tael-stat-card {
  background: rgba(139, 0, 0, 0.15);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
}

.tael-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffd700;
  font-family: 'Cinzel', serif;
}

.tael-stat-label {
  font-size: 0.78rem;
  color: #999;
  margin-top: 0.3rem;
}

.tael-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.tael-form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.tael-form-group-wide { grid-column: span 4; }
.tael-form-label { font-size: 0.82rem; color: #ccc; font-weight: 600; }

.btn-tael-bulk {
  background: linear-gradient(135deg, #8b6914, #daa520);
  color: #1a1a1a;
  font-weight: 700;
  padding: 0.6rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-tael-bulk:hover { background: linear-gradient(135deg, #daa520, #ffd700); }

.tael-amount-cell { text-align: right; font-family: monospace; font-weight: 600; }
.tael-positive { color: #4caf50; }
.tael-negative { color: #f44336; }

/* Tael on player character cards */
.char-tael-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.tael-badge {
  background: rgba(218, 165, 32, 0.2);
  color: #ffd700;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(218, 165, 32, 0.3);
}

.bonus-badge {
  background: rgba(100, 149, 237, 0.2);
  color: #6495ed;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(100, 149, 237, 0.3);
}

.char-tael-actions { margin-top: 0.5rem; }

.tael-inline-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: nowrap;
}

.tael-select {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #444;
  padding: 0.3rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.tael-amount-input {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #444;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  width: 100px;
  font-size: 0.8rem;
}

.tael-reason-input {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #444;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  width: 140px;
  font-size: 0.8rem;
}

.btn-tael-grant {
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  color: #fff;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-tael-grant:hover { background: linear-gradient(135deg, #4caf50, #66bb6a); }

.tael-bulk-form { margin-top: 0.5rem; }

/* ========== REFERRAL SYSTEM ========== */

.referral-invite-banner {
  padding: 12px 18px;
  margin-bottom: 1.2rem;
  background: rgba(40, 167, 69, 0.12);
  border-left: 3px solid #88dd88;
  color: #a8e8a8;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}

.referral-link-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.referral-link-input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 164, 74, 0.3);
  color: var(--gold-light);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  outline: none;
  cursor: text;
}

.referral-link-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 164, 74, 0.15);
}

.referral-copy-btn {
  white-space: nowrap;
  transition: all 0.2s;
}

.recruit-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(201, 164, 74, 0.03);
  border: 1px solid rgba(201, 164, 74, 0.08);
  border-left: 3px solid rgba(201, 164, 74, 0.15);
  transition: all 0.2s;
}

.recruit-card:hover {
  border-color: rgba(201, 164, 74, 0.2);
  background: rgba(201, 164, 74, 0.06);
}

.recruit-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recruit-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.3px;
}

.recruit-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}

.recruit-status-created,
.recruit-status-pending {
  background: rgba(100, 100, 100, 0.2);
  color: var(--text-dim);
}

.recruit-status-qualified {
  background: rgba(201, 164, 74, 0.14);
  color: var(--gold-light);
}

.recruit-status-approved,
.recruit-status-paid,
.recruit-status-verified,
.recruit-status-queued {
  background: rgba(201, 164, 74, 0.2);
  color: var(--gold);
}

.recruit-status-review {
  background: rgba(240, 176, 64, 0.18);
  color: #f0b040;
}

.recruit-status-rejected {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
}

.recruit-status-revoked,
.recruit-status-clawed_back {
  background: rgba(220, 53, 69, 0.15);
  color: #cc5555;
}

@media (max-width: 640px) {
  .referral-link-box {
    flex-direction: column;
  }
  .referral-link-input {
    font-size: 0.75rem;
  }
}

/* Admin inventory viewer */
.inventory-admin-page {
  --kh2-slot-size: 38px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inventory-admin-header,
.inventory-admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-admin-meta,
.inventory-source {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.inventory-admin-meta span,
.inventory-source span {
  border: 1px solid rgba(201, 164, 74, 0.16);
  background: rgba(18, 18, 16, 0.55);
  padding: 0.25rem 0.45rem;
  border-radius: 3px;
}

.inventory-admin-actions,
.inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.inventory-tab {
  min-height: 32px;
  padding: 0 0.8rem;
  border: 1px solid rgba(201, 164, 74, 0.22);
  background: rgba(20, 20, 18, 0.72);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.inventory-tab.active,
.inventory-tab:hover {
  color: var(--gold-light);
  border-color: rgba(201, 164, 74, 0.48);
  background: rgba(201, 164, 74, 0.1);
}

.inventory-pane {
  display: none;
}

.inventory-pane.active {
  display: block;
}

.kh2-inventory-window {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(201, 164, 74, 0.72);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(42, 37, 27, 0.98), rgba(22, 20, 18, 0.98)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.kh2-window-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 0.65rem;
  border-bottom: 1px solid rgba(201, 164, 74, 0.28);
  background: linear-gradient(180deg, rgba(13, 13, 12, 0.95), rgba(37, 33, 27, 0.95));
  color: #f3d27a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  text-shadow: 1px 1px 0 #000;
}

.kh2-window-body {
  padding: 0.65rem;
}

.kh2-bag-line,
.kh2-bank-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.kh2-bag-line {
  margin-bottom: 0.55rem;
}

.kh2-bag-row {
  display: flex;
  gap: 0.35rem;
}

.kh2-bag-socket {
  width: var(--kh2-slot-size);
  height: var(--kh2-slot-size);
}

.kh2-expiry,
.kh2-bank-meta span {
  color: #f1dfb0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  text-shadow: 1px 1px 0 #000;
}

.kh2-slot-grid {
  display: grid;
  grid-template-columns: repeat(10, var(--kh2-slot-size));
  grid-auto-rows: var(--kh2-slot-size);
  gap: 3px;
  max-height: calc((var(--kh2-slot-size) + 3px) * 5);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.kh2-inv-slot {
  position: relative;
  width: var(--kh2-slot-size);
  height: var(--kh2-slot-size);
  border: 1px solid rgba(172, 149, 104, 0.42);
  background:
    linear-gradient(145deg, rgba(58, 62, 64, 0.92), rgba(30, 31, 30, 0.95)),
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), transparent 42%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.1),
    inset -1px -1px 0 rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.kh2-inv-slot.empty {
  background:
    linear-gradient(145deg, rgba(40, 42, 42, 0.62), rgba(18, 18, 17, 0.86)),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 55%);
}

.kh2-inv-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.kh2-slot-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-content: center;
  padding: 0.15rem;
  color: #d6e6f7;
  font-size: 0.55rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.kh2-slot-stack,
.kh2-slot-enhance,
.kh2-slot-flag {
  position: absolute;
  z-index: 1;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  border-radius: 2px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

.kh2-slot-stack {
  right: 1px;
  bottom: 1px;
  color: #fff;
}

.kh2-slot-enhance {
  left: 1px;
  top: 1px;
  color: #ffd15c;
}

.kh2-slot-flag {
  right: 1px;
  top: 1px;
  color: #ff7070;
}

.inventory-items-section {
  margin-top: 0.25rem;
}

.inventory-table-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.inventory-table-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (max-width: 720px) {
  .inventory-admin-page {
    --kh2-slot-size: 32px;
  }

  .inventory-admin-header,
  .inventory-admin-toolbar {
    flex-direction: column;
  }

  .kh2-inventory-window {
    width: 100%;
  }

  .kh2-slot-grid {
    grid-template-columns: repeat(5, var(--kh2-slot-size));
    max-height: none;
  }
}
