/*
 * OrbitBlock - Minecraft pixel GUI design system (web-visual-identity).
 *
 * - Every colour is a palette token defined ONCE in :root (the Minecraft chat colours of the
 *   server MOTD, the colours of the server icon, black, the GUI grays and the error red).
 *   No colour literal appears anywhere else in this file.
 * - Text uses Monocraft (SIL OFL 1.1, served from /fonts/) with the Minecraft text shadow:
 *   the text colour at one quarter brightness, one font pixel (2px) down and right.
 * - Everything sits on a 2px pixel grid: no rounded corner, blur, glass or gradient.
 * - Components: .mc-button .mc-panel .mc-tooltip .mc-input .mc-xpbar .mc-toast .mc-tab .mc-slot
 *   and the chat colour classes .c-aqua, .c-gold ... The legacy class names of the first site
 *   (.btn, .glass-panel, ...) are kept as aliases until web-frontend rewrites the pages.
 */

@font-face {
  font-family: "Monocraft";
  src: url("/fonts/Monocraft.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Monocraft";
  src: url("/fonts/Monocraft-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Minecraft chat colours of the MOTD */
  --aqua: #55FFFF;
  --dark-aqua: #00AAAA;
  --dark-gray: #555555;
  --gray: #AAAAAA;
  --white: #FFFFFF;
  --green: #55FF55;
  --dark-green: #00AA00;
  --gold: #FFAA00;
  --yellow: #FFFF55;
  --light-purple: #FF55FF;

  /* Colours of the server icon: space, nebula, grass, teal, dirt, sand */
  --space-1: #050922;
  --space-2: #080F33;
  --space-3: #141646;
  --space-4: #192253;
  --nebula-1: #290F4B;
  --nebula-2: #391F60;
  --grass: #46C18C;
  --teal: #327572;
  --dirt: #9D7B3F;
  --dirt-dark: #513C38;
  --sand: #E6D380;

  /* Black, Minecraft GUI grays and error red */
  --black: #000000;
  --gui-c6: #C6C6C6;
  --gui-a0: #A0A0A0;
  --gui-8b: #8B8B8B;
  --gui-6f: #6F6F6F;
  --gui-37: #373737;
  --red: #FF5555;

  /* The pixel grid: one Monocraft font pixel */
  --px: 2px;
  --text-shadow: var(--px) var(--px) 0 color-mix(in srgb, currentColor 25%, var(--black));

  --font-main: "Monocraft", monospace;
  --font-mono: "Monocraft", monospace;

  /* Semantic aliases (no colour literals) */
  --bg-deep: var(--space-1);
  --bg-surface: var(--space-2);
  --bg-surface-elevated: var(--space-3);

  /*
   * Readable text (web-ux-fixes AC-506): every text colour is a token --on-<surface>[-<role>]
   * defined ONCE here, next to the surface it is drawn on. WebContrastTest measures each pair
   * (WCAG 2.1) and fails below 4.5:1 (3:1 for tokens ending in -large, which are only used by
   * text of 24px or more, or 18.66px or more in bold). A rule never sets `color` with a raw
   * palette colour: it picks one of these tokens.
   *
   * Surfaces. --surface-space is the LIGHTEST dark surface a text sits on (the raised table
   * header), so a token measured on it also holds on the darker space-1 / space-2 / space-3.
   */
  --surface-panel: var(--gui-c6);
  --surface-space: var(--space-4);
  --surface-stone: var(--gui-37);
  --surface-stone-light: var(--gui-6f);
  --surface-input: var(--black);
  --surface-slot: var(--gui-8b);
  --surface-grass: var(--grass);
  --surface-gold: var(--gold);

  /* Light inventory panel: dark text only, never a chat accent colour */
  --on-panel: var(--gui-37);
  --on-panel-strong: var(--black);

  /* Dark space surfaces (page, cards, telemetry slots, badges, tooltips, tables) */
  --on-space: var(--white);
  --on-space-muted: var(--gray);
  --on-space-dim: var(--gui-a0);
  --on-space-aqua: var(--aqua);
  --on-space-dark-aqua: var(--dark-aqua);
  --on-space-yellow: var(--yellow);
  --on-space-gold: var(--gold);
  --on-space-green: var(--green);
  --on-space-purple: var(--light-purple);
  --on-space-red: var(--red);

  /* Gray stone: header, tabs, menu items, toasts */
  --on-stone: var(--white);
  --on-stone-muted: var(--gray);
  --on-stone-hover: var(--yellow);
  --on-stone-active: var(--aqua);
  --on-stone-brand-large: var(--dark-aqua);

  /* Stone-light: buttons and the modal close button */
  --on-stone-light: var(--white);
  --on-stone-light-hover: var(--yellow);

  /* Text input, inventory slot and the bright button fills */
  --on-input: var(--white);
  --on-input-placeholder: var(--gui-a0);
  --on-slot: var(--black);
  --on-grass: var(--space-1);
  --on-gold: var(--space-1);

  /* Legacy names of the first site, kept as aliases of the tokens above */
  --text-main: var(--on-space);
  --text-muted: var(--on-space-muted);
  --text-dim: var(--on-space-dim);
  --color-primary: var(--on-space-aqua);
  --color-secondary: var(--on-space-purple);
  --color-gold: var(--on-space-gold);
  --color-success: var(--on-space-green);
  --color-danger: var(--on-space-red);
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-shadow: var(--text-shadow);
}

html {
  font-size: 16px;
}

body {
  background-color: var(--space-1);
  color: var(--on-space);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: none;
  text-rendering: optimizeSpeed;
}

/* Space background: pixel stars and nebula blocks of the icon colours */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  text-shadow: none;
}

body::before {
  width: 2px;
  height: 2px;
  background: var(--white);
  box-shadow:
    6vw 12vh 0 var(--white), 14vw 62vh 0 var(--aqua), 21vw 28vh 0 var(--white),
    27vw 84vh 0 var(--sand), 34vw 8vh 0 var(--aqua), 41vw 47vh 0 var(--white),
    48vw 92vh 0 var(--white), 55vw 19vh 0 var(--sand), 62vw 70vh 0 var(--aqua),
    69vw 36vh 0 var(--white), 76vw 88vh 0 var(--white), 82vw 6vh 0 var(--aqua),
    88vw 54vh 0 var(--sand), 94vw 24vh 0 var(--white), 97vw 76vh 0 var(--white),
    9vw 94vh 0 var(--aqua), 45vw 14vh 0 var(--white), 73vw 58vh 0 var(--sand);
}

body::after {
  width: 16px;
  height: 16px;
  background: var(--nebula-1);
  box-shadow:
    11vw 18vh 0 var(--nebula-1), 11vw 18vh 0 var(--nebula-2), 13vw 20vh 0 var(--nebula-2),
    78vw 66vh 0 var(--nebula-1), 80vw 68vh 0 var(--nebula-2), 82vw 66vh 0 var(--nebula-1),
    58vw 40vh 0 var(--space-3), 60vw 42vh 0 var(--space-4);
}

a {
  color: var(--on-space-aqua);
}

a:hover {
  color: var(--on-space-yellow);
}

b, strong, h1, h2, h3, h4, h5, h6, th {
  font-weight: 700;
}

img, svg, canvas, video {
  image-rendering: pixelated;
}

svg {
  shape-rendering: crispEdges;
}

/* Pixel icons (SVG sprite, 16x16 grid) */
.icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-lg {
  width: 32px;
  height: 32px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus shows the same white outline as hover, never removed */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
::-webkit-scrollbar-track {
  background: var(--black);
}
::-webkit-scrollbar-thumb {
  background: var(--gui-6f);
  box-shadow: inset 2px 2px 0 var(--gui-a0), inset -2px -2px 0 var(--gui-37);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gui-8b);
}

/* ---------- Chat colour classes (Minecraft colour codes) ---------- */

/* Dark surfaces only: on a light panel the rules further down turn them dark. Dark gray (#555)
   is below 4.5:1 on every surface, so the class reads as the dim gray of the same family. */
.c-aqua { color: var(--on-space-aqua); }
.c-dark-aqua { color: var(--on-space-dark-aqua); }
.c-dark-gray { color: var(--on-space-dim); }
.c-gray { color: var(--on-space-muted); }
.c-white { color: var(--on-space); }
.c-green { color: var(--on-space-green); }
.c-gold { color: var(--on-space-gold); }
.c-yellow { color: var(--on-space-yellow); }
.c-light-purple { color: var(--on-space-purple); }
.c-red { color: var(--on-space-red); }
.c-bold { font-weight: 700; }

/* ---------- Button: stone bevel, black outline ---------- */

.mc-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  background: var(--surface-stone-light);
  color: var(--on-stone-light);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  outline: 2px solid var(--black);
  outline-offset: 0;
  box-shadow: inset 2px 2px 0 var(--gui-a0), inset -2px -2px 0 var(--gui-37);
}

