/* =====================================================
   Cloud Create — Global Design System
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.cdnfonts.com/css/minecraft-4');

/* =====================================================
   1. DESIGN TOKENS
   ===================================================== */
:root {
  color-scheme: light;
  --bg-html: #d4ecfc;
  /* Colors — Sky & Cloud Palette */
  --sky-50:  #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --gold-600:  #ca8a04;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic tokens */
  --bg-body:    linear-gradient(160deg, #d4ecfc 0%, #b2daf7 50%, #8ac3f2 100%);
  --bg-card:    rgba(255, 255, 255, 0.25);
  --bg-card-hover: rgba(255, 255, 255, 0.40);
  --bg-nav:     rgba(255, 255, 255, 0.35);

  --text-main:  var(--slate-900);
  --text-body:  var(--slate-700);
  --text-muted: var(--slate-600);

  --accent:     var(--sky-500);
  --accent-dark: var(--sky-600);
  --accent-glow: rgba(14, 165, 233, 0.35);

  --gold:       var(--gold-600);
  --gold-glow:  rgba(202, 138, 4, 0.3);

  --border:     rgba(255, 255, 255, 0.4);
  --border-card: rgba(255, 255, 255, 0.5);

  --shadow-sm:  0 8px 24px rgba(14, 165, 233, 0.06), inset 0 2px 4px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md:  0 16px 40px rgba(14, 165, 233, 0.08), inset 0 3px 6px rgba(255, 255, 255, 0.9), inset 0 -2px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 24px 60px rgba(14, 165, 233, 0.12), inset 0 3px 8px rgba(255, 255, 255, 0.95), inset 0 -3px 4px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.3);
  --shadow-card-hover: 0 25px 50px rgba(14, 165, 233, 0.12), inset 0 3px 6px rgba(255, 255, 255, 0.8), inset 0 -1.5px 2px rgba(0, 0, 0, 0.04);
  
  /* Glass highlights & shines */
  --border-highlight-top: rgba(255, 255, 255, 0.75);
  --border-highlight-left: rgba(255, 255, 255, 0.60);
  --card-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 60%);
  --bg-item: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  --bg-item-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.22) 100%);
  --border-item: rgba(255, 255, 255, 0.45);
  --border-item-hover: rgba(255, 255, 255, 0.70);

  --nav-border-top: rgba(255, 255, 255, 0.8);
  --nav-border-left: rgba(255, 255, 255, 0.7);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Custom Easings (Emil Kowalski) */
  --ease-out-expo: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-expo: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --container-max: 1160px;
  --nav-height: 100px;

  /* Theme-adaptive scrollbars */
  --scrollbar-track: rgba(0, 0, 0, 0.04);
  --scrollbar-thumb: rgba(14, 165, 233, 0.2);
  --scrollbar-thumb-hover: rgba(14, 165, 233, 0.35);
}

/* =====================================================
   1.1. DARK THEME VARIABLES
   ===================================================== */
html.dark-theme {
  color-scheme: dark;
  --bg-html: #090d16;
  --bg-body:    linear-gradient(160deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%);
  --bg-card:    rgba(15, 23, 42, 0.45);
  --bg-card-hover: rgba(15, 23, 42, 0.60);
  --bg-nav:     rgba(9, 13, 22, 0.50);

  --text-main:  #f8fafc;
  --text-body:  #cbd5e1;
  --text-muted: #94a3b8;

  --border:     rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);

  --shadow-sm:  0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.03), inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1.5px 3px rgba(255, 255, 255, 0.04), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 24px 60px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.05), inset 0 -3px 4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.2);
  --shadow-card-hover: 0 25px 50px rgba(0, 0, 0, 0.55), inset 0 1.5px 3px rgba(255, 255, 255, 0.05), inset 0 -1.5px 2px rgba(0, 0, 0, 0.4);

  --slate-800: #e2e8f0;

  /* Glass highlights & shines */
  --border-highlight-top: rgba(255, 255, 255, 0.06);
  --border-highlight-left: rgba(255, 255, 255, 0.03);
  --card-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 60%);
  --bg-item: linear-gradient(135deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.15) 100%);
  --bg-item-hover: linear-gradient(135deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.35) 100%);
  --border-item: rgba(255, 255, 255, 0.06);
  --border-item-hover: rgba(255, 255, 255, 0.12);

  --nav-border-top: rgba(255, 255, 255, 0.06);
  --nav-border-left: rgba(255, 255, 255, 0.03);

  /* Theme-adaptive scrollbars */
  --scrollbar-track: rgba(255, 255, 255, 0.02);
  --scrollbar-thumb: rgba(56, 189, 248, 0.2);
  --scrollbar-thumb-hover: rgba(56, 189, 248, 0.4);
}

/* =====================================================
   2. RESET & BASE
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-html, #d4ecfc);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-main);
  background: var(--bg-body);
  min-height: 100vh;
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 400ms var(--ease-out-expo), color 400ms var(--ease-out-expo);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =====================================================
   3. BACKGROUND — ANIMATED SKY
   ===================================================== */
.sky-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-body);
  transition: background 400ms var(--ease-out-expo);
}

/* Background — Animated Orbs and sky are preserved */


/* =====================================================
   4. LAYOUT
   ===================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================================================
   5. NAVIGATION
   ===================================================== */
header {
  position: sticky;
  top: 1.25rem;
  z-index: 100;
  height: var(--nav-height);
  margin: 0 auto;
  max-width: var(--container-max);
  padding: 0 1.5rem;
  width: 100%;
}

nav {
  background: var(--bg-nav);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--nav-border-top);
  border-left: 1px solid var(--nav-border-left);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 2rem;
  transition: background-color 250ms var(--ease-out-expo), border-color 250ms var(--ease-out-expo), box-shadow 250ms var(--ease-out-expo);
}

.logo {
  order: 3;
  margin-left: auto;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.logo-icon {
  height: 72px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  display: block;
  transition: transform 300ms var(--ease-out-expo), filter 300ms var(--ease-out-expo);
}

.logo a:hover .logo-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 0 16px rgba(14, 165, 233, 0.45)) drop-shadow(0 0 6px rgba(251, 191, 36, 0.25));
}

.logo-text-cloud { color: var(--accent); }
.logo-text-create { color: var(--gold); }

.nav-links {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-body);
  transition: color 150ms var(--ease-out-expo),
              background-color 150ms var(--ease-out-expo);
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--accent);
    background-color: rgba(14, 165, 233, 0.08);
  }
}

.nav-links a.active {
  color: var(--accent);
  background-color: rgba(14, 165, 233, 0.10);
}

.nav-links a i {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Theme Toggle Button */
.theme-toggle {
  order: 4; /* Place after logo */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 300ms var(--ease-out-expo),
              border-color 300ms var(--ease-out-expo),
              transform 300ms var(--ease-out-expo),
              box-shadow 300ms var(--ease-out-expo);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
  background: rgba(14, 165, 233, 0.1);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.92);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: transform 500ms var(--ease-out-expo),
              opacity 500ms var(--ease-out-expo),
              color 300ms ease;
}

