/* ==========================================================================
   Design tokens
   Light is the default. Dark follows the OS unless the visitor picked a theme
   explicitly, in which case <html data-theme> wins.
   ========================================================================== */

:root {
  /* Brand fills — used as backgrounds, always paired with --on-primary */
  --primary-color: #1F6B5A;
  --primary-dark: #164F43;
  --secondary-color: #2A8F78;
  --on-primary: #ffffff;

  /* Brand ink — used as text/heading colour on a surface */
  --primary-ink: #1F6B5A;

  --accent-color: #E0A045;
  --accent-hover: #C98B32;
  --on-accent: #1A2421;

  /* Surfaces and text */
  --text-color: #1A2421;
  --text-muted: #4A5A55;
  --background-color: #EAF0EE;
  --surface: #F7FAF9;
  --surface-sunken: rgba(31, 107, 90, 0.04);
  --footer-bg: #15201D;

  /* Primary tints, so the same wash is not re-invented per file */
  --tint-weak: rgba(31, 107, 90, 0.04);
  --tint-soft: rgba(31, 107, 90, 0.08);
  --tint-medium: rgba(31, 107, 90, 0.14);
  --border-color: rgba(31, 107, 90, 0.12);
  --border-strong: rgba(31, 107, 90, 0.24);

  /* Status colours, shared by pills, note boxes and build badges */
  --ok-bg: rgba(31, 107, 90, 0.14);
  --ok-ink: #14584A;
  --warn-bg: rgba(224, 160, 69, 0.2);
  --warn-ink: #7A4E0C;
  --rough-bg: rgba(200, 110, 60, 0.18);
  --rough-ink: #7C3612;
  --danger-bg: rgba(180, 70, 60, 0.16);
  --danger-ink: #8A3030;
  --info-bg: rgba(42, 143, 120, 0.16);
  --info-ink: #14584A;

  /* Hero scrim — a dark wash over the background photo */
  --scrim-top: rgba(12, 24, 22, 0.45);
  --scrim-mid: rgba(12, 24, 22, 0.55);
  --scrim-bottom: rgba(12, 24, 22, 0.72);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-soft: 0 8px 24px rgba(26, 36, 33, 0.08);
  --shadow-lift: 0 12px 28px rgba(26, 36, 33, 0.12);

  /* Motion — every transition references these so reduced-motion can zero them */
  --motion-fast: 0.2s ease;
  --motion-slow: 0.25s ease;

  /* Layout */
  --header-height: 4.25rem;
  --measure-wide: 1200px;
  --measure-text: 860px;
  --measure-narrow: 800px;
  --tap-target: 2.75rem;

  --focus-ring: 0 0 0 3px rgba(224, 160, 69, 0.55);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

/* Dark palette. Kept in one place; the two selectors below both point at it. */
:root[data-theme="dark"] {
  --primary-color: #2A8F78;
  --primary-dark: #35A88C;
  --secondary-color: #45BFA0;
  --on-primary: #08130F;
  --primary-ink: #7BDCBC;

  --accent-color: #E9B15F;
  --accent-hover: #F3C57F;
  --on-accent: #14201C;

  --text-color: #E4EDEA;
  --text-muted: #A2B5AF;
  --background-color: #0E1715;
  --surface: #16211E;
  --surface-sunken: rgba(123, 220, 188, 0.05);
  --footer-bg: #0A1210;

  --tint-weak: rgba(123, 220, 188, 0.05);
  --tint-soft: rgba(123, 220, 188, 0.1);
  --tint-medium: rgba(123, 220, 188, 0.16);
  --border-color: rgba(123, 220, 188, 0.16);
  --border-strong: rgba(123, 220, 188, 0.3);

  --ok-bg: rgba(69, 191, 160, 0.18);
  --ok-ink: #7BDCBC;
  --warn-bg: rgba(233, 177, 95, 0.18);
  --warn-ink: #F0C583;
  --rough-bg: rgba(224, 138, 84, 0.18);
  --rough-ink: #F0A87C;
  --danger-bg: rgba(226, 106, 96, 0.18);
  --danger-ink: #F09A92;
  --info-bg: rgba(69, 191, 160, 0.16);
  --info-ink: #7BDCBC;

  --scrim-top: rgba(6, 14, 12, 0.55);
  --scrim-mid: rgba(6, 14, 12, 0.68);
  --scrim-bottom: rgba(6, 14, 12, 0.85);

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 12px 28px rgba(0, 0, 0, 0.55);

  --focus-ring: 0 0 0 3px rgba(233, 177, 95, 0.6);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-color: #2A8F78;
    --primary-dark: #35A88C;
    --secondary-color: #45BFA0;
    --on-primary: #08130F;
    --primary-ink: #7BDCBC;

    --accent-color: #E9B15F;
    --accent-hover: #F3C57F;
    --on-accent: #14201C;

    --text-color: #E4EDEA;
    --text-muted: #A2B5AF;
    --background-color: #0E1715;
    --surface: #16211E;
    --surface-sunken: rgba(123, 220, 188, 0.05);
    --footer-bg: #0A1210;

    --tint-weak: rgba(123, 220, 188, 0.05);
    --tint-soft: rgba(123, 220, 188, 0.1);
    --tint-medium: rgba(123, 220, 188, 0.16);
    --border-color: rgba(123, 220, 188, 0.16);
    --border-strong: rgba(123, 220, 188, 0.3);

    --ok-bg: rgba(69, 191, 160, 0.18);
    --ok-ink: #7BDCBC;
    --warn-bg: rgba(233, 177, 95, 0.18);
    --warn-ink: #F0C583;
    --rough-bg: rgba(224, 138, 84, 0.18);
    --rough-ink: #F0A87C;
    --danger-bg: rgba(226, 106, 96, 0.18);
    --danger-ink: #F09A92;
    --info-bg: rgba(69, 191, 160, 0.16);
    --info-ink: #7BDCBC;

    --scrim-top: rgba(6, 14, 12, 0.55);
    --scrim-mid: rgba(6, 14, 12, 0.68);
    --scrim-bottom: rgba(6, 14, 12, 0.85);

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 12px 28px rgba(0, 0, 0, 0.55);

    --focus-ring: 0 0 0 3px rgba(233, 177, 95, 0.6);

    color-scheme: dark;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-color);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--tint-medium), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, var(--warn-bg), transparent 50%),
    var(--background-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Short pages still push the footer to the bottom. */
main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, .logo span, .hero-brand {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* One page-title scale instead of a different h1 size per stylesheet. */
.plugins-header h1,
.plugin-header h1,
.about-header h1,
.contact-content > h1,
.join-section h1,
.play-page h1,
.terms-section h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.15;
}

/* Section headings inside a content column. */
.plugins-section h2,
.plugins-content > section h2,
.about-section h2,
.contact-info h2,
.play-page h2,
.play-guide h2,
.membership-card h2,
.costs-section h2,
.community-section h2 {
  font-size: 1.5rem;
}

/* Visible keyboard focus everywhere. Mouse users never see it. */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(var(--space-2) * -10);
  z-index: 1100;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--primary-ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--motion-fast);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ==========================================================================
   Header & navigation
   ========================================================================== */

