@charset "UTF-8";

/* =========================================================
   AstraHarmony / styles.css
   Glassmorphism UI (参考HTMLベース) ＋ 画面表示バグ修正
   ========================================================= */

:root {
  --bg: #030408;
  --bg-soft: #0a0d18;
  --glass-bg: rgba(200, 220, 240, 0.05);
  --glass-border: rgba(180, 210, 240, 0.15);
  --text: #f0f4f8;
  --text-dim: rgba(200, 220, 240, 0.65);
  --accent: #5c8cf2;
  --accent-2: #92b4f2;
  --gold: #b8ccdb;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(900px 620px at 50% -12%, #0b1530 0%, rgba(3, 4, 8, 0) 65%),
    radial-gradient(700px 500px at 88% 108%, #162445 0%, rgba(3, 4, 8, 0) 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  letter-spacing: 0.04em;
  line-height: 1.75;
  text-align: center;
}

/* ---------- 画面切り替え ---------- */
.screen { display: none; min-height: 100dvh; animation: fadeIn 0.7s var(--ease); }
/* .is-active が付いている時だけ表示する。表示形式を各画面ごとに指定 */
.screen.is-active { display: block; }
#screen-setup.is-active { display: flex; flex-direction: column; justify-content: center; }
#screen-summary.is-active { display: flex; flex-direction: column; justify-content: center; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.wrap { max-width: 560px; margin: 0 auto; padding: 5vw; }
.wrap--narrow { max-width: 500px; padding: 5vw; }

/* ========================================
   共通UIパーツ（Glass Container等）
   ======================================== */
.glass-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 32px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.btn { 
  display: inline-block; width: 100%; padding: 16px; border-radius: 8px; 
  font-size: 16px; font-weight: 600; border: none; cursor: pointer; transition: all 0.3s ease; 
}
.btn:active { transform: scale(0.98); }
.btn--primary { 
  background: var(--glass-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
}
.btn--primary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
  margin-top: 16px;
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.text-btn { 
  background: none; border: none; color: var(--accent); 
  font-weight: 600; cursor: pointer; text-decoration: underline; font-size: 14px; 
  margin-bottom: 24px; padding: 10px;
}
.text-btn:hover { color: #fff; }

/* ========================================
   1. トップ画面
   ======================================== */
.eyebrow { font-size: 13px; font-weight: 600; margin-bottom: 8px; letter-spacing: 0.1em; color: var(--accent); }
.logo { font-size: 32px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.05em; color: var(--text); }
.lede { font-size: 15px; margin-bottom: 32px; line-height: 1.6; color: var(--text-dim); }

/* フォーム・入力 */
.card { margin-top: 20px; } /* HTML側で.cardを使用している場合、glass-containerスタイルで上書き */
form.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 32px 24px;
  backdrop-filter: blur(10px);
}
.field { display: block; margin-bottom: 24px; }
.field__label { display: block; font-weight: 600; margin-bottom: 12px; font-size: 15px; color: var(--text); }
.date-dropdowns { 
  display: flex; justify-content: center; align-items: center; 
  gap: 8px; flex-wrap: wrap; /* スマホではみ出さないようにラップさせる */
}
.select-wrap { position: relative; flex: 1; min-width: 80px; }
.select-wrap::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.select-wrap select { 
  width: 100%;
  appearance: none; background: rgba(0,0,0,0.3); color: var(--text); 
  padding: 12px 32px 12px 12px; border: 1px solid var(--glass-border); border-radius: 6px; 
  font-size: 16px; font-family: inherit; cursor: pointer; 
  transition: border-color 0.2s;
}
.select-wrap select:focus { outline: none; border-color: var(--accent); }
.select-wrap select option { background: #111; color: #fff; }
.date-sep { font-size: 14px; color: var(--text-dim); }
.note { font-size: 12px; color: var(--text-dim); margin-bottom: 30px; line-height: 1.6; }

/* ========================================
   2. ホーム画面
   ======================================== */
.home-head { position: relative; margin-bottom: 30px; padding-top: 20px; }
.home-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; color: var(--text); }

/* メッセージ帯 */
.sky { 
  background: rgba(92, 140, 242, 0.05);
  border: 1px solid var(--glass-border);
  padding: 24px 20px; margin-bottom: 30px; 
  border-radius: 12px; 
}
.sky__line { margin: 0; font-size: 15px; line-height: 1.8; color: var(--text); }

/* 和音カード */
.chord-card { 
  background: var(--glass-bg);
  border: 1px solid var(--accent); /* 参考HTML風のアクセント枠 */
  border-radius: 12px; padding: 24px 20px; margin-bottom: 30px; 
}
.chord-card__head { font-weight: 600; font-size: 15px; margin: 0 0 20px; color: var(--accent); letter-spacing: 0.05em; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.chip { background: rgba(92, 140, 242, 0.1); padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--glass-border); color: var(--text); }
.chip strong { color: var(--gold); font-size: 15px; margin-right: 6px; }
.chord-formula { font-size: 18px; color: var(--accent-2); font-weight: 700; margin-bottom: 12px; letter-spacing: 0.1em; }
.chord-msg { font-size: 14px; line-height: 1.8; color: var(--text-dim); }

/* コントロール群 */
.controls { display: grid; gap: 24px; margin-bottom: 40px; }
.control { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.control__label { font-weight: 600; font-size: 14px; color: var(--text); }
.control__hint { font-size: 12px; color: var(--text-dim); }

.stepper { display: flex; align-items: center; gap: 16px; }
.stepper__btn { 
  width: 40px; height: 40px; border-radius: 50%; 
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); 
  font-size: 20px; color: var(--text); cursor: pointer; 
  transition: background 0.2s;
}
.stepper__btn:hover { background: rgba(255,255,255,0.1); }
.stepper__value { font-size: 24px; font-weight: 700; min-width: 80px; color: var(--text); }
.stepper__value small { font-size: 13px; margin-left: 4px; font-weight: normal; color: var(--text-dim); }

input[type="range"] { 
  -webkit-appearance: none; appearance: none;
  width: 100%; max-width: 240px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.2); 
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer;
}

/* トグルスイッチ */
.switch { 
  position: relative; width: 56px; height: 30px; border-radius: 30px; 
  background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); cursor: pointer; transition: background 0.3s; 
}
.switch__knob { 
  position: absolute; top: 1px; left: 1px; width: 26px; height: 26px; 
  border-radius: 50%; background: var(--text-dim); transition: transform 0.3s, background 0.3s; 
}
.switch.is-on { background: rgba(92, 140, 242, 0.35); border-color: rgba(92, 140, 242, 0.55); }
.switch.is-on .switch__knob { transform: translateX(26px); background: #fff; }

/* スタートボタン */
.orb {
  display: block; width: 160px; height: 160px; margin: 0 auto;
  border-radius: 50%; border: 1px solid rgba(146, 180, 242, 0.35);
  background: radial-gradient(circle at 50% 42%, rgba(146, 180, 242, 0.34), rgba(92, 140, 242, 0.12) 58%, transparent 72%);
  color: var(--text); font-family: inherit; font-size: 18px; font-weight: 700; letter-spacing: 0.1em; text-indent: 0.1em;
  cursor: pointer; position: relative; transition: transform 0.4s var(--ease);
  animation: pulse 7s ease-in-out infinite;
}
.orb:hover { transform: scale(1.03); }
.orb:active { transform: scale(0.98); }
.orb__inner { position: relative; z-index: 1; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 140, 242, 0.22), 0 0 44px rgba(92, 140, 242, 0.22) inset; }
  50%      { box-shadow: 0 0 0 22px rgba(92, 140, 242, 0), 0 0 76px rgba(120, 160, 242, 0.34) inset; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.foot-note { font-size: 12px; color: var(--text-dim); margin-top: 24px; line-height: 1.8; }


/* ========================================
   3. セッション再生画面
   ======================================== */
#screen-session { background: #05040c; color: var(--text); position: relative; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.session-ui { 
  position: relative; z-index: 10; min-height: 100dvh; 
  display: flex; flex-direction: column; justify-content: space-between; padding: 5vw; 
  transition: opacity 1.6s var(--ease);
}
.session-ui.is-dim { opacity: 0.06; }
.session-top { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-dim); }
.session-bottom { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-bottom: 20px; }