.theme-toggle .sun-icon {
  color: var(--gold-400);
}

.theme-toggle .moon-icon {
  color: var(--slate-300);
}

/* Light mode state */
html:not(.dark-theme) .theme-toggle .sun-icon {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

html:not(.dark-theme) .theme-toggle .moon-icon {
  transform: translateY(20px) rotate(-90deg);
  opacity: 0;
}

/* Dark mode state */
html.dark-theme .theme-toggle .sun-icon {
  transform: translateY(-20px) rotate(90deg);
  opacity: 0;
}

html.dark-theme .theme-toggle .moon-icon {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

/* Mobile menu toggle */
.menu-toggle {
  order: 2;
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  width: 38px;
  height: 38px;
  position: relative;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out-expo),
              transform 160ms var(--ease-out-expo);
}

.menu-toggle span {
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background-color: var(--text-body);
  border-radius: 2px;
  transition: transform 250ms var(--ease-out-expo),
              opacity 250ms var(--ease-out-expo),
              background-color 250ms var(--ease-out-expo);
  will-change: transform, opacity;
}

.menu-toggle span:nth-child(1) {
  top: 12px;
}

.menu-toggle span:nth-child(2) {
  top: 18px;
}

.menu-toggle span:nth-child(3) {
  top: 24px;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-toggle:active { transform: scale(0.95); }

/* =====================================================
   6. BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 300ms var(--ease-out-expo),
              box-shadow 300ms var(--ease-out-expo),
              background-color 300ms var(--ease-out-expo),
              filter 300ms var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn:active { transform: translateY(1px) scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  color: #fff;
  box-shadow: var(--shadow-sm), 0 4px 16px var(--accent-glow);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    box-shadow: var(--shadow-md), 0 6px 24px var(--accent-glow);
    filter: brightness(1.05);
    transform: translateY(-2px);
  }
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.btn-gold {
  background: linear-gradient(135deg, var(--amber-500), var(--gold-600));
  color: #fff;
  box-shadow: var(--shadow-sm), 0 4px 16px var(--gold-glow);
}

@media (hover: hover) and (pointer: fine) {
  .btn-gold:hover {
    box-shadow: var(--shadow-md), 0 6px 24px rgba(202, 138, 4, 0.35);
    filter: brightness(1.05);
    transform: translateY(-2px);
  }
}

/* =====================================================
   7. CARDS — Glassmorphism
   ===================================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 400ms var(--ease-out-expo),
              box-shadow 400ms var(--ease-out-expo),
              border-color 400ms var(--ease-out-expo),
              background-color 400ms var(--ease-out-expo);
  padding: 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-shine);
  pointer-events: none;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-6px);
    background-color: var(--bg-card-hover);
    box-shadow: var(--shadow-card-hover);
  }
  .card-sky:hover {
    border-color: rgba(14, 165, 233, 0.4);
  }
  .card-gold:hover {
    border-color: rgba(245, 158, 11, 0.4);
  }
  .card-slate:hover {
    border-color: rgba(71, 85, 105, 0.4);
  }
  .card-green:hover {
    border-color: rgba(34, 197, 94, 0.4);
  }
  .card-red:hover {
    border-color: rgba(239, 68, 68, 0.4);
  }
  .card-purple:hover {
    border-color: rgba(168, 85, 247, 0.4);
  }
}

/* Inline SVG Icon Utility */
.icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 200ms var(--ease-out-expo), stroke-width 200ms var(--ease-out-expo);
}

.nav-links a .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2px;
  opacity: 0.85;
}

/* Card classes */
.card-sky   { }
.card-gold  { }
.card-slate { }
.card-green { }
.card-red   { }
.card-purple{ }

/* =====================================================
   8. IP BOX
   ===================================================== */
.ip-box {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  transition: transform 300ms var(--ease-out-expo),
              box-shadow 300ms var(--ease-out-expo),
              border-color 300ms var(--ease-out-expo),
              background-color 300ms var(--ease-out-expo);
  user-select: none;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .ip-box:hover {
    border-color: rgba(14, 165, 233, 0.4);
    background-color: var(--bg-card-hover);
    box-shadow: var(--shadow-md), 0 4px 20px var(--accent-glow);
    transform: translateY(-2px);
  }
}

.ip-box:active { transform: translateY(1px) scale(0.97); }

#server-ip {
  font-family: 'Minecraft', monospace;
  font-size: 0.92em;
  letter-spacing: 0.03em;
}

.ip-copy-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 200ms var(--ease-out-expo);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .ip-box:hover .ip-copy-hint { opacity: 1; }
}

.ip-toast-container {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90vw;
  height: 52px;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 10;
}

.ip-copied-toast {
  transform: translateY(-105%) scale(0.95);
  background: var(--slate-900);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: opacity 350ms var(--ease-out-expo),
              transform 350ms var(--ease-out-expo);
}

.ip-copied-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ip-copied-toast.ip-warning {
  background: rgba(239, 68, 68, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

.ip-box.ip-unavailable {
  border-color: rgba(239, 68, 68, 0.5) !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2), var(--shadow-sm) !important;
  color: #ef4444 !important;
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--slate-400);
  flex-shrink: 0;
}

