:root {
  --ink: #1e2038;
  --sky: #5a5888;
  --mint: #78d8c8;
  --brass: #c8a050;
  --coral: #f08070;
}

*,
*::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(--ink);
  background: linear-gradient(180deg, #1a1838 0%, #3a3868 38%, #6a6898 72%, #9898b8 100%);
}

a {
  color: #4a88c8;
}

.masthead {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
}

#sound {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.intro {
  text-align: center;
  padding: 0 1rem 0.25rem;
  color: #f0f0ff;
}

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

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

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

.hud {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.72rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.hud strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.1;
}

.live {
  text-align: center;
  font-size: 0.92rem;
  color: #fff;
  margin: 0.15rem 0 0.4rem;
  min-height: 1.35em;
}

.stage-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(8, 6, 24, 0.45),
    0 0 0 1px rgba(200, 220, 255, 0.12);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  background: #2a2848;
}

.burapi {
  position: absolute;
  right: 4%;
  bottom: 3%;
  width: 56px;
  height: auto;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.pull-hint {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  animation: hint-pull 1.1s ease-in-out infinite;
  pointer-events: none;
}

.pull-hint::after {
  content: "↓";
  position: absolute;
  left: 50%;
  top: 110%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1.1rem;
}

@keyframes hint-pull {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(22px);
    opacity: 0.95;
  }
}

.start-btn {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(180deg, #88e8d8, #48b8a8);
  color: #1a2830;
  cursor: pointer;
}

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

.result-panel {
  margin-top: 0.85rem;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
}

.rank-badge {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0;
  color: var(--brass);
}

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

.guide h2 {
  font-size: 1rem;
}

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

.records div {
  text-align: center;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.records dt {
  font-size: 0.65rem;
}

.records dd {
  margin: 0.1rem 0 0;
  font-weight: 800;
}

.reset,
.share {
  font-family: inherit;
  cursor: pointer;
}

.reset {
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: transparent;
  color: #fff;
}

.share {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  background: #1a1a1a;
  color: #fff;
}

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

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

html[data-capture="1"] .play-shell {
  max-width: 100%;
  padding: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html[data-capture="1"] .play-shell {
  position: relative;
}

html[data-capture="1"] .stage-wrap {
  width: min(100vw, calc(100dvh * 540 / 620));
  max-width: min(100vw, calc(100dvh * 540 / 620));
  margin: 0 auto;
  border-radius: 0;
  box-shadow: none;
}

html[data-capture="1"] #game {
  width: 100%;
  height: auto;
}

html[data-capture="1"] .hud,
html[data-capture="1"] .live {
  padding-inline: max(12px, env(safe-area-inset-right));
  padding-left: max(12px, env(safe-area-inset-left));
}

html[data-capture="1"] .result-panel {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 6%;
  margin: 0;
  padding: 0.75rem 0.85rem 0.85rem;
  z-index: 4;
  background: rgba(12, 16, 36, 0.82);
  border: 1px solid rgba(200, 220, 255, 0.22);
  backdrop-filter: blur(6px);
}

html[data-capture="1"] .result-panel .result-game-title {
  display: block;
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #88e8d8;
  letter-spacing: 0.04em;
}

html[data-capture="1"] .result-panel .rank-badge {
  font-size: 2rem;
  margin: 0;
}

html[data-capture="1"] .result-panel h2,
html[data-capture="1"] .result-panel #result-title {
  font-size: 1rem;
  margin: 0.15rem 0;
  color: #fff8ec;
}

html[data-capture="1"] .result-panel #result-copy {
  font-size: 0.82rem;
  margin: 0;
  color: #f3ead8;
  line-height: 1.45;
}

html[data-capture="1"] .result-panel .rank-badge {
  color: #fff6d8;
  text-shadow: 0 0 12px rgba(255, 220, 140, 0.35);
}

html[data-shot="1"] {
  overflow: hidden;
  height: 100%;
}

html[data-shot="1"] .masthead,
html[data-shot="1"] .intro,
html[data-shot="1"] .guide,
html[data-shot="1"] .start-btn,
html[data-shot="1"] .result-panel,
html[data-shot="1"] .live {
  display: none !important;
}

html[data-shot="1"] body {
  background: #0e1024;
  margin: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

html[data-shot="1"] main {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

html[data-shot="1"] .play-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

html[data-shot="1"] .hud {
  margin: 0;
  font-size: 0.95rem;
}

html[data-shot="1"] .hud strong {
  font-size: 1.35rem;
}

html[data-shot="1"] .stage-wrap {
  width: 80vw;
  max-width: 1632px;
  margin: 0;
  flex-shrink: 0;
}

html[data-shot="1"] #game {
  width: 100%;
  height: auto;
  vertical-align: top;
}

@media (prefers-reduced-motion: reduce) {
  .pull-hint {
    animation: none;
    opacity: 0.7;
  }
}
