:root {
  --ink: #273432;
  --muted: #687773;
  --line: #dce9e4;
  --mint: #7ad0b3;
  --mint-dark: #2f8f70;
  --mint-soft: #eef9f5;
  --paper: #fffefb;
  --off-white: #fafbf7;
  --coral: #ff9f8f;
  --blue: #4f8fc9;
  --shadow: 0 18px 48px rgba(48, 91, 78, 0.12);
}

* { box-sizing: border-box; }
html { background: #fff; }
body {
  margin: 0;
  color: var(--ink);
  background: #fbfdfb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.75;
}
button { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header,
.site-footer,
.game-page {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header {
  gap: 16px;
  padding: 18px 0 8px;
  color: #263332;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.8;
}
.site-footer {
  gap: 18px;
  padding: 36px 0 42px;
  border-top: 1px solid #edf5f2;
  color: #667572;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.8;
}
.site-logo {
  font-weight: 700;
  letter-spacing: 0;
}
.site-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: #667572;
  font-size: 0.92rem;
}
.site-nav a,
.site-footer a { text-decoration: none; }
.site-nav a:hover,
.site-footer a:hover { color: var(--mint-dark); }

.game-page { margin-bottom: 64px; }
.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: 340px;
  padding: 30px 0 38px;
}
.series-label {
  margin: 0 0 12px;
  color: var(--mint-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 3rem);
  line-height: 1.15;
}
.hero-title-line { display: block; }
.hero-copy > p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
}
.hero-copy > .view-note { margin-top: 10px; font-size: 0.9rem; }
.hero-preview {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid #e3eee9;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 49% 52%, rgba(122, 208, 179, 0.2), transparent 48%),
    linear-gradient(180deg, #f9fcfa, #eff8f4);
  box-shadow: 0 16px 38px rgba(48, 91, 78, 0.09);
}
.hero-preview::before,
.hero-preview::after {
  position: absolute;
  inset: 18% 12%;
  border: 1px solid rgba(47, 143, 112, 0.16);
  border-radius: 50%;
  content: "";
}
.hero-preview::after { inset: 28% 25%; border-color: rgba(47, 143, 112, 0.23); }
.preview-orbit {
  position: absolute;
  inset: 16% 8%;
  border: 1px dashed rgba(47, 143, 112, 0.27);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(0.72);
}
.orbit-b { inset: 18% 18%; transform: rotate(35deg) scaleY(0.72); }
.preview-ship {
  position: absolute;
  top: 48%;
  left: 49%;
  width: 34px;
  height: 24px;
  border: 1px solid #267d65;
  background: linear-gradient(145deg, #fff 5%, #74c6a7 48%, #3b9275 90%);
  clip-path: polygon(100% 50%, 18% 0, 30% 50%, 18% 100%);
  filter: drop-shadow(0 4px 8px rgba(47, 143, 112, 0.24));
  transform: rotate(-28deg);
}
.preview-shot {
  position: absolute;
  top: 37%;
  left: 58%;
  width: 34px;
  height: 2px;
  background: #e69b55;
  box-shadow: 0 0 12px rgba(230, 155, 85, 0.55);
  transform: rotate(-28deg);
}
.shot-b { top: 65%; left: 34%; width: 42px; transform: rotate(152deg); }
.preview-caption {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.game-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 28px);
}
.status-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.status-panel div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfefc;
  padding: 8px 12px;
}
.status-panel span {
  display: block;
  color: var(--mint-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}
.status-panel strong {
  display: block;
  margin-top: 1px;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.game-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid #213744;
  border-radius: 8px;
  background: #0c1720;
  box-shadow: inset 0 0 0 1px rgba(228, 247, 255, 0.07), 0 12px 30px rgba(17, 34, 43, 0.19);
  touch-action: none;
  user-select: none;
}
.game-stage:focus-within { outline: 3px solid rgba(47, 143, 112, 0.24); outline-offset: 3px; }
.game-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.screen-controls {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}
.screen-button {
  min-height: 42px;
  border: 1px solid rgba(205, 223, 216, 0.7);
  border-radius: 7px;
  background: rgba(249, 253, 251, 0.94);
  color: #287b62;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.screen-button:hover:not(:disabled) { background: #fff; }
.screen-button:disabled { opacity: 0.56; cursor: default; }
.stage-start {
  position: absolute;
  z-index: 3;
  bottom: 7%;
  left: 50%;
  min-width: 202px;
  box-shadow: 0 8px 24px rgba(2, 11, 16, 0.42), 0 0 24px rgba(117, 219, 193, 0.18);
  transform: translateX(-50%);
}
.stage-start:hover { box-shadow: 0 8px 28px rgba(2, 11, 16, 0.5), 0 0 30px rgba(117, 219, 193, 0.28); }
button:focus-visible,
a:focus-visible { outline: 3px solid #439e7f; outline-offset: 3px; }
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.primary-button,
.ghost-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { background: var(--mint-dark); color: #fff; }
.primary-button:hover { background: #267b5f; }
.ghost-button { border-color: #cddfd8; background: #fff; color: var(--mint-dark); }
.ghost-button:hover { background: var(--mint-soft); }
.mobile-play-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.stage-message { min-height: 1.7em; margin: 9px 0 0; color: #50625d; font-size: 0.92rem; }
.result-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.result-panel h2 { margin: 0 0 4px; font-size: 1.08rem; }
.result-panel p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.info-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.info-section article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}
.info-section h2 { margin: 0 0 8px; font-size: 1.08rem; }
.info-section p { margin: 0; color: var(--muted); }
.info-section a { color: var(--mint-dark); font-weight: 800; }
.comments-stub {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.comments-stub h2 { margin: 0 0 8px; font-size: 1.15rem; }
.comments-stub p { margin: 0; color: var(--muted); }
.site-footer p {
  margin: 0;
  font-weight: 800;
}

.game-shell:fullscreen,
.game-shell.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #fbfdfb;
  padding: clamp(12px, 2vw, 24px);
}
.game-shell:fullscreen .status-panel,
.game-shell:fullscreen .game-stage,
.game-shell:fullscreen .control-row,
.game-shell:fullscreen .mobile-play-note,
.game-shell:fullscreen .stage-message,
.game-shell:fullscreen .result-panel,
.game-shell.pseudo-fullscreen .status-panel,
.game-shell.pseudo-fullscreen .game-stage,
.game-shell.pseudo-fullscreen .control-row,
.game-shell.pseudo-fullscreen .mobile-play-note,
.game-shell.pseudo-fullscreen .stage-message,
.game-shell.pseudo-fullscreen .result-panel {
  width: min(100%, 1200px);
  margin-inline: auto;
}
.game-shell:fullscreen .game-stage,
.game-shell.pseudo-fullscreen .game-stage {
  max-height: min(64vh, 760px);
}
.game-shell.pseudo-fullscreen { position: fixed; z-index: 10000; inset: 0; }
body:has(.game-shell.pseudo-fullscreen) { overflow: hidden; }

@media (max-width: 820px) {
  .game-hero { grid-template-columns: 1fr; min-height: 0; gap: 22px; padding: 26px 0; }
  .hero-preview { min-height: 210px; }
  .info-section { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-header,
  .site-footer,
  .game-page { width: min(100% - 24px, 1120px); }
  .site-header,
  .site-footer { align-items: flex-start; flex-direction: column; }
  .site-nav,
  .site-footer nav { gap: 8px 14px; }
  .hero-copy h1 { font-size: 2rem; }
  .hero-copy > p { margin-top: 15px; }
  .game-shell { padding: 12px; }
  .status-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .status-panel div { padding: 6px 9px; }
  .screen-controls { top: 7px; right: 7px; gap: 5px; }
  .screen-button { min-height: 38px; padding-inline: 9px; font-size: 0.72rem; }
  .stage-start { bottom: 6%; min-width: min(202px, calc(100% - 32px)); min-height: 42px; padding-inline: 10px; font-size: 0.88rem; }
  .control-row { gap: 8px; }
  .primary-button,
  .ghost-button { min-height: 44px; padding-inline: 13px; }
  .info-section article { padding: 15px; }
  .game-shell:fullscreen .game-stage,
  .game-shell.pseudo-fullscreen .game-stage { max-height: 55vh; }
}
@media (max-width: 360px) {
  .screen-controls { top: 5px; right: 5px; }
  .screen-button { min-height: 36px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