.status-dot.online  { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.status-dot.offline { background: #ef4444; }
.status-dot.checking {
  background: var(--amber-500);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* =====================================================
   9. SECTION TITLES
   ===================================================== */
.section-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* =====================================================
   10. GRID LAYOUTS
   ===================================================== */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* =====================================================
   11. BADGE / TAG
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-sky {
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: var(--sky-600);
}

.badge-gold {
  background: rgba(202, 138, 4, 0.10);
  border: 1px solid rgba(202, 138, 4, 0.25);
  color: var(--gold-600);
}

/* =====================================================
   12. HERO SECTION
   ===================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4rem;
  align-items: center;
  padding: 6.5rem 2rem 5rem;
  position: relative;
}

.hero-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--slate-800) 30%, var(--sky-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 580px;
  margin: 0 0 2.5rem 0;
  line-height: 1.75;
  text-align: left;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-cloud-image {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 30px rgba(14, 165, 233, 0.12));
  animation: hero-cloud-float 6s ease-in-out infinite alternate;
  transition: transform 500ms var(--ease-out-expo), filter 500ms var(--ease-out-expo);
}

.hero-cloud-image:hover {
  transform: scale(1.04) translateY(-5px);
  filter: drop-shadow(0 22px 45px rgba(14, 165, 233, 0.25));
}

@keyframes hero-cloud-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-15px); }
}

/* Hero IP & Status wrappers for aligning */
.hero-ip-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 2.5rem;
  width: max-content;
}

.hero-status-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

/* Hero Visual (Cloud Showcase) */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

.hero-visual::before {
  content: '';
  position: absolute;
  width: min(340px, 80%);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  animation: pulse-halo 5s ease-in-out infinite alternate;
}

@keyframes pulse-halo {
  0% { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.05); opacity: 1; }
}


/* Ambient glow orbs */
.glow-orb {
  position: fixed;
  border-radius: var(--radius-full);
  filter: blur(140px);
  opacity: 0.16;
  z-index: -3;
  pointer-events: none;
  will-change: transform, border-radius;
}
.orb-1 {
  width: 450px;
  height: 450px;
  background: var(--sky-400);
  top: -50px;
  left: -100px;
  animation: float-orb-1 28s infinite alternate ease-in-out;
}
.orb-2 {
  width: 550px;
  height: 550px;
  background: var(--amber-300);
  bottom: -100px;
  right: -100px;
  animation: float-orb-2 33s infinite alternate ease-in-out;
}
.orb-3 {
  width: 350px;
  height: 350px;
  background: var(--sky-300);
  top: 50%;
  left: 35%;
  animation: float-orb-3 25s infinite alternate ease-in-out;
}

@keyframes float-orb-1 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 40% 60% 60% 40% / 40% 50% 50% 60%;
  }
  50% {
    transform: translate(80px, 50px) scale(1.1) rotate(90deg);
    border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
  }
  100% {
    transform: translate(120px, 80px) scale(1.15) rotate(180deg);
    border-radius: 40% 60% 60% 40% / 40% 50% 50% 60%;
  }
}
@keyframes float-orb-2 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%;
  }
  50% {
    transform: translate(-100px, -60px) scale(1.05) rotate(-120deg);
    border-radius: 40% 60% 50% 50% / 60% 50% 40% 50%;
  }
  100% {
    transform: translate(-150px, -100px) scale(1.1) rotate(-240deg);
    border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%;
  }
}
@keyframes float-orb-3 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
  }
  50% {
    transform: translate(40px, -70px) scale(1.15) rotate(60deg);
    border-radius: 40% 60% 40% 60% / 40% 60% 40% 60%;
  }
  100% {
    transform: translate(60px, -110px) scale(1.25) rotate(120deg);
    border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
  }
}

/* Interlocking gear mechanism showcase */
.mechanism-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mechanism-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.mechanism-gear {
  position: absolute;
  pointer-events: auto;
  will-change: transform;
  transition: filter 300ms var(--ease-out-expo);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.mechanism-gear:hover {
  filter: drop-shadow(0 8px 24px rgba(14, 165, 233, 0.35)) brightness(1.1);
}

/* Interlocking gear positions */
.gear-large {
  width: 160px;
  height: 160px;
  top: calc(50% - 110px);
  left: calc(50% - 110px);
  animation: gear-spin 25s linear infinite;
}

.gear-medium {
  width: 110px;
  height: 110px;
  top: calc(50% - -10px);
  left: calc(50% - -10px);
  animation: gear-spin 17.18s linear infinite reverse; /* speed ratio = 110 / 160 */
}

.gear-small {
  width: 75px;
  height: 75px;
  top: calc(50% - 100px);
  left: calc(50% - -40px);
  animation: gear-spin 11.72s linear infinite; /* speed ratio = 75 / 160 */
}

@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =====================================================
   13. FEATURE CARDS
   ===================================================== */
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.feature-icon-sky  { background: rgba(14, 165, 233, 0.12); color: var(--sky-500); }
.feature-icon-gold { background: rgba(202, 138, 4, 0.12);  color: var(--gold-600); }
.feature-icon-slate{ background: rgba(71, 85, 105, 0.10);  color: var(--slate-600); }

/* =====================================================
   14. TEAM CARDS
   ===================================================== */
.team-role {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.role-red    { color: #ef4444; }
.role-sky    { color: var(--sky-500); }
.role-purple { color: #a855f7; }
.role-green  { color: #22c55e; }
.role-gold   { color: var(--gold-600); }
.role-slate  { color: var(--slate-600); }

/* =====================================================
   15. FOOTER
   ===================================================== */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 5rem;
  border-top: 1px solid rgba(14, 165, 233, 0.12);
  background: var(--bg-nav);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.footer-socials a {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.15rem;
  transition: color 150ms var(--ease-out-expo),
              border-color 150ms var(--ease-out-expo),
              transform 160ms var(--ease-out-expo),
              box-shadow 200ms var(--ease-out-expo);
}

@media (hover: hover) and (pointer: fine) {
  .footer-socials a:hover {
    color: var(--accent);
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: 0 4px 12px var(--accent-glow);
  }
}

.footer-socials a:active { transform: scale(0.95); }

footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 150ms var(--ease-out-expo);
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover { color: var(--accent); }
}

.footer-update-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent) !important;
  background: rgba(14, 165, 233, 0.07);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 300ms var(--ease-out-expo),
              box-shadow 300ms var(--ease-out-expo),
              background-color 300ms var(--ease-out-expo),
              border-color 300ms var(--ease-out-expo);
}

html.dark-theme .footer-update-link {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.18);
}

.footer-update-link:hover {
  transform: translateY(-2px);
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

html.dark-theme .footer-update-link:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.update-btn-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.8px;
  fill: none;
  stroke: currentColor;
  transition: transform 600ms var(--ease-out-expo);
}

.footer-update-link:hover .update-btn-icon {
  transform: rotate(360deg);
}

/* =====================================================
   16. PAGE HERO (inner pages)
   ===================================================== */
.page-hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

/* =====================================================
   17. ACCORDION (Rules page)
   ===================================================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  transition: box-shadow 300ms var(--ease-out-expo),
              background-color 300ms var(--ease-out-expo);
}

.accordion-item:has(.accordion-content:not([hidden])) {
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card-hover);
}

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 1.1rem 1.4rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  transition: background-color 150ms var(--ease-out-expo);
}

.accordion-trigger:hover { background: rgba(14, 165, 233, 0.05); }
.accordion-trigger:active { background: rgba(14, 165, 233, 0.08); }

.accordion-chevron {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 250ms var(--ease-out-expo);
}

.accordion-item.open .accordion-chevron { transform: rotate(180deg); }

.accordion-content {
  padding: 0 1.4rem 1.2rem;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.75;
}

.accordion-content p + p { margin-top: 0.75rem; }
.accordion-content ul { padding-left: 1.25rem; list-style: disc; }
.accordion-content li { margin-top: 0.4rem; }

/* =====================================================
   18. SHOP CARDS
   ===================================================== */
.shop-card {
  background: var(--bg-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  transition: transform 400ms var(--ease-out-expo),
              box-shadow 400ms var(--ease-out-expo),
              background-color 400ms var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .shop-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-card-hover);
    border-color: rgba(14, 165, 233, 0.3);
  }
}

.shop-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.shop-price span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.shop-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.shop-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-body);
}

