/* ==========================================================================
   OrchidSMP — Refined Minimalist Design (Willow Studio Style)
   Font: Unbounded | Primary Accent: #e77d7d | Full Dark & Light Mode
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@300;400;500;600;700;800;900&display=swap');
@import url("https://cdn.jsdelivr.net/npm/@south-paw/typeface-minecraft@1.0.0/index.css");

/* --- Root & Themes --- */
:root, [data-theme="dark"] {
  --font-main: 'Unbounded', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-neutral: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Primary Brand Accent: #e77d7d */
  --accent: #e77d7d;
  --accent-hover: #ef9393;
  --accent-active: #d66868;
  --accent-soft: rgba(231, 125, 125, 0.12);
  --accent-glow: rgba(231, 125, 125, 0.22);
  --accent-border: rgba(231, 125, 125, 0.45);

  /* Dark Theme Palette */
  --bg: #0b0d11;
  --bg-subtle: #10141a;
  --panel: rgba(18, 22, 30, 0.85);
  --panel-card: rgba(22, 27, 36, 0.75);
  --panel-hover: rgba(28, 35, 48, 0.95);
  --border: rgba(255, 255, 255, 0.11);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --text: #f5f6f8;
  --text-muted: #8d98a6;
  --text-dim: #545e6d;

  --header-bg: rgba(14, 18, 25, 0.84);
  --header-border: rgba(255, 255, 255, 0.13);
  --footer-bg: rgba(18, 22, 30, 0.90);
  --footer-border: rgba(255, 255, 255, 0.12);

  /* CTA Button Colors */
  --cta-bg: #e77d7d;
  --cta-text: #ffffff;
  --cta-hover-bg: #f09191;

  --card-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  --noise-opacity: 0.065;
}

[data-theme="light"] {
  --font-main: 'Unbounded', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-neutral: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Primary Brand Accent: #e77d7d */
  --accent: #e77d7d;
  --accent-hover: #dd6e6e;
  --accent-active: #cf5e5e;
  --accent-soft: rgba(231, 125, 125, 0.12);
  --accent-glow: rgba(231, 125, 125, 0.18);
  --accent-border: rgba(231, 125, 125, 0.40);

  /* Light Theme Palette (Willow style #f0f4f9) */
  --bg: #f0f4f9;
  --bg-subtle: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-card: rgba(255, 255, 255, 0.94);
  --panel-hover: #ffffff;
  --border: rgba(0, 0, 0, 0.09);
  --border-subtle: rgba(0, 0, 0, 0.04);

  --text: #0e1218;
  --text-muted: #596474;
  --text-dim: #8e99a8;

  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: rgba(0, 0, 0, 0.10);
  --footer-bg: rgba(255, 255, 255, 0.92);
  --footer-border: rgba(0, 0, 0, 0.09);

  /* CTA Button Colors - Dark contrast text in light mode */
  --cta-bg: #e77d7d;
  --cta-text: #1a0808;
  --cta-hover-bg: #df6f6f;

  --card-shadow: 0 20px 45px rgba(0, 0, 0, 0.06);
  --noise-opacity: 0.038;
}

/* --- Base Reset & Typography --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark light;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.28s ease, color 0.28s ease;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.shell {
  width: min(1380px, calc(100% - 48px));
  margin-inline: auto;
}

/* --- Gritty / Dirty Noise Texture Overlay --- */
.site-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.site-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 85% 10%, rgba(231, 125, 125, 0.08), transparent 34%),
              radial-gradient(circle at 15% 50%, rgba(231, 125, 125, 0.04), transparent 30%);
}

.site-main {
  flex: 1;
  padding-top: 110px;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Header: Pill Style with Absolute-Centered Navigation
   ========================================================================== */
.site-header-wrapper {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 999;
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.site-header {
  pointer-events: auto;
  position: relative;
  width: min(1380px, 100%);
  height: 64px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 9999px;
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--card-shadow);
  transition: border-color 0.24s ease, background-color 0.24s ease;
}

/* Left: Logo + Name Single Button */
.header-brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 6px;
  border-radius: 9999px;
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-brand-button:hover {
  background: var(--accent-soft);
}

.header-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  padding: 6px;
}

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

