@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  --bg-purple: #0a0a0a;
  --bg-purple-light: #111111;
  --bg-gradient-2: #141414;
  --bg-gradient-3: #1a1a1a;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(255, 255, 255, 0.02);
  --text-main: #f8f8f2;
  --text-muted: #9d7ee0;
  --text-muted-bright: #b49cec;
  --grad-text-start: #7c58cc;
  --grad-text-end: #9d7ee0;
  --grad-title-start: #7c58cc;
  --accent-purple: #7c58cc;
  --accent-purple-dark: #6a47b8;
  --accent-focus-ring: rgba(124, 88, 204, 0.18);
  --heart: #ff4d4d;
  --btn-text: #ffffff;
  --shadow-md: rgba(0, 0, 0, 0.5);
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --shadow-xl: rgba(0, 0, 0, 0.7);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.15);
  --input-bg: rgba(255, 255, 255, 0.04);
  --online-green: #50fa7b;
  --warn-yellow: #f1fa8c;
  --offline-red: #ff5555;
  --mana-blue: #4fc3f7;
  --xp-gold: #ffd54f;
}

.theme-green {
  --text-muted: #1ad76f;
  --text-muted-bright: #34d399;
  --grad-text-start: #1ad76f;
  --grad-text-end: #34d399;
  --grad-title-start: #1ad76f;
  --accent-purple: #1ad76f;
  --accent-purple-dark: #16b85e;
  --accent-focus-ring: rgba(26, 215, 111, 0.18);
}

.theme-red {
  --text-muted: #f99393;
  --text-muted-bright: #fbaaaa;
  --grad-text-start: #9c0c0c;
  --grad-text-end: #d94e4e;
  --grad-title-start: #a51111;
  --accent-purple: #c74343;
  --accent-purple-dark: #af3636;
  --accent-focus-ring: rgba(199, 67, 67, 0.2);
}

.theme-yellow {
  --text-muted: #f9d993;
  --text-muted-bright: #fbe8aa;
  --grad-text-start: #9c7a0c;
  --grad-text-end: #d9a84e;
  --grad-title-start: #a59011;
  --accent-purple: #c7a043;
  --accent-purple-dark: #af8836;
  --accent-focus-ring: rgba(199, 160, 67, 0.2);
}

.theme-blue {
  --text-muted: #93b8f9;
  --text-muted-bright: #aacafb;
  --grad-text-start: #0c4a9c;
  --grad-text-end: #4e84d9;
  --grad-title-start: #1155a5;
  --accent-purple: #4372c7;
  --accent-purple-dark: #3660af;
  --accent-focus-ring: rgba(67, 114, 199, 0.2);
}

.theme-pink {
  --text-muted: #ff7eb3;
  --text-muted-bright: #ff9ec8;
  --grad-text-start: #ff4080;
  --grad-text-end: #ff7eb3;
  --grad-title-start: #ff4080;
  --accent-purple: #ff7eb3;
  --accent-purple-dark: #e85a9a;
  --accent-focus-ring: rgba(255, 126, 179, 0.2);
}

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

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: linear-gradient(125deg, #0a0a0a 0%, #141414 35%, #1a1a1a 100%);
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 180ms ease;
}

a:hover {
  color: var(--text-muted-bright);
}

code {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted-bright);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  border: 1px solid var(--panel-border);
  white-space: nowrap;
}

pre code {
  white-space: pre;
  display: block;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  line-height: 1.7;
}

.lucide {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.navbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px clamp(14px, 3vw, 36px);
  border-bottom: 1px solid var(--panel-border);
  background: rgba(17, 17, 17, 0.88);
  backdrop-filter: blur(18px);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main) !important;
}

.navbar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.navbar-brand span {
  background: linear-gradient(147deg, var(--grad-text-start), var(--grad-text-end));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-weight: 800;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: border-color 180ms ease;
  min-width: 180px;
}

.navbar-search:focus-within {
  border-color: var(--accent-purple);
}

.navbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  width: 100%;
}