.shop-features li i,
.shop-features li .icon {
  color: var(--sky-500);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Shop Alert Banner */
.shop-alert-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-top: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.4rem;
  color: #fca5a5;
  margin: 1.5rem auto 0;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.04);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.shop-alert-banner span {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.shop-alert-banner .icon {
  color: #ef4444;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-pulse {
  animation: alert-pulse-anim 2s infinite ease-in-out;
}

@keyframes alert-pulse-anim {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

html:not(.dark-theme) .shop-alert-banner {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

/* Premium Shop Cards */
.shop-card.featured {
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-top: 4px solid var(--gold-600);
  box-shadow: 0 20px 48px rgba(245, 158, 11, 0.08), var(--shadow-md);
  background-color: rgba(245, 158, 11, 0.02);
}

html.dark-theme .shop-card.featured {
  background-color: rgba(245, 158, 11, 0.01);
}

.shop-card.featured::before {
  content: 'POPULAR';
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--amber-500), var(--gold-600));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.3);
}

.shop-card .card-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.shop-card .card-icon-wrapper.sky {
  background: rgba(14, 165, 233, 0.08);
  color: var(--sky-500);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.shop-card .card-icon-wrapper.gold {
  background: rgba(245, 158, 11, 0.08);
  color: var(--amber-500);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.shop-card .card-icon-wrapper.danger {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.shop-card .card-icon-wrapper .icon {
  width: 24px;
  height: 24px;
}

/* Support Benefits Section */
.support-benefit {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.75rem;
  text-align: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-sm);
  transition: transform 300ms var(--ease-out-expo), box-shadow 300ms var(--ease-out-expo);
}

.support-benefit:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.benefit-icon-wrapper {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.benefit-icon-wrapper.sky {
  background: rgba(14, 165, 233, 0.08);
  color: var(--sky-500);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.benefit-icon-wrapper.gold {
  background: rgba(245, 158, 11, 0.08);
  color: var(--amber-500);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.benefit-icon-wrapper.purple {
  background: rgba(168, 85, 247, 0.08);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.benefit-icon-wrapper .icon {
  width: 26px;
  height: 26px;
}

.support-benefit h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.support-benefit p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =====================================================
   19. MODPACK STEPS & TABS
   ===================================================== */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: all 250ms var(--ease-out-expo);
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  border-color: var(--sky-500);
  color: #fff;
  box-shadow: var(--shadow-md), 0 4px 16px var(--accent-glow);
}

.tab-btn.active:hover {
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  border-color: var(--sky-500);
  color: #fff;
}

/* Tab panes fade-in */
.tab-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: tab-fade-in 350ms var(--ease-out-expo) forwards;
}

@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-600));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--accent-glow);
}

/* =====================================================
   20. STAGGER ANIMATION (entry)
   ===================================================== */
.stagger > * {
  opacity: 0;
  transform: translateY(10px);
  animation: stagger-in 350ms var(--ease-out-expo) forwards;
}

.stagger > *:nth-child(1) { animation-delay: 50ms; }
.stagger > *:nth-child(2) { animation-delay: 110ms; }
.stagger > *:nth-child(3) { animation-delay: 170ms; }
.stagger > *:nth-child(4) { animation-delay: 230ms; }
.stagger > *:nth-child(5) { animation-delay: 290ms; }
.stagger > *:nth-child(6) { animation-delay: 350ms; }
.stagger > *:nth-child(7) { animation-delay: 410ms; }
.stagger > *:nth-child(8) { animation-delay: 470ms; }

@keyframes stagger-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   21. SECTION PADDING
   ===================================================== */
.section {
  padding: 4rem 0;
}

/* =====================================================
   22. RESPONSIVE
   ===================================================== */
main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: calc(var(--nav-height) + 10px);
    left: 1.5rem; right: 1.5rem;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    gap: 0.25rem;
    box-shadow: var(--shadow-lg), inset 0 1.5px 2px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(0, 0, 0, 0.02);

    /* Smooth mobile menu animation */
    display: flex;
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
    transition: opacity 300ms var(--ease-out-expo),
                transform 300ms var(--ease-out-expo);
  }

  html.dark-theme .nav-links {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg), inset 0 1.5px 2px rgba(255, 255, 255, 0.02), inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 4.5rem 1.5rem;
    gap: 3rem;
  }
  .hero-info {
    align-items: center;
    text-align: center;
  }
  .hero-subtitle {
    text-align: center;
    margin: 0 auto 2rem;
  }
  .hero-ip-wrapper,
  .hero-status-wrapper {
    justify-content: center;
  }
  .hero-actions {
    justify-content: center;
    width: 100%;
  }
  .hero-actions .btn { width: 100%; max-width: 340px; justify-content: center; }
}

@media (max-width: 480px) {
  nav { padding: 0 1rem; }

  .logo-icon {
    height: 42px;
  }

  .ip-box { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* Smooth layout adjustments for small screens */
  .card {
    padding: 1.5rem 1.2rem !important;
  }

  .step-card {
    padding: 1.25rem 1rem !important;
    gap: 0.75rem !important;
  }

  .tab-btn {
    padding: 0.65rem 1.15rem !important;
    font-size: 0.88rem !important;
  }

  .tabs-nav {
    gap: 0.5rem !important;
    margin-bottom: 1.75rem !important;
  }

  .hero-cloud-image {
    max-width: min(260px, 80%) !important;
  }

  .hero-visual::before {
    width: 200px !important;
    height: 200px !important;
  }
}

/* GPU Acceleration for UI elements */
.card, .btn, .ip-box, .hero-cloud-image, .tab-btn, .accordion-item, .nav-links, .rules-section, .rules-mobile-dropdown, .rules-menu-item {
  will-change: transform, opacity;
}

/* =====================================================
   23. RULES PAGE LAYOUT
   ===================================================== */
.rules-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}

.rules-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2.5rem);
  padding: 1.75rem !important;
  max-height: calc(100vh - var(--nav-height) - 4.5rem);
  overflow-y: auto;
  gap: 1.25rem;
}

.rules-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.rules-sidebar::-webkit-scrollbar {
  width: 6px;
}
.rules-sidebar::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-full);
}
.rules-sidebar::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
.rules-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.rules-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-group-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sky-600);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--sky-400);
}

.rules-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rules-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 200ms var(--ease-out-expo), border-color 200ms var(--ease-out-expo), color 200ms var(--ease-out-expo), transform 160ms var(--ease-out-expo), box-shadow 200ms var(--ease-out-expo);
}

.rules-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  height: 56%;
  width: 3px;
  background: var(--sky-500);
  border-radius: 0 4px 4px 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out-expo);
}

.rules-menu-item.active::before {
  transform: scaleX(1);
}

.rules-menu-item.active {
  color: var(--accent);
  background-color: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 2px var(--border-highlight-top), var(--shadow-sm);
}

.rules-menu-item:active {
  transform: scale(0.97);
}

.rules-menu-item .icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  stroke-width: 2px;
  transition: transform 200ms var(--ease-out-expo);
}

@media (hover: hover) and (pointer: fine) {
  .rules-menu-item:hover {
    color: var(--accent);
    background-color: rgba(14, 165, 233, 0.04);
    border-color: rgba(14, 165, 233, 0.08);
  }
  .rules-menu-item:hover .icon {
    transform: translateX(3px);
    opacity: 1;
  }
}