.header-brand-text {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: uppercase;
}

/* Absolute Center: Navigation Icons Row */
.header-nav-icons-centered {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.header-nav-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.header-nav-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.nav-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--panel-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1000;
}

.header-nav-btn:hover .nav-tooltip {
  opacity: 1;
}

/* Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-card);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.header-action-btn:hover {
  border-color: var(--accent-border);
}

.header-action-btn.telegram:hover {
  background: #229ed9;
  color: #fff;
  border-color: #229ed9;
}

.header-action-btn.discord:hover {
  background: #5865f2;
  color: #fff;
  border-color: #5865f2;
}

.header-action-btn.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* CTA Button: Adapts text color with theme */
.header-cta-button {
  height: 44px;
  padding: 0 20px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cta-text);
  background: var(--cta-bg);
  border: 1px solid var(--cta-bg);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.header-cta-button:hover {
  background: var(--cta-hover-bg);
  border-color: var(--cta-hover-bg);
}

/* ==========================================================================
   Home Page
   ========================================================================= */

/* Hero Section */
.home-hero-willow {
  min-height: calc(80vh - 110px);
  padding: 40px 0 50px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.home-hero-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-brand-title {
  font-size: clamp(52px, 7.8vw, 104px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.94;
  color: var(--text);
  margin: 0;
}

.hero-punchy-lead {
  font-size: clamp(17px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 25ch;
}

.hero-action-row {
  margin-top: 6px;
}

.primary-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 32px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cta-text);
  background: var(--cta-bg);
  border: 1px solid var(--cta-bg);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.primary-pill-button:hover {
  background: var(--cta-hover-bg);
  border-color: var(--cta-hover-bg);
}

/* 2D Levitating Logo in Hero */
.hero-logo-box {
  position: relative;
  width: 100%;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 72%);
  cursor: pointer;
}

.hero-logo-levitate {
  width: 230px;
  height: 230px;
  object-fit: contain;
  animation: levitateLogo 4s ease-in-out infinite;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
  filter: drop-shadow(0 15px 30px var(--accent-glow));
}

.hero-logo-card:hover .hero-logo-levitate,
.hero-logo-box:hover .hero-logo-levitate {
  animation-play-state: paused;
  transform: translateY(0) scale(1.08);
  filter: drop-shadow(0 25px 45px var(--accent-glow));
}

@keyframes levitateLogo {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

/* Section "О сервере" */
.section-about-server {
  padding: 70px 0;
  border-top: 1px solid var(--border-subtle);
}

.about-server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.section-heading {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 20px;
}

.section-heading.centered {
  text-align: center;
  margin-bottom: 44px;
}

.about-text-neutral {
  font-family: var(--font-neutral);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 48ch;
}

/* Clean Gallery (No Text on Images) */
.about-gallery-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-main-view {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-card);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color 0.22s ease;
}

.gallery-main-view:hover {
  border-color: var(--accent-border);
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-zoom-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.gallery-zoom-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  z-index: 10;
}

.gallery-nav-arrow.left { left: 14px; }
.gallery-nav-arrow.right { right: 14px; }

.gallery-nav-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
}

.gallery-thumb-btn {
  flex: 1;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--panel-card);
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-btn:hover {
  opacity: 0.9;
}

.gallery-thumb-btn.active {
  opacity: 1;
  border-color: var(--accent);
}

/* Lightbox Modal */
.gallery-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.lightbox-full-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease;
}

.lightbox-close-btn:hover {
  background: var(--accent);
}

/* Section "Как попасть на OrchidSMP?" */
.section-how-to-join {
  padding: 70px 0;
  border-top: 1px solid var(--border-subtle);
}

.join-steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.join-step-card {
  padding: 34px 28px;
  border-radius: 28px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s ease, background-color 0.22s ease;
  box-shadow: var(--card-shadow);
}

.join-step-card:hover {
  border-color: var(--accent-border);
}

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

.step-num-pill {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.step-icon-bubble {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.join-step-card h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text);
}

.join-step-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex: 1;
}

.step-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  transition: color 0.2s ease;
}

.step-link-btn:hover {
  color: var(--accent-hover);
}

