/* Matter World website. Dark theme, voxel motifs, no framework.
   Shared by / (fr), /en/ and /404.html. After editing, run tools/stamp_assets.py. */

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/chakra-petch-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/chakra-petch-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --bg: #0b0e13;
  --bg-elev: #11151d;
  --bg-elev-2: #181d27;
  --bg-inset: #07090d;
  --line: #242b38;
  --line-strong: #39435a;

  --text: #e9edf4;
  --text-dim: #a9b2c1;
  --text-faint: #8590a2;

  /* From the game: brick, grass, sky. */
  --accent: #ff7847;
  --accent-hover: #ff936a;
  --accent-ink: #1b0c05;
  --accent-shadow: #8c3416;
  --grass: #84c862;
  --sky: #8ab4ff;
  --sky-hover: #b6d0ff;
  --focus: #ffd166;

  --cube-brick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23ff9b6a' d='M32 4 58 18 32 32 6 18z'/%3E%3Cpath fill='%23e0643a' d='M6 18 32 32v28L6 46z'/%3E%3Cpath fill='%23a3432a' d='M32 32 58 18v28L32 60z'/%3E%3C/svg%3E");
  --cube-grass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23a3e07e' d='M32 4 58 18 32 32 6 18z'/%3E%3Cpath fill='%236fae4b' d='M6 18 32 32v28L6 46z'/%3E%3Cpath fill='%23497c31' d='M32 32 58 18v28L32 60z'/%3E%3C/svg%3E");
  --cube-steel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23b9c0cc' d='M32 4 58 18 32 32 6 18z'/%3E%3Cpath fill='%23858d9b' d='M6 18 32 32v28L6 46z'/%3E%3Cpath fill='%235b6270' d='M32 32 58 18v28L32 60z'/%3E%3C/svg%3E");
  --cube-sky: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23bcd4ff' d='M32 4 58 18 32 32 6 18z'/%3E%3Cpath fill='%237ea6ec' d='M6 18 32 32v28L6 46z'/%3E%3Cpath fill='%23557bc0' d='M32 32 58 18v28L32 60z'/%3E%3C/svg%3E");

  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 64px;
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Author display rules (grid, flex) must not reveal what the page or site.js hides. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

a {
  color: var(--sky);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--sky-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

p,
ul,
ol,
dl,
figure,
pre {
  margin: 0;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.875em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg-elev-2);
  color: var(--text);
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.7;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

pre .comment {
  color: var(--text-faint);
}

kbd {
  display: inline-block;
  min-width: 2em;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--focus);
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 22px;
  border: 2px solid transparent;
  border-radius: 6px;
  font: 700 1.0625rem/1.15 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 5px 5px 0 var(--accent-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--accent-shadow);
}

.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--accent-shadow);
}

.btn-xl {
  padding: 17px 28px;
  font-size: 1.1875rem;
}

.btn-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.btn-sub {
  font: 500 0.8125rem/1.2 var(--font-mono);
  letter-spacing: 0;
  opacity: 0.82;
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.9375rem;
  box-shadow: 3px 3px 0 var(--accent-shadow);
}

.btn-small:hover {
  box-shadow: 5px 5px 0 var(--accent-shadow);
}

.btn-small svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgb(11 14 19 / 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font: 700 1.3125rem/1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand svg {
  flex: none; /* kept at full size on a 320 px wide screen */
  width: 30px;
  height: 30px;
}

.nav-desktop ul,
.nav-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop ul {
  display: flex;
  gap: 2px;
}

.nav-desktop a,
.nav-mobile a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  font-weight: 500;
  text-decoration: none;
}

.nav-desktop a:hover,
.nav-mobile a:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.lang-switch {
  display: flex;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.lang-switch a {
  padding: 7px 10px;
  color: var(--text-dim);
  font: 700 0.8125rem/1 var(--font-display);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--text);
  background: var(--bg-elev-2);
}

