:root {
  --bg: #090611;
  --surface: #130c22;
  --surface-2: #1b1230;
  --text: #f4f1ff;
  --muted: #b8abdc;
  --primary: #a855f7;
  --primary-strong: #c084fc;
  --border: #31224f;
  --ok-bg: #153726;
  --ok-text: #8af7bb;
  --warn-bg: #3a1b2a;
  --warn-text: #ff95c0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1d0f35 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.hero {
  min-height: 78vh;
  border-bottom: 1px solid var(--border);
}

.hero:not(.hero-page) {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
}

.hero-page {
  min-height: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.logo span {
  color: var(--primary-strong);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  color: var(--primary-strong);
}

.hero-content {
  padding: 4rem 0 5rem;
}

.hero:not(.hero-page) .hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 0 2rem;
}

.eyebrow {
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h1 span {
  color: var(--primary-strong);
}

.hero-text {
  max-width: 700px;
  color: var(--muted);
  margin-bottom: 1.7rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.tag-pill {
  border: 1px solid var(--border);
  background: rgba(19, 12, 34, 0.8);
  color: var(--muted);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
}

.section {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.section-separator {
  height: 1px;
  margin: 1rem 0 1.2rem;
  background: linear-gradient(90deg, transparent 0%, var(--border) 14%, var(--primary) 50%, var(--border) 86%, transparent 100%);
  opacity: 0.7;
}

.reglement-wiki {
  padding-top: 2.5rem;
}

.reglement-wiki.container {
  width: min(1520px, 98%);
}

.wiki-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.wiki-sidebar {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.9rem;
  margin-left: -1.6rem;
}

.wiki-sidebar-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

.wiki-sidebar-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
}

.wiki-nav {
  display: grid;
  gap: 0.35rem;
}

.wiki-nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.92rem;
}

.wiki-nav a:hover,
.wiki-nav a:focus-visible {
  color: var(--text);
  border-color: var(--border);
  background: rgba(168, 85, 247, 0.08);
}

.wiki-nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.16);
}

.wiki-actions {
  display: grid;
  gap: 0.5rem;
}

.wiki-actions .btn {
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.wiki-edit-note {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.7rem;
}

.wiki-content {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  background: rgba(19, 12, 34, 0.85);
}

.wiki-content[data-editing="true"] {
  outline: 2px dashed rgba(168, 85, 247, 0.55);
  outline-offset: 4px;
}

.wiki-section {
  scroll-margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
}

.wiki-section + .wiki-section {
  margin-top: 0.8rem;
}

.wiki-section h3 {
  margin-bottom: 0.55rem;
  color: var(--primary-strong);
}

.wiki-section p,
.wiki-section li {
  color: var(--muted);
}

.wiki-section ul {
  padding-left: 1.15rem;
}

.wiki-section li + li {
  margin-top: 0.35rem;
}

@keyframes wikiContentFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wiki-content-switch-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.wiki-content-switch-in {
  animation: wikiContentFadeIn 0.22s ease both;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
}

.info-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 1rem;
}

.info-card p {
  color: var(--muted);
}

.bullet-list {
  padding-left: 1.1rem;
  color: var(--muted);
}

.bullet-list li + li {
  margin-top: 0.45rem;
}

.stats-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.9rem;
}

.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.55rem;
  background: rgba(168, 85, 247, 0.12);
}

.stat-item strong {
  display: block;
  font-size: 1.3rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.stat-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.media-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}

.media-placeholder {
  height: 170px;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(12, 8, 22, 0.6)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 8px, transparent 8px, transparent 16px);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--primary-strong);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-card-content {
  padding: 0.9rem;
}

.media-card-content p {
  color: var(--muted);
  font-size: 0.94rem;
}

.notice {
  border: 1px dashed var(--border);
  background: rgba(19, 12, 34, 0.55);
  border-radius: 12px;
  padding: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: 14px;
  padding: 1rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.quick-card {
  display: block;
  text-decoration: none;
}

.card-head {
  margin-bottom: 0.55rem;
}

.icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(168, 85, 247, 0.12);
  font-size: 0.95rem;
  color: var(--text);
}

.quick-card h3 {
  color: var(--text);
  margin-bottom: 0.4rem;
}

.quick-card p {
  color: var(--muted);
}

.quick-card:hover {
  border-color: var(--primary);
}