/* Reviews Section */
.section-reviews {
  padding: 70px 0 110px;
  border-top: 1px solid var(--border-subtle);
}

.reviews-grid-willow {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.review-card-willow {
  padding: 30px;
  border-radius: 28px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  transition: border-color 0.22s ease;
  box-shadow: var(--card-shadow);
}

.review-card-willow:hover {
  border-color: var(--accent-border);
}

.review-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.review-avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.review-user-row strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.review-user-row small {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
}

.review-card-willow p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

.reviews-empty-card {
  text-align: center;
  padding: 56px 24px;
  border-radius: 28px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  max-width: 580px;
  margin: 0 auto;
}

.reviews-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

.reviews-empty-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
}

.reviews-empty-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Footer: Centered Navigation Columns (Requirement 14)
   ========================================================================== */
.site-footer-wrapper {
  padding: 0 16px 36px;
  position: relative;
  z-index: 10;
}

.site-footer-card {
  border-radius: 40px;
  background: var(--footer-bg);
  border: 1px solid var(--footer-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 48px 56px 34px;
  box-shadow: var(--card-shadow);
}

.footer-top-grid {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand-column {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s ease;
}

.footer-brand-title:hover {
  opacity: 0.85;
}

.footer-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel-card);
  border: 1px solid var(--border);
  padding: 7px;
  display: grid;
  place-items: center;
}

.footer-brand-name {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Online status pill */
.footer-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse-indicator.is-live {
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.pulse-indicator.is-offline {
  background: var(--accent);
}

.footer-socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.footer-social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-social-btn.tg:hover {
  background: #229ed9;
  border-color: #229ed9;
  color: #fff;
}

.footer-social-btn.ds:hover {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}

/* Centered navigation columns */
.footer-links-grid-centered {
  display: flex;
  gap: 60px;
  margin-left: 40px;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-col-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.footer-col-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-list button {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  transition: color 0.2s ease;
  padding: 0;
}

.footer-col-list button:hover {
  color: var(--accent);
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 11px;
  color: var(--text-dim);
}

.footer-disclaimer {
  opacity: 0.75;
}

/* ==========================================================================
   Willow-Style Unavailable / Empty State Hero Card
   ========================================================================== */
.willow-hero-card {
  position: relative;
  width: 100%;
  min-height: 460px;
  border-radius: 36px;
  overflow: hidden;
  background: var(--panel-card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 40px;
}

.willow-card-ambient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.willow-card-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.willow-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

.willow-card-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0;
}

.willow-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.willow-ping-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.willow-ping-chip strong {
  color: var(--accent);
}

.willow-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.secondary-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.secondary-pill-button:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ==========================================================================
   Wiki Page
   ========================================================================== */
.wiki-page-new {
  padding-bottom: 80px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.breadcrumbs button {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumbs button:hover {
  color: var(--accent);
}

.wiki-header-new {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.wiki-header-new h1 {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
}

.wiki-header-new p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 60ch;
}

.wiki-rules-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-radius: 18px;
  background: var(--panel-card);
  border: 1px solid var(--accent-border);
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wiki-rules-cta:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}

.wiki-rules-cta svg {
  color: var(--accent);
}

.wiki-rules-cta small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.wiki-rules-cta strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.wiki-layout-new {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 200px;
  gap: 24px;
  align-items: start;
}

.wiki-sidebar-new {
  position: sticky;
  top: 96px;
  padding: 16px;
  border-radius: 24px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.wiki-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.wiki-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12px;
}

.wiki-category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.wiki-category-tabs button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.wiki-category-tabs button:hover {
  color: var(--text);
  border-color: var(--accent-border);
}

.wiki-category-tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wiki-article-list-new {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 58vh;
  overflow-y: auto;
}

.wiki-article-list-new button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
  border: 1px solid transparent;
}

.wiki-article-list-new button:hover {
  background: var(--panel-hover);
  border-color: var(--border);
}

.wiki-article-list-new button.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

.wiki-list-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.wiki-item-title {
  font-size: 12px;
  font-weight: 700;
  flex: 1;
}

.wiki-item-arrow {
  color: var(--text-dim);
}

/* Wiki Article Content */
.wiki-article-new {
  padding: 38px;
  border-radius: 32px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.wiki-article-icon-new {
  float: right;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.wiki-article-new h2 {
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 6px 0 14px;
}

.wiki-summary-new {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
}

.wiki-callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  margin: 20px 0;
}

.wiki-callout.important {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

.wiki-callout.important svg {
  color: var(--accent);
}

.wiki-callout > svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.wiki-callout > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wiki-callout > div > strong,
.wiki-callout > div > span {
  display: block;
}

.wiki-content-section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--border-subtle);
}

.wiki-content-section h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.wiki-content-section p, .wiki-content-section li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.wiki-content-section ul {
  padding-left: 20px;
  margin: 14px 0;
}

.wiki-content-section li + li {
  margin-top: 6px;
}

.rule-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rule-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.rule-card:hover {
  border-color: var(--accent-border);
}


.rule-number {
  height: 36px;
  border-radius: 10px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--accent);
}

.rule-card h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
}

.rule-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.command-list-new code {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  margin-top: 8px;
}

.wiki-toc {
  position: sticky;
  top: 96px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiki-toc span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
}

.wiki-toc button {
  font-size: 12px;
  text-align: left;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.wiki-toc button:hover {
  color: var(--accent);
}

.wiki-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.wiki-media {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

.wiki-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wiki-media figcaption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Statistics Page
   ========================================================================== */
.stats-page {
  padding-bottom: 80px;
}

.stats-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.stats-header h1 {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
}

.online-counter {
  text-align: right;
  padding: 16px 24px;
  border-radius: 22px;
  background: var(--panel-card);
  border: 1px solid var(--border);
}

.online-counter strong {
  font-size: 44px;
  font-weight: 900;
  color: var(--accent);
}

.online-counter span {
  font-size: 22px;
  color: var(--text-muted);
}

.online-counter small {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

.live-panel {
  padding: 28px;
  border-radius: 32px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  margin-bottom: 34px;
}

.live-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.server-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-glyph {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  padding: 7px;
}

.server-identity h2 {
  font-size: 20px;
  font-weight: 800;
}

.server-identity span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.peak-pill {
  text-align: right;
}

.peak-pill b {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}

.peak-pill span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.top-player-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin: 16px 0 34px;
}

.top-player-row button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: border-color 0.2s ease;
}

.top-player-row button:hover {
  border-color: var(--accent-border);
}

.players-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.players-tools input {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  min-width: 240px;
  font-size: 13px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-card);
  border: 1px solid var(--border);
}

.filter-tabs button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.filter-tabs button.active {
  background: var(--accent);
  color: #fff;
}

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

.player-card {
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: border-color 0.2s ease;
  box-shadow: var(--card-shadow);
}

.player-card:hover {
  border-color: var(--accent-border);
}

.player-card img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.player-card strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.player-card span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.player-card small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
}