.mc-button:hover,
.mc-button:focus-visible,
.btn:hover,
.btn:focus-visible {
  outline-color: var(--white);
  outline-offset: 0;
  color: var(--on-stone-light-hover);
}

.mc-button:active,
.btn:active {
  padding: 10px 16px 6px;
  box-shadow: inset 2px 2px 0 var(--gui-37), inset -2px -2px 0 var(--gui-a0);
}

.mc-button:disabled,
.mc-button[aria-disabled="true"],
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--surface-stone);
  color: var(--on-stone-muted);
  cursor: not-allowed;
  outline-color: var(--black);
  padding: 8px 16px;
  box-shadow: inset 2px 2px 0 var(--gui-6f), inset -2px -2px 0 var(--space-1);
}

/* Variants keep the dark text: white on a bright fill would not be readable */
.mc-button--green,
.btn-primary {
  background: var(--surface-grass);
  color: var(--on-grass);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--green), inset -2px -2px 0 var(--teal);
}
.mc-button--green:hover,
.mc-button--green:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--on-grass);
}
.mc-button--green:active,
.btn-primary:active {
  box-shadow: inset 2px 2px 0 var(--teal), inset -2px -2px 0 var(--green);
}

.mc-button--gold,
.btn-gold {
  background: var(--surface-gold);
  color: var(--on-gold);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--yellow), inset -2px -2px 0 var(--dirt);
}
.mc-button--gold:hover,
.mc-button--gold:focus-visible,
.btn-gold:hover,
.btn-gold:focus-visible {
  color: var(--on-gold);
}
.mc-button--gold:active,
.btn-gold:active {
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--yellow);
}