.lang-switch a[aria-current] {
  background: var(--bg-elev-2);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-mobile {
  display: none;
  position: relative;
}

.nav-mobile summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font: 700 0.875rem/1 var(--font-display);
  letter-spacing: 0.06em;
  list-style: none;
  cursor: pointer;
}

.nav-mobile summary::-webkit-details-marker {
  display: none;
}

.nav-mobile summary svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.nav-mobile[open] summary {
  background: var(--bg-elev-2);
}

.nav-mobile ul {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.7);
}

.nav-mobile a {
  padding: 11px 12px;
}

@media (max-width: 1023px) {
  .nav-desktop {
    display: none;
  }

  .nav-mobile {
    display: block;
  }
}

/* Below 560 px the header has no room for this button: the hero has the same one. */
@media (max-width: 559px) {
  .header-cta {
    display: none;
  }
}

/* Narrow screens (down to 320 px): brand, language switch, menu and the account button still fit on
   one line. */
@media (max-width: 479px) {
  .header-inner {
    gap: 10px;
  }

  .brand {
    gap: 8px;
    font-size: 1.125rem;
  }

  .brand svg {
    width: 26px;
    height: 26px;
  }

  /* The menu button keeps only its icon; "Menu" stays its accessible name. */
  .nav-mobile summary {
    padding-inline: 9px;
  }

  .nav-mobile .menu-label,
  .account-dropdown [data-account-name] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* The account menu keeps only its cube; the pseudo stays its accessible name. */
  .account-dropdown summary {
    padding-inline: 9px;
  }

  .login-btn {
    padding: 7px 10px;
    font-size: 0.875rem;
  }
}

/* Below 420 px the home page brand keeps its cube; "Matter World" stays the link's name. */
@media (max-width: 419px) {
  .brand svg + span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 7vw, 96px);
}

/* The fixed grid every cube lives on. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 65% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 70% at 65% 40%, #000 25%, transparent 75%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30%;
  right: -15%;
  width: min(900px, 90vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(255 120 71 / 0.16), rgb(138 180 255 / 0.05) 55%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 20px;
  color: var(--text-dim);
  font: 700 0.8125rem/1.2 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge {
  padding: 5px 9px;
  border: 1px solid rgb(132 200 98 / 0.5);
  border-radius: 4px;
  background: rgb(132 200 98 / 0.1);
  color: var(--grass);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.25rem, 8.5vw, 6.25rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero-tagline {
  margin-top: 18px;
  color: #fff;
  font: 600 clamp(1.375rem, 2.6vw, 1.9375rem)/1.22 var(--font-display);
  max-width: 21em;
}

.hero-lead {
  margin-top: 18px;
  max-width: 34em;
  color: var(--text-dim);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 34px;
}

.release-meta {
  color: var(--text-faint);
  font-size: 0.9375rem;
}

.release-meta strong {
  color: var(--text-dim);
  font-weight: 600;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.9375rem;
}

.hero-media {
  position: relative;
}

.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-inset);
  aspect-ratio: 16 / 9;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-crop {
  aspect-ratio: 16 / 10;
}

.hero-media .frame {
  box-shadow: 0 40px 90px -40px rgb(0 0 0 / 0.9), 0 0 0 6px rgb(255 255 255 / 0.03);
}

/* Two loose cubes on the frame corners. */
.hero-media .frame-wrap {
  position: relative;
}

.hero-media .frame-wrap::before,
.hero-media .frame-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
}

.hero-media .frame-wrap::before {
  top: -8px;
  left: -8px;
  background: var(--accent);
  box-shadow: 16px 0 0 rgb(255 120 71 / 0.45), 0 16px 0 rgb(255 120 71 / 0.25);
}

.hero-media .frame-wrap::after {
  right: -8px;
  bottom: -8px;
  background: var(--grass);
  box-shadow: -16px 0 0 rgb(132 200 98 / 0.45), 0 -16px 0 rgb(132 200 98 / 0.25);
}

