[hidden]{display:none!important}

/* ============================================================
   CSS 変数（visual.md カラーパレット）
   ============================================================ */
:root {
  --color-primary: #1a1209;
  --color-amber: #c97c22;
  --color-amber-dark: #a85e14;
  --color-gold: #e8b84b;
  --color-charcoal: #392d1f;
  --color-cream: #f5f0e8;
  --color-offwhite: #faf8f4;
  --color-coolgray: #8a8a8a;
  --color-text: #1a1209;
  --color-textsub: #5c4a30;

  /* フェーズ連動カラー */
  --phase-bg-low: linear-gradient(to bottom, #d0d8e4, #e8e4dc);
  --phase-bg-high: linear-gradient(to bottom, #3d1a00, #6b2d00);
  --phase-ring-low: #7aafc8;
  --phase-ring-high: #e85c00;

  /* タイポ */
  --font-serif-jp: "Noto Serif JP", serif;
  --font-sans-jp: "Noto Sans JP", system-ui, sans-serif;
  --font-cormorant: "Cormorant Garamond", "Noto Serif JP", serif;

  /* レイアウト */
  --radius-card: 12px;
  --radius-btn: 8px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.15);
  --shadow-modal: 0 8px 32px rgba(0,0,0,0.25);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans-jp);
  color: var(--color-text);
  background: var(--color-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; }
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
}

/* ============================================================
   画面切替の基盤
   ============================================================ */
.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.bg-hero { background-image: url(assets/hero.jpg); }
.bg-game {
  background-image: url(assets/game-bg.jpg);
  opacity: 0.33;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.bg-result { background-image: url(assets/result-success.jpg); }
.bg-result.is-fail { background-image: url(assets/result-fail.jpg); }
.bg-hayami { background-image: url(assets/hayami-bg.jpg); }

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(26,18,9,0.55) 0%,
    rgba(26,18,9,0.4) 50%,
    rgba(26,18,9,0.78) 100%);
  z-index: 1;
}
.bg-overlay-mode {
  background: linear-gradient(to bottom,
    rgba(26,18,9,0.65) 0%,
    rgba(26,18,9,0.5) 50%,
    rgba(26,18,9,0.8) 100%);
}
.bg-overlay-result {
  background: linear-gradient(to bottom,
    rgba(26,18,9,0.45) 0%,
    rgba(26,18,9,0.55) 60%,
    rgba(26,18,9,0.85) 100%);
}
.bg-overlay-share {
  background: linear-gradient(to bottom,
    rgba(26,18,9,0.7) 0%,
    rgba(26,18,9,0.85) 100%);
}

/* ============================================================
   ミュートボタン（全画面共通）
   ============================================================ */