.rules-menu-item.active .icon {
  opacity: 1;
  color: var(--sky-500);
}

/* Rules content */
.rules-content {
  padding: 2.5rem !important;
  min-height: 520px;
}

.rules-section {
  display: none;
}

.rules-section.active {
  display: block;
}

.rules-section.active .rule-item,
.rules-section.active .rule-intro-card,
.rules-section.active .rules-sub-heading,
.rules-section.active .rule-relations-table,
.rules-section.active .rule-phase-list {
  animation: rule-item-fade-in 450ms var(--ease-out-expo) forwards;
  opacity: 0;
}

/* Stagger delays for content entry */
.rules-section.active .rule-intro-card { animation-delay: 20ms; }
.rules-section.active .rules-sub-heading { animation-delay: 40ms; }
.rules-section.active .rule-relations-table { animation-delay: 60ms; }
.rules-section.active .rule-phase-list { animation-delay: 60ms; }

.rules-section.active .rule-item:nth-child(1) { animation-delay: 40ms; }
.rules-section.active .rule-item:nth-child(2) { animation-delay: 80ms; }
.rules-section.active .rule-item:nth-child(3) { animation-delay: 120ms; }
.rules-section.active .rule-item:nth-child(4) { animation-delay: 160ms; }
.rules-section.active .rule-item:nth-child(5) { animation-delay: 200ms; }
.rules-section.active .rule-item:nth-child(6) { animation-delay: 240ms; }
.rules-section.active .rule-item:nth-child(7) { animation-delay: 280ms; }
.rules-section.active .rule-item:nth-child(8) { animation-delay: 320ms; }
.rules-section.active .rule-item:nth-child(9) { animation-delay: 360ms; }
.rules-section.active .rule-item:nth-child(10) { animation-delay: 400ms; }
.rules-section.active .rule-item:nth-child(n+11) { animation-delay: 440ms; }

@keyframes rule-item-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rules-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  padding-bottom: 1rem;
}

.rules-card-title span {
  background: linear-gradient(135deg, var(--text-main) 30%, var(--sky-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rules-card-title .icon {
  width: 28px;
  height: 28px;
  color: var(--sky-500);
}

/* Rule placeholder layout */
.rule-placeholder-card {
  background: rgba(255, 255, 255, 0.25);
  border: 1px dashed rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.rule-placeholder-card .icon {
  width: 48px;
  height: 48px;
  color: var(--sky-400);
  opacity: 0.6;
  animation: pulse-icon 2s ease-in-out infinite alternate;
}

@keyframes pulse-icon {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.05); opacity: 0.8; }
}

.rule-placeholder-text {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.75;
  max-width: 460px;
}

.rule-placeholder-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ========= Rules List Items ========= */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-item {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: var(--bg-item);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-item);
  border-left: 4px solid rgba(14, 165, 233, 0.4);
  box-shadow: var(--shadow-sm);
  transition: background 300ms ease, border-color 300ms ease, border-left-color 300ms ease,
    transform 300ms ease, box-shadow 300ms ease;
  position: relative;
  cursor: pointer;
}

.rule-item::after {
  content: '';
  position: absolute;
  top: 1.1rem;
  right: 1.35rem;
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0;
  transform: scale(0.8);
  background-color: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  -webkit-mask-size: contain;
  transition: opacity 200ms var(--ease-out-expo), transform 200ms var(--ease-out-expo), background-color 200ms var(--ease-out-expo);
}

.rule-item:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-item-hover);
  border-left-color: var(--sky-400);
  transform: translateX(3px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.06);
}

.rule-item:hover::after {
  opacity: 0.8;
  transform: scale(1);
  background-color: var(--sky-400);
}

.rule-item.highlight-pulse {
  animation: rule-highlight-pulse-animation 2.5s ease-out;
}

@keyframes rule-highlight-pulse-animation {
  0% {
    background-color: var(--bg-item);
    border-color: var(--border-item);
  }
  15% {
    background-color: rgba(14, 165, 233, 0.22);
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
  }
  100% {
    background-color: var(--bg-item);
    border-color: var(--border-item);
  }
}

.rule-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--sky-500);
  font-size: 0.82rem;
  flex-shrink: 0;
  min-width: 2.8rem;
  padding-top: 0.12rem;
  line-height: 1.6;
}

.rule-text {
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  padding-right: 1.5rem;
}

.rule-text strong {
  color: var(--text-main);
}

.rule-penalty {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #dc2626;
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-left: 3px solid #ef4444;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* Intro/context card within a section */
.rule-intro-card {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.1);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--text-body);
}

.rule-intro-card ul {
  margin-top: 0.65rem;
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  list-style: disc;
}

.rule-intro-card li {
  font-size: 0.91rem;
  line-height: 1.6;
  color: var(--text-body);
}

/* Sub-list inside rule-text */
.rule-sub-list {
  margin-top: 0.45rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: disc;
}

.rule-sub-list li {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-body);
}

/* Sub-heading within a section */
.rules-sub-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Political relations scale */
.rule-relations-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rule-relation-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-item);
  background: var(--bg-item);
  transition: background-color 180ms var(--ease-out-expo), border-color 180ms var(--ease-out-expo);
}

.rule-relation-item:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-item-hover);
}

.rule-relation-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 1.8rem;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-positive {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #16a34a;
}
.badge-neutral {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--slate-600);
}
.badge-negative {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: #dc2626;
}
.badge-war {
  background: rgba(153, 27, 27, 0.12);
  border: 1px solid rgba(153, 27, 27, 0.25);
  color: #991b1b;
  font-weight: 900;
}

.rule-relation-text {
  font-size: 0.91rem;
  line-height: 1.65;
  color: var(--text-body);
}

/* Siege phases */
.rule-phase-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rule-phase-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-item);
  border-radius: var(--radius-md);
  border-left: 3px solid rgba(14, 165, 233, 0.28);
  transition: background 180ms var(--ease-out-expo), border-color 180ms var(--ease-out-expo);
}

.rule-phase-item:hover {
  background: var(--bg-item-hover);
  border-color: var(--sky-400);
}

.rule-phase-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--sky-500);
  flex-shrink: 0;
  min-width: 4rem;
  padding-top: 0.12rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rule-phase-text {
  font-size: 0.91rem;
  line-height: 1.65;
  color: var(--text-body);
}

/* Forbidden items */
.rule-forbidden-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(185, 28, 28, 0.04);
  border-radius: var(--radius-md);
  border-left: 3px solid rgba(185, 28, 28, 0.22);
  transition: background 300ms ease, border-color 300ms ease, border-left-color 300ms ease,
    transform 300ms ease, box-shadow 300ms ease;
  position: relative;
  cursor: pointer;
}

.rule-forbidden-item::after {
  content: '';
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0;
  transform: scale(0.8);
  background-color: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  -webkit-mask-size: contain;
  transition: opacity 200ms var(--ease-out-expo), transform 200ms var(--ease-out-expo), background-color 200ms var(--ease-out-expo);
}

