/* =========================================================================
   Component layer
   -------------------------------------------------------------------------
   Shared building blocks. All colour comes from tokens.
   ========================================================================= */

/* ---- Button: shared design-system primitive ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  flex-shrink: 0;
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 20px;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-xs); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 90%, transparent); color: var(--text-on-accent); }
.btn--outline { background: transparent; border-color: var(--line-strong); color: var(--text-body); box-shadow: var(--shadow-xs); }
.btn--outline:hover { background: var(--control-hover-bg); color: var(--text-body); }
.btn--ghost { background: transparent; color: var(--text-body); }
.btn--ghost:hover { background: var(--control-hover-bg); color: var(--text-body); }
.btn:hover, .btn:focus-visible { box-shadow: var(--glow-amber); border-color: var(--focus-ring); }
/* Use the current JSON glow, rather than the export's stale Button glow. */
.btn--glow { box-shadow: var(--shadow-xs); }
.btn--glow:hover { box-shadow: var(--glow-accent); }
.btn--glow:focus-visible { box-shadow: var(--glow-amber); border-color: var(--focus-ring); }

/* Shared control and text roles; page styles only arrange their contents. */
.field-control {
  font: 400 14px/20px var(--font-sans);
  color: var(--text-body);
  background: var(--surface-raised);
  border: 1px solid var(--line-input);
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 var(--space-3);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.field-control:focus-visible { border-color: var(--focus-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 50%, transparent); }
.type-lead { font-size: var(--text-md); line-height: 26px; font-weight: var(--weight-regular); }
.type-body { font-size: var(--text-base); line-height: 24px; font-weight: var(--weight-regular); }
.type-h3 { font-size: var(--text-lg); line-height: 28px; font-weight: var(--weight-semibold); }
.type-ui { font-size: var(--text-sm); line-height: 20px; font-weight: var(--weight-medium); }
.type-small { font-size: 13px; line-height: 20px; font-weight: var(--weight-regular); }
.type-caption { font-size: var(--text-xs); line-height: 18px; font-weight: var(--weight-medium); }
.brand-label { font-size: var(--text-md); line-height: 26px; font-weight: var(--weight-bold); }
.text-muted { color: var(--text-muted); }
.detail-label { font-size: var(--text-sm); line-height: 20px; font-weight: var(--weight-medium); color: var(--text-muted); margin-bottom: var(--space-2); }
.reading-column, .about__body, .about__blocks, .contact__email { max-width: var(--reading-width); width: 100%; }
.back-link { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--text-sm); line-height: 20px; font-weight: var(--weight-medium); }
.brand-context {
  --text-body: var(--color-cream);
  --text-strong: var(--color-cream);
  --line-strong: var(--color-cream);
  --focus-ring: var(--color-amber);
  --control-hover-bg: color-mix(in srgb, var(--color-cream) 8%, transparent);
}

/* ---- Badge and chip ----------------------------------------------------
   Status and category marks. Fill carries meaning, but never colour alone:
   the text always states the state, so the mark survives greyscale and
   colour-vision differences.

   Colours come from the --badge-* token trios, which resolve per theme. */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-1) 10px;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-fg);
}

/* Released: the live, positive state. */
.badge[data-status='released'] {
  background: var(--badge-released-bg);
  color: var(--badge-released-fg);
}

/* Demo uses the design system's structure tone. */
.badge[data-status='demo'] {
  background: var(--color-structure);
  color: var(--color-cream);
}

/* In development uses the amber status tone. */
.badge[data-status='in-development'] {
  background: var(--badge-active-bg);
  color: var(--badge-active-fg);
}

/* Announced and unconfirmed stay deliberately neutral and low-key, because
   they describe things that are not yet true. */
.badge[data-status='announced'],
.badge[data-status='on-hold'],
.badge[data-status='unconfirmed'] {
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-fg);
}

/* ---- Cards ------------------------------------------------------------- */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-md);
  min-width: 0;
  transition: border-color var(--duration-base) var(--ease-out);
}

/* ---- Section headers --------------------------------------------------- */

/* Reserve equal text slots in catalogue cards across languages. */
.catalogue .game-card__title { min-height: 84px; }
.catalogue .game-card__text { min-height: 96px; }
@media (max-width: 48rem) {
  .catalogue .game-card__title { min-height: 112px; }
}

.section-title {
  font-size: var(--text-2xl);
  line-height: 40px;
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.section-lead {
  color: var(--text-muted);
  max-width: var(--reading-width);
  margin-bottom: var(--space-5);
  font-size: var(--text-md);
  line-height: 26px;
}

.page-head {
  margin-bottom: var(--space-6);
}
.page-head > :last-child { margin-bottom: 0; }

.demo-notice {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-hover);
  color: var(--text-muted);
  border-bottom: 1px solid var(--line-faint);
  font-size: var(--text-xs);
}
.demo-notice a { color: var(--text-accent); }
@media (max-width: 48rem) {
  .demo-notice { flex-direction: column; gap: var(--space-1); text-align: center; }
  .demo-notice span { min-height: 36px; line-height: 18px; }
}