/* --- Statistics 0.5.4: live DM Statistics dashboard --- */
.stats-header-redesign {
  align-items: flex-end;
  margin-bottom: 22px;
}

.stats-header-redesign > div:first-child {
  max-width: 820px;
}

.stats-header-redesign p {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.stats-live-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.api-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(94, 220, 141, 0.24);
  border-radius: 999px;
  background: rgba(94, 220, 141, 0.07);
  color: #7fe8a6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.api-live-badge i,
.online-counter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5edc8d;
  box-shadow: 0 0 0 4px rgba(94, 220, 141, .08), 0 0 18px rgba(94, 220, 141, .28);
}

.stats-updated {
  color: var(--text-dim);
  font-size: 10px;
}

.online-counter-redesign {
  min-width: 210px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: left;
}

.online-counter-redesign .online-counter-dot {
  grid-row: 1 / span 2;
}

.online-counter-redesign > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.online-counter-redesign strong {
  font-size: 38px;
}

.online-counter-redesign small {
  grid-column: 2;
  margin-top: 0;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--panel-card);
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.stat-kpi-card {
  min-width: 0;
  min-height: 132px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(160deg, rgba(255,255,255,.018), transparent 60%);
}

.stat-kpi-card:last-child { border-right: 0; }
.stat-kpi-card.featured { background: linear-gradient(160deg, rgba(94,220,141,.07), transparent 65%); }

