/* TITC shell: the global header and footer shared by every public page.
   Self-contained (own tokens, own class prefix gh-/gf-) so it can sit next to
   each page's own styles without colliding. The accent follows --game-color
   when a page defines it (red by default, blue on the training page). */
:root {
  --t-bg: #07080d;
  --t-bg-1: #0c0e17;
  --t-bg-2: #12141f;
  --t-ink: #f1ede4;
  --t-ink-2: #c9c3b6;
  --t-ink-3: #9a958a;
  --t-line: #2a2d3a;
  --t-line-strong: #4a4e60;
  --t-red: #e51421;
  --t-red-hi: #ff5a64;
  --t-red-lo: #7a000c;
  --t-gold: #f8d01c;
  --t-pixel: 'DotGothic16', 'Noto Sans JP', sans-serif;
  --t-term: 'VT323', 'DotGothic16', monospace;
  --t-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif;
}

.gh, .gh *, .gf, .gf * { box-sizing: border-box; }
.gh a:focus-visible, .gf a:focus-visible { outline: 3px solid var(--t-gold); outline-offset: 3px; }

/* ---------- header ---------- */
.gh {
  position: relative; z-index: 60; margin: 0; padding: 0;
  background: var(--t-bg); color: var(--t-ink);
  border-bottom: 3px solid var(--game-color, var(--t-red));
  font-family: var(--t-pixel); font-weight: 400; line-height: 1.4; letter-spacing: 0; text-align: left;
}
.gh-in {
  width: min(1184px, calc(100% - 80px)); margin-inline: auto; min-height: 76px;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav cta";
  align-items: center; column-gap: 28px;
}
.gh-brand {
  grid-area: brand; display: inline-flex; align-items: center; gap: 10px;
  color: var(--t-ink); text-decoration: none;
  font: 400 2.2rem/1 var(--t-term); letter-spacing: .08em;
}
.gh-brand:hover { color: #fff; }
.gh-candy { display: block; width: 36px; height: 28px; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; image-rendering: pixelated; }
.gh-tag { margin-left: 6px; font: 400 .875rem/1 var(--t-term); letter-spacing: .08em; color: var(--t-ink-3); }
/* Decorative label lives in CSS, not in the HTML, so crawlers and AI text
   extraction never read it as body copy. */
.gh-tag::before { content: '[ READY PLAYER 1 ]'; }

.gh-nav { grid-area: nav; display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin: 0; padding: 0; }
.gh-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  color: var(--t-ink-2); font-size: .9375rem; text-decoration: none; white-space: nowrap;
}
.gh-nav a::before {
  content: ''; position: absolute; left: 3px; top: 50%; margin-top: -4px;
  border: 4px solid transparent; border-left: 6px solid var(--t-gold); border-right: 0; opacity: 0;
}
.gh-nav a:hover, .gh-nav a[aria-current] { color: var(--t-gold); }
.gh-nav a:hover::before, .gh-nav a:focus-visible::before { opacity: 1; }
.gh-nav a[aria-current]::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 3px; height: 3px; background: var(--t-gold);
}

.gh-cta {
  grid-area: cta; display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 20px;
  background: var(--game-color, var(--t-red)); color: #fff; text-decoration: none; white-space: nowrap;
  border: 2px solid var(--t-ink); box-shadow: 4px 4px 0 var(--game-shadow, var(--t-red-lo));
  font-size: .9375rem; transition: transform .12s, box-shadow .12s;
}
.gh-cta span { color: var(--t-gold); }
.gh-cta:hover { color: #fff; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--game-shadow, var(--t-red-lo)); }
.gh-cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--game-shadow, var(--t-red-lo)); }

@media (min-width: 801px) {
  .gh--sticky { position: sticky; top: 0; }
}
@media (max-width: 1100px) {
  .gh-tag { display: none; }
  .gh-in { column-gap: 16px; }
  .gh-nav a { padding: 0 11px; }
  .gh-nav a[aria-current]::after { left: 11px; right: 11px; }
}
/* Phone: a thin menu strip on top, then the brand bar. Only the brand bar
   stays stuck while scrolling (the strip slides away), so the sticky part
   costs 58px instead of two full rows. */