.rule-forbidden-item:hover {
  background: rgba(185, 28, 28, 0.07);
  border-left-color: #ef4444;
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.05);
  transform: translateX(3px);
}

.rule-forbidden-item:hover::after {
  opacity: 0.8;
  transform: scale(1);
  background-color: #ef4444;
}

.rule-forbidden-icon {
  width: 17px;
  height: 17px;
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 0.18rem;
}

.rule-forbidden-text {
  font-size: 0.91rem;
  line-height: 1.65;
  color: var(--text-body);
  padding-right: 1.5rem;
}

/* ============================================ */

/* Mobile rules navigation styling */
.rules-mobile-nav {
  display: none;
  position: relative;
  width: 100%;
  margin-bottom: 1.25rem;
  z-index: 10;
}

.rules-mobile-trigger {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-main);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  transition: all 200ms var(--ease-out-expo);
}

.rules-mobile-trigger:active {
  transform: scale(0.97);
}

.rules-mobile-trigger .btn-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
}

.rules-mobile-trigger .select-icon {
  width: 20px;
  height: 20px;
  color: var(--sky-500);
}

.rules-mobile-trigger .chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 300ms var(--ease-out-expo);
}

.rules-mobile-trigger.open .chevron-icon {
  transform: rotate(180deg);
}

.rules-mobile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem;
  z-index: 20;
  flex-direction: column;
  gap: 0.25rem;
  animation: dropdown-fade-in 250ms var(--ease-out-expo) forwards;
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rules-mobile-dropdown.open {
  display: flex;
}

.rules-mobile-group-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sky-600);
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  padding-left: 0.5rem;
}

.rules-mobile-group-title:first-child {
  margin-top: 0;
}

.rules-mobile-item {
  width: 100%;
  padding: 0.75rem 1.1rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out-expo), color 150ms var(--ease-out-expo), transform 120ms var(--ease-out-expo);
}

.rules-mobile-item:hover,
.rules-mobile-item.active {
  background: rgba(14, 165, 233, 0.08);
  color: var(--accent);
}

.rules-mobile-item:active {
  transform: scale(0.97);
}

html.dark-theme .rules-mobile-trigger {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
}

html.dark-theme .rules-mobile-dropdown {
  background: rgba(9, 13, 22, 0.90);
  border-color: rgba(255, 255, 255, 0.08);
}

/* =====================================================
   24. RESPONSIVE LAYOUT OVERRIDES FOR RULES
   ===================================================== */
@media (max-width: 900px) {
  .rules-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .rules-sidebar {
    display: none;
  }
  .rules-mobile-nav {
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-links a .icon {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2px !important;
  }
}

/* =====================================================
   25. REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .cloud,
  .cloud-img,
  .gear-deco,
  .rule-placeholder-card .icon { animation: none; }

  .stagger > *,
  .rules-section {
    animation: none;
    opacity: 1;
    transform: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =====================================================
   26. SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* =====================================================
   27. MODPACK UNAVAILABLE BANNER, BUTTON EFFECT & TOASTS
   ===================================================== */
.unavailable-banner {
  background: rgba(239, 68, 68, 0.05);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 2rem;
  margin-top: 1.5rem;
  margin-bottom: -1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.04), inset 0 1.5px 2px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 400ms var(--ease-out-expo), box-shadow 400ms var(--ease-out-expo), border-color 400ms var(--ease-out-expo);
}

.unavailable-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 16px 40px rgba(239, 68, 68, 0.08), inset 0 1.5px 2px rgba(255, 255, 255, 0.85);
}

.unavailable-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.unavailable-banner-message {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.unavailable-banner-message svg {
  color: #ef4444;
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  animation: pulse-alert 2s infinite ease-in-out;
}

@keyframes pulse-alert {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.1); }
}

.unavailable-banner-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.unavailable-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(14, 165, 233, 0.15);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sky-700);
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms var(--ease-out-expo), border-color 200ms var(--ease-out-expo), color 200ms var(--ease-out-expo), transform 200ms var(--ease-out-expo);
}

.unavailable-banner-link svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5px;
  transition: transform 200ms var(--ease-out-expo);
}

.unavailable-banner-link:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.35);
  color: var(--sky-600);
  transform: translateY(-1px);
}

.unavailable-banner-link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 820px) {
  .unavailable-banner {
    padding: 1.25rem;
    margin-bottom: 0;
  }
  .unavailable-banner-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .unavailable-banner-message {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

/* Modpack Available Announcement Banner */
.modpack-banner {
  background: rgba(34, 197, 94, 0.05);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.75rem;
  max-width: 520px;
  margin: 1.5rem auto -1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.04), inset 0 1.5px 2px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 400ms var(--ease-out-expo), box-shadow 400ms var(--ease-out-expo), border-color 400ms var(--ease-out-expo);
}

html.dark-theme .modpack-banner {
  background: rgba(34, 197, 94, 0.03);
  border-color: rgba(34, 197, 94, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modpack-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.08), inset 0 1.5px 2px rgba(255, 255, 255, 0.85);
}

.modpack-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1rem;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.modpack-banner-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modpack-banner-message svg {
  color: #22c55e;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  animation: pulse-alert 2s infinite ease-in-out;
}

.modpack-banner-badge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.modpack-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #16a34a;
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms var(--ease-out-expo), border-color 200ms var(--ease-out-expo), color 200ms var(--ease-out-expo), transform 200ms var(--ease-out-expo);
}

html.dark-theme .modpack-banner-link {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.modpack-banner-link svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5px;
  transition: transform 200ms var(--ease-out-expo);
}

.modpack-banner-link:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: #15803d;
  transform: translateY(-1px);
}

html.dark-theme .modpack-banner-link:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
  color: #22c55e;
}

.modpack-banner-link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 820px) {
  .modpack-banner {
    padding: 1.25rem;
    margin-bottom: 0;
  }
  .modpack-banner-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .modpack-banner-message {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

/* Button Shaking Effect & Unavailable Color State */
@keyframes btn-shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-5px); }
  30%, 60%, 90% { transform: translateX(5px); }
}

.btn-shake {
  animation: btn-shake 0.4s var(--ease-standard) !important;
}

.btn-unavailable {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35) !important;
  filter: brightness(1) !important;
}



/* Bottom Toast Notification */
.download-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 16px rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
  transition: transform 400ms var(--ease-out-expo), opacity 400ms var(--ease-out-expo);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

.download-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.download-toast .toast-icon {
  color: #ef4444;
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2.5px;
}

/* Rules Page Toast Notification */
.rules-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(14, 165, 233, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 16px rgba(14, 165, 233, 0.15);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
  transition: transform 400ms var(--ease-out-expo), opacity 400ms var(--ease-out-expo);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

.rules-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* =====================================================
   25. VIEW TRANSITIONS
   ===================================================== */
::view-transition-old(root) {
  animation: 450ms cubic-bezier(0.23, 1, 0.32, 1) both fade-out;
}
::view-transition-new(root) {
  animation: 450ms cubic-bezier(0.23, 1, 0.32, 1) both fade-in;
}

@keyframes fade-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.995); }
}
@keyframes fade-in {
  from { opacity: 0; transform: scale(1.005); }
  to { opacity: 1; transform: scale(1); }
}