header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-3) 1.25rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--motion-slow), background-color var(--motion-slow);
}

header.is-scrolled {
  box-shadow: var(--shadow-soft);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.staff-bar {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: flex-end;
  max-width: var(--measure-wide);
  margin: 0 auto var(--space-2);
  font-size: 0.9rem;
}

.staff-bar a {
  color: var(--primary-ink);
  font-weight: 600;
}

.staff-bar form {
  margin: 0;
}

.staff-bar button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--measure-wide);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.logo img {
  height: 42px;
  width: auto;
}

.logo span {
  color: var(--primary-ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-5);
  align-items: stretch;
  align-self: stretch;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

.nav-links > li.dropdown {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  position: relative;
  transition: color var(--motion-fast);
}

.nav-links > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--motion-fast);
}

.nav-links > li > a:hover {
  color: var(--primary-ink);
}

.nav-links > li > a:hover::after {
  transform: scaleX(1);
}

/* Language switcher and theme toggle */
.nav-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-2);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.lang-switcher form {
  display: inline-flex;
}

.lang-switcher button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  min-height: var(--tap-target);
  min-width: var(--tap-target);
  border-radius: var(--radius-md);
  transition: color var(--motion-fast), background-color var(--motion-fast);
}

.lang-switcher button[aria-current="true"],
.lang-switcher button.active,
.lang-switcher button:hover {
  color: var(--primary-ink);
  background: var(--tint-soft);
}

