:root {
  --bg: #0c1820;
  --mint: #8fe0c6;
  --text: #edf6f3;
  --muted: #93b5aa;
  --panel: rgba(10, 26, 34, 0.94);
  --line: rgba(127, 212, 184, 0.38);
  --amber: #f0b868;
}

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

html {
  background: radial-gradient(ellipse at 50% 0%, #1a3040 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

body {
  margin: 0;
  min-height: 100dvh;
}

a {
  color: var(--mint);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

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

.masthead button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

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

.intro .eyebrow {
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}

.intro h1 {
  margin: 0.25rem 0;
  font-size: 1.35rem;
}

.intro h1 span {
  display: block;
  font-size: 1.05rem;
  color: var(--mint);
}

.intro p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.hud {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.hud small {
  color: var(--muted);
  margin-right: 0.2rem;
}

.hud strong {
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}

.live {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.4em;
  margin: 0 0 0.35rem;
}

.banner {
  text-align: center;
  background: rgba(200, 90, 80, 0.25);
  border: 1px solid rgba(255, 120, 100, 0.5);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0 0.5rem 0.35rem;
  font-size: 0.9rem;
}

.stage-wrap {
  display: flex;
  justify-content: center;
}

canvas {
  width: min(100%, 540px);
  height: auto;
  touch-action: none;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 185, 0.35);
  background: #152530;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.panel {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(92%, 360px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1rem;
  text-align: center;
  z-index: 2;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.panel p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.btn-primary {
  background: var(--mint);
  color: #0a1818;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.summary .rank {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mint);
  margin: 0.25rem 0;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.stats li {
  margin: 0.2rem 0;
}

.hint {
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.9;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.records {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.linkish {
  background: none;
  border: none;
  color: var(--mint);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

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

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

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

html[data-capture="1"] .play-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  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;
}

html[data-capture="1"] canvas {
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  box-shadow: none;
}

.capture-only {
  display: none;
}

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

html[data-capture="1"] #summary {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 7%;
  top: auto;
  transform: none;
  width: auto;
  padding: 0.85rem 0.9rem 0.95rem;
  background: rgba(10, 24, 32, 0.86);
  border-color: rgba(140, 200, 185, 0.35);
  backdrop-filter: blur(6px);
  z-index: 5;
}

html[data-capture="1"] .summary-game-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--mint);
  letter-spacing: 0.04em;
}

html[data-capture="1"] .summary-burapi {
  margin: 0 auto 0.35rem;
  width: 72px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

html[data-capture="1"] #summary-title {
  font-size: 1rem;
  margin: 0.1rem 0;
}

html[data-capture="1"] .summary .rank {
  font-size: 2.2rem;
  margin: 0.15rem 0;
  text-shadow: 0 0 14px rgba(127, 212, 184, 0.35);
}

html[data-capture="1"] .summary .stats {
  font-size: 0.84rem;
  color: #e8f2f0;
}

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

html[data-promo="shot"] .play-shell {
  padding: 0;
  max-width: none;
}

html[data-promo="shot"] canvas {
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: 540px;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