.btn-outline {
  background: var(--space-3);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}
.btn-outline:active {
  box-shadow: inset 2px 2px 0 var(--space-2), inset -2px -2px 0 var(--space-4);
}

.mc-button--small,
.btn-sm {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
}

/* Icon-only button: the page gives it an accessible name (aria-label) */
.mc-button--icon {
  width: 40px;
  padding: 8px;
}

/* ---------- Panel: the inventory window ---------- */

.mc-panel {
  background: var(--gui-c6);
  color: var(--on-panel);
  padding: 24px;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--white), inset -2px -2px 0 var(--dark-gray);
}

.mc-panel,
.mc-panel * {
  text-shadow: none;
}

/*
 * Every text colour on the light panel comes from the "on-space" tokens (labels, footers, values, badges). Inside a
 * light panel those tokens are redefined to dark colours (navy #141646, dark gray, black), each at 6.9:1 or more on #C6C6C6,
 * so no component can put pale text on it, whatever class it uses.
 */
.mc-panel:not(.mc-panel--dark) {
  --on-space: var(--on-panel-strong);
  --on-space-muted: var(--on-panel);
  --on-space-dim: var(--on-panel);
  --on-space-aqua: var(--space-3);
  --on-space-dark-aqua: var(--space-3);
  --on-space-yellow: var(--on-panel-strong);
  --on-space-gold: var(--on-panel-strong);
  --on-space-green: var(--on-panel-strong);
  --on-space-purple: var(--on-panel-strong);
  --on-space-red: var(--on-panel-strong);
  --text-main: var(--on-panel-strong);
  --text-muted: var(--on-panel);
  --text-dim: var(--on-panel);
}

/*
 * The light panel carries dark text only. The chat accent colours (aqua, yellow, green, gold,
 * light purple, gray) are for dark surfaces: any utility colour class or link that lands on a
 * light panel turns dark. Buttons and badges keep the colours of their own dark surface.
 */
.mc-panel:not(.mc-panel--dark) a:not(.mc-button),
.mc-panel:not(.mc-panel--dark) .c-aqua,
.mc-panel:not(.mc-panel--dark) .c-gray,
.mc-panel:not(.mc-panel--dark) .c-green,
.mc-panel:not(.mc-panel--dark) .c-gold,
.mc-panel:not(.mc-panel--dark) .c-yellow,
.mc-panel:not(.mc-panel--dark) .c-light-purple,
.mc-panel:not(.mc-panel--dark) .text-orbit,
.mc-panel:not(.mc-panel--dark) .text-gold,
.mc-panel:not(.mc-panel--dark) .text-green,
.mc-panel:not(.mc-panel--dark) .text-yellow,
.mc-panel:not(.mc-panel--dark) .text-muted {
  color: var(--on-panel-strong);
}

.mc-panel:not(.mc-panel--dark) .c-white,
.mc-panel:not(.mc-panel--dark) .c-dark-aqua,
.mc-panel:not(.mc-panel--dark) .c-dark-gray,
.mc-panel:not(.mc-panel--dark) .text-white,
.mc-panel:not(.mc-panel--dark) .text-block {
  color: var(--on-panel);
}

.auth-gate-panel .gate-title {
  color: var(--on-panel-strong);
}

.auth-gate-panel .gate-desc {
  color: var(--on-panel);
}

/* Dark variant of the window, built from the icon's space colours */
.mc-panel--dark,
.glass-panel,
.feature-card,
.modal-card,
.stat-box {
  background: var(--space-3);
  color: var(--on-space);
  padding: 24px;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}

.mc-panel--dark,
.mc-panel--dark * {
  text-shadow: var(--text-shadow);
}

/* Buttons keep a crisp label even inside a dark panel */
.mc-panel--dark .mc-button,
.mc-panel--dark .mc-button * {
  text-shadow: none;
}

/* ---------- Tooltip: the item tooltip ---------- */

.mc-tooltip {
  display: inline-block;
  max-width: 320px;
  padding: 8px 12px;
  background: var(--space-1);
  color: var(--on-space);
  font-size: 12px;
  border: 2px solid var(--nebula-2);
  outline: 2px solid var(--space-1);
  box-shadow: inset 0 0 0 2px var(--nebula-1);
}

.mc-tooltip__title {
  display: block;
  color: var(--on-space-aqua);
  font-weight: 700;
}

/* ---------- Text input ---------- */

