:root {
  --ink: #1a2830;
  --copper: #b87333;
  --mint: #5a9a8a;
  --paper: #e8e0d0;
  --dawn: #f0b88a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif;
  color: var(--paper);
  background: linear-gradient(180deg, #1a2830 0%, #243840 55%, #2a4048 100%);
}

a {
  color: #8fd4c4;
  text-decoration: none;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

#sound {
  border: 1px solid #5a7a88;
  background: transparent;
  color: var(--paper);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.intro {
  padding: 0 1rem 0.35rem;
  text-align: center;
}

.intro .eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.intro h1 {
  margin: 0.2rem 0;
  font-size: clamp(1.55rem, 5vw, 1.9rem);
}

.intro h1 span {
  color: var(--dawn);
}

.intro p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.play-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 0.5rem 1.5rem;
}

.hud {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  font-size: 0.78rem;
  opacity: 0.85;
}

.hud strong {
  display: block;
  font-size: 1.35rem;
  color: #fff;
}

.live {
  text-align: center;
  min-height: 1.4em;
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.stage-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: pointer;
  background: #243038;
}

/* Canvas の drawImage 用。画面上には描画しない */
#burapi {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.start-btn {
  display: block;
  width: min(100%, 340px);
  margin: 1rem auto 0;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, #e8c878, var(--copper));
  cursor: pointer;
}

.result-panel {
  margin-top: 1rem;
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.rank-badge {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--dawn);
}

.guide {
  max-width: 560px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.records {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.records dt {
  font-size: 0.68rem;
  opacity: 0.75;
}

.records dd {
  margin: 0;
  font-size: 1rem;
}

.reset,
.share {
  margin: 0.35rem 0.25rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #6a8a98;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.share {
  border-color: #8fd4c4;
  color: #8fd4c4;
}

html[data-capture="1"] .capture-hide {
  display: none !important;
}

html[data-capture="1"] .start-btn {
  display: none;
}

html[data-capture="1"] .play-shell {
  max-width: 100%;
  padding: 0;
}

html[data-capture="1"] body {
  background: #1a2830;
}

html[data-capture="1"] .stage-wrap {
  max-width: min(100vw, 420px);
  margin: 0 auto;
  border-radius: 0;
}

html[data-capture="1"] #game {
  max-height: min(92dvh, 760px);
}

html[data-promo="shot"] .capture-hide,
html[data-promo="shot"] .start-btn,
html[data-promo="shot"] .result-panel {
  display: none !important;
}

@media (min-width: 720px) {
  main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    max-width: 920px;
    margin: 0 auto;
    align-items: start;
  }

  .intro {
    grid-column: 1 / -1;
  }

  .play-shell {
    grid-column: 1;
  }

  .guide {
    grid-column: 2;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
