@charset "UTF-8";

:root {
  --footer-height: 54px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 8px 10px calc(var(--footer-height) + 16px);
  overflow-x: hidden;
  background: #000;
  color: #0f0;
  font-family: "Courier New", "Noto Sans Mono CJK JP", monospace;
}

.game-shell {
  width: min(100%, 540px);
  margin: 0 auto;
  text-align: center;
}

.game-title {
  margin: 0 0 4px;
  color: #66ff82;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.game-help {
  margin: 0 auto 8px;
  color: #b9ffc8;
  font-size: 0.78rem;
  line-height: 1.45;
}

#game {
  display: block;
  width: min(92vw, 480px);
  width: min(92vw, 480px, calc((100dvh - var(--footer-height) - 154px) * 0.75));
  min-width: 240px;
  height: auto;
  margin: 0 auto;
  background: #000;
  border: 4px solid #0f0;
  image-rendering: pixelated;
  touch-action: none;
}

.game-controls {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 9px;
  width: min(92vw, 480px);
  margin: 9px auto 0;
}

.game-controls button {
  min-height: 44px;
  margin: 0;
  padding: 8px 6px;
  border: 2px solid #0f0;
  border-radius: 9px;
  background: #061506;
  color: #7dff92;
  font: 700 1rem/1 "Courier New", monospace;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.game-controls .fire-button {
  background: #123312;
}

.game-controls button:hover,
.game-controls button:focus-visible {
  background: #0b260b;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.game-controls button:active {
  background: #0f0;
  color: #001700;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  min-height: var(--footer-height);
  margin: 0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 10, 19, 0.97);
  border-top: 1px solid #164c72;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.sakurayama-copyright {
  margin: 0;
  color: #42a5f5;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.sakurayama-copyright a {
  color: #42a5f5;
  text-decoration: none;
}

.sakurayama-copyright a:hover,
.sakurayama-copyright a:focus-visible {
  color: #90caf9;
  text-decoration: underline;
}

@media (max-width: 420px) {
  :root {
    --footer-height: 50px;
  }

  body {
    padding-left: 6px;
    padding-right: 6px;
  }

  .game-help {
    font-size: 0.72rem;
  }

  #game,
  .game-controls {
    width: min(96vw, 480px);
  }

  #game {
    width: min(96vw, 480px, calc((100dvh - var(--footer-height) - 146px) * 0.75));
    min-width: 220px;
  }

  .game-controls button {
    min-height: 42px;
    font-size: 0.92rem;
  }

  .sakurayama-copyright {
    font-size: 0.92rem;
  }
}

@media print {
  body {
    padding-bottom: 0;
  }

  .site-footer {
    display: none;
  }
}