.mc-input,
.wiki-search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface-input);
  color: var(--on-input);
  font-family: var(--font-main);
  font-size: 16px;
  border: 0;
  outline: 2px solid var(--gui-a0);
  outline-offset: 0;
}

.mc-input::placeholder,
.wiki-search-input::placeholder {
  color: var(--on-input-placeholder);
  opacity: 1;
}

.mc-input:hover,
.mc-input:focus,
.mc-input:focus-visible,
.wiki-search-input:hover,
.wiki-search-input:focus,
.wiki-search-input:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 0;
}

/* ---------- Experience bar ---------- */

.mc-xpbar,
.progress-bar-container {
  width: 100%;
  height: 12px;
  margin: 12px 0 8px;
  background: var(--black);
  outline: 2px solid var(--gui-37);
  overflow: hidden;
}

.mc-xpbar__fill,
.progress-fill {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--green);
  box-shadow: inset 0 2px 0 var(--yellow), inset 0 -2px 0 var(--grass);
}

/* ---------- Toast: the advancement toast ---------- */

.mc-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--gui-37);
  color: var(--on-stone);
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--dirt-dark);
}

.mc-toast__title {
  display: block;
  color: var(--on-space-yellow);
  font-weight: 700;
}

/* Error red is below 4.5:1 on the gray stone, so the error toast sits on the dark space colour */
.mc-toast--error {
  background: var(--space-1);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--space-2);
}

.mc-toast--error .mc-toast__title {
  color: var(--on-space-red);
}

/* ---------- Tab: the creative inventory tab ---------- */

.mc-tab,
.nav-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-stone);
  color: var(--on-stone-muted);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--gui-6f), inset -2px -2px 0 var(--space-1);
}

.mc-tab:hover,
.mc-tab:focus-visible,
.nav-item a:hover,
.nav-item a:focus-visible {
  outline-color: var(--white);
  color: var(--on-stone-hover);
}

.mc-tab[aria-selected="true"],
.mc-tab.active,
.nav-item.active a {
  background: var(--surface-panel);
  color: var(--on-panel);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--white), inset -2px -2px 0 var(--dark-gray);
}

/* ---------- Slot: the inventory slot ---------- */

.mc-slot,
.feature-icon,
.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--surface-slot);
  color: var(--on-slot);
  overflow: hidden;
  box-shadow: inset 2px 2px 0 var(--gui-37), inset -2px -2px 0 var(--white);
}

/* The coloured feature icons sit on the dark space colour: an accent icon on the gray slot is under 3:1 */
.feature-icon {
  margin-bottom: 16px;
  background: var(--space-1);
  color: var(--on-space);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}

.profile-avatar {
  width: 80px;
  height: 80px;
}

.profile-avatar svg {
  width: 100%;
  height: 100%;
}

/* ---------- Layout: header and navigation ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gui-37);
  border-bottom: 2px solid var(--black);
  box-shadow: inset 0 2px 0 var(--gui-6f), inset 0 -2px 0 var(--space-1);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--space-1);
  color: var(--on-space-aqua);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}

.brand-icon-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  display: block;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-orbit,
.text-orbit {
  color: var(--on-space-aqua);
}

/* Dark aqua is 4.2:1 on the gray header: allowed only because the brand title is 20px bold (large text) */
.brand-block {
  color: var(--on-stone-brand-large);
  font-size: 20px;
  font-weight: 700;
}

.text-block {
  color: var(--on-space-dark-aqua);
}

.text-white {
  color: var(--on-space);
}

.text-gold {
  color: var(--on-space-gold);
}

.text-green {
  color: var(--on-space-green);
}

.text-yellow {
  color: var(--on-space-yellow);
}

.text-muted {
  color: var(--on-space-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-action-btn,
.app-header .mc-button--icon {
  height: 36px;
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--space-1);
  color: var(--on-space-aqua);
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}

.header-action-btn:hover,
.app-header .mc-button--icon:hover,
.header-action-btn:focus-visible,
.app-header .mc-button--icon:focus-visible {
  outline-color: var(--white);
  color: var(--on-space-yellow);
}

.header-login-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--space-3);
  color: var(--on-space-aqua);
  font-size: 13px;
  font-weight: 700;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-1);
}

.header-login-btn:hover,
.header-login-btn:focus-visible {
  outline-color: var(--white);
  color: var(--on-space-yellow);
  background: var(--space-4);
}

@keyframes pulse-dot {
  0% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ---------- Page views ---------- */

.page-view {
  display: none;
  opacity: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-view.active {
  display: block;
  opacity: 1;
}

.hero {
  text-align: center;
  padding: 64px 16px 48px;
  position: relative;
}

.hero-tag {
  display: inline-block;
  padding: 4px 16px;
  background: var(--nebula-1);
  color: var(--on-space-purple);
  font-size: 12px;
  margin-bottom: 20px;
  text-transform: uppercase;
  outline: 2px solid var(--nebula-2);
}

.hero-title {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--on-space-aqua);
}

.hero-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--on-space-muted);
  max-width: 720px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.grid-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--on-space-yellow);
}