.navbar-search input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.navbar-search .lucide {
  width: 15px;
  height: 15px;
  opacity: 0.5;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.icon-btn:hover {
  background: var(--hover-bg);
  color: var(--text-muted-bright);
}

.icon-btn .lucide {
  width: 18px;
  height: 18px;
}

.page-wrapper {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(10px, 2vw, 24px);
  gap: 18px;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 10px 6px;
  opacity: 0.5;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}

.sidebar-item:hover {
  background: var(--hover-bg);
  color: var(--text-muted-bright);
}

.sidebar-item.active {
  background: var(--accent-focus-ring);
  color: var(--accent-purple);
  font-weight: 600;
}

.sidebar-item .lucide {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.sidebar-item.active .lucide {
  opacity: 1;
}

.sidebar-item.hidden-tab {
  display: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--panel-border);
  margin: 6px 10px;
}

.sidebar-spacer {
  flex: 1;
}

.content {
  flex: 1;
  min-width: 0;
}

.tab-panel {
  display: none;
  animation: tabFadeIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  padding: clamp(20px, 3vw, 34px);
  margin-bottom: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-header .lucide {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  color: var(--accent-purple);
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(147deg, var(--grad-title-start), var(--grad-text-end));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.panel-header .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.panel p {
  color: var(--text-main);
  margin-bottom: 12px;
  opacity: 0.88;
}

.panel p:last-child {
  margin-bottom: 0;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.command-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 180ms ease, border-color 180ms ease;
}

.command-row:hover {
  background: var(--hover-bg);
  border-color: var(--panel-border);
}

.command-row code {
  flex-shrink: 0;
}

.command-row span {
  color: var(--text-main);
  opacity: 0.7;
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.info-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  transition: transform 180ms ease, border-color 180ms ease;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-purple);
}

.info-card .card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-purple);
  margin-bottom: 12px;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.info-card p {
  font-size: 0.88rem;
  color: var(--text-main);
  opacity: 0.7;
  margin-bottom: 0;
}

.info-card ul {
  list-style: none;
  margin-top: 8px;
}

.info-card ul li {
  font-size: 0.84rem;
  padding: 3px 0;
  color: var(--text-main);
  opacity: 0.7;
}

.info-card ul li code {
  font-size: 0.82em;
  padding: 1px 6px;
}

.progress-bar {
  margin-top: 8px;
}

.progress-bar .bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.progress-bar .bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar .bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--grad-text-start), var(--grad-text-end));
  transition: width 300ms ease;
}

.wiki-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  margin-bottom: 12px;
}

.wiki-table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted-bright);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.wiki-table tbody td {
  padding: 9px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.wiki-table tbody tr:last-child td {
  border-bottom: none;
}

.wiki-table tbody tr:hover {
  background: var(--hover-bg);
}

.feature-list {
  display: grid;
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.feature-item .lucide {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent-purple);
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.feature-item span {
  font-size: 0.88rem;
  color: var(--text-main);
  opacity: 0.7;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-green {
  background: rgba(80, 250, 123, 0.15);
  color: var(--online-green);
}

.tag-gold {
  background: rgba(255, 213, 79, 0.15);
  color: var(--xp-gold);
}

.tag-blue {
  background: rgba(79, 195, 247, 0.15);
  color: var(--mana-blue);
}

.tag-red {
  background: rgba(255, 85, 85, 0.15);
  color: var(--offline-red);
}

.tag-purple {
  background: var(--accent-focus-ring);
  color: var(--accent-purple);
}

.section-divider {
  height: 1px;
  background: var(--panel-border);
  margin: 24px 0;
}

.rules-list {
  counter-reset: rule;
  display: grid;
  gap: 8px;
}

.rules-list li {
  counter-increment: rule;
  position: relative;
  padding: 12px 14px 12px 44px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  list-style: none;
  color: var(--text-main);
  opacity: 0.88;
}

.rules-list li::before {
  content: counter(rule);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 190px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .page-wrapper {
    flex-direction: column;
    padding-top: 8px;
  }

  .sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
    max-height: none;
    overflow: visible;
    padding: 0 0 4px;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-item {
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 8px;
    width: auto;
  }

  .sidebar-divider {
    display: none;
  }

  .navbar-search {
    min-width: 120px;
  }

  .command-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .navbar-search {
    display: none;
  }

  .navbar {
    padding: 8px 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
  }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Settings Modal */
.settings-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 200;
}

.settings-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-purple-light);
  border: 2px solid var(--panel-border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px var(--shadow-xl);
  max-height: 80dvh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(147deg, var(--grad-text-start) 0%, var(--grad-text-end) 82%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
  color: var(--text-main);
  background: var(--hover-bg);
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--panel-bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-btn:hover {
  border-color: var(--accent-purple);
  background: var(--accent-focus-ring);
  color: var(--accent-purple);
}

.theme-btn.active {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: var(--accent-focus-ring);
}

.settings-section label:not(.custom-checkbox) {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 180ms ease;
}

.settings-section label:not(.custom-checkbox):hover {
  background: var(--hover-bg);
}

.settings-section input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-purple);
  cursor: pointer;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  user-select: none;
  color: var(--text-main);
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 20px;
  width: 20px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--accent-purple);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--text-muted);
  border-color: var(--text-muted-bright);
}

.custom-checkbox input:checked ~ .checkmark::after {
  display: block;
}

.custom-checkbox .checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2.5px;
  width: 5px;
  height: 9px;
  border: solid var(--text-main);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state .lucide {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}