* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; max-width: 100%; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  overflow-anchor: none;
}
button, a { font-family: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }

.wrap { width: min(1440px, 100%); margin: 0 auto; padding: 24px 96px 48px; }
.site-header { height: 48px; display: flex; align-items: center; gap: 44px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { font-family: var(--font-brand); font-weight: 900; font-size: 22px; letter-spacing: .02em; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { border-bottom: 3px solid var(--accent); padding-bottom: 3px; }
.quit, .nav-toggle {
  margin-left: auto; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: var(--radius-pill); cursor: pointer; font-weight: 700;
}
.quit { height: 40px; padding: 0 16px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.back { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.nav-toggle {
  width: 44px; height: 44px; border-radius: 50%; display: none; align-items: center; justify-content: center; padding: 0;
}
.short { display: none; }
.ply { display: none; margin-left: auto; font-weight: 700; font-size: 12px; color: var(--muted); }

.hero { display: flex; align-items: baseline; gap: 14px; margin: 24px 0 28px; position: relative; }
h1 { font-weight: 900; font-size: 36px; line-height: 1; }
h1 em { font-style: normal; color: var(--accent); }
.hero-note { font-weight: 700; font-size: 13px; color: var(--muted); }
.hero-lead { display: none; }
.hero-art { display: none; }

.site-footer { background: var(--footer-bg); color: var(--footer); padding: 56px 0 48px; }
.site-footer .inner { width: min(1180px, calc(100% - 48px)); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.foot-row { display: flex; align-items: center; gap: 56px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-family: var(--font-brand); font-weight: 900; font-size: 20px; }
.foot-nav { display: flex; gap: 28px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.foot-nav a { color: var(--footer); text-decoration: none; }
.site-footer p { font-size: 12px; line-height: 1.8; color: var(--footer-note); }

@media (max-width: 1439px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 767px) {
  .wrap { padding: 0 16px 40px; }
  .site-header { height: 60px; gap: 8px; }
  body[data-phase="playing"] .site-header,
  body[data-phase="result"] .site-header { height: 56px; }
  .brand svg { width: 32px; height: 32px; }
  .brand span { font-size: 20px; }
  body[data-phase="playing"] .brand svg,
  body[data-phase="result"] .brand svg { width: 28px; height: 28px; }
  body[data-phase="playing"] .brand span,
  body[data-phase="result"] .brand span { font-size: 16px; }
  .nav {
    display: none; position: absolute; z-index: 6; top: 64px; left: 16px; right: 16px;
    margin: 0; flex-direction: column; gap: 12px; background: var(--card);
    border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow-card);
  }
  body[data-phase="setup"].nav-open .nav { display: flex; }
  .nav-toggle { display: flex; }
  .quit { height: 36px; padding: 0 12px; font-size: 12px; }
  .quit .long, .quit svg { display: none; }
  .quit .short { display: inline; }
  .back { font-size: 12px; }
  body[data-phase="playing"] .ply { display: inline; }
  .hero { flex-direction: column; align-items: flex-start; gap: 6px; margin: 6px 0 14px; }
  .hero-note { order: -1; color: var(--accent); letter-spacing: .08em; font-size: 12px; }
  h1 { font-size: 46px; margin: 6px 0; }
  .hero-lead { display: block; font-size: 13px; line-height: 1.7; color: var(--note); }
  .hero-art { display: block; position: absolute; right: 0; top: 4px; }
  body[data-phase="playing"] .hero,
  body[data-phase="result"] .hero { display: none; }
  .site-footer { padding: 32px 0; }
  .site-footer .inner { width: min(1180px, calc(100% - 32px)); }
  .foot-row { gap: 16px; }
}

/* ロゴ・見出し札の SVG。色は tokens.css から取る（属性の色は CSS が無いときの予備） */
.mk-a { stroke: var(--accent); }
.mk-af { fill: var(--accent); }
.mk-i { stroke: var(--ink); }
.mk-if { fill: var(--ink); }
.mk-foot { fill: var(--footer-bg); }

/* hidden を付けたメニュー釦は、スマホの display:flex より優先して消す */
.nav-toggle[hidden] { display: none !important; }