.hero-media figcaption {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.voxels {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.voxels i {
  position: absolute;
  display: block;
  width: 22px;
  aspect-ratio: 1;
  background: var(--cube-brick) center / contain no-repeat;
  opacity: 0.85;
  animation: drift 8s ease-in-out infinite;
}

.voxels i:nth-child(1) { top: 9%; left: 45%; width: 26px; }
.voxels i:nth-child(2) { top: 4%; right: 7%; width: 16px; background-image: var(--cube-sky); animation-delay: -2s; }
.voxels i:nth-child(3) { bottom: 9%; left: 48%; width: 14px; background-image: var(--cube-steel); animation-delay: -4s; }
.voxels i:nth-child(4) { bottom: 4%; right: 13%; width: 30px; background-image: var(--cube-grass); animation-delay: -1s; }
.voxels i:nth-child(5) { top: 30%; left: 3%; width: 12px; background-image: var(--cube-steel); animation-delay: -5s; opacity: 0.5; }
.voxels i:nth-child(6) { bottom: 24%; left: 30%; width: 10px; animation-delay: -3s; opacity: 0.5; }

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

@media (max-width: 959px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .voxels i:not(:nth-child(2)) {
    display: none;
  }
}

/* ---------- Key numbers ---------- */

.stats {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin-block: 0;
}

.stats-grid li {
  padding: 30px 24px 32px;
  border-left: 1px solid var(--line);
}

.stats-grid li:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat-value {
  display: block;
  color: var(--text);
  font: 700 clamp(1.75rem, 3.2vw, 2.5rem)/1.1 var(--font-body);
  letter-spacing: -0.01em;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (max-width: 859px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid li {
    padding: 22px 16px 24px;
  }

  .stats-grid li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .stats-grid li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 419px) {
  .stat-value {
    font-size: 1.5rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section-alt {
  border-block: 1px solid var(--line);
  background: var(--bg-elev);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent);
  font: 700 0.8125rem/1.2 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Three cubes, fading: the section marker. */
.kicker::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 24px;
  background: currentColor;
  box-shadow: 12px 0 0 rgb(255 120 71 / 0.5), 24px 0 0 rgb(255 120 71 / 0.22);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.125rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.section-intro {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 1.125rem;
}

/* ---------- Features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
}

.feature {
  padding: 28px 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  transition: border-color 0.2s ease;
}

.feature:hover {
  border-color: var(--line-strong);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgb(255 120 71 / 0.12);
  color: var(--accent);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.tone-grass .feature-icon {
  background: rgb(132 200 98 / 0.12);
  color: var(--grass);
}

.tone-sky .feature-icon {
  background: rgb(138 180 255 / 0.12);
  color: var(--sky);
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 1.3125rem;
}

.feature p {
  color: var(--text-dim);
  font-size: 1rem;
}

@media (max-width: 1023px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Spotlights ---------- */

.spotlights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(56px, 8vw, 104px);
}

.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.spotlight:nth-child(even) .spotlight-media {
  order: 2;
}

.spotlight-media .frame {
  box-shadow: 0 30px 70px -36px rgb(0 0 0 / 0.95);
}

.spotlight h3 {
  margin: 0 0 14px;
  font-size: clamp(1.625rem, 2.8vw, 2.125rem);
}

.spotlight-text > p:not(.kicker) {
  color: var(--text-dim);
}

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.facts li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
  font-size: 1rem;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--grass);
}

@media (max-width: 859px) {
  .spotlight {
    grid-template-columns: minmax(0, 1fr);
  }

  .spotlight:nth-child(even) .spotlight-media {
    order: 0;
  }
}

/* ---------- Measurements ---------- */

.perf {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.perf .section-head {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  margin-bottom: 0;
}

.perf-note {
  margin-top: 18px;
  color: var(--text-dim);
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96875rem;
}

.data-table caption {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.875rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table thead th {
  color: var(--text-faint);
  font: 700 0.75rem/1.3 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.data-table tbody th {
  color: var(--text-dim);
  font-weight: 400;
  width: 46%;
}

.data-table td {
  color: var(--text);
}

.data-table td strong {
  font-weight: 650;
}

@media (max-width: 959px) {
  .perf {
    grid-template-columns: minmax(0, 1fr);
  }

  .perf .section-head {
    position: static;
  }
}

@media (max-width: 559px) {
  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

  .data-table caption {
    padding: 14px;
  }
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 18px;
  list-style: none;
  padding: 0;
}

.gallery figure {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.shot-link {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-inset);
  aspect-ratio: 16 / 9;
  cursor: zoom-in;
}

.shot-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.shot-link:hover img {
  transform: scale(1.04);
}

.shot-link::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgb(11 14 19 / 0.78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e9edf4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 16px no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.shot-link:hover::after,
.shot-link:focus-visible::after {
  opacity: 1;
}

.gallery figcaption {
  padding-top: 12px;
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.gallery figcaption strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

@media (max-width: 1023px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 559px) {
  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Lightbox ---------- */

/* Percentages of a modal dialog refer to the viewport without its scrollbar. */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgb(4 5 8 / 0.97);
}

body:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 64px 84px 28px;
}

.lightbox-figure img {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 190px);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-inset);
}

.lightbox-figure figcaption {
  max-width: 70ch;
  margin-top: 16px;
  color: var(--text-dim);
  text-align: center;
}

.lightbox-figure figcaption strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgb(17 21 29 / 0.9);
  color: var(--text);
  cursor: pointer;
}

.lb-btn:hover {
  background: var(--bg-elev-2);
  border-color: var(--text-faint);
}

.lb-btn svg {
  width: 22px;
  height: 22px;
}

.lb-close {
  top: 12px;
  right: 12px;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev {
  left: 16px;
}

.lb-next {
  right: 16px;
}

.lb-counter {
  position: absolute;
  top: 24px;
  left: 20px;
  color: var(--text-dim);
  font: 700 0.875rem/1 var(--font-display);
  letter-spacing: 0.08em;
}

@media (max-width: 767px) {
  .lightbox-figure {
    padding: 64px 12px 92px;
  }

  .lightbox-figure img {
    max-height: calc(100dvh - 260px);
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .lb-prev {
    left: calc(50% - 60px);
  }

  .lb-next {
    right: calc(50% - 60px);
  }
}

/* ---------- How to play ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 64px);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 5px;
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--accent-shadow);
  color: var(--accent-ink);
  font: 700 1.1875rem/1 var(--font-display);
}

.steps h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.steps p {
  color: var(--text-dim);
  font-size: 1rem;
}

.steps code {
  white-space: nowrap;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.controls .data-table tbody th {
  width: 40%;
  color: var(--text);
}

.controls .data-table td {
  color: var(--text-dim);
}

.key-or {
  color: var(--text-faint);
  font-size: 0.875rem;
}

.side-stack {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 1.1875rem;
}

.panel > p {
  color: var(--text-dim);
  font-size: 1rem;
}

.panel > p + p,
.panel > p + pre,
.panel > pre + p {
  margin-top: 12px;
}

.scene-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  list-style: none;
}

.scene-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text-dim);
  font-size: 1rem;
}

.scene-list kbd {
  min-width: 2.6em;
}

.cli summary {
  color: var(--text);
  font: 700 1.1875rem/1.3 var(--font-display);
  cursor: pointer;
}

.cli[open] summary {
  margin-bottom: 14px;
}

.cli p {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.9375rem;
}

@media (max-width: 1023px) {
  .controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-stack {
    position: static;
  }
}

@media (max-width: 859px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Requirements ---------- */

.specs {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.spec-list {
  border-top: 1px solid var(--line);
}

.spec-list > div {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  padding-top: 3px;
  color: var(--text-faint);
  font: 700 0.8125rem/1.5 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spec-list dd {
  margin: 0;
}

.spec-list dd span {
  display: block;
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.tested {
  padding: 28px;
  border: 1px solid rgb(132 200 98 / 0.4);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgb(132 200 98 / 0.1), rgb(132 200 98 / 0.02) 60%);
}

.tested .kicker {
  color: var(--grass);
}

.tested .kicker::before {
  box-shadow: 12px 0 0 rgb(132 200 98 / 0.5), 24px 0 0 rgb(132 200 98 / 0.22);
}

.tested-gpu {
  color: var(--text);
  font: 700 1.5rem/1.2 var(--font-display);
}

.tested-os {
  margin-top: 4px;
  color: var(--text-dim);
  font-weight: 600;
}

.tested-note {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1rem;
}

@media (max-width: 959px) {
  .specs {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 559px) {
  .spec-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

/* ---------- Download ---------- */

.download-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgb(255 120 71 / 0.16), transparent 45%),
    radial-gradient(circle at 100% 100%, rgb(138 180 255 / 0.08), transparent 45%),
    var(--bg-elev);
}

.download-main h3 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.download-main > p {
  color: var(--text-dim);
}

.download-main .btn {
  margin-top: 26px;
}

.release-box {
  margin-top: 26px;
  font-size: 0.9375rem;
}

.release-box > p {
  color: var(--text-dim);
}

.release-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
}

.release-facts dt {
  color: var(--text-faint);
}

.release-facts dd {
  margin: 0;
  color: var(--text);
}

.release-facts code {
  font-size: 0.8125rem;
  word-break: break-all;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 0.9375rem;
}

.checklist {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(11 14 19 / 0.6);
}

.checklist h3 {
  margin: 0 0 6px;
  font: 700 1.0625rem/1.3 var(--font-display);
}

.checklist p {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.checklist pre {
  margin-top: 10px;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.build-yourself {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: center;
  margin-top: 28px;
  padding: 26px clamp(24px, 4vw, 48px);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.build-yourself h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.build-yourself p {
  color: var(--text-dim);
  font-size: 1rem;
}

@media (max-width: 959px) {
  .download-card,
  .build-yourself {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 479px) {
  .download-main .btn {
    width: 100%;
  }
}

/* Phones: the clone URL wraps instead of hiding behind a sideways scroll (copying the block
   still gives the original lines). */
@media (max-width: 559px) {
  .build-yourself pre {
    white-space: pre-wrap;
  }

  /* On the code element itself: "pre code" resets overflow-wrap to normal. */
  .build-yourself pre code {
    overflow-wrap: anywhere;
  }
}

/* ---------- FAQ ---------- */

.faq-list {
  max-width: 880px;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 20px 48px 20px 0;
  color: var(--text);
  font: 700 1.125rem/1.4 var(--font-display);
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before,
.faq-list summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.2s ease;
}

.faq-list summary::after {
  transform: rotate(90deg);
}

.faq-list details[open] summary::after {
  transform: rotate(0deg);
}

.faq-list summary:hover {
  color: #fff;
}

.faq-answer {
  padding: 0 48px 24px 0;
  color: var(--text-dim);
}

.faq-answer p + p {
  margin-top: 10px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 56px 0 36px;
  border-top: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
}

.footer-grid .brand {
  margin-bottom: 14px;
}

.footer-grid h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-grid ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  list-style: none;
}

.footer-grid a[aria-current] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.875rem;
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 160px);
  padding-block: 64px;
  text-align: center;
}

.not-found .voxel-pile {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.not-found .voxel-pile i {
  width: 34px;
  aspect-ratio: 1;
  background: var(--cube-brick) center / contain no-repeat;
}

.not-found .voxel-pile i:nth-child(2) {
  background-image: var(--cube-steel);
  transform: translateY(10px);
}

.not-found .voxel-pile i:nth-child(3) {
  background-image: var(--cube-grass);
}

.not-found h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 6vw, 3.25rem);
}

.not-found h1 + p {
  color: var(--text-faint);
  font: 600 1.25rem/1.3 var(--font-display);
}

.not-found .lead {
  max-width: 34em;
  margin: 22px auto 0;
  color: var(--text-dim);
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
}

/* ---------- Motion and contrast preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .btn-primary:hover,
  .btn-primary:active,
  .shot-link:hover img {
    transform: none;
  }
}

@media (forced-colors: active) {
  .btn-primary {
    border-color: ButtonText;
  }

  .kicker::before,
  .facts li::before {
    forced-color-adjust: none;
  }
}

/* Account and catalogue use the same palette and type scale as the game pages. */
.account-main { padding-top: clamp(2rem, 6vw, 5rem); padding-bottom: 4rem; }
.account-main > h1 { font-size: clamp(2rem, 5vw, 3.6rem); max-width: 22ch; }
.account-main > section { margin-top: 2rem; }
.account-main > section > p { max-width: 80ch; }
.account-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.5rem 0; }
.account-actions button { font: inherit; }
.notice:empty { display: none; }
.notice { border-left: 3px solid var(--accent, #ff9b6a); padding: 1rem 1.25rem; background: #161c27; border-radius: 0 .5rem .5rem 0; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin: 2rem 0; }
.shop-card { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; background: #121923; border: 1px solid #2d3745; border-radius: 1rem; }
.shop-card h3 { margin: 0; font-size: 1.3rem; }
.shop-card .kicker { color: #ffb48d; }
.shop-card .shop-price { margin-top: auto; padding-top: 1rem; font-weight: 700; }
.btn:disabled, [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.account-list { padding: 0; list-style: none; }
.account-list > li, .order-row { padding: 1.25rem; border-bottom: 1px solid #303b49; overflow-wrap: anywhere; }
.order-row h3 { margin: 0; }
.account-main input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin-right: .5rem; accent-color: #ff9b6a; vertical-align: middle; }
.muted { color: #b3bdcb; font-size: .95rem; }
.map-key-field { display: flex; flex-wrap: wrap; gap: .8rem; margin: .75rem 0 1rem; }
.map-key-field input { flex: 1 1 18rem; min-width: 0; padding: .7rem .9rem; font: inherit; font-family: ui-monospace, Consolas, monospace; color: #e4eaf2; background: #0b0e13; border: 1px solid #43516a; border-radius: .5rem; }
.map-key-field button { font: inherit; }
.seller-details dt { font-weight: 700; margin-top: .7rem; }
.seller-details dd { margin-left: 0; white-space: pre-line; }
@media (max-width: 960px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .shop-grid { grid-template-columns: 1fr; } .account-actions .btn { width: 100%; } .account-main > h1 { font-size: 2rem; } }
@media print { .site-header, .site-footer { display: none; } .account-main { color: #000; } }

.btn-outline { color: #e4eaf2; background: #1b2431; border-color: #43516a; }
.btn-outline:hover:not(:disabled) { background: #29374a; border-color: #ff9b6a; }

/* ---------- Player pages: pseudo, statistics, match history, leaderboard ---------- */

.account-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-left: auto; }
.account-nav a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration: none; }
.pseudo-form { display: grid; gap: .5rem; max-width: 46rem; margin: 1.25rem 0; }
.pseudo-form label, .board-filters label { font-weight: 700; color: var(--text); }
.field-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: stretch; }
.field-row input { flex: 1 1 14rem; min-width: 0; }
.account-main input[type="text"], .account-main input[type="search"], .account-main select {
  padding: .7rem .9rem; border: 2px solid var(--line-strong); border-radius: 6px;
  background: var(--bg-inset); color: var(--text); font: inherit;
}
.account-main input[type="text"]:focus-visible, .account-main input[type="search"]:focus-visible, .account-main select:focus-visible { border-color: var(--focus); }
.form-error { margin: 0; color: #ffb1a1; font-weight: 600; }
.btn-danger { color: #ffe9e3; background: #6d1f12; border-color: #b4412a; }
.btn-danger:hover:not(:disabled) { background: #8a2716; border-color: #ff9b6a; }
.player-facts { color: var(--text-dim); font-size: 1.05rem; }
.stat-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin: 1.5rem 0; }
.stat-group { padding: 1.25rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stat-group h3 { margin: 0 0 .8rem; font-size: 1.15rem; }
.stat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; margin: 0; }
.stat-cards div { min-width: 0; }
.stat-cards dt { color: var(--text-faint); font-size: .85rem; }
.stat-cards dd { margin: .15rem 0 0; font: 700 1.3rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.stats-table th, .stats-table td, .board-table th, .board-table td { white-space: nowrap; }
.stats-table tbody th, .board-table tbody th { width: auto; color: var(--text); }
.match-list > li { padding: 1rem 0; }
.match-head { margin: 0 0 .3rem; }
.match-players { margin: .3rem 0; overflow-wrap: anywhere; }
.player-link { font-weight: 600; }
.match-details summary { cursor: pointer; color: var(--sky); width: fit-content; }
.match-details summary:hover { color: var(--sky-hover); }
.match-body { margin-top: .8rem; }
.result { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .85rem; font-weight: 700; border: 1px solid var(--line-strong); color: var(--text-dim); }
.result-win { color: #10200a; background: var(--grass); border-color: var(--grass); }
.result-loss { color: #ffd2c4; border-color: #b4412a; }
.result-draw { color: var(--sky); border-color: var(--sky); }
.device-row { display: grid; gap: .4rem; justify-items: start; }
.device-row p { margin: 0; }
.board-filters { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 1rem 0; }
.board-filters > div { display: grid; gap: .35rem; }
.board-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.25rem; }
.board-tab { padding: .55rem 1rem; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--bg-elev-2); color: var(--text); font: 700 .95rem/1.2 var(--font-display); cursor: pointer; }
.board-tab:hover { border-color: var(--accent-hover); }
.board-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.board-rank { width: 4.5rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.board-value { font-weight: 700; font-variant-numeric: tabular-nums; }
#board-status, #more-board { margin-top: 1rem; }
@media (max-width: 960px) { .stat-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .stat-groups { grid-template-columns: 1fr; } .field-row .btn { width: 100%; } .account-nav { gap: .3rem .8rem; font-size: .95rem; } }
#leaderboard > .muted { margin-top: 1rem; }

/* ---------- Header account menu (Sign in, or the pseudo once signed in) ---------- */

.account-menu { position: relative; flex: none; }
.account-dropdown summary {
  display: flex; align-items: center; gap: 8px; max-width: 14rem; padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg-elev-2);
  color: var(--text); font: 700 0.875rem/1.2 var(--font-display); list-style: none; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-dropdown summary::-webkit-details-marker { display: none; }
.account-dropdown summary::before { content: ""; flex: none; width: 16px; height: 16px; background: var(--cube-brick) center / contain no-repeat; }
.account-dropdown[open] summary { border-color: var(--accent); }
.account-dropdown ul {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: min(250px, calc(100vw - 32px));
  margin: 0; padding: 8px; list-style: none; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.7);
}
.account-dropdown a, .account-dropdown button {
  display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--text-dim); font: 500 1rem/1.3 var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--bg-elev-2); color: var(--text); }
.account-dropdown li:last-child { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.login-btn { white-space: nowrap; }
@media (max-width: 559px) {
  .account-dropdown summary { max-width: 8.5rem; }
  /* Phones: only « Accueil » stays, so the leaderboard and the other pages keep a way back to the home page. */
  .account-nav a:not([data-home]) { display: none; }
}

/* ---------- Home: hero video, maps, account perks ---------- */

.frame-video video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-inset); }
.video-toggle {
  margin-left: 8px; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--bg-elev-2); color: var(--text-dim); font: 600 0.8125rem/1.6 var(--font-body); cursor: pointer;
}
.video-toggle:hover { color: var(--text); border-color: var(--accent); }
.hero-cta .btn-outline { box-shadow: none; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.map-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg-elev); }
.map-card h3 { margin: 0; font: 700 1.2rem/1.2 var(--font-display); }
.map-card p { margin: 0; color: var(--text-dim); }
.map-card .map-size { margin-top: auto; padding-top: 6px; color: var(--sky); font: 600 0.875rem/1.3 var(--font-mono); }
.map-create { margin-top: 24px; }
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.perks li { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); }
.perks h3 { margin: 0 0 8px; }
.perks p { margin: 0; color: var(--text-dim); }
.perks-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 859px) { .perks { grid-template-columns: 1fr; } }

/* ---------- Account area: tabs and panels ---------- */

.account-main.account-space { padding-top: 1.5rem; }
.account-area { margin-top: .5rem; }
/* Credits band: under the tabs, whatever the open tab. */
.credits-band { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-bottom: 1rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); }
.credits-title { margin: 0; font-size: 1rem; color: var(--text-dim); }
.credits-list { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.credits-band > p { margin: 0; }
.credit-chip { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .45rem; padding: .4rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-inset); }
.credit-name { font-weight: 700; }
.credit-chip[title] { cursor: help; }
.credit-value { font: 700 1.35rem/1 var(--font-display); color: var(--accent-hover); font-variant-numeric: tabular-nums; }
.credit-detail { color: var(--text-faint); font-size: .875rem; }
/* Shop: notice, then the cart button at the top right. */
.cart-button { position: relative; flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; margin-left: auto; padding: 0; border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); cursor: pointer; }
.cart-button:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.cart-icon { display: block; }
.cart-badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 .8rem/22px var(--font-body); text-align: center; }
.cart-badge[hidden] { display: none; }
/* Cart dialog (modal). */
.cart-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 1.25rem 1.5rem; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg); color: var(--text); overflow: auto; }
.cart-dialog::backdrop { background: rgb(4 5 8 / 0.8); }
body:has(.cart-dialog[open]) { overflow: hidden; }
.cart-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cart-dialog-head h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.8rem); }
@media (max-width: 600px) { .cart-dialog { padding: 1rem; } .cart-button { align-self: flex-end; } }
.tabs-bar { display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--line-strong); }
.tabs-bar > .tabs { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.tabs-bar > .cart-button { width: 44px; height: 44px; margin: 0 0 4px auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line-strong); scrollbar-width: thin; }
.tab {
  flex: none; padding: 12px 16px; border: 0; border-bottom: 3px solid transparent; background: none;
  color: var(--text-dim); font: 700 1rem/1.2 var(--font-display); letter-spacing: .02em; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--bg-elev); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.subtabs { margin-top: .5rem; border-bottom-color: var(--line); }
.subtabs .tab { padding: 9px 14px; font-size: .9375rem; }
.subtabs .tab[aria-selected="true"] { border-bottom-color: var(--sky); }
.tab-panel { padding: 1.5rem 0 .5rem; }
.tab-panel:focus-visible { outline-offset: 4px; }
.subpanel { padding-top: 1.25rem; }
.panel-title { margin: 0 0 .75rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.subpanel > h3 { margin: 0 0 .75rem; }
.subpanel h4 { margin: 1.75rem 0 .5rem; font-size: 1.15rem; }
.cart-table th[scope="row"] { font-weight: 600; }
.cart-table td, .cart-table th { vertical-align: middle; }
.cart-table tfoot th, .cart-table tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.cart-warning { color: #ffb1a1; font-weight: 600; }
.qty-btn { min-width: 2.2rem; padding: 4px 8px; box-shadow: none; }
.qty-value { display: inline-block; min-width: 2.2rem; text-align: center; font-weight: 700; }
.qty-cell { display: inline-flex; align-items: center; gap: 0.4rem; }
.qty-stepper { display: inline-flex; flex-direction: column; gap: 3px; }
.qty-stepper .qty-btn { min-width: 2rem; min-height: 1.6rem; padding: 0 8px; line-height: 1; }
.purchase-consent { margin: 1.25rem 0 0; }
.form-ok { color: var(--grass); }
.order-lines { margin: .5rem 0; padding-left: 1.2rem; }
.order-row h4 { margin: 0; }
.profile-facts { margin: 0; }
.profile-facts dt { color: var(--text-dim); font-size: .95rem; }
.profile-facts dd { margin: .2rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; max-width: 46rem; margin-top: 1rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 700; color: var(--text); }
.account-main .field input { width: 100%; }
.board-table tr.is-me th, .board-table tr.is-me td { color: var(--accent-hover); }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .tab { padding: 10px 12px; font-size: .9375rem; }
}