.feature-desc {
  font-size: 14px;
  color: var(--on-space-muted);
}

/* ---------- Dashboard ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 960px) {
  .col-span-8, .col-span-6, .col-span-4 {
    grid-column: span 12;
  }
}

.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.profile-details h2 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-email {
  font-size: 12px;
  color: var(--on-space-dim);
}

.spec-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--black);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  outline: 2px solid currentColor;
}
.spec-badge.met { color: var(--on-space-muted); }
.spec-badge.ene { color: var(--on-space-yellow); }
.spec-badge.qui { color: var(--on-space-dark-aqua); }
.spec-badge.agr { color: var(--on-space-green); }
.spec-badge.mec { color: var(--on-space-gold); }

.stat-box {
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--on-space-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--on-space);
}
.stat-value.gold { color: var(--on-space-gold); }
.stat-value.cyan { color: var(--on-space-aqua); }

/* ---------- Wiki ---------- */

.wiki-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  margin-top: 24px;
}

@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }
}

.wiki-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 4px 8px 4px 4px;
}

.wiki-search-box {
  position: relative;
  margin-bottom: 20px;
}

.wiki-search-input {
  padding-left: 40px;
  font-size: 14px;
}

.wiki-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-space-dim);
}

.wiki-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiki-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-stone);
  color: var(--on-stone-muted);
  font-size: 14px;
  cursor: pointer;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--gui-6f), inset -2px -2px 0 var(--space-1);
}

.wiki-menu-item:hover,
.wiki-menu-item:focus-visible {
  outline-color: var(--white);
  color: var(--on-stone-hover);
}

.wiki-menu-item.active {
  background: var(--gui-c6);
  color: var(--on-panel);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--white), inset -2px -2px 0 var(--dark-gray);
}

.wiki-content-card {
  margin-bottom: 32px;
}

.wiki-content-card h2 {
  font-size: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--space-4);
  padding-bottom: 12px;
  color: var(--on-space-yellow);
}

.wiki-content-card h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--on-space-aqua);
}

.wiki-content-card p,
.wiki-content-card li {
  color: var(--on-space);
  font-size: 14px;
  line-height: 1.75;
}

.wiki-content-card ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.wiki-table-container {
  overflow-x: auto;
  margin: 16px 0;
  outline: 2px solid var(--black);
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.wiki-table th {
  background: var(--space-4);
  padding: 12px 16px;
  color: var(--on-space-yellow);
  border-bottom: 2px solid var(--black);
}

.wiki-table td {
  padding: 12px 16px;
  border-bottom: 2px solid var(--space-4);
  color: var(--on-space-muted);
}

.wiki-table tr:hover td {
  background: var(--space-2);
  color: var(--on-space);
}

/* ---------- Mobile navigation ---------- */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--gui-37);
  border-top: 2px solid var(--black);
  box-shadow: inset 0 2px 0 var(--gui-6f);
  z-index: 1000;
  align-items: center;
  justify-content: space-around;
}

@media (max-width: 768px) {
  .app-header .nav-links {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  body {
    padding-bottom: 64px;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--on-stone-muted);
  text-decoration: none;
  font-size: 10px;
  cursor: pointer;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus-visible {
  outline: 2px solid var(--white);
  color: var(--on-stone-hover);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

.mobile-nav-item.active {
  color: var(--on-stone-active);
}

/* ---------- Modals ---------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay .modal-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 32px;
  min-height: 32px;
  background: var(--surface-stone-light);
  color: var(--on-stone-light);
  font-family: var(--font-main);
  font-size: 16px;
  border: 0;
  outline: 2px solid var(--black);
  cursor: pointer;
  box-shadow: inset 2px 2px 0 var(--gui-a0), inset -2px -2px 0 var(--gui-37);
}

.modal-close:hover,
.modal-close:focus-visible {
  outline-color: var(--white);
  color: var(--on-stone-light-hover);
}

/* ---------- Auth Gate & Shell Utilities ---------- */

.app-main {
  min-height: calc(100vh - 140px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--on-space-yellow);
  letter-spacing: 2px;
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-logout-btn {
  padding: 6px 8px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.auth-gate-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  min-height: 60vh;
}

.auth-gate-panel {
  max-width: 580px;
  width: 100%;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--space-1);
  color: var(--on-space-gold);
  font-size: 11px;
  outline: 2px solid var(--black);
}

/* The auth gate sits on a light panel: its text colours are in the .auth-gate-panel rules above */
.gate-title {
  font-size: 26px;
  margin-top: 8px;
}

.gate-desc {
  font-size: 14px;
  line-height: 1.6;
  max-width: 480px;
}

.gate-actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--black);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-space-aqua);
}

.modal-title {
  font-size: 20px;
  color: var(--on-space-aqua);
}

.modal-desc {
  font-size: 14px;
  color: var(--on-space);
  line-height: 1.5;
  margin-bottom: 24px;
}

.google-btn-slot,
.google-btn-slot * {
  text-shadow: none !important;
}