.lang-switcher .sep {
  color: var(--text-muted);
  opacity: 0.4;
  user-select: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target);
  min-width: var(--tap-target);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--motion-fast), background-color var(--motion-fast),
    border-color var(--motion-fast);
}

.theme-toggle:hover {
  color: var(--primary-ink);
  background: var(--tint-soft);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

/* Only one of the two icons is shown, depending on the resolved theme. */
.theme-toggle .icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-dark {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-light {
    display: none;
  }
}

/* ==========================================================================
   Dropdown
   On pointer devices it opens on hover. On touch it is toggled by JS, which
   sets aria-expanded — hover alone would leave the menu stuck open.
   ========================================================================== */

.dropdown {
  position: relative;
}

.dropdown-content {
  --dropdown-bridge: 0.9rem;
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  padding-top: var(--dropdown-bridge);
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  z-index: 1000;
  animation: dropdownFade var(--motion-fast);
}

/* Card look sits below the invisible hover bridge (header padding + visual gap). */
.dropdown-content::before {
  content: "";
  position: absolute;
  top: var(--dropdown-bridge);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  z-index: 0;
  pointer-events: none;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .dropdown:hover .dropdown-content,
  .dropdown:focus-within .dropdown-content {
    display: block;
  }
}

.dropdown-toggle[aria-expanded="true"] + .dropdown-content {
  display: block;
}

.dropdown-toggle .caret {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.7em;
  transition: transform var(--motion-fast);
}

.dropdown-toggle[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.dropdown-content li {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border-color);
  list-style: none;
}

.dropdown-content li:last-child {
  border-bottom: none;
}

.dropdown-content li:first-child a {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-content li:last-child a {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-content a {
  color: var(--text-color);
  padding: 0.85rem 1.25rem;
  display: block;
  transition: background-color var(--motion-fast), color var(--motion-fast);
  font-size: 0.95rem;
  font-weight: 600;
}

.dropdown-content a:hover {
  background-color: var(--tint-soft);
  color: var(--primary-ink);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/background.png") center/cover no-repeat;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    var(--scrim-top) 0%,
    var(--scrim-mid) 45%,
    var(--scrim-bottom) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
  padding: var(--space-6) var(--space-5) var(--space-7);
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.8s ease forwards 0.15s;
}

@keyframes heroIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.hero-brand img {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.hero-brand span {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  margin-bottom: var(--space-3);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero .hero-lead {
  font-size: 1.15rem;
  margin-bottom: 1.75rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.server-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.server-status .status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  max-width: 22rem;
  line-height: 1.3;
  text-align: left;
}

.status-pill-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.status-pill-partial {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.status-pill-testing {
  background: var(--info-bg);
  color: var(--info-ink);
}

.status-pill-off {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.hero .server-status .status-pill-ok {
  background: rgba(69, 191, 160, 0.28);
  color: #d8f5e3;
}

.hero .server-status .status-pill-partial {
  background: rgba(224, 160, 69, 0.35);
  color: #ffe9b8;
}

.hero .server-status .status-pill-testing {
  background: rgba(56, 139, 253, 0.32);
  color: #c8e1ff;
}

.hero .server-status .status-pill-off {
  background: rgba(226, 106, 96, 0.35);
  color: #ffd0cc;
}

.server-uptime {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
}

.hero .server-uptime {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.server-ip {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.65rem var(--space-4);
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Buttons — one implementation, variants on top
   ========================================================================== */

.btn,
.submit-btn,
.copy-ip,
.map-info-close,
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding: 0.7rem 1.15rem;
  background-color: var(--primary-color);
  color: var(--on-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color var(--motion-fast), transform var(--motion-fast);
}

.btn {
  margin: var(--space-2);
}

.btn:hover,
.submit-btn:hover,
.map-info-close:hover,
.social-links a:hover {
  background-color: var(--primary-dark);
  color: var(--on-primary);
}

.btn-primary,
.copy-ip {
  background-color: var(--accent-color);
  color: var(--on-accent);
}

.btn-primary:hover,
.copy-ip:hover {
  background-color: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--primary-ink);
}

.btn-secondary:hover {
  background-color: var(--background-color);
  color: var(--primary-ink);
}

.copy-ip.is-copied {
  background: var(--secondary-color);
  color: var(--on-primary);
}

/* ==========================================================================
   Home: features & plugin cards
   ========================================================================== */

.features {
  padding: var(--space-8) var(--space-6);
  max-width: var(--measure-wide);
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--primary-ink);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-5);
}

.plugin-card {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--motion-slow), box-shadow var(--motion-slow);
  border: 1px solid var(--border-color);
  position: relative;
  padding-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
}

.plugin-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.plugin-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.plugin-card h3 {
  padding: var(--space-4) var(--space-4) 0.35rem;
  color: var(--primary-ink);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.plugin-card p {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--text-muted);
  flex-grow: 1;
}

.plugin-card .btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  border-radius: 0;
  text-align: center;
}

.join-us {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--on-primary);
  text-align: center;
  padding: var(--space-7) var(--space-6);
}

.join-us h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: var(--space-3);
}

.join-us p {
  max-width: 36rem;
  margin: 0 auto;
  opacity: 0.92;
}

.cta-buttons {
  margin-top: 1.75rem;
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Closing line under the plugin grid on the home page. */
.features-note {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background-color: var(--footer-bg);
  color: #E4EDEA;
  padding: 1.25rem var(--space-6);
  flex-shrink: 0;
  margin-top: auto;
}

.footer-bottom {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
}

.footer-bottom a {
  color: var(--accent-color);
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

.footer-bottom p {
  margin: 0;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary-ink);
  font-size: 1.75rem;
  cursor: pointer;
  min-height: var(--tap-target);
  min-width: var(--tap-target);
  line-height: 1;
}

@media (max-width: 768px) {
  .main-nav {
    position: relative;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--surface);
    position: absolute;
    top: calc(100% + var(--space-3));
    left: 0;
    padding: var(--space-4) 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    z-index: 999;
    gap: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    text-align: center;
    width: 100%;
  }

  .nav-links > li > a,
  .dropdown-toggle {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
  }

  .nav-links > li > a::after {
    display: none;
  }

  .nav-tools {
    justify-content: center;
    margin: var(--space-2) 0 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .dropdown-content {
    position: static;
    transform: none;
    padding-top: 0;
    box-shadow: none;
    border: none;
    background-color: transparent;
    animation: none;
  }

  .dropdown-content::before {
    display: none;
  }

  .dropdown-content li:first-child a,
  .dropdown-content li:last-child a {
    border-radius: 0;
  }

  .dropdown-content a {
    color: var(--text-muted);
  }

  .hero-brand img {
    height: 48px;
  }

  .server-info,
  .hero-cta,
  .cta-buttons {
    flex-direction: column;
  }

  .plugins-header h1,
  .plugin-header h1 {
    font-size: 1.9rem;
  }
}

/* ==========================================================================
   Join / membership / play
   ========================================================================== */

.join-section {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: var(--space-6);
}

.join-section h1 {
  text-align: center;
  color: var(--primary-ink);
  margin-bottom: var(--space-6);
}

.intro-text {
  text-align: center;
  font-size: 1.15rem;
  margin-bottom: var(--space-7);
  color: var(--text-muted);
}

/* Shared surface-card look. */
.play-guide,
.play-page section,
.membership-card,
.costs-section,
.community-section,
.terms-content {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.play-guide {
  padding: var(--space-6);
  margin-bottom: 2.5rem;
}

.play-guide h2,
.play-page h2,
.membership-card h2,
.costs-section h2,
.community-section h2 {
  color: var(--primary-ink);
  margin-bottom: var(--space-4);
}

.play-guide .server-info {
  margin: var(--space-4) 0 var(--space-5);
  justify-content: center;
}

.play-page {
  max-width: var(--measure-text);
  margin: 0 auto;
  padding: var(--space-6);
}

.play-page h1 {
  text-align: center;
  color: var(--primary-ink);
  margin-bottom: var(--space-4);
}

.play-page .lead {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: var(--space-6);
}

.play-page section {
  padding: 1.75rem var(--space-6);
  margin-bottom: var(--space-5);
}

.play-page ol,
.play-page ul {
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
}

.play-page li {
  margin-bottom: 0.65rem;
}

.play-page .server-info {
  justify-content: center;
  margin: var(--space-4) 0;
}

.play-page .cta-buttons,
.hero-cta + .cta-buttons {
  margin-top: var(--space-6);
}

code {
  background: var(--tint-soft);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: var(--primary-ink);
  font-size: 0.92em;
}

.membership-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.membership-card {
  padding: var(--space-6);
  text-align: center;
}

.membership-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-6);
  text-align: left;
}

.support-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.costs-section,
.community-section {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.costs-section ul {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0;
}

.community-section {
  text-align: center;
}

.support-intro {
  margin-bottom: var(--space-6);
  text-align: center;
}

.support-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.tier {
  background: var(--surface-sunken);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: left;
}

.tier h3 {
  color: var(--primary-ink);
  margin-bottom: var(--space-4);
  font-size: 1.15rem;
}

.tier ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tier ul li {
  font-size: 0.95rem;
}

/* One list-marker language: an arrow for "what you get", a dot for plain lists. */
.membership-card ul li {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
  position: relative;
}

.membership-card ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary-ink);
}

.costs-section ul li,
.tier ul li,
.terms-content ul li {
  margin-bottom: var(--space-2);
  padding-left: var(--space-5);
  position: relative;
}

.costs-section ul li::before,
.tier ul li::before,
.terms-content ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-ink);
}