/* =====================================================
   26. RP SECTION STYLES
   ===================================================== */

/* RP button in main nav — amber/gold accent */
.nav-rp-btn {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(234,88,12,0.08)) !important;
  border: 1px solid rgba(245,158,11,0.30) !important;
  color: #d97706 !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md) !important;
  position: relative;
  overflow: hidden;
}

.nav-rp-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,0.10), transparent 60%);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .nav-rp-btn:hover {
    color: #b45309 !important;
    background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(234,88,12,0.14)) !important;
    border-color: rgba(245,158,11,0.55) !important;
    box-shadow: 0 0 18px rgba(245,158,11,0.25) !important;
  }
}

html.dark-theme .nav-rp-btn {
  color: #fbbf24 !important;
  background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(234,88,12,0.06)) !important;
  border-color: rgba(245,158,11,0.22) !important;
}

@media (hover: hover) and (pointer: fine) {
  html.dark-theme .nav-rp-btn:hover {
    color: #fcd34d !important;
    background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(234,88,12,0.12)) !important;
    border-color: rgba(245,158,11,0.45) !important;
    box-shadow: 0 0 18px rgba(245,158,11,0.20) !important;
  }
}

/* RP Hub — back button in its own nav */
.rp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-body);
  transition: color 150ms var(--ease-out-expo),
              background-color 150ms var(--ease-out-expo);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .rp-back-btn:hover {
    color: var(--accent);
    background-color: rgba(14,165,233,0.08);
  }
}

/* RP Hub nav — amber accent label */
.rp-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(234,88,12,0.08));
  border: 1px solid rgba(245,158,11,0.30);
  color: #d97706;
  letter-spacing: 0.02em;
}

html.dark-theme .rp-nav-label {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(234,88,12,0.06));
  border-color: rgba(245,158,11,0.22);
}

/* RP Hub — section module cards */
.rp-module-card {
  background: var(--bg-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 350ms var(--ease-out-expo),
              box-shadow 350ms var(--ease-out-expo),
              background-color 350ms var(--ease-out-expo),
              border-color 350ms var(--ease-out-expo);
}

.rp-module-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-shine);
  pointer-events: none;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .rp-module-card:hover {
    transform: translateY(-6px);
    background-color: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
    border-color: rgba(245,158,11,0.32);
  }
}

.rp-module-card:active {
  transform: translateY(-2px) scale(0.99);
}

.rp-module-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(234,88,12,0.09));
  border: 1px solid rgba(245,158,11,0.28);
  color: #d97706;
  flex-shrink: 0;
}

html.dark-theme .rp-module-icon {
  background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(234,88,12,0.06));
  border-color: rgba(245,158,11,0.20);
  color: #fbbf24;
}

.rp-module-icon .icon {
  width: 24px;
  height: 24px;
}

.rp-module-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}

.rp-module-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.rp-module-arrow {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #d97706;
  padding-top: 0.5rem;
}

html.dark-theme .rp-module-arrow {
  color: #fbbf24;
}

.rp-module-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
}

.rp-module-card.coming-soon:hover {
  transform: none;
  box-shadow: var(--shadow-md);
  border-color: var(--border-card);
  background-color: var(--bg-card);
}

/* Symmetrical flex layout for RP modules */
.rp-modules-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto 5rem;
}

.rp-modules-flex > .rp-module-card {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .rp-modules-flex > .rp-module-card {
    width: calc((100% - 1.5rem) / 2);
  }
}

@media (min-width: 992px) {
  .rp-modules-flex > .rp-module-card {
    width: calc((100% - 3rem) / 3);
  }
}

.rp-coming-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(100,116,139,0.10);
  border: 1px solid rgba(100,116,139,0.20);
  color: var(--text-muted);
  width: fit-content;
}

/* RP Hub hero banner accent bar */
.rp-hero-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(234,88,12,0.08));
  border: 1px solid rgba(245,158,11,0.28);
  color: #d97706;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

html.dark-theme .rp-hero-accent {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(234,88,12,0.06));
  border-color: rgba(245,158,11,0.20);
}

/* Amber glow orbs for RP hub */
.rp-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.30;
  animation: float-orb 16s ease-in-out infinite;
}

.rp-orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(245,158,11,0.35), transparent 70%);
  top: -120px;
  right: -120px;
  animation-delay: -4s;
}

.rp-orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(234,88,12,0.28), transparent 70%);
  bottom: 40px;
  left: -100px;
  animation-delay: -9s;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-40px) scale(1.04); }
  66% { transform: translate(-20px,25px) scale(0.97); }
}

/* =====================================================
   27. RP Diplomatic Relations Map
   ===================================================== */
.rp-diplomatic-section {
  background: var(--bg-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.rp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-item);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--sky-500);
  box-shadow: 0 0 8px var(--sky-500);
}

.status-dot.online {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.rp-diplomatic-container {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  width: 100%;
  height: 480px;
}

.rp-map-wrapper {
  position: relative;
  flex: 1;
  height: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4), var(--shadow-md);
  min-width: 0;
}

#diplomatic-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

.rp-diplomatic-sidebar {
  width: 0;
  opacity: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: var(--border-card);
  border-top-color: var(--border-highlight-top);
  border-left-color: var(--border-highlight-left);
  background: var(--bg-card);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  z-index: 10;
  flex-shrink: 0;
  transition: 
    width 350ms var(--ease-standard),
    padding 350ms var(--ease-standard),
    opacity 300ms ease,
    border-width 350ms var(--ease-standard),
    box-shadow 350ms var(--ease-standard);
}

.rp-diplomatic-sidebar.active {
  width: 320px;
  opacity: 1;
  padding: 1.5rem;
  border-width: 1px;
  box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.profile-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 150ms ease, color 150ms ease, transform 200ms ease;
  margin-left: auto;
}

.profile-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  transform: rotate(90deg);
}

html.dark-theme .profile-close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 992px) {
  .rp-diplomatic-container {
    flex-direction: column;
    height: auto;
  }
  .rp-map-wrapper {
    height: 380px;
  }
  .rp-diplomatic-sidebar {
    width: 100%;
    max-height: 0;
    opacity: 0;
    padding: 0;
    border-width: 0;
    flex-shrink: 1;
    box-shadow: none;
    transition: 
      max-height 350ms var(--ease-standard),
      padding 350ms var(--ease-standard),
      opacity 300ms ease,
      border-width 350ms var(--ease-standard);
  }
  .rp-diplomatic-sidebar.active {
    max-height: 500px;
    opacity: 1;
    padding: 1.5rem;
    border-width: 1px;
    box-shadow: var(--shadow-lg);
  }
}

#diplomatic-profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  color: var(--text-muted);
  gap: 1rem;
}

#diplomatic-profile-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}


#diplomatic-profile-empty .empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

