/* ==========================================================
   羽ばたきバード - style.css
   宣伝画像（夕焼け空を舞う青とオレンジの絵画調の小鳥、光る結晶）に
   世界観を合わせた夕焼け/黄昏テーマ。
   ========================================================== */

:root {
  --color-sky-top: #241a4a;
  --color-sky-mid: #8a4a6a;
  --color-sky-bottom: #ffb14d;
  --color-primary: #ff7a3d;
  --color-primary-2: #3f8bff;
  --color-accent: #ffd166;
  --color-text: #3a2a1a;
  --color-text-muted: #8a6a55;
  --color-border: #4a2f2a;
  --color-panel: #fff8ec;
  --header-h: 56px;
  --score-h: 52px;
  --ad-h: 64px;
  --ad-gap-h: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-sky-bottom);
  color: var(--color-text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* ---------- ヘッダー ---------- */
.game-header {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem;
  background: rgba(255, 248, 236, 0.7);
  border-bottom: 3px solid var(--color-border);
  z-index: 20;
}

.back-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
}

.back-link:active {
  background: rgba(255, 255, 255, 1);
}

.game-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 1);
}

.icon-btn.is-muted {
  color: var(--color-text-muted);
}

/* ---------- スコアバー ---------- */
.score-bar {
  height: var(--score-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  z-index: 15;
}

.score-box {
  background: rgba(255, 248, 236, 0.85);
  border: 2px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-box__label {
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--color-text-muted);
}

.score-box__value {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--color-primary);
}

/* ---------- ゲームステージ ---------- */
.game-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  background: linear-gradient(180deg, var(--color-sky-top) 0%, var(--color-sky-mid) 55%, var(--color-sky-bottom) 100%);
}

/* ふわふわ漂う光の粒子（結晶のきらめき）装飾レイヤー */
.stage-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.deco-item {
  position: absolute;
  bottom: -10%;
  opacity: 0;
  animation: deco-float linear infinite;
}

.deco-item.spark-gold {
  color: var(--color-accent);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.9);
}

.deco-item.spark-blue {
  color: var(--color-primary-2);
  text-shadow: 0 0 10px rgba(63, 139, 255, 0.9);
}

@keyframes deco-float {
  0% { transform: translateY(0) scale(0.7) rotate(-10deg); opacity: 0; }
  12% { opacity: 0.9; }
  88% { opacity: 0.6; }
  100% { transform: translateY(-120vh) scale(1.2) rotate(16deg); opacity: 0; }
}

.deco-item:nth-child(1) { left: 6%;  font-size: 1rem;   animation-duration: 14s; animation-delay: 0s; }
.deco-item:nth-child(2) { left: 20%; font-size: 0.7rem;  animation-duration: 10.5s; animation-delay: 2.5s; }
.deco-item:nth-child(3) { left: 36%; font-size: 1.2rem;  animation-duration: 16s; animation-delay: 5s; }
.deco-item:nth-child(4) { left: 60%; font-size: 0.8rem;  animation-duration: 12s; animation-delay: 1s; }
.deco-item:nth-child(5) { left: 76%; font-size: 1.05rem; animation-duration: 15s; animation-delay: 7s; }
.deco-item:nth-child(6) { left: 90%; font-size: 0.65rem; animation-duration: 12.5s; animation-delay: 3.5s; }
.deco-item:nth-child(7) { left: 48%; font-size: 0.9rem;  animation-duration: 17s; animation-delay: 9s; }
.deco-item:nth-child(8) { left: 12%; font-size: 0.6rem;  animation-duration: 10s; animation-delay: 6s; }

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

/* ---------- 操作ヒント ---------- */
.control-hint {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-size: 0.9rem;
  font-weight: 900;
  color: #fff;
  background: rgba(58, 42, 26, 0.55);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.control-hint.is-hidden {
  opacity: 0;
}

/* ---------- オーバーレイ ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(36, 26, 74, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay__box {
  text-align: center;
  padding: 1.8rem 2rem;
  background: var(--color-panel);
  border: 3px solid var(--color-border);
  border-radius: 22px;
  max-width: 85%;
  box-shadow: 0 20px 50px rgba(36, 26, 74, 0.45), 0 0 30px rgba(255, 209, 102, 0.2);
}

.overlay__box--wide {
  max-width: min(92%, 460px);
  max-height: 88%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay__title {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}

.overlay__desc {
  color: var(--color-text-muted);
  margin: 0 0 1.3rem;
  font-size: 1rem;
  font-weight: bold;
}

.overlay__btn {
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.overlay__btn:active {
  filter: brightness(0.92);
}

/* ---------- ガイド画面 ---------- */
.guide-section {
  text-align: left;
  margin: 1rem 0;
}

.guide-section__title {
  font-size: 0.92rem;
  color: var(--color-primary);
  margin: 0 0 0.4rem;
}

.guide-section__text {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

.guide-section__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.guide-section__list li {
  margin-bottom: 0.3rem;
}

/* ---------- 広告スペース ---------- */
.ad-gap {
  flex: 0 0 var(--ad-gap-h);
  background: var(--color-sky-bottom);
}

.ad-slot {
  flex: 0 0 var(--ad-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 2px dashed var(--color-border);
  background: rgba(255, 248, 236, 0.7);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  z-index: 20;
  overflow: hidden;
}

@media (max-height: 620px) {
  .ad-slot {
    --ad-h: 44px;
    font-size: 0.65rem;
  }
  .ad-gap {
    --ad-gap-h: 10px;
  }
}