/* ==========================================================================
   Terms
   ========================================================================== */

.terms-section {
  max-width: var(--measure-narrow);
  margin: 0 auto;
  padding: var(--space-6);
}

.terms-section h1 {
  color: var(--primary-ink);
  margin-bottom: var(--space-4);
  text-align: center;
}

.last-updated {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  font-size: 0.9rem;
}

.terms-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  font-style: italic;
}

.terms-content {
  padding: var(--space-6);
}

.terms-content h2 {
  color: var(--primary-ink);
  margin: var(--space-6) 0 var(--space-4);
  font-size: 1.25rem;
}

.terms-content h2:first-child {
  margin-top: 0;
}

.terms-content p {
  margin-bottom: var(--space-4);
}

.terms-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: var(--space-5);
}

.terms-content a {
  color: var(--primary-ink);
  text-decoration: underline;
}

/* Error page: .text-danger came from the Bootstrap scaffold and had no styling. */
.text-danger {
  color: var(--danger-ink);
  font-weight: 600;
}

@media (max-width: 768px) {
  .join-section,
  .terms-section,
  .play-page {
    padding: var(--space-4);
  }

  .membership-options,
  .support-tiers {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Respect a reduced-motion preference
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0.01ms;
    --motion-slow: 0.01ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-content {
    opacity: 1;
    transform: none;
  }

  .plugin-card:hover {
    transform: none;
  }
}