.card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.card ul {
  padding-left: 1.1rem;
  color: var(--muted);
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.4rem;
  row-gap: 1rem;
}

.business-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(27, 18, 48, 0.68) 100%);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.business-card:hover {
  border-color: var(--primary);
}

.business-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.business-logo {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 0;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-strong);
  flex-shrink: 0;
  overflow: hidden;
}

.business-logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  z-index: 1;
}

.business-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

.business-card h3 {
  margin-bottom: 0.18rem;
  font-size: 1.02rem;
  color: var(--primary-strong);
  line-height: 1.2;
}

.business-type {
  color: var(--muted);
  font-size: 0.94rem;
}

.business-status-label {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.24rem 0.62rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.business-status-label-free {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.business-status-label-taken {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.business-side {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.business-discord-link {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(19, 12, 34, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--primary-strong);
  line-height: 1;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.discord-icon {
  width: 16px;
  height: 16px;
  display: block;
  background: currentColor;
  -webkit-mask-image: url("https://cdn.simpleicons.org/discord");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("https://cdn.simpleicons.org/discord");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.business-discord-link:hover {
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
}

.badge {
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.badge-free {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-taken {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.vip-table-wrap {
  border-color: #4f2a7a;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(19, 12, 34, 0.75));
  box-shadow: 0 16px 30px rgba(6, 2, 14, 0.45);
}

.vip-wide.container {
  width: min(1500px, 98%);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: var(--surface);
}

.vip-table {
  min-width: 100%;
  table-layout: auto;
}

.vip-table th,
.vip-table td {
  padding: 1rem 1.35rem;
  line-height: 1.45;
  white-space: normal;
  word-break: normal;
  border-right: 1px solid rgba(168, 85, 247, 0.32);
}

.vip-table th:last-child,
.vip-table td:last-child {
  border-right: none;
}

.vip-table th:first-child,
.vip-table td:first-child {
  width: 25%;
  padding-right: 0.95rem;
}

.vip-table th:nth-child(2),
.vip-table td:nth-child(2) {
  padding-left: 0.95rem;
}

.vip-table th:not(:first-child),
.vip-table td:not(:first-child) {
  white-space: nowrap;
}

thead {
  background: var(--surface-2);
}

.vip-table thead th {
  color: #ffffff;
  font-weight: 700;
}

.vip-table .tier-name {
  display: block;
  line-height: 1.1;
}

.vip-table .tier-bronze {
  color: #e89a4e;
  border: 1.5px solid #cd7f32;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  display: inline-block;
  background: rgba(205, 127, 50, 0.08);
}

.vip-table .tier-gold {
  color: #ffd700;
  border: 1.5px solid #daa520;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  display: inline-block;
  background: rgba(255, 215, 0, 0.08);
}

.vip-table .tier-diamond {
  color: #00d4ff;
  border: 1.5px solid #0099cc;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  display: inline-block;
  background: rgba(0, 212, 255, 0.08);
}

.vip-table .tier-price {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

th,
td {
  padding: 0.85rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

th:first-child,
td:first-child {
  text-align: left;
}

.vip-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.status-check {
  color: #72f5a5;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.status-cross {
  color: #ff5f92;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

tbody tr:last-child td {
  border-bottom: none;
}

.vip-purchase-row {
  background: transparent !important;
}

.vip-purchase-row td {
  padding: 1.8rem 1.35rem !important;
  border-bottom: none !important;
}

.vip-buy-btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid;
  background: transparent;
}

.bronze-btn {
  border-color: #cd7f32;
  color: #e89a4e;
}

.bronze-btn:hover {
  background: rgba(205, 127, 50, 0.1);
  border-color: #e89a4e;
  color: #f5a860;
}

.gold-btn {
  border-color: #daa520;
  color: #ffd700;
}

.gold-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: #ffd700;
  color: #ffe55c;
}

.diamond-btn {
  border-color: #0099cc;
  color: #00d4ff;
}

.diamond-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #00d4ff;
  color: #4dd4ff;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  background: rgba(10, 8, 18, 0.85);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.footer a {
  color: var(--primary-strong);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: static;
    margin-left: 0;
  }

  .rules-grid,
  .business-grid,
  .quick-grid,
  .media-grid,
  .stats-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .business-discord-link {
    margin-left: auto;
  }
}

@media (max-width: 700px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero {
    min-height: auto;
  }
}

/* Page Loader */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.loader-text::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}
