:root {
  color-scheme: dark;
  --bg: #0b0f0d;
  --panel: #121814;
  --panel-2: #0f1511;
  --line: #243028;
  --text: #e8efe7;
  --muted: #8fa096;
  --accent: #c8ff5a;
  --accent-dim: #8fbf3f;
  --danger: #ff7a6b;
  --radius: 18px;
  --max: 1040px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(200, 255, 90, 0.08), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(122, 223, 155, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 13, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(200, 255, 90, 0.5);
}
.nav-links { display: flex; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }

main { padding: clamp(22px, 4vw, 40px) 0 clamp(36px, 6vw, 64px); }

.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 650;
}
.intro p { color: var(--muted); max-width: 420px; margin: 0; font-size: 15px; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(240px, 300px);
  justify-content: center;
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
}

.arcade {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(10px, 1.6vw, 14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 4px 6px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--muted);
}
.hud b { color: var(--text); font-weight: 600; }
.hud .score { color: var(--accent); font-size: 18px; letter-spacing: 0.04em; }

.screen {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2b3a30;
  background: #0a0e0b;
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 7, 0.72);
  backdrop-filter: blur(3px);
  text-align: center;
}
.overlay.hidden { display: none; }
.overlay h2 { margin: 6px 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.overlay p { margin: 0 0 16px; color: var(--muted); font-size: 14px; max-width: 280px; }
.overlay .kicker { margin-bottom: 0; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #1a231d;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
}
button:hover { border-color: #3b4d41; }
button.primary {
  background: var(--accent);
  color: #10150f;
  border-color: var(--accent);
  font-weight: 700;
}
button.primary:hover { background: #d6ff7f; }

.pad {
  display: grid;
  grid-template-columns: repeat(3, clamp(46px, 12vw, 56px));
  grid-template-rows: repeat(2, clamp(40px, 10vw, 46px));
  gap: 8px;
  justify-content: center;
  padding: 12px 0 2px;
}
.pad button { padding: 0; font-size: 18px; line-height: 1; }
.pad .up { grid-column: 2; }
.pad .left { grid-column: 1; grid-row: 2; }
.pad .down { grid-column: 2; grid-row: 2; }
.pad .right { grid-column: 3; grid-row: 2; }

.side { display: grid; gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card p, .card li { color: var(--muted); font-size: 14px; }
.card ul { margin: 0; padding-left: 18px; }
.card li { margin: 6px 0; }
.key {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #0d120f;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
}

section.about { margin-top: 44px; max-width: 720px; }
section.about h2 { font-size: 22px; margin: 0 0 10px; }
section.about p { color: var(--muted); margin: 0 0 14px; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
footer .foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.prose { max-width: 700px; }
.prose h1 { margin-bottom: 10px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose p { color: var(--muted); }

@media (max-width: 860px) {
  .game-layout { grid-template-columns: minmax(0, 560px); }
  .intro { flex-direction: column; align-items: flex-start; gap: 8px; }
  .side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .side { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; gap: 8px 16px; }
  .nav-links { gap: 14px; }
  .intro-note { font-size: 14px; }
  .overlay { padding: 14px; }
  .overlay h2 { font-size: 21px; }
  .overlay p { font-size: 13px; }
  .pad { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 42px); }
}