.stat-kpi-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent);
}

.stat-kpi-card.featured .stat-kpi-icon { color: #70e39b; }

.stat-kpi-card > div { min-width: 0; }
.stat-kpi-card small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat-kpi-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--text);
  font-size: clamp(18px, 1.45vw, 24px);
  line-height: 1.05;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.stat-kpi-card.featured strong { color: #7fe8a6; }
.stat-kpi-card > div > span { color: var(--text-dim); font-size: 9px; }

.stats-live-panel { margin-bottom: 30px; }
.server-identity > div > span { display: flex; align-items: center; gap: 7px; }
.map-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5edc8d;
  box-shadow: 0 0 12px rgba(94,220,141,.45);
}

.online-chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 8px;
  padding: 14px 10px 20px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background:
    linear-gradient(var(--border-subtle) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px) 0 0 / 12.5% 100%,
    rgba(255,255,255,.008);
}

.online-chart { width: 100%; height: 238px; overflow: visible; }
.chart-tooltip {
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  min-width: 112px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-subtle);
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  pointer-events: none;
  z-index: 2;
}
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip strong { color: #7ce7ff; font-size: 11px; }
.chart-tooltip span { color: var(--text-muted); font-size: 9px; margin-top: 3px; }
.chart-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--text-dim);
  font-size: 11px;
}

.top-players-section { margin: 34px 0 44px; }
.stats-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
}
.stats-section-heading > div > span {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}
.stats-section-heading h2 { font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.04em; }
.stats-section-heading > small { color: var(--text-dim); font-size: 10px; }

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.leaderboard-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-card);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.leaderboard-card:hover { transform: translateY(-2px); border-color: var(--accent-border); background: var(--panel-hover); }
.leaderboard-card img { width: 42px; height: 42px; border-radius: 10px; image-rendering: pixelated; }
.leaderboard-card > svg { color: var(--text-dim); }
.leaderboard-rank { color: var(--accent); font-size: 10px; font-weight: 900; }
.leaderboard-copy { min-width: 0; }
.leaderboard-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.leaderboard-copy small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 9px; }
.leaderboard-card.rank-1 { border-color: rgba(255, 206, 96, .25); background: linear-gradient(145deg, rgba(255,206,96,.06), var(--panel-card)); }

.players-heading { margin-bottom: 14px; }
.players-tools-redesign {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--panel-card);
  margin-bottom: 14px;
}
.players-search {
  min-width: min(340px, 100%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text-dim);
}
.players-search input {
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
}
.stats-sort-select {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stats-sort-select select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  font-size: 10px;
}

.player-card {
  padding: 15px;
  display: block;
  text-align: left;
}
.player-card-main {
  display: grid;
  grid-template-columns: 46px 1fr 9px;
  align-items: center;
  gap: 12px;
}
.player-card-main > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #66717f;
  box-shadow: 0 0 0 3px rgba(102,113,127,.08);
}
.player-card-main > i.online { background: #5edc8d; box-shadow: 0 0 0 3px rgba(94,220,141,.1); }
.player-card-copy { min-width: 0; }
.player-card-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.player-card-name-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-rank {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent) !important;
  font-size: 8px !important;
  margin: 0 !important;
}
.player-card-copy > span { margin-top: 3px; font-size: 9px; color: var(--text-dim); }
.player-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border-subtle);
}
.player-card-stats > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 9px;
  margin: 0;
}
.player-card-stats b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}
.empty-list {
  margin-top: 14px;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--text-dim);
  font-size: 11px;
}
.stats-api-unavailable code { color: var(--accent); }

@media (max-width: 1180px) {
  .stats-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-kpi-card:nth-child(3) { border-right: 0; }
  .stat-kpi-card:nth-child(-n+3) { border-bottom: 1px solid var(--border-subtle); }
  .leaderboard-grid { grid-template-columns: repeat(2, 1fr); }
  .leaderboard-card:last-child { grid-column: span 2; }
}

