: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; }

.game-page {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}







.game-page { margin-bottom: 64px; }
.game-page > .breadcrumb {
  margin-top: 12px;
  color: #667572;
  font-size: .88rem;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
.game-page > .breadcrumb a { color: #26755b; }

.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: var(--mint-soft);
  box-shadow: 0 16px 38px rgba(48, 91, 78, 0.09);
}
.preview-man {
  position: absolute;
  bottom: -46px;
  left: 50%;
  width: clamp(190px, 30vw, 270px);
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}
.preview-mosquito {
  position: absolute;
  top: 30px;
  left: calc(50% + 94px);
  width: clamp(46px, 6vw, 62px);
  height: auto;
  object-fit: contain;
}

.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); }
.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; }
.play-guide {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: clamp(15px, 3vw, 24px);
}
.play-guide h2 { margin: 0 0 16px; font-size: 1.2rem; }
.play-guide h3 { margin: 0 0 10px; color: var(--mint-dark); font-size: 1rem; }
.guide-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 30px;
  margin: 0;
  padding-left: 1.5em;
}
.guide-steps li::marker { color: var(--mint-dark); font-weight: 800; }
.guide-steps strong, .guide-steps span { display: block; }
.guide-steps span { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.guide-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: .9rem;
}
.guide-controls { margin: 0; }
.guide-controls dt { margin-top: 10px; color: var(--ink); font-weight: 800; }
.guide-controls dt:first-child { margin-top: 0; }
.guide-controls dd { margin: 2px 0 0; }
.guide-details ul { margin: 0; padding-left: 1.3em; }
.guide-details li + li { margin-top: 8px; }
.guide-tip { margin: 12px 0 0; }






@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; }
  .guide-steps ol, .guide-details { grid-template-columns: 1fr; }
  .guide-details { gap: 18px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .game-page { width: min(100% - 24px, 1120px); }



  .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; }
}
@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; }
}

.status-panel { grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)); }
.status-panel .hp-status { position: relative; }
.hp-track {
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1ded9;
}
.hp-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60b894, #93d5aa);
  transition: width 180ms ease, background-color 180ms ease;
}
.game-stage { background: #101b2a; }
.game-stage canvas { outline: none; }
.warning-banner {
  position: absolute;
  z-index: 4;
  top: 74px;
  left: 50%;
  max-width: calc(100% - 24px);
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d94f48;
  box-shadow: 0 4px 18px rgba(20, 19, 25, .45);
  color: #fff;
  padding: 8px 18px;
  font-size: clamp(.9rem, 2.2vw, 1.3rem);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  animation: warning-pulse .48s ease-in-out infinite alternate;
}
@keyframes warning-pulse { to { background: #b92c31; transform: translateX(-50%) scale(1.035); } }
.game-controls { align-items: center; }
.escape-button { margin-left: auto; }
.escape-button:disabled,
.cheek-button:disabled { opacity: .52; cursor: default; }
kbd {
  display: inline-block;
  margin-left: 3px;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 4px;
  padding: 0 5px;
  font: inherit;
  font-size: .72em;
}
@media (max-width: 820px) {
  .status-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-preview { min-height: 205px; }
  .status-panel .hp-status { grid-column: span 2; }
  .game-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-controls button { min-width: 0; padding-inline: 8px; font-size: .84rem; }
  .escape-button { margin-left: 0; }
  .warning-banner { top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .warning-banner { animation: none; }
}


/* Keep gameplay and playable controls in the stage. */
.game-stage { min-height: 320px; }
.game-stage canvas { object-fit: contain; }
.stage-hud {
  position: absolute; z-index: 2;
  top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left));
  width: 112px; padding: 6px 8px; border-radius: 7px;
  background: rgba(12, 23, 32, .8); color: #fff;
  pointer-events: none; font-size: 11px; line-height: 1.3;
}
.stage-hud strong { display: block; font-size: 12px; }
.stage-hud .hp-track { margin: 3px 0 5px; height: 5px; }
.screen-controls {
  top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
  gap: 4px; pointer-events: none;
}
.screen-controls button { pointer-events: auto; min-height: 44px; padding-inline: 6px; font-size: 11px; }
.game-controls {
  position: absolute; z-index: 3; inset: auto 0 0;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 0 max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  gap: 8px; margin: 0; pointer-events: none;
}
.game-controls button { pointer-events: auto; min-width: 0; min-height: 44px; padding: 0 8px; font-size: 13px; }
#leftButton { grid-column: 1; grid-row: 1; justify-self: start; }
#escapeButton { grid-column: 2; grid-row: 1; justify-self: center; margin: 0; }
#rightButton { grid-column: 3; grid-row: 1; justify-self: end; }
.stage-start { top: 50%; bottom: auto; min-height: 44px; transform: translate(-50%, -50%); }
.warning-banner { top: 78px; font-size: 14px; padding: 5px 12px; pointer-events: none; }
.game-stage:fullscreen, .game-stage.pseudo-fullscreen {
  width: 100vw; height: 100vh; height: 100dvh; min-height: 0;
  max-width: none; aspect-ratio: auto; border: 0; border-radius: 0;
}
.game-stage.pseudo-fullscreen { position: fixed; z-index: 10000; inset: 0; }
@media (max-width: 640px) {
  .status-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-panel strong { font-size: 13px; }
  .stage-start { min-width: 180px; font-size: 14px; }
}

.screen-controls button { min-width: 44px; }
#leftButton, #rightButton { min-width: 64px; }
#escapeButton { min-width: 96px; min-height: 48px; }

/* Separate audio control from the HUD and existing top controls. */
.stage-audio { position: absolute; z-index: 3; top: 66px; right: max(8px, env(safe-area-inset-right)); min-width: 48px; min-height: 44px; padding: 0 8px; font-size: 12px; }

.score-card {
  position: absolute; z-index: 2;
  top: calc(96px + env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left));
  width: 144px; padding: 8px; border-radius: 7px;
  background: rgba(12, 23, 32, .88); color: #fff;
  pointer-events: none; line-height: 1.2;
}
.score-label { font-size: 13px; }
.score-total, .score-pending { white-space: nowrap; }
.score-total b { font-size: 28px; }
.score-total span, .score-pending span { margin-left: 4px; font-size: 12px; }
.score-attempt { margin-top: 6px; color: #ffe079; }
.score-pending b { font-size: 26px; }
.score-note { font-size: 12px; }
.score-rate { margin-top: 5px; white-space: nowrap; font-size: 14px; }
@media (max-width: 640px) {
  .score-card { width: 88px; padding: 6px; }
  .score-label { font-size: 11px; }
  .score-total b, .score-pending b { font-size: 24px; }
  .score-total b, .score-pending b { font-family: Arial, sans-serif; font-variant-numeric: tabular-nums; }
  .score-total span, .score-pending span { margin-left: 0; font-size: 10px; }
  .score-note { font-size: 10px; }
  .score-rate { font-size: 11px; }
}
@media (max-width: 360px) {
  .score-card { width: 76px; }
  .score-total b, .score-pending b { font-size: 22px; }
}