.btn-mute {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(245,240,232,0.3);
  background: rgba(26,18,9,0.55);
  color: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.btn-mute:hover { background: rgba(26,18,9,0.75); }

/* ============================================================
   HERO 画面
   ============================================================ */
.hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 20px 40px;
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-cream);
}
.hero-canvas-wrap {
  width: 100%;
  max-width: 320px;
  margin-bottom: 16px;
}
#canvas-hero {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(201,124,34,0.4) 0%, rgba(26,10,0,0.8) 80%);
  box-shadow: 0 0 60px rgba(232,184,75,0.15), inset 0 0 40px rgba(0,0,0,0.5);
}
.hero-eyebrow {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  margin: 8px 0 4px;
  color: var(--color-gold);
  opacity: 0.85;
}
.hero-title {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(36px, 9vw, 56px);
  letter-spacing: 0.06em;
  margin: 4px 0 12px;
  color: var(--color-cream);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-sub {
  font-family: var(--font-serif-jp);
  font-size: clamp(15px, 4vw, 18px);
  margin: 0 0 24px;
  opacity: 0.92;
}
.hero-poem {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: clamp(13px, 3.5vw, 14px);
  line-height: 1.9;
  margin: 16px 0 32px;
  opacity: 0.85;
  max-width: 460px;
}

/* ============================================================
   ボタン
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  min-height: 48px;
  background: var(--color-amber);
  color: var(--color-primary);
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover {
  background: var(--color-amber-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(201,124,34,0.4);
  color: var(--color-cream);
}
.btn-primary:active { transform: translateY(0); }
.btn-large { min-height: 56px; padding: 16px 32px; font-size: 16px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 44px;
  background: transparent;
  color: var(--color-amber);
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid var(--color-amber);
  border-radius: var(--radius-btn);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--color-amber);
  color: var(--color-primary);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--color-cream);
  font-family: var(--font-sans-jp);
  font-size: 14px;
  padding: 10px 18px;
  min-height: 44px;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.btn-text:hover { opacity: 1; }

/* ============================================================
   免責
   ============================================================ */
.disclaimer {
  font-size: 11.5px;
  line-height: 1.6;
  opacity: 0.65;
  margin: 24px auto 0;
  max-width: 440px;
}
.disclaimer-small { font-size: 11px; }

/* ============================================================
   モード選択
   ============================================================ */
.mode-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-cream);
}
.mode-title {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(24px, 6vw, 32px);
  margin: 0 0 8px;
}
.mode-sub {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 14px;
  opacity: 0.8;
  margin: 0 0 32px;
}
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 440px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  padding: 20px 22px;
  background: rgba(245,240,232,0.10);
  border: 1.5px solid rgba(245,240,232,0.25);
  border-radius: var(--radius-card);
  color: var(--color-cream);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  min-height: 110px;
}
.mode-card:hover {
  border-color: var(--color-amber);
  background: rgba(245,240,232,0.18);
  transform: translateY(-2px);
}
.mode-icon { font-size: 22px; }
.mode-name {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 18px;
  margin-top: 2px;
}
.mode-desc { font-size: 13.5px; line-height: 1.6; opacity: 0.9; }
.mode-tag {
  font-size: 11.5px;
  color: var(--color-gold);
  margin-top: 4px;
  opacity: 0.85;
}

/* ============================================================
   GAME 画面
   ============================================================ */
#screen-game {
  background: linear-gradient(to bottom, #2a1a08 0%, #1a0d00 100%);
}
.game-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  box-shadow: inset 0 0 0 0 rgba(232,92,0,0);
  transition: box-shadow 0.3s;
}
.game-overlay.is-spike-alert {
  animation: spike-blink 0.25s alternate 4;
}
.game-overlay.is-phase-shift {
  box-shadow: inset 0 0 80px 8px rgba(232,92,0,0.6);
  animation: phase-flash 0.8s ease-out;
}
@keyframes spike-blink {
  from { box-shadow: inset 0 0 60px 4px rgba(232,92,0,0); }
  to { box-shadow: inset 0 0 60px 8px rgba(232,92,0,0.55); }
}
@keyframes phase-flash {
  0% { box-shadow: inset 0 0 80px 8px rgba(232,92,0,0.9); }
  100% { box-shadow: inset 0 0 80px 0 rgba(232,92,0,0); }
}

.game-header {
  position: relative;
  z-index: 20;
  padding: 56px 16px 8px;
  color: var(--color-cream);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.game-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.phase-label {
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  background: rgba(26,18,9,0.55);
  border-radius: 16px;
  border: 1px solid rgba(245,240,232,0.2);
}
.timer {
  font-family: var(--font-cormorant);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
}
.timer.is-warning { color: #ff7e5a; }

.score-bars { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.score-bar { display: flex; align-items: center; gap: 10px; }
.score-bar-label {
  font-size: 11.5px;
  flex-shrink: 0;
  width: 70px;
  opacity: 0.85;
}
.score-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(245,240,232,0.18);
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-gold), var(--color-amber));
  border-radius: 4px;
  transition: width 0.2s, background 0.2s;
}
.score-bar-fill.is-out-zone {
  background: linear-gradient(to right, #c9963a, #c44b1a);
}
.score-bar-value {
  font-family: var(--font-cormorant);
  font-weight: 700;
  font-size: 18px;
  width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.op-guide {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 12.5px;
  text-align: center;
  margin: 8px 0 0;
  opacity: 0.85;
}

.game-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  padding: 12px 16px;
}
#canvas-game {
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 56vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,0,0,0.3);
}

