:root {
  --cobalt: #1e5a8a;
  --sea: #5eb8a8;
  --coral: #d4574a;
  --lemon: #ffe566;
  --ivory: #f2e6c9;
  --ink: #2a2420;
  --panel: rgba(42, 36, 32, 0.9);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #9ec5c0 0%, #7ec8e3 45%, #c8b898 100%);
  line-height: 1.55;
}

.masthead {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.masthead a {
  color: var(--cobalt);
  text-decoration: none;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.intro {
  text-align: center;
  margin-bottom: 0.65rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--cobalt);
}

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

.game-layout {
  display: grid;
  gap: 1rem;
}

.game-column {
  width: 100%;
  max-width: min(100vw - 2rem, 560px);
  margin-inline: auto;
}

@media (min-width: 920px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .game-column {
    max-width: none;
  }

  canvas {
    max-height: min(68vh, 680px);
  }

  .game-shell {
    width: 100%;
    max-width: calc(min(68vh, 680px) * 540 / 760);
  }
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  font-size: 0.74rem;
}

.hud div,
.gauge-wrap {
  background: var(--panel);
  color: var(--ivory);
  border-radius: 0.5rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
}

.hud strong {
  color: var(--lemon);
  font-size: 1.02rem;
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gauge-label {
  font-size: 0.65rem;
  opacity: 0.85;
}

.gauge-lights {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.gauge-lights span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.gauge-lights span.on {
  background: var(--lemon);
  box-shadow: 0 0 6px rgba(255, 229, 102, 0.8);
}

.game-shell {
  position: relative;
  margin-inline: auto;
  width: min(100%, 560px);
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid rgba(30, 90, 138, 0.35);
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 760;
  background: #7ec8e3;
}

.burapi-climber {
  position: absolute;
  left: 50%;
  bottom: 28%;
  width: clamp(96px, 26vw, 128px);
  translate: -50% 0;
  pointer-events: none;
  z-index: 2;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
  transform-origin: center bottom;
}

.burapi-climber[hidden] {
  display: none !important;
}

.start-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.45rem;
  padding: 1rem;
  text-align: center;
  background: rgba(232, 220, 200, 0.92);
  z-index: 3;
}

.start-panel[hidden] {
  display: none !important;
}

#start,
.share,
.sub-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#start,
.share {
  background: linear-gradient(180deg, #ffe566, #d4a017);
}

.sub-btn {
  background: rgba(94, 184, 168, 0.25);
  border: 1px solid var(--sea);
}

.live {
  margin: 0 0 0.4rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--panel);
  color: var(--ivory);
  border-radius: 0.55rem;
  text-align: center;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mission {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(30, 90, 138, 0.25);
}

.tips {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

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

.reset {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: 1px dashed var(--sea);
  background: transparent;
  border-radius: 0.4rem;
  cursor: pointer;
  font: inherit;
}

.hook {
  position: absolute;
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: var(--cobalt);
  pointer-events: none;
  z-index: 1;
}

html[data-promo="shot"] .masthead,
html[data-promo="shot"] .intro,
html[data-promo="shot"] .mission {
  display: none !important;
}

html[data-promo="shot"] main {
  padding-top: 0.5rem;
}

html[data-promo="shot"] .game-column {
  max-width: 540px;
}

  display: none !important;
}

html[data-capture="1"] .capture-only {
  display: block;
}

html:not([data-capture="1"]) .capture-only {
  display: none;
}

html[data-capture="1"] body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

html[data-capture="1"] main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.35rem 0;
  max-width: none;
}

html[data-capture="1"] .game-column {
  width: min(88vw, calc((100dvh - 8.5rem) * 540 / 760));
  margin-inline: auto;
}

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