.google-btn-slot {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  min-height: 44px;
}

.modal-info-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--space-2);
  color: var(--on-space-green);
  font-size: 11px;
  outline: 2px solid var(--black);
}

/*
 * Readable typography & contrast: remove text-shadow from small/body text, tables, labels,
 * inputs, badges, and cards to prevent doubled/blurred letters ("dois textos pretos"),
 * while keeping crisp pixel shadows on big titles against space backgrounds.
 */
p, span, label, small, li, td, th, input, textarea, code,
.metric-label, .metric-footer, .view-subtitle, .feature-desc, .feature-body,
.gate-desc, .modal-desc, .access-badge, .specialty-badge,
.mc-button, .mc-tab, .toast-desc, .table-cell,
.instructions-list, .instructions-list li, .pix-helper-note, .pix-helper-note p,
.telemetry-label, .telemetry-value, .hall-members, .hall-members-list,
.phase-stats-sub, .ranking-counter-badge, .stat-label, .blocks-heading,
.block-tag, .no-guild-desc, .empty-invites-text, .empty-text, .member-name-cell {
  text-shadow: none;
}

/* ---------- View Layout & High-Contrast Station Panels ---------- */

.view-home,
.view-status,
.view-rankings,
.view-market,
.view-wiki,
.view-account,
.view-subscription,
.view-guild,
.view-quests,
.view-link {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.view-header {
  margin-bottom: 28px;
  max-width: 860px;
}

.view-title-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--space-1);
  color: var(--on-space-dark-aqua);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
  outline: 2px solid var(--black);
}

.view-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--on-space-aqua);
  margin-bottom: 8px;
  line-height: 1.25;
}

.view-subtitle {
  font-size: 14px;
  color: var(--on-space-muted);
  line-height: 1.6;
  max-width: 720px;
}

/* Card Wrapping & Line Breaking Protection */
.mc-panel,
.mc-panel--dark,
.profile-card,
.metric-card,
.phase-progress-panel,
.milestone-panel,
.hall-of-fame-card,
.ranking-table-card,
.market-board-card,
.history-panel,
.no-guild-panel,
.invites-card,
.guild-summary-card,
.members-card,
.movements-card,
.quest-card,
.pix-card,
.link-code-card,
.phase-card,
.specialty-card,
.commands-guide-panel,
.feature-panel,
.telemetry-bar {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

/* Telemetry Bar (Home) */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px;
  margin-bottom: 36px;
}

.telemetry-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.telemetry-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--on-space-dark-aqua);
  font-weight: 700;
}

.telemetry-value {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Account Navigation */
.account-subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Metric Telemetry Grids */
.account-metrics-grid,
.status-metric-grid,
.market-summary-grid,
.quests-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  min-width: 0;
}

.metric-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--on-space-aqua);
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0;
  word-break: break-all;
}

.metric-unit {
  font-size: 14px;
  color: var(--on-space-gold);
}

.metric-sub {
  font-size: 14px;
  color: var(--on-space-muted);
}

.metric-footer {
  font-size: 12px;
  color: var(--on-space-muted);
  line-height: 1.4;
}

/* Profile Card */
.profile-card {
  margin-bottom: 24px;
  padding: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-avatar-box {
  width: 64px;
  height: 64px;
  background: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: block;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid var(--black);
}

.badge-active {
  background: var(--space-1);
  color: var(--on-space-green);
  box-shadow: inset 2px 2px 0 var(--teal), inset -2px -2px 0 var(--space-2);
}

.badge-pending {
  background: var(--space-1);
  color: var(--on-space-yellow);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--space-2);
}

.specialty-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--space-1);
  color: var(--on-space-gold);
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--space-2);
}

/* Phase Progress Panel */
.phase-progress-panel {
  margin-bottom: 24px;
  padding: 24px;
}

.phase-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.phase-title {
  font-size: 18px;
  font-weight: 700;
}

.phase-percent {
  font-size: 18px;
  font-weight: 700;
}

.phase-stats-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--on-space-muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* Pix Subscription Card */
.pix-card {
  max-width: 820px;
  margin: 0 auto 32px;
  padding: 28px;
}

.pix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--black);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.pix-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge-pending {
  padding: 4px 10px;
  background: var(--space-1);
  color: var(--on-space-yellow);
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--space-2);
}

.status-badge-approved {
  padding: 4px 10px;
  background: var(--space-1);
  color: var(--on-space-green);
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--teal), inset -2px -2px 0 var(--space-2);
}

.pix-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 18px;
}

.pix-amount-label {
  color: var(--on-space);
  font-weight: 700;
}

.pix-amount-value {
  font-size: 24px;
  font-weight: 700;
}

.pix-body-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 640px) {
  .pix-body-grid {
    grid-template-columns: 1fr;
  }
}

.pix-qr-box {
  padding: 16px;
  background: var(--white);
  outline: 2px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 232px;
}

.pix-qr-image {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  display: block;
}

.qr-placeholder {
  font-size: 12px;
  text-align: center;
  padding: 24px;
}