@media (max-width: 760px) {
  .stats-header-redesign { align-items: stretch; }
  .online-counter-redesign { width: 100%; }
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); border-radius: 18px; }
  .stat-kpi-card { border-bottom: 1px solid var(--border-subtle); }
  .stat-kpi-card:nth-child(odd) { border-right: 1px solid var(--border-subtle); }
  .stat-kpi-card:nth-child(even) { border-right: 0; }
  .stat-kpi-card:nth-last-child(-n+2) { border-bottom: 0; }
  .leaderboard-grid { grid-template-columns: 1fr; }
  .leaderboard-card:last-child { grid-column: auto; }
  .stats-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .players-tools-redesign { align-items: stretch; }
  .players-search { min-width: 100%; width: 100%; }
  .stats-sort-select { margin-left: 0; justify-content: space-between; width: 100%; }
  .stats-sort-select select { flex: 1; }
  .player-grid { grid-template-columns: 1fr; }
  .online-chart-wrap { height: 230px; }
  .online-chart { height: 190px; }
}

@media (max-width: 480px) {
  .stats-kpi-grid { grid-template-columns: 1fr; }
  .stat-kpi-card { border-right: 0 !important; border-bottom: 1px solid var(--border-subtle) !important; }
  .stat-kpi-card:last-child { border-bottom: 0 !important; }
}

/* Player Profile Page */
.profile-simple-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  padding-bottom: 80px;
}

.profile-simple-model-card {
  height: 420px;
  border-radius: 32px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: var(--card-shadow);
}

.profile-simple-model-hint {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

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

.profile-name-line h1 {
  font-size: 34px;
  font-weight: 900;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.profile-status.online {
  color: var(--accent);
}

.profile-fact-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-fact-row--meta { grid-template-columns: repeat(2, 1fr); }
.profile-fact-row--four { grid-template-columns: repeat(4, 1fr); }
.profile-fact-row--chat { grid-template-columns: repeat(2, 1fr); }

.profile-fact {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.profile-fact:hover {
  border-color: var(--accent-border);
}

.profile-fact strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-top: 6px;
}

.profile-fact-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Map Page */
.map-page {
  padding-bottom: 80px;
}

.map-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.map-title-row h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.map-world-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.map-privacy-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.map-privacy-strip > div {
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--panel-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.map-privacy-strip svg {
  color: var(--accent);
}

.map-privacy-strip b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
}

.map-privacy-strip small {
  font-size: 11px;
  color: var(--text-muted);
}

.map-frame-toolbar {
  height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 24px 24px 0 0;
  background: var(--panel-card);
  border: 1px solid var(--border);
  border-bottom: 0;
}

/* Keep toolbar labels visually separated instead of running together. */
.map-frame-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-frame-toolbar .map-view-hint {
  gap: 6px;
}

.map-frame-toolbar .map-view-hint small {
  margin-left: 6px;
}

.map-frame-shell {
  position: relative;
  height: 72vh;
  min-height: 560px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.map-frame-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1120px) {
  .home-hero-willow {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }
  .home-hero-text {
    align-items: center;
  }
  .about-server-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .join-steps-container {
    grid-template-columns: 1fr;
  }
  .wiki-layout-new {
    grid-template-columns: 240px 1fr;
  }
  .wiki-toc {
    display: none;
  }
  .profile-simple-layout {
    grid-template-columns: 1fr;
  }
  .footer-top-grid {
    flex-direction: column;
    gap: 34px;
  }
  .footer-links-grid-centered {
    margin-left: 0;
  }
}

@media (max-width: 860px) {
  .site-header {
    height: 58px;
    padding: 6px 12px;
  }
  .header-brand-text {
    display: none;
  }
  .header-cta-button {
    padding: 0 14px;
    font-size: 11px;
  }
  .hero-brand-title {
    font-size: 48px;
  }
  .hero-logo-box {
    height: 320px;
  }
  .hero-logo-card {
    width: 240px;
    height: 240px;
  }
  .hero-logo-levitate {
    width: 180px;
    height: 180px;
  }
  .reviews-grid-willow {
    grid-template-columns: 1fr;
  }
  .wiki-layout-new {
    grid-template-columns: 1fr;
  }
  .wiki-sidebar-new {
    position: static;
  }
  .profile-fact-row--four {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-privacy-strip {
    grid-template-columns: 1fr;
  }
  .site-footer-card {
    padding: 34px 20px;
    border-radius: 28px;
  }
  .footer-links-grid-centered {
    flex-direction: column;
    gap: 24px;
  }
}

/* ========================================================================
   0.5.5 — player profile repair, communication media and resource links
   ======================================================================== */

/* The profile model relies on absolute 3D faces. These positioning rules are
   intentionally explicit so a skin can never spill out across the page. */
.profile-simple-model-column { min-width: 0; }
.profile-simple-model-card {
  width: 100%;
  height: 560px;
  min-height: 560px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 38%, rgba(237,126,130,.08), transparent 38%),
    radial-gradient(circle at 50% 70%, rgba(114,219,255,.035), transparent 46%),
    var(--panel-card);
}
.skin3d-shell {
  position: relative;
  width: 360px;
  height: 520px;
  display: grid;
  place-items: center;
  perspective: 1250px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
}
.skin3d-shell:active { cursor: grabbing; }
.skin3d-preload { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.skin3d-stage {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  transition: transform .08s ease-out;
}
.skin-part { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.skin-part--outer { pointer-events: none; }
.skin-face {
  position: absolute;
  left: 50%;
  top: 50%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  backface-visibility: hidden;
}
.skin3d-hint { position: absolute; bottom: 14px; color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }

.profile-simple-layout {
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}
.profile-simple-content { min-width: 0; }
.profile-simple-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 86px;
}
.profile-name-line { min-width: 0; }
.profile-name-line h1 { overflow-wrap: anywhere; }
.profile-faction {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 15px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--text);
}
.profile-faction--none {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--panel-card);
  font-size: 11px;
  font-weight: 750;
}
.profile-faction-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 11px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-faction-icon img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.profile-faction-icon.fallback { color: var(--accent); }
.profile-faction > div { display: grid; gap: 2px; min-width: 0; }
.profile-faction > div > span { font-size: 9px; color: var(--text-dim); letter-spacing: .09em; text-transform: uppercase; font-weight: 800; }
.profile-faction > div > strong { font-size: 15px; color: var(--text); line-height: 1.1; }
.profile-faction > div > small { font-size: 10px; color: var(--text-muted); }
.profile-fact-label { display: flex !important; align-items: center; gap: 8px; }
.profile-fact-label b { font: inherit; font-weight: 800; color: inherit; }
.profile-fact-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 8px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-style: normal;
}
.profile-fact-icon svg { width: 15px !important; height: 15px !important; color: inherit !important; }