/* 音量コントローラー */
.vol-row { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 30px; backdrop-filter: blur(6px); }
.vol-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--glass-border); font-size: 18px; cursor: pointer; transition: background 0.2s;}
.vol-btn:hover { background: rgba(92, 140, 242, 0.22); }
.vol-meter { width: 120px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; position: relative; overflow: hidden; }
.vol-meter__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 70%; background: var(--accent); }

/* セッションアクションボタン */
.session-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ghost-btn { 
  padding: 10px 20px; border-radius: 8px; border: 1px solid var(--glass-border); 
  background: rgba(0,0,0,0.4); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px);
}
.ghost-btn:hover { background: rgba(255,255,255,0.1); }

/* ナレーションと暗転 */
.narration { 
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; 
  font-size: 18px; color: rgba(255,255,255,0); transition: color 2.4s var(--ease); pointer-events: none; z-index: 5; font-weight: 600; letter-spacing: 0.1em;
}
.narration.is-show { color: var(--text); }
.blackout { 
  position: fixed; inset: 0; z-index: 20; background: black; display: flex; align-items: center; justify-content: center; 
  opacity: 0; animation: blackoutIn 3.5s forwards; cursor: pointer; 
}
.blackout[hidden] { display: none; }
.blackout__note { color: rgba(255, 255, 255, 0.4); font-size: 13px; letter-spacing: 0.1em; animation: noteFade 9s forwards;}
@keyframes blackoutIn { to { opacity: 1; } }
@keyframes noteFade { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }


/* ========================================
   4. 終了・サマリー画面
   ======================================== */
.summary-line { font-size: 15px; margin-bottom: 24px; line-height: 1.6; color: var(--text-dim); }
.card--quiet { 
  background: var(--glass-bg);
  border: 1px solid var(--glass-border); 
  padding: 32px 20px; 
  border-radius: 12px; 
  margin-bottom: 40px; 
  backdrop-filter: blur(10px);
}