.pix-details-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.pix-copy-label {
  font-size: 12px;
  color: var(--on-space-aqua);
  font-weight: 700;
}

.pix-copy-field {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pix-input {
  flex: 1;
  min-width: 180px;
  font-size: 12px;
}

.pix-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.pix-helper-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--space-2);
  outline: 2px solid var(--black);
  font-size: 12px;
  color: var(--on-space-muted);
  line-height: 1.6;
  margin-top: 12px;
}

/* Link Code Card */
.link-code-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
}

.link-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.link-code-label {
  font-size: 12px;
  color: var(--on-space-aqua);
  font-weight: 700;
  letter-spacing: 1px;
}

.link-code-value {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--on-space-gold);
  padding: 12px 24px;
  background: var(--space-1);
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
}

.link-countdown {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.link-instructions-box {
  margin-top: 28px;
  padding: 24px;
  text-align: left;
}

.instructions-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.instructions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 20px;
}

.instructions-list li {
  font-size: 14px;
  color: var(--on-space);
  line-height: 1.6;
}

/* Launch Countdown & Masked Address */
.launch-countdown-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--space-1);
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--space-4), inset -2px -2px 0 var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.launch-countdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.launch-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  background: var(--space-3);
  color: var(--on-space-gold);
  border: 2px solid var(--gold);
}

.launch-target-text {
  font-size: 12px;
  color: var(--on-space-dim);
}

.launch-timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--on-space-aqua);
}

.launch-timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--space-2);
  padding: 6px 12px;
  border: 2px solid var(--space-4);
  min-width: 54px;
}

.launch-timer-val {
  font-size: 24px;
  line-height: 1;
  color: var(--on-space-yellow);
}

.launch-timer-lbl {
  font-size: 9px;
  color: var(--on-space-dim);
  margin-top: 4px;
  letter-spacing: 1px;
}

.launch-timer-sep {
  font-size: 20px;
  color: var(--on-space-dim);
  font-weight: 700;
}

.launch-notice-text {
  font-size: 12px;
  color: var(--on-space-dim);
  line-height: 1.5;
  max-width: 540px;
  margin: 0;
}

.server-address-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.server-address-code {
  font-size: 14px;
  padding: 3px 8px;
  background: var(--space-1);
  outline: 2px solid var(--black);
}

.server-address-masked {
  letter-spacing: 2px;
  user-select: none;
}

.tag-locked {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--red);
  color: var(--on-slot);
  letter-spacing: 0.5px;
  border: 1px solid var(--black);
}

/* Pulse dots */
.metric-value--status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse-dot,
.pulse-dot-red {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  display: inline-block;
}

.pulse-dot {
  background: var(--dark-green);
  animation: pulse-dot 2s steps(2, jump-none) infinite;
}

.pulse-dot-red {
  background: var(--red);
}

/* Appearance burst: a square shockwave and four pixel particles fly out of the dot (played with the XP sound). */
.pulse-dot::before,
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.pulse-dot--burst::before {
  background: var(--dark-green);
  animation: dot-wave 0.6s steps(5, jump-none) 1;
}

.pulse-dot--burst::after {
  width: 3px;
  height: 3px;
  inset: 3px;
  background: var(--dark-green);
  box-shadow: -9px -9px 0 var(--dark-green), 9px -9px 0 var(--dark-green),
    -9px 9px 0 var(--dark-green), 9px 9px 0 var(--dark-green);
  animation: dot-sparks 0.6s steps(5, jump-none) 1;
}

@keyframes dot-wave {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(4); }
}

@keyframes dot-sparks {
  0% { opacity: 1; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Milestone Panel (Status) */
.milestone-panel {
  padding: 24px;
  margin-bottom: 24px;
}

.milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.milestone-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.milestone-percent {
  font-size: 14px;
  font-weight: 700;
}

.milestone-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-space);
  margin-bottom: 8px;
}

.milestone-desc {
  font-size: 14px;
  color: var(--on-space-muted);
  line-height: 1.6;
  max-width: 720px;
}

/* Hall of Fame & Rankings */
.hall-of-fame-card {
  padding: 24px;
  margin-bottom: 24px;
}

.hall-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--on-space-gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.hall-guild-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hall-members {
  font-size: 13px;
  color: var(--on-space);
  line-height: 1.6;
}

.hall-members-label {
  color: var(--on-space-muted);
}

.ranking-table-card {
  padding: 24px;
  margin-bottom: 24px;
}

.ranking-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--black);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.ranking-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--on-space);
}

