/*
 * Application shell (WP03; FR-008, FR-009, FR-017): the header and footer
 * around every screen (src/app/shell.js). Tokens and primitives only (WP02).
 *
 *   body                a column: header, the app root (<main id="app">,
 *                       grows), footer; the footer sits at the bottom of a
 *                       short page
 *   .site-header        full-width bar on the panel surface; the product
 *                       name (link home, with the CSS stack mark) on the left,
 *                       the 'Game' navigation (quiet buttons) on the right.
 *                       Static (not sticky), so it never covers content.
 *                       Below 600 px the navigation takes its own rows of
 *                       three equal 44 px buttons: no horizontal scroll at 360 px.
 *   .site-footer        full-width bar: the unofficial notice, the privacy
 *                       statement and the offline help (caption text)
 *   .brand-mark         three pawns of a stack drawn with borders and radii
 */

body {
  display: flex;
  flex-direction: column;
}

.app {
  flex: 1 0 auto;
}

/* ---- header ------------------------------------------------------------- */

.site-header {
  background: var(--surface-panel);
  border-bottom: 1px solid var(--color-border-subtle);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
}

.site-header__home {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-target);
  min-width: 0;
  padding: 0 var(--space-1);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  text-decoration: none;
}

.site-header__home:hover .site-header__name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-width: 0;
}

/* ---- the product mark: a stack of three pawns --------------------------- */

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-1) / 2);
  flex: none;
  width: var(--space-6);
}

.brand-mark__pawn {
  display: block;
  height: var(--space-2);
  border: 1px solid;
  border-radius: var(--radius-round);
}

.brand-mark__pawn--1 {
  width: calc(100% - var(--space-2));
  background: var(--accent);
  border-color: var(--accent);
}

.brand-mark__pawn--2 {
  width: calc(100% - var(--space-1));
  background: var(--pawn-white-fill);
  border-color: var(--pawn-white-stroke);
}

.brand-mark__pawn--3 {
  width: 100%;
  background: var(--pawn-black-fill);
  border-color: var(--pawn-black-stroke);
}

/* ---- footer ------------------------------------------------------------- */

.site-footer {
  margin-top: var(--space-7);
  background: var(--surface-panel);
  border-top: 1px solid var(--color-border-subtle);
}

.site-footer__inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  overflow-wrap: anywhere;
}

.site-footer__notice {
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

.site-footer__offline:empty {
  display: none;
}

/* ---- phones --------------------------------------------------------------- */

@media (max-width: 599.98px) {
  .site-header__inner {
    padding: var(--space-2);
  }

  .site-header__nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .site-header__action {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    text-align: center;
  }

  .site-footer {
    margin-top: var(--space-6);
  }

  .site-footer__inner {
    padding: var(--space-4) var(--space-2);
  }
}
