:root {
  --ink: #1a1830;
  --mint: #7fd4c4;
  --sky: #5a7fb8;
  --paper: #f8f4ea;
  --accent: #ffb88a;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--paper);
  background: var(--ink);
}

.sky-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #2a2850 0%, #5a7fb8 45%, #ffd8b0 100%);
  z-index: -1;
}

.masthead {
  padding: 12px 16px 0;
}

.back {
  color: var(--mint);
  text-decoration: none;
  font-size: 0.9rem;
}

.flock-app {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

.hero h1 {
  font-size: 1.65rem;
  margin: 0.2rem 0;
  line-height: 1.25;
}

.hero h1 span {
  display: block;
  color: var(--accent);
}

.kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin: 0;
}

.catch {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

.start-panel,
.play-panel,
.summary-panel {
  margin-top: 12px;
}

.rule-lead {
  font-size: 0.95rem;
  line-height: 1.5;
}

.kb-hint {
  font-size: 0.8rem;
  opacity: 0.85;
}

.btn-primary,
.btn-ghost,
.btn-text {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: none;
  padding: 0.65rem 1.2rem;
}

.btn-primary {
  background: linear-gradient(180deg, #ffe8a0, #ffb88a);
  color: var(--ink);
  font-weight: 700;
  width: 100%;
  max-width: 280px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--paper);
}

.btn-text {
  background: transparent;
  color: var(--mint);
  text-decoration: underline;
  padding: 0.4rem;
}

.records {
  font-size: 0.85rem;
  opacity: 0.9;
}

.hud-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: center;
  font-size: 0.78rem;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.canvas-wrap {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #87a8d8;
}

.live-msg,
.gate-hold {
  text-align: center;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.summary-panel h2 {
  color: var(--accent);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.utility-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.disclaimer {
  font-size: 0.75rem;
  opacity: 0.7;
}

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

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

html[data-capture="1"] #play-panel {
  display: block !important;
}

html[data-capture="1"] .flock-app {
  padding-top: 8px;
}

html[data-promo-shot="1"] .start-panel {
  display: none;
}

html[data-promo-shot="1"] #play-panel {
  display: block !important;
}

html[data-promo-shot="1"] .flock-app {
  min-height: 0;
  padding: 8px 0 20px;
}

html[data-promo-shot="1"] .live-msg {
  margin: 10px 16px 0;
}

html[data-promo-shot="1"] .canvas-wrap {
  margin: 0;
}

html[data-promo-shot="1"] #game-canvas {
  max-height: none;
}

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

@media (min-width: 480px) {
  .hero h1 {
    font-size: 1.85rem;
  }
}