#diplomatic-profile-empty p {
  font-size: 0.9rem;
  max-width: 240px;
  line-height: 1.5;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-item);
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: white;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease;
  cursor: pointer;
}

.profile-avatar:hover {
  transform: scale(1.08) rotate(3deg);
}

.profile-header h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0;
  color: var(--text-main);
}

.profile-leader-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.relations-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.relations-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.relations-list-scroll::-webkit-scrollbar {
  width: 6px;
}
.relations-list-scroll::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-full);
}
.relations-list-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
.relations-list-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.relation-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
  transition: all 200ms ease;
  gap: 0.75rem;
}

.relation-mini-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.relation-mini-state {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.35;
}

.relation-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 800;
  font-family: var(--font-display);
}

/* Colors for levels -3 to +3 */
.badge-rel-p3 { background: rgba(34, 197, 94, 0.16); border: 1px solid rgba(34, 197, 94, 0.35); color: #22c55e; }
.badge-rel-p2 { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.35); color: #10b981; }
.badge-rel-p1 { background: rgba(6, 182, 212, 0.16); border: 1px solid rgba(6, 182, 212, 0.35); color: #06b6d4; }
.badge-rel-0  { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.7); }
.badge-rel-n1 { background: rgba(250, 204, 21, 0.16); border: 1px solid rgba(250, 204, 21, 0.35); color: #facc15; }
.badge-rel-n2 { background: rgba(251, 146, 60, 0.16); border: 1px solid rgba(251, 146, 60, 0.35); color: #fb923c; }
.badge-rel-n3 { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.35); color: #ef4444; }

/* -----------------------------------------------------
   28. RP Relations Guide Section
   ----------------------------------------------------- */
.rp-relations-guide {
  background: var(--bg-card);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-highlight-top);
  border-left: 1px solid var(--border-highlight-left);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.guide-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-item);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 200ms ease, background 200ms ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.guide-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
}

/* Badge colors matching levels */
.badge-p3 { background: rgba(34, 197, 94, 0.16); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.35); }
.badge-p2 { background: rgba(16, 185, 129, 0.16); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-p1 { background: rgba(6, 182, 212, 0.16); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.35); }
.badge-0  { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.12); }
.badge-n1 { background: rgba(250, 204, 21, 0.16); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.35); }
.badge-n2 { background: rgba(251, 146, 60, 0.16); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.35); }
.badge-n3 { background: rgba(239, 68, 68, 0.16); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.35); }

.guide-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.guide-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.guide-rule-banner {
  margin-top: 1.75rem; 
  padding: 1.15rem 1.35rem; 
  background: rgba(255,255,255,0.02); 
  border: 1px solid var(--border-item); 
  border-radius: var(--radius-md); 
  font-size: 0.88rem; 
  color: var(--text-muted); 
  line-height: 1.5; 
  display: flex; 
  gap: 0.85rem; 
  align-items: flex-start;
}

/* Sidebar Backdrop Overlay (Desktop hidden) */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .guide-columns-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .rp-nav-label {
    display: none !important;
  }

  /* Diplomacy Page Mobile Polishing */
  .page-hero {
    padding: 2.5rem 1rem 1.5rem !important;
    text-align: center !important;
  }
  .page-hero .section-title {
    font-size: 1.8rem !important;
  }
  .page-hero .section-subtitle {
    font-size: 0.9rem !important;
    padding: 0 0.5rem;
  }

  .rp-diplomatic-section.card {
    padding: 1rem !important;
    margin: 0 auto 2.5rem !important;
  }
  .rp-section-title {
    font-size: 1.35rem !important;
  }
  .rp-section-header p {
    font-size: 0.82rem !important;
  }

  .rp-map-wrapper {
    height: 550px !important;
  }

  /* ====== Mobile Diplomatic Modal ====== */
  /* Backdrop: covers full screen, blurs content behind it */
  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 2000 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 280ms ease !important;
  }
  .sidebar-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Modal: sits above backdrop, isolation ensures it is NOT blurred */
  .rp-diplomatic-sidebar {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    width: calc(100vw - 2rem) !important;
    max-width: 400px !important;
    height: auto !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    z-index: 2001 !important;
    isolation: isolate !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition:
      transform 300ms var(--ease-standard),
      opacity 280ms ease,
      visibility 0ms linear 280ms !important;
  }
  .rp-diplomatic-sidebar.active {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    border-width: 1px !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.15rem !important;
    transition:
      transform 300ms var(--ease-standard),
      opacity 280ms ease,
      visibility 0ms linear 0ms !important;
  }
  .relation-mini-card {
    padding: 0.65rem 0.85rem !important;
    gap: 0.5rem !important;
  }
  .relation-mini-state {
    font-size: 0.82rem !important;
  }
  .relation-mini-badge {
    font-size: 0.7rem !important;
    padding: 0.15rem 0.45rem !important;
  }

  /* Allow sidebar to grow to fit all relations — no inner scroll needed */
  .rp-diplomatic-sidebar .relations-list-scroll {
    overflow: visible !important;
    flex: none !important;
    min-height: unset !important;
    height: auto !important;
  }

  .rp-relations-guide {
    padding: 1.25rem 1rem !important;
    margin: 1.5rem auto 3rem !important;
  }
  .rp-relations-guide h3 {
    font-size: 1.15rem !important;
    justify-content: center !important;
    margin-bottom: 1.25rem !important;
  }
  .column-group-title {
    justify-content: center !important;
    margin-bottom: 0.5rem !important;
  }
  .guide-card {
    padding: 0.85rem 1rem !important;
  }
  .guide-title {
    font-size: 0.88rem !important;
  }
  .guide-desc {
    font-size: 0.78rem !important;
  }
  .rp-relations-guide > div:last-child {
    padding: 0.85rem 1rem !important;
    font-size: 0.8rem !important;
    margin-top: 1.25rem !important;
  }

  .rp-map-wrapper {
    display: none !important;
  }
  #rp-mobile-states-list {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  .mobile-state-card {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-item);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 200ms ease, background 200ms ease;
  }
  .mobile-state-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
  }
  .mobile-state-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .mobile-state-meta {
    flex: 1;
    min-width: 0;
    text-align: left;
  }
  .mobile-state-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-state-leader {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
  }
  .mobile-state-card svg {
    color: var(--text-muted);
    opacity: 0.6;
    flex-shrink: 0;
  }
}

/* =====================================================
   28. UPDATES PAGE TIMELINE
   ===================================================== */
.updates-timeline {
  max-width: 800px;
  margin: 0 auto 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.update-release-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.update-date-badge {
  background: rgba(14, 165, 233, 0.12);
  color: var(--sky-600);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

html.dark-theme .update-date-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--sky-300);
}

.update-release-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.update-features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.update-feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  line-height: 1.6;
}

.update-feature-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-top: 0.15rem;
}

.update-feature-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.update-feature-text {
  font-size: 0.95rem;
  color: var(--text-body);
}

.update-feature-text strong {
  color: var(--text-main);
  font-weight: 700;
}