/* New chat screenshots are UI captures, not decorative photography: never crop them. */
.wiki-media.chat img,
.wiki-media.portrait img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
  background: #11161d;
}
.wiki-media.chat img { max-height: 360px; }
.wiki-media.portrait img { max-height: 520px; }

.wiki-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0 2px;
}
.wiki-resource-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.wiki-resource-link:hover { border-color: var(--accent-border); background: var(--panel-hover); transform: translateY(-1px); }
.wiki-resource-link-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.wiki-resource-link strong { display: block; font-size: 12px; }
.wiki-resource-link small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; line-height: 1.35; }
.wiki-resource-link > svg { color: var(--text-dim); }

@media (max-width: 980px) {
  .profile-simple-layout { grid-template-columns: 320px minmax(0,1fr); gap: 28px; }
  .profile-simple-model-card { height: 500px; min-height: 500px; }
  .skin3d-shell { width: 310px; height: 470px; }
  .profile-fact-row--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .profile-simple-layout { grid-template-columns: 1fr; }
  .profile-simple-model-column { width: min(100%, 420px); }
  .profile-simple-header { grid-template-columns: 1fr; }
  .profile-simple-model-card { height: 510px; min-height: 510px; }
  .skin3d-shell { width: min(360px, 92vw); height: 480px; }
  .wiki-link-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .profile-fact-row--meta,
  .profile-fact-row--four,
  .profile-fact-row--chat { grid-template-columns: 1fr; }
}

/* 0.5.6 — player nicknames use the classic Minecraft pixel typeface. */
.player-profile-page .profile-name-line h1 {
  font-family: Minecraft, var(--font-main);
  font-weight: 400;
  letter-spacing: 0;
}