@media (max-width: 800px) {
  .gh--sticky { position: sticky; top: -42px; }
  .gh-in {
    width: 100%; min-height: 0; column-gap: 12px;
    grid-template-columns: 1fr auto; grid-template-areas: "nav nav" "brand cta";
  }
  .gh-nav {
    justify-content: flex-start; gap: 0; height: 42px; padding: 0 8px;
    background: var(--t-bg-1); border-bottom: 1px solid var(--t-line);
    overflow-x: auto; scrollbar-width: none;
  }
  .gh-nav::-webkit-scrollbar { display: none; }
  .gh-nav a { min-height: 42px; padding: 0 10px; font-size: .8125rem; }
  .gh-nav a::before { display: none; }
  .gh-nav a[aria-current]::after { left: 10px; right: 10px; bottom: 0; }
  .gh-brand { margin: 10px 0 10px 18px; font-size: 1.85rem; }
  .gh-candy { width: 27px; height: 21px; }
  .gh-cta { margin-right: 18px; min-height: 40px; padding: 0 14px; font-size: .875rem; box-shadow: 3px 3px 0 var(--game-shadow, var(--t-red-lo)); }
  .gh-cta span { display: none; }
}

/* ---------- footer ---------- */
.gf {
  position: relative; margin: 0; padding: 64px 0 28px;
  background: var(--t-bg); color: var(--t-ink-2);
  border-top: 3px solid var(--game-color, var(--t-red));
  font-family: var(--t-sans); font-size: .875rem; font-weight: 400; line-height: 1.8; letter-spacing: 0; text-align: left;
}
.gf-in { width: min(1184px, calc(100% - 80px)); margin-inline: auto; }
.gf-top { display: grid; grid-template-columns: minmax(240px, 1fr) 2.2fr; gap: 64px; }
.gf-brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--t-ink); text-decoration: none;
  font: 400 2.6rem/1 var(--t-term); letter-spacing: .08em;
}
.gf-brand:hover { color: #fff; }
.gf-tagline { margin: 22px 0 0; font-family: var(--t-pixel); font-size: 1rem; line-height: 1.9; color: var(--t-ink); }
.gf-org { margin: 14px 0 0; font-size: .8125rem; line-height: 1.9; color: var(--t-ink-3); }
.gf-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin: 0; padding: 0; }
.gf-h {
  margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px dashed var(--t-line-strong);
  font-family: var(--t-pixel); font-size: .875rem; font-weight: 400; line-height: 1.4; letter-spacing: .08em; color: var(--t-gold);
}
.gf-nav ul { list-style: none; margin: 0; padding: 0; }
.gf-nav li { margin: 0; padding: 0; }
.gf-nav a {
  display: block; padding: 7px 0; color: var(--t-ink-2); text-decoration: none;
  font-family: var(--t-pixel); font-size: .875rem; line-height: 1.6;
}
.gf-nav a:hover { color: var(--t-gold); }
.gf-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--t-line);
  font-family: var(--t-pixel); font-size: .75rem; line-height: 1.7; color: var(--t-ink-3);
}
@media (max-width: 800px) {
  .gf { padding: 48px 0 24px; }
  .gf-in { width: calc(100% - 36px); }
  .gf-top { grid-template-columns: 1fr; gap: 36px; }
  .gf-nav { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .gf-bottom { flex-direction: column; margin-top: 36px; }
}
@media (max-width: 420px) {
  .gf-nav { grid-template-columns: 1fr; }
}
@media print {
  .gh-nav, .gh-cta, .gf-nav { display: none; }
  .gh, .gf { background: #fff; color: #000; border-color: #000; }
  .gh-brand, .gf-brand, .gf-tagline, .gf-bottom { color: #000; }
}