.ranking-counter-badge {
  font-size: 12px;
  font-weight: 700;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.mc-table th {
  background: var(--space-4);
  padding: 12px 16px;
  color: var(--on-space-yellow);
  border-bottom: 2px solid var(--black);
  font-weight: 700;
}

.mc-table td {
  padding: 12px 16px;
  border-bottom: 2px solid var(--space-4);
  color: var(--on-space);
}

.mc-table tr:hover td {
  background: var(--space-2);
}

/* Quests Grid */
.quests-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.quest-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.quest-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.quest-kind-badge {
  font-size: 11px;
  font-weight: 700;
}

.badge-claimed {
  padding: 2px 8px;
  background: var(--space-1);
  color: var(--on-space-muted);
  font-size: 10px;
  outline: 2px solid var(--black);
}

.badge-completed {
  padding: 2px 8px;
  background: var(--space-1);
  color: var(--on-space-green);
  font-size: 10px;
  outline: 2px solid var(--black);
}

.badge-progress {
  padding: 2px 8px;
  background: var(--space-1);
  color: var(--on-space-yellow);
  font-size: 10px;
  outline: 2px solid var(--black);
}

.quest-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--on-space);
}

.quest-desc {
  font-size: 13px;
  color: var(--on-space-muted);
  line-height: 1.5;
}

.quest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: auto;
}

/* Wiki Cards */
.wiki-phases-grid,
.wiki-specialties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.phase-card,
.specialty-card,
.commands-guide-panel {
  padding: 20px;
}

.phase-card-header,
.specialty-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--black);
  padding-bottom: 10px;
}

.phase-weights-bar {
  font-size: 11px;
  color: var(--on-space-muted);
  margin-bottom: 12px;
}

.blocks-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.block-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--space-1);
  color: var(--on-space-aqua);
  font-size: 11px;
  outline: 2px solid var(--black);
}

.block-tag--exclusive {
  color: var(--on-space-gold);
}

.block-tag--more {
  color: var(--on-space-muted);
}

.commands-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.command-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--space-2);
  outline: 2px solid var(--black);
}

.command-row code {
  color: var(--on-space-green);
  font-weight: 700;
  font-size: 14px;
}

.command-row span {
  color: var(--on-space);
  font-size: 13px;
  line-height: 1.5;
}

/* Feature Panels on Home */
.feature-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.feature-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.feature-heading {
  font-size: 18px;
  font-weight: 700;
}

.feature-body {
  font-size: 14px;
  color: var(--on-space-muted);
  line-height: 1.6;
}

/* Guild Cards */
.guild-summary-card {
  padding: 24px;
  margin-bottom: 24px;
}

.guild-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--black);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.guild-name-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.guild-name {
  font-size: 24px;
  font-weight: 700;
}

.guild-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.members-card,
.movements-card,
.no-guild-panel,
.invites-card {
  padding: 24px;
  margin-bottom: 24px;
}

.section-heading {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--black);
  padding-bottom: 10px;
}

.no-guild-panel {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.no-guild-title {
  font-size: 22px;
  font-weight: 700;
}

.no-guild-desc {
  font-size: 14px;
  color: var(--on-space-muted);
  line-height: 1.6;
  max-width: 600px;
}

.role-badge-leader {
  padding: 4px 10px;
  background: var(--space-1);
  color: var(--on-space-gold);
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--dirt), inset -2px -2px 0 var(--space-2);
}

.role-badge-member {
  padding: 4px 10px;
  background: var(--space-1);
  color: var(--on-space-green);
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid var(--black);
  box-shadow: inset 2px 2px 0 var(--teal), inset -2px -2px 0 var(--space-2);
}

.role-leader {
  color: var(--on-space-gold);
  font-weight: 700;
}

.role-member {
  color: var(--on-space-muted);
}

.loading-panel,
.error-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 48px 24px;
}

.error-title {
  font-size: 20px;
  color: var(--on-space-red);
  font-weight: 700;
}

.error-msg {
  font-size: 14px;
  color: var(--on-space-muted);
  line-height: 1.6;
  max-width: 540px;
}

/* ---------- Motion: pixel steps only, and none when the visitor asks for less ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Form controls inherit the Monocraft font ---------- */
button,
input,
select,
textarea {
  font-family: var(--font-main);
  font-size: inherit;
  line-height: inherit;
}

/* ---------- Wiki tabs: one horizontal row that wraps ---------- */
.wiki-tabs-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.wiki-tabs-bar .mc-tab {
  flex: 0 0 auto;
  width: auto;
}

.milestone-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--on-space);
}

/* ---------- Player head (3D, follows the cursor) ---------- */
.profile-avatar-box--head {
  width: 96px;
  height: 96px;
}

.skin-head {
  width: var(--head-size);
  height: var(--head-size);
  perspective: 320px;
}

.skin-head-turn,
.skin-cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.skin-cube--hat {
  position: absolute;
  inset: 0;
  transform: scale(var(--head-scale));
}

.skin-face {
  position: absolute;
  inset: 0;
  background-size: 800% auto;
  background-position: calc(var(--skin-x) * 1px) calc(var(--skin-y) * 1px);
  background-repeat: no-repeat;
  image-rendering: pixelated;
  backface-visibility: hidden;
  transform: var(--face-transform);
}

/* Particles that burst out of a finished counter, in the colour of its number */
.metric-value > span[id] {
  position: relative;
  display: inline-block;
}

.burst-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.burst-piece {
  position: absolute;
  width: 4px;
  height: 4px;
  background: currentColor;
}