.spike-toast,
.cool-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 18px;
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 13px;
  z-index: 22;
  animation: toast-fade 0.6s ease-out;
}
.spike-toast {
  background: rgba(196,75,26,0.85);
  color: var(--color-cream);
}
.cool-toast {
  background: rgba(232,184,75,0.9);
  color: var(--color-primary);
  letter-spacing: 0.1em;
}
@keyframes toast-fade {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  20% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.game-footer {
  position: relative;
  z-index: 20;
  padding: 12px 16px 28px;
  background: linear-gradient(to top, rgba(26,10,0,0.85), transparent);
  color: var(--color-cream);
}
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 4px;
}
.flame-icon { flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.flame-icon.is-pulse {
  animation: flame-pulse 0.55s ease-in-out 4 alternate;
}
@keyframes flame-pulse {
  from { opacity: 1; transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) drop-shadow(0 0 10px rgba(232,184,75,0.85)); }
  to   { opacity: 0.4; transform: scale(0.9); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
}

/* スライダー＋ゾーン帯の重ね合わせ */
.slider-stack {
  position: relative;
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
}
.slider-zone {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  background: rgba(76, 175, 80, 0.30);
  border: 1px solid rgba(120, 200, 110, 0.55);
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.45), inset 0 0 6px rgba(255,255,255,0.15);
  left: 15%;
  width: 15%;
  transition: left 0.5s ease, width 0.5s ease, background 0.3s;
}
.slider-zone.is-phase-shift {
  animation: zone-shift-flash 0.9s ease-out;
}
@keyframes zone-shift-flash {
  0% { background: rgba(232,184,75,0.55); box-shadow: 0 0 24px rgba(232,184,75,0.7); }
  100% { background: rgba(76, 175, 80, 0.30); box-shadow: 0 0 12px rgba(76, 175, 80, 0.45); }
}

/* スライダーカスタム */
.slider-fire {
  position: relative;
  z-index: 2;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #4a7db5 0%, #c97c22 50%, #e85c00 100%);
  outline: none;
  margin: 0;
  cursor: pointer;
}
.slider-fire::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-cream);
  border: 3px solid var(--color-amber);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: transform 0.1s;
}
.slider-fire::-webkit-slider-thumb:active { transform: scale(1.15); }
.slider-fire::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-cream);
  border: 3px solid var(--color-amber);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
/* タッチ判定エリア拡張 */
.slider-wrap { min-height: 60px; }

.slider-cap {
  text-align: center;
  font-size: 11px;
  margin: 4px 0 0;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* ============================================================
   RESULT 画面
   ============================================================ */
.result-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 56px 18px 36px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  color: var(--color-cream);
}
.result-tabs {
  display: flex;
  gap: 4px;
  background: rgba(26,18,9,0.6);
  border-radius: var(--radius-card);
  padding: 4px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.result-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--color-cream);
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
}
.result-tab.is-active {
  background: var(--color-amber);
  color: var(--color-primary);
}

.result-pane { display: none; }
.result-pane.is-active { display: block; animation: pane-fade 0.4s; }
@keyframes pane-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rank-eyebrow {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--color-gold);
  margin: 0;
  text-align: center;
}
.rank-name {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(26px, 7vw, 34px);
  margin: 8px 0 12px;
  text-align: center;
  letter-spacing: 0.04em;
  animation: rank-slidein 0.5s ease-out;
}
@keyframes rank-slidein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rank-comment {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 14px;
  line-height: 1.9;
  margin: 0 0 24px;
  text-align: center;
  opacity: 0.92;
  white-space: pre-line;
  animation: rank-slidein 0.6s ease-out 0.15s both;
}

.scores-display {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(245,240,232,0.08);
  border: 1px solid rgba(245,240,232,0.15);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 92px;
}
.score-cell-label {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 4px;
}
.score-cell-value {
  font-family: var(--font-cormorant);
  font-weight: 700;
  font-size: 38px;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.score-cell-unit { font-size: 11px; opacity: 0.6; margin-top: 2px; }

.kura-voice-card {
  background: rgba(245,240,232,0.08);
  border-left: 3px solid var(--color-amber);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0 20px;
}
.kura-voice {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.85;
  margin: 0;
  opacity: 0.9;
  white-space: pre-line;
}
.kura-voice-hayami {
  margin-top: 24px;
  text-align: center;
  opacity: 0.75;
}

.best-record {
  text-align: center;
  font-size: 12.5px;
  margin-bottom: 16px;
  color: var(--color-gold);
  opacity: 0.9;
  min-height: 18px;
}

.action-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 18px;
}
.action-grid .btn-primary,
.action-grid .btn-secondary { width: 100%; }

.cta-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0 24px;
  text-align: center;
}
.cta-link {
  color: var(--color-gold);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(232,184,75,0.2);
  opacity: 0.9;
  transition: opacity 0.15s;
}
.cta-link:hover { opacity: 1; border-color: var(--color-gold); }

/* ============================================================
   早見表
   ============================================================ */
#pane-hayami { position: relative; }
#pane-hayami .bg-photo {
  border-radius: var(--radius-card);
  opacity: 0.18;
}

.hayami-title {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 4px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.hayami-sub {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 13px;
  margin: 0 0 12px;
  opacity: 0.8;
  text-align: center;
  position: relative;
  z-index: 2;
}
.hayami-mark {
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-gold);
  text-align: center;
  margin: 8px 0 12px;
  animation: rank-slidein 0.5s ease-out 0.3s both;
  position: relative;
  z-index: 2;
}

.hayami-table-wrap {
  position: relative;
  z-index: 2;
  background: rgba(26,18,9,0.5);
  border-radius: 10px;
  padding: 4px;
  overflow-x: auto;
}
.hayami-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans-jp);
  font-size: 12.5px;
}
.hayami-table thead th {
  background: rgba(201,124,34,0.25);
  color: var(--color-cream);
  font-weight: 700;
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(92,74,48,0.5);
}
.hayami-table tbody td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(245,240,232,0.1);
  vertical-align: top;
}
.hayami-table tbody tr.is-active {
  background: rgba(232,184,75,0.18);
  box-shadow: inset 4px 0 0 var(--color-amber);
}
.hayami-table .kv {
  display: block;
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 11.5px;
  color: var(--color-gold);
  opacity: 0.85;
  margin-top: 4px;
}
.hayami-table td:nth-child(2),
.hayami-table td:nth-child(3) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hayami-note {
  font-size: 11px;
  color: var(--color-coolgray);
  margin: 20px 0 0;
  line-height: 1.7;
  position: relative;
  z-index: 2;
  opacity: 0.85;
}

/* ============================================================
   SHARE 画面
   ============================================================ */
.share-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 56px 18px 32px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
  color: var(--color-cream);
  text-align: center;
}
.share-title {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 6px;
}
.share-sub {
  font-size: 13px;
  opacity: 0.8;
  margin: 0 0 24px;
}
.share-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 24px;
  aspect-ratio: 9 / 16;
  background: rgba(245,240,232,0.05);
  border: 1px solid rgba(245,240,232,0.18);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.share-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.share-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.8;
  margin: 0;
}
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.share-actions a { width: 100%; }

.safari-hint {
  font-size: 11.5px;
  opacity: 0.7;
  margin: 8px 0 16px;
}

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 3;
  background: var(--color-primary);
  color: var(--color-coolgray);
  text-align: center;
  padding: 24px 20px 28px;
  font-size: 11px;
  line-height: 1.7;
}
.site-footer p { margin: 0 0 8px; }
.ai-credit { opacity: 0.6; font-size: 10.5px; margin-top: 12px !important; }

/* ============================================================
   9:16 シェアカード（隠しDOM）
   ============================================================ */
.share-card-hidden {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
}
.share-card-root {
  position: relative;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
  font-family: var(--font-serif-jp);
  color: var(--color-cream);
}
.share-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.share-card-bg.is-success {
  background-image:
    linear-gradient(160deg, rgba(232,184,75,0.4) 0%, rgba(201,124,34,0.55) 40%, rgba(26,18,9,0.92) 100%),
    url(assets/result-success.jpg);
}
.share-card-bg.is-fail {
  background-image:
    linear-gradient(160deg, rgba(57,45,31,0.85) 0%, rgba(26,10,0,0.95) 60%, rgba(0,0,0,0.95) 100%),
    url(assets/result-fail.jpg);
}
.share-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(26,18,9,0.3) 0%,
    rgba(26,18,9,0.0) 40%,
    rgba(26,18,9,0.5) 100%);
}
.share-card-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 130px 90px 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.share-card-header { text-align: center; }
.share-card-brand {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 92px;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.share-card-brand-en {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.2em;
  margin: 0;
  opacity: 0.85;
  color: var(--color-gold);
}

.share-card-body { text-align: center; }
.share-card-eyebrow {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 38px;
  letter-spacing: 0.2em;
  margin: 0 0 30px;
  color: var(--color-gold);
}
.share-card-rank {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 92px;
  letter-spacing: 0.06em;
  margin: 0 0 32px;
  text-shadow: 0 6px 30px rgba(0,0,0,0.65);
  line-height: 1.2;
}
.share-card-comment {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 36px;
  line-height: 1.8;
  margin: 0 0 50px;
  opacity: 0.95;
  white-space: pre-line;
}

.share-card-scores {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-bottom: 20px;
}
.share-card-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(26,18,9,0.55);
  padding: 28px 50px;
  border-radius: 18px;
  border: 2px solid rgba(232,184,75,0.4);
}
.sc-label {
  font-family: var(--font-sans-jp);
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.85;
}
.sc-value {
  font-family: var(--font-cormorant);
  font-weight: 700;
  font-size: 110px;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.sc-unit { font-size: 28px; opacity: 0.65; margin-top: 4px; }

.share-card-footer { text-align: center; }
.share-card-tag {
  font-family: var(--font-sans-jp);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: 0.12em;
  margin: 0 0 18px;
  color: var(--color-gold);
}
.share-card-note {
  font-family: var(--font-serif-jp);
  font-style: italic;
  font-size: 28px;
  margin: 0 0 24px;
  opacity: 0.9;
}
.share-card-disclaimer {
  font-size: 20px;
  opacity: 0.55;
  margin: 0;
}

/* ============================================================
   PC レイアウト
   ============================================================ */
@media (min-width: 768px) {
  .mode-cards { flex-direction: row; }
  .mode-card { flex: 1; min-height: 160px; }

  .game-header { padding: 56px 24px 8px; }
  #canvas-game { max-height: 60vh; }

  .action-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .action-grid .btn-primary { flex-basis: 100%; }
  .action-grid .btn-secondary { flex: 1; min-width: 140px; }

  .share-actions { flex-direction: row; flex-wrap: wrap; }
  .share-actions .btn-primary { flex-basis: 100%; }
  .share-actions .btn-secondary { flex: 1; min-width: 110px; }
}

@media (min-width: 1024px) {
  .hero-canvas-wrap { max-width: 380px; }
  #canvas-hero { /* 大型化 */ }
  .game-canvas-wrap { padding: 16px 20px; }
}

/* ============================================================
   reduced-motion 配慮
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .game-overlay.is-spike-alert,
  .game-overlay.is-phase-shift { animation: none; }
}
