/* ============================================================
   Luminous Re:Chord — グローバルスタイル
   ============================================================ */

:root {
  --bg-deep:    #07071a;
  --bg-dark:    #0d0d2b;
  --bg-card:    #12123a;
  --bg-card2:   #1a1a45;
  --primary:    #c97aff;
  --primary2:   #ff6fc8;
  --gold:       #ffd700;
  --text:       #e8e8ff;
  --text-muted: #8888bb;
  --border:     #2a2a5a;
  --radius:     12px;
  --radius-sm:  8px;
  --nav-h:      64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

/* ============================================================
   レイアウト
   ============================================================ */
#wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-deep);
}

#app {
  padding-bottom: calc(var(--nav-h) + 12px);
  min-height: calc(100vh - var(--nav-h));
}

/* ============================================================
   ナビゲーション
   ============================================================ */
#nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: linear-gradient(180deg, #0d0d2bee, #07071aee);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  background: none;
  border: none;
  font-size: 11px;
}
.nav-item .nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 4px var(--primary)); }

/* ============================================================
   汎用
   ============================================================ */
.screen { padding: 16px; }
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.screen-header h2 { font-size: 20px; color: var(--primary); }
.section-title {
  font-size: 13px; color: var(--text-muted);
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}
.empty-msg { color: var(--text-muted); text-align: center; padding: 24px; }
.warn-msg { color: #ff8c00; font-size: 12px; margin-top: 8px; }
.back-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 12px; border-radius: 20px;
  cursor: pointer; margin-bottom: 12px; font-size: 13px;
}
.back-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ============================================================
   通知バナー
   ============================================================ */
#notif {
  position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff; padding: 12px 24px; border-radius: 24px;
  font-size: 14px; font-weight: bold;
  transition: top 0.3s ease; z-index: 999;
  white-space: pre-line; text-align: center;
  box-shadow: 0 4px 20px rgba(201, 122, 255, 0.5);
  max-width: 360px; width: 90%;
}
#notif.show { top: 16px; }

/* ============================================================
   ホーム画面
   ============================================================ */
.home-screen { padding: 0; overflow: hidden; }

.home-header {
  text-align: center; padding: 20px 16px 0;
  background: linear-gradient(180deg, #1a0a3a, transparent);
}
.home-title {
  font-size: 22px; font-weight: bold;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.home-subtitle { font-size: 12px; color: var(--text-muted); letter-spacing: 4px; }

.home-char-area {
  position: relative; height: 300px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.home-char-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.home-char-img {
  height: 280px; object-fit: contain; position: relative; z-index: 2;
}
.home-char-placeholder {
  height: 280px; width: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px; gap: 8px; position: relative; z-index: 2;
}
.home-char-speech {
  position: absolute; bottom: 12px; left: 16px; right: 16px; z-index: 3;
  background: rgba(7,7,26,0.85); border-radius: 12px;
  padding: 10px 14px; border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.speech-name { font-size: 11px; font-weight: bold; display: block; margin-bottom: 2px; }
.speech-text { font-size: 13px; color: var(--text); }

.home-status-bar {
  display: flex; justify-content: center; gap: 32px;
  padding: 10px 16px; background: rgba(13,13,43,0.8);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.status-item { display: flex; align-items: center; gap: 6px; }
.status-icon { font-size: 18px; }
.status-val { font-size: 16px; font-weight: bold; color: var(--gold); }
.status-label { font-size: 11px; color: var(--text-muted); }

.home-menu {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; padding: 16px;
}
.menu-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: all 0.2s; color: var(--text);
}
.menu-btn:hover, .menu-btn:active { background: var(--bg-card2); border-color: var(--primary); }
.menu-btn.large { grid-column: span 1; }
.menu-icon { font-size: 28px; }
.menu-label { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   アイドル一覧
   ============================================================ */
.idol-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.idol-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.idol-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(201,122,255,0.2); }
.idol-card-bg { position: absolute; inset: 0; pointer-events: none; }
.idol-card-attr { font-size: 11px; font-weight: bold; margin-bottom: 6px; position: relative; }
.idol-card-img-wrap {
  width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 8px;
  margin-bottom: 8px; position: relative; background: #0a0a1a;
}
.idol-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.idol-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.idol-card-name { font-size: 14px; font-weight: bold; margin-bottom: 2px; }
.idol-card-role { font-size: 11px; margin-bottom: 6px; }
.stat-bar-mini { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.stat-bar-mini span { font-size: 9px; color: var(--text-muted); width: 24px; }
.stat-bar-mini .bar {
  flex: 1; height: 4px; background: #2a2a4a; border-radius: 2px; overflow: hidden;
}
.stat-bar-mini .bar div { height: 100%; border-radius: 2px; transition: width 0.5s; }

/* ============================================================
   アイドル詳細
   ============================================================ */
.idol-detail-hero {
  position: relative; min-height: 360px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 16px;
}
.idol-detail-img { height: 300px; object-fit: contain; }
.idol-detail-placeholder {
  height: 300px; width: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px;
}
.idol-detail-name-block { text-align: center; margin-top: 8px; }
.idol-detail-attr { font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.idol-detail-name { font-size: 24px; font-weight: bold; }
.idol-detail-name-en { font-size: 12px; color: var(--text-muted); letter-spacing: 2px; }

.idol-detail-body { padding: 16px; }
.detail-section { margin-bottom: 20px; }
.detail-title {
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
  padding-left: 8px; border-left: 3px solid var(--primary);
}
.detail-catchphrase {
  font-size: 15px; font-style: italic; color: var(--gold);
  text-align: center; padding: 12px; border-radius: 8px;
  background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.2);
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-text { font-size: 13px; line-height: 1.7; margin-bottom: 8px; color: var(--text); }
.detail-text.weak { color: var(--text-muted); font-size: 12px; }
.detail-text.theme { font-weight: bold; font-size: 15px; }

.stat-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.stat-label { font-size: 12px; color: var(--text-muted); width: 64px; }
.stat-bar-wrap {
  flex: 1; height: 8px; background: #2a2a4a; border-radius: 4px; overflow: hidden;
}
.stat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.stat-val { font-size: 12px; width: 28px; text-align: right; }

.card-list-small { display: flex; flex-direction: column; gap: 8px; }
.card-small {
  background: var(--bg-card2); border: 1px solid; border-radius: 8px; padding: 10px;
}
.card-small-rar { font-size: 11px; font-weight: bold; margin-bottom: 2px; }
.card-small-name { font-size: 13px; font-weight: bold; margin-bottom: 2px; }
.card-small-attr { font-size: 11px; margin-bottom: 4px; }
.card-small-cost { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.card-small-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ============================================================
   デッキ編成
   ============================================================ */
.deck-count { font-size: 13px; color: var(--text-muted); }
.deck-list { display: flex; flex-direction: column; gap: 6px; }
.deck-card-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
}
.deck-card-item.add-card { cursor: pointer; }
.deck-card-item.add-card:hover { background: var(--bg-card2); }
.rar-badge { font-size: 10px; font-weight: bold; min-width: 28px; }
.deck-card-name { flex: 1; font-size: 13px; }
.deck-card-cost { font-size: 12px; color: var(--text-muted); }
.deck-remove-btn {
  background: rgba(255,60,60,0.2); border: 1px solid rgba(255,60,60,0.4);
  color: #ff6060; width: 24px; height: 24px; border-radius: 50%;
  cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.deck-add-btn {
  background: rgba(100,255,100,0.1); border: 1px solid rgba(100,255,100,0.3);
  color: #60ff60; width: 24px; height: 24px; border-radius: 50%;
  cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   ステージ選択
   ============================================================ */
.stage-list { display: flex; flex-direction: column; gap: 12px; }
.stage-card {
  position: relative; height: 140px; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; border: 1px solid var(--border);
  transition: transform 0.2s;
}
.stage-card:hover:not(.locked) { transform: translateY(-2px); }
.stage-card.locked { opacity: 0.5; cursor: not-allowed; }
.stage-card.cleared { border-color: #2ecc7155; }
.stage-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.stage-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,7,26,0.9) 0%, rgba(7,7,26,0.5) 100%);
}
.stage-info {
  position: relative; z-index: 2; padding: 14px 16px;
}
.stage-chapter { font-size: 11px; color: var(--text-muted); }
.stage-title { font-size: 18px; font-weight: bold; margin: 4px 0; }
.stage-subtitle { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.stage-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.stage-status {
  position: absolute; bottom: 12px; right: 14px; z-index: 2;
  font-size: 12px; color: var(--gold);
}

/* ============================================================
   バトル前プレビュー
   ============================================================ */
.battle-preview {
  position: relative; height: 180px; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
  background-size: cover; background-position: center;
}
.battle-preview-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(7,7,26,0.9));
}
.battle-preview-info {
  position: absolute; bottom: 14px; left: 16px; z-index: 2;
}
.bp-chapter { font-size: 11px; color: var(--text-muted); }
.bp-title { font-size: 20px; font-weight: bold; }
.bp-enemy { font-size: 13px; color: var(--primary); margin-top: 4px; }

.battle-info-section { margin-bottom: 12px; }
.bi-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.bi-enemy-effects, .bi-deck-info { margin-bottom: 16px; }
.bi-title { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.bi-eff { font-size: 12px; padding: 4px 0; color: #ff8c00; }
.bi-deck-count { font-size: 24px; font-weight: bold; color: var(--primary); }

.start-battle-btn {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border: none; border-radius: var(--radius);
  color: #fff; font-size: 18px; font-weight: bold;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(201,122,255,0.4);
}
.start-battle-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(201,122,255,0.6); }
.start-battle-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   バトル画面（アクティブ）
   ============================================================ */
.battle-screen { padding: 10px; }

.battle-top-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding: 8px 12px;
  background: var(--bg-card); border-radius: 8px;
}
.bt-turn { font-size: 12px; color: var(--gold); font-weight: bold; }
.bt-stage { font-size: 12px; color: var(--text-muted); }

.enemy-section {
  background: linear-gradient(135deg, #1a003a, #0d0d2b);
  border: 1px solid #4a008055; border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; text-align: center;
}
.enemy-icon { font-size: 36px; margin-bottom: 4px; }
.enemy-name { font-size: 13px; color: var(--primary); font-weight: bold; margin-bottom: 8px; }

.gauge-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.gauge-row span:first-child { font-size: 11px; color: var(--text-muted); min-width: 60px; }
.gauge {
  flex: 1; height: 12px; background: #1a1a3a; border-radius: 6px;
  overflow: hidden; border: 1px solid var(--border);
}
.gauge-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.gauge-val { font-size: 11px; color: var(--text-muted); min-width: 70px; text-align: right; }

.player-status {
  background: var(--bg-card); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.tension-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.tension-row span:first-child { font-size: 11px; color: var(--text-muted); min-width: 72px; }
.tension-pips { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.pip { width: 14px; height: 14px; border-radius: 50%; background: #2a2a4a; border: 1px solid var(--border); }
.pip.active { background: #ffd700; border-color: #ffd700; box-shadow: 0 0 6px #ffd70088; }
.voltage-row { font-size: 12px; color: var(--primary); margin-top: 4px; }

.battle-log {
  background: rgba(0,0,0,0.4); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  max-height: 80px; overflow-y: auto;
}
.log-line { font-size: 11px; color: var(--text-muted); padding: 1px 0; }

.hand-area { margin-bottom: 8px; }
.hand-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.hand-cards {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
}
.battle-card {
  min-width: 90px; flex-shrink: 0;
  background: var(--bg-card); border: 2px solid; border-radius: 10px;
  padding: 8px 6px; cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 3px;
}
.battle-card.playable:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(255,255,255,0.15); }
.battle-card.unplayable { filter: grayscale(0.5); opacity: 0.6; cursor: not-allowed; }
.bc-rar { font-size: 9px; font-weight: bold; }
.bc-attr { font-size: 16px; text-align: center; }
.bc-name { font-size: 10px; font-weight: bold; text-align: center; line-height: 1.3; }
.bc-cost { font-size: 11px; color: var(--gold); text-align: center; }
.bc-desc { font-size: 9px; color: var(--text-muted); text-align: center; line-height: 1.3; }

.battle-actions { display: flex; justify-content: flex-end; }
.end-turn-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #2a2a6a, #1a1a4a);
  border: 1px solid var(--primary);
  color: var(--primary); font-size: 14px; font-weight: bold;
  border-radius: 24px; cursor: pointer; transition: all 0.2s;
}
.end-turn-btn:hover { background: linear-gradient(135deg, #3a3a8a, #2a2a6a); }

/* ============================================================
   バトル結果
   ============================================================ */
.result-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; gap: 12px; text-align: center;
}
.result-icon { font-size: 72px; }
.result-title { font-size: 28px; font-weight: bold; }
.result-title.win { color: var(--gold); text-shadow: 0 0 20px rgba(255,215,0,0.6); }
.result-title.lose { color: #ff6060; }
.result-stage { font-size: 14px; color: var(--text-muted); }
.result-rewards {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; width: 100%; max-width: 320px;
}
.rew-title { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.rew-item { font-size: 16px; padding: 4px 0; }
.result-hint { font-size: 14px; color: var(--text-muted); max-width: 260px; }
.result-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 280px; }
.result-btn {
  padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border: none; color: #fff; font-size: 15px; font-weight: bold;
  cursor: pointer; transition: all 0.2s;
}
.result-btn.secondary {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
}
.result-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ============================================================
   ストーリー
   ============================================================ */
.story-list { display: flex; flex-direction: column; gap: 8px; }
.story-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  transition: all 0.2s;
}
.story-item:hover:not(.locked) { background: var(--bg-card2); border-color: var(--primary); }
.story-item.locked { opacity: 0.5; cursor: default; }
.story-icon { font-size: 20px; min-width: 24px; }
.story-title { font-size: 14px; }
.story-title.unread { font-weight: bold; color: var(--primary); }
.story-arrow { color: var(--text-muted); margin-left: auto; }

.story-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0; cursor: pointer; user-select: none;
}
.story-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.story-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 70%);
}
.story-char {
  position: absolute; bottom: 180px; left: 50%; transform: translateX(-50%);
  height: 380px; object-fit: contain; z-index: 2;
}
.story-text-box {
  position: relative; z-index: 3; margin: 16px;
  background: rgba(7,7,26,0.9); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  backdrop-filter: blur(8px);
  margin-bottom: 60px;
}
.story-speaker {
  font-size: 13px; font-weight: bold; color: var(--primary); margin-bottom: 6px;
}
.story-text { font-size: 15px; line-height: 1.8; }
.story-progress {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  font-size: 11px; color: rgba(255,255,255,0.5);
}
.story-tap-hint, .story-end-hint {
  position: absolute; bottom: 20px; right: 20px; z-index: 3;
  font-size: 11px; color: rgba(255,255,255,0.5); animation: blink 1.5s infinite;
}
@keyframes blink { 0%,100%{opacity:0.5} 50%{opacity:1} }

/* ============================================================
   ガチャ
   ============================================================ */
.gacha-screen { }
.gacha-banner {
  background: linear-gradient(135deg, #1a0a3a, #0a1a3a);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; margin-bottom: 16px;
}
.gacha-stars { font-size: 20px; margin-bottom: 6px; }
.gacha-name { font-size: 18px; font-weight: bold; color: var(--gold); margin-bottom: 4px; }
.gacha-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.gacha-rates { font-size: 11px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.gacha-currency {
  text-align: center; font-size: 14px; margin-bottom: 16px;
}
.currency-val { font-size: 20px; font-weight: bold; color: var(--gold); margin-left: 4px; }

.gacha-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.gacha-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.gacha-btn:hover { border-color: var(--primary); background: var(--bg-card2); }
.gacha-btn.ten { border-color: var(--gold); }
.gacha-btn-title { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
.gacha-btn-cost { font-size: 13px; color: var(--gold); }
.gacha-btn-note { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.gacha-single-result {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  position: relative; overflow: hidden;
  animation: fadeInUp 0.4s ease;
}
.gr-flash {
  position: absolute; inset: 0; pointer-events: none;
  animation: flashPulse 0.6s ease;
}
@keyframes flashPulse { 0%{opacity:1} 100%{opacity:0} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
.gr-rarity { font-size: 22px; font-weight: bold; margin-bottom: 6px; }
.gr-attr { font-size: 16px; margin-bottom: 6px; }
.gr-name { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.gr-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.gr-remain { font-size: 13px; color: var(--text-muted); }

.gacha-ten-results {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  animation: fadeInUp 0.4s ease;
}
.gt-card {
  background: var(--bg-card); border: 1px solid; border-radius: 8px;
  padding: 6px; text-align: center; position: relative;
}
.gt-card.highlight {
  box-shadow: 0 0 12px rgba(255,215,0,0.5);
  animation: sparkle 0.6s ease;
}
@keyframes sparkle { 0%{transform:scale(1.2)} 50%{transform:scale(0.95)} 100%{transform:scale(1)} }
.gt-rar { font-size: 9px; font-weight: bold; }
.gt-attr { font-size: 18px; }
.gt-name { font-size: 8px; color: var(--text-muted); margin-top: 2px; line-height: 1.2; }
.gt-new {
  position: absolute; top: -4px; right: -4px;
  background: var(--primary2); color: #fff; font-size: 8px; font-weight: bold;
  padding: 1px 4px; border-radius: 8px;
}

/* ============================================================
   ミッション
   ============================================================ */
.mission-list { display: flex; flex-direction: column; gap: 8px; }
.mission-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.mission-item.done { opacity: 0.6; }
.mission-icon { font-size: 22px; }
.mission-info { flex: 1; }
.mission-title { font-size: 14px; font-weight: bold; }
.mission-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mission-reward { font-size: 13px; color: var(--gold); }

/* ============================================================
   設定
   ============================================================ */
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.setting-item label { color: var(--text-muted); }
.setting-item select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 8px;
}
.danger-btn {
  background: rgba(255,60,60,0.1); border: 1px solid rgba(255,60,60,0.4);
  color: #ff6060; padding: 8px 16px; border-radius: 8px; cursor: pointer;
}
.danger-btn:hover { background: rgba(255,60,60,0.2); }

/* ============================================================
   スクロールバー
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================================
   ホーム画面 v2（スクショ再現レイアウト）
   ============================================================ */
.home-screen-v2 {
  position: relative; width: 100%; min-height: calc(100vh - 64px);
  overflow: hidden; padding: 0; color: #fff;
}
.home-stage-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(0.9) brightness(0.85);
  z-index: 0;
}
.home-stage-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* 上部バー：ランクバッジ + ロゴ + 攻略 */
.home-topbar {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 12px 0;
}
.rank-badge {
  --accent: #c97aff;
  background: linear-gradient(150deg, rgba(255,255,255,0.07), rgba(0,0,0,0.35));
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 6px 12px 7px;
  text-align: center;
  box-shadow: 0 0 14px var(--accent)55, inset 0 0 8px rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
  min-width: 76px;
}
.rank-badge-label {
  font-size: 8px; letter-spacing: 1.6px; color: #d8c4ff;
  font-weight: 700;
}
.rank-badge-tier {
  font-size: 28px; font-weight: 900; line-height: 1;
  color: var(--accent); text-shadow: 0 0 8px var(--accent)cc;
  font-family: 'Impact','Arial Black',sans-serif; letter-spacing: 0;
}
.rank-num { font-size: 18px; margin-left: 2px; color: #fff; }
.home-logo-area {
  text-align: right; line-height: 1;
}
.home-logo-main {
  font-size: 19px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg,#fff,#c97aff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.home-logo-sub {
  font-size: 22px; font-weight: 900; letter-spacing: 1px;
  margin-top: 2px;
  text-shadow: 0 0 10px rgba(201,122,255,0.55);
}
.home-guide-btn {
  margin-top: 5px;
  background: linear-gradient(180deg,#ff6fc8,#c97aff);
  border: none; color: #fff; padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  box-shadow: 0 0 8px #c97aff77;
  cursor: pointer;
}

/* 通貨チップ */
.home-currency-row {
  position: relative; z-index: 3;
  display: flex; gap: 6px; justify-content: flex-end;
  padding: 8px 12px 0;
}
.cur-chip {
  background: rgba(7,7,26,0.7);
  border: 1px solid rgba(201,122,255,0.4);
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  font-size: 11px; color: #e8d8ff;
  display: flex; align-items: center; gap: 4px;
}
.cur-chip b { font-size: 13px; color: #fff; font-weight: 700; }
.cur-chip-gold { border-color: rgba(255,215,0,0.55); }
.cur-chip-gold b { color: var(--gold); }

/* 中央メインキャラ */
.home-main-stage {
  position: relative; z-index: 2;
  height: 56vh; min-height: 380px;
  display: flex; align-items: flex-end; justify-content: center;
}
.home-char-frame {
  --accent: #c97aff;
  position: relative; width: 78%; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.home-main-img {
  max-height: 100%; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(0,0,0,0.6));
}
.home-main-placeholder {
  width: 240px; height: 320px; border-radius: 24px;
  border: 1px solid var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  box-shadow: 0 0 28px var(--accent)55, inset 0 0 30px rgba(0,0,0,0.4);
}
.ph-attr-icon { font-size: 92px; filter: drop-shadow(0 0 14px rgba(255,255,255,0.4)); }
.ph-attr-name { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.ph-attr-tag { font-size: 12px; letter-spacing: 2px; }

/* セリフバブル */
.home-speech-bubble {
  position: absolute; left: 12px; top: 28%;
  max-width: 56%;
  background: rgba(255,255,255,0.95);
  color: #2a1a3a;
  border-radius: 14px;
  padding: 8px 12px 10px;
  font-size: 12px; line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 4;
}
.speech-tail {
  position: absolute; right: -10px; top: 18px;
  width: 0; height: 0;
  border: 6px solid transparent;
  border-right: 0;
  border-left: 10px solid #fff;
}
.speech-name-tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; margin-bottom: 3px; }
.speech-body { font-weight: 600; }

/* 右縦アイコン */
.home-side-icons {
  position: absolute; right: 6px; top: 6px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 4;
}
.side-icon {
  position: relative;
  width: 52px; padding: 6px 0 5px;
  background: rgba(7,7,26,0.75);
  border: 1px solid rgba(201,122,255,0.5);
  border-radius: 12px;
  color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 0 10px rgba(201,122,255,0.25);
}
.side-icon:active { transform: scale(0.95); }
.side-icon-emoji { font-size: 22px; }
.side-icon-label { font-size: 9px; letter-spacing: 0.5px; color: #d8c4ff; }
.side-icon-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ff3366; color: #fff;
  font-size: 8px; font-weight: 800;
  padding: 1px 5px; border-radius: 999px;
  box-shadow: 0 0 8px #ff336688;
}

/* 下段アクション */
.home-action-deck {
  position: relative; z-index: 3;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 0 10px 12px;
  margin-top: -8px;
}
.home-mini-roster {
  flex: 1; min-width: 0;
  background: linear-gradient(180deg, rgba(20,10,40,0.85), rgba(7,7,26,0.95));
  border: 1px solid rgba(201,122,255,0.4);
  border-radius: 14px;
  padding: 8px 8px 10px;
}
.mini-roster-row {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px;
}
.mini-roster-row::-webkit-scrollbar { display: none; }
.home-mini-avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  background: rgba(7,7,26,0.8);
  border: 1.5px solid #c97aff;
  border-radius: 10px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px;
}
.mini-avatar-icon { font-size: 18px; line-height: 1; }
.mini-avatar-name { font-size: 7px; color: #c8b8ff; margin-top: 2px; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.mini-sub-actions { display: flex; gap: 6px; margin-top: 6px; }
.sub-action-btn {
  position: relative;
  flex: 1;
  background: linear-gradient(180deg, #ff6fc8, #c97aff);
  border: none; color: #fff;
  padding: 6px 4px; border-radius: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(201,122,255,0.5);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.sub-action-btn span { font-size: 14px; }
.sub-action-btn .new-dot {
  position: absolute; top: -6px; right: -4px;
  background: #ff3366; color: #fff;
  font-size: 8px; font-weight: 800; font-style: normal;
  padding: 1px 5px; border-radius: 999px;
  box-shadow: 0 0 8px #ff336688;
}

/* ライブ大円ボタン */
.home-live-orb-wrap {
  flex: 0 0 auto;
}
.home-live-orb {
  --accent: #ff6fc8;
  width: 116px; height: 116px;
  border-radius: 50%;
  border: 3px solid #fff;
  background:
    radial-gradient(circle at 50% 35%, #fff 0%, var(--accent) 35%, #6a1a9a 85%);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow:
    0 0 24px var(--accent)cc,
    0 0 48px var(--accent)55,
    inset 0 4px 12px rgba(255,255,255,0.4),
    inset 0 -8px 18px rgba(0,0,0,0.35);
  animation: liveOrbPulse 2.2s ease-in-out infinite;
}
.home-live-orb:active { transform: scale(0.96); }
.orb-mic { font-size: 38px; filter: drop-shadow(0 0 6px rgba(0,0,0,0.5)); }
.orb-label { font-size: 18px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.orb-sub { font-size: 8px; letter-spacing: 2px; color: #fff; opacity: 0.85; }
@keyframes liveOrbPulse {
  0%,100% { box-shadow: 0 0 24px var(--accent)cc, 0 0 48px var(--accent)55, inset 0 4px 12px rgba(255,255,255,0.4), inset 0 -8px 18px rgba(0,0,0,0.35); }
  50%     { box-shadow: 0 0 32px var(--accent)ff, 0 0 72px var(--accent)88, inset 0 4px 12px rgba(255,255,255,0.5), inset 0 -8px 18px rgba(0,0,0,0.35); }
}

/* ホームナビ強調 */
.nav-item.nav-home {
  position: relative;
}
.nav-item.nav-home .nav-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(201,122,255,0.7));
}

/* レスポンシブ（狭幅） */
@media (max-width: 360px) {
  .home-live-orb { width: 100px; height: 100px; }
  .orb-mic { font-size: 32px; }
  .orb-label { font-size: 15px; }
  .home-main-stage { height: 50vh; min-height: 320px; }
}

/* ============================================================
   育成タブ（編成/レッスン）
   ============================================================ */
.lesson-tabs {
  display: flex; gap: 6px; padding: 8px 12px 0;
}
.lesson-tab {
  flex: 1; background: rgba(20,10,40,0.8);
  border: 1px solid rgba(201,122,255,0.35); color: #c8b8ff;
  padding: 9px 6px; border-radius: 12px 12px 0 0;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.lesson-tab.active {
  background: linear-gradient(180deg, #c97aff, #6a1a9a);
  color: #fff; border-color: #c97aff;
  box-shadow: 0 0 10px rgba(201,122,255,0.5);
}
.lesson-desc {
  font-size: 11px; color: var(--text-muted);
  padding: 8px 12px 4px;
  line-height: 1.5;
}
.lesson-list { padding: 4px 10px 80px; display: flex; flex-direction: column; gap: 6px; }
.lesson-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,10,40,0.7);
  border-left-width: 3px; border-left-style: solid;
  border-radius: 8px;
  padding: 8px 8px 8px 10px;
}
.lesson-row-main { flex: 1; min-width: 0; }
.lesson-row-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lesson-row-name b { font-weight: 700; color: #fff; }
.lesson-row-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.5px; }
.lesson-do-btn {
  flex: 0 0 auto;
  min-width: 64px;
  background: linear-gradient(180deg, #ff6fc8, #c97aff);
  border: none; color: #fff;
  padding: 6px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 800; line-height: 1.1;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 6px rgba(201,122,255,0.4);
}
.lesson-do-btn:active { transform: scale(0.95); }
.lesson-do-btn.maxed {
  background: linear-gradient(180deg, #ffd700, #c98a00);
  cursor: default; color: #2a1a00;
}
.lesson-do-btn.disabled {
  background: #3a2a55; color: #88779b;
  box-shadow: none;
}
.lesson-cost { font-size: 10px; font-weight: 700; color: #ffe4b5; }
.card-lv-pill {
  display: inline-block;
  font-style: normal; font-size: 9px; font-weight: 800;
  background: rgba(255,215,0,0.15);
  color: #ffd700;
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  letter-spacing: 0.5px;
}

/* ============================================================
   s006 グランドフィナーレ・クリア演出
   ============================================================ */
.result-screen.finale-clear {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,215,0,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(255,111,200,0.18) 0%, transparent 65%),
    linear-gradient(180deg, #0a0030 0%, #1a0030 50%, #07071a 100%);
}
.finale-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0%, transparent 8%),
    radial-gradient(circle at 80% 30%, rgba(255,215,0,0.1) 0%, transparent 10%),
    radial-gradient(circle at 30% 75%, rgba(201,122,255,0.12) 0%, transparent 12%),
    radial-gradient(circle at 75% 85%, rgba(255,111,200,0.1) 0%, transparent 10%);
  animation: finaleBgPulse 4s ease-in-out infinite;
  z-index: 0;
}
@keyframes finaleBgPulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
.finale-badge {
  position: relative; z-index: 2;
  margin-top: 14px;
  font-size: 11px; font-weight: 900; letter-spacing: 4px;
  color: #ffd700;
  text-shadow: 0 0 14px rgba(255,215,0,0.7);
  animation: finaleBadgeFade 1.2s ease-out;
}
@keyframes finaleBadgeFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.finale-sparkles {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
}
.finale-sparkles span {
  position: absolute;
  color: #fff; font-size: 18px;
  text-shadow: 0 0 8px rgba(255,255,255,0.8);
  animation: finaleSparkle 2.4s ease-in-out infinite;
}
.finale-sparkles span:nth-child(1) { top: 18%; left: 12%; animation-delay: 0s; }
.finale-sparkles span:nth-child(2) { top: 24%; right: 14%; animation-delay: 0.4s; }
.finale-sparkles span:nth-child(3) { top: 50%; left: 6%;  animation-delay: 0.8s; color: #ffd700; }
.finale-sparkles span:nth-child(4) { top: 56%; right: 8%; animation-delay: 1.2s; color: #ff6fc8; }
.finale-sparkles span:nth-child(5) { bottom: 22%; left: 18%; animation-delay: 1.6s; }
.finale-sparkles span:nth-child(6) { bottom: 18%; right: 16%; animation-delay: 2.0s; color: #c97aff; }
@keyframes finaleSparkle {
  0%, 100% { opacity: 0; transform: scale(0.7) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.2) rotate(180deg); }
}
.result-title.finale {
  font-size: 22px;
  background: linear-gradient(90deg, #ffd700, #ff6fc8, #c97aff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: 1.5px;
  animation: finaleTitleGlow 2.6s ease-in-out infinite;
}
@keyframes finaleTitleGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,215,0,0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(255,111,200,0.7)); }
}
.finale-message {
  position: relative; z-index: 2;
  margin: 14px 24px 8px;
  padding: 14px 16px;
  background: rgba(7,7,26,0.6);
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 12px;
  font-size: 13px; line-height: 1.7;
  color: #ffe9c2;
  text-align: center;
  box-shadow: 0 0 16px rgba(255,215,0,0.15);
}
.finale-message-sub {
  display: block; margin-top: 8px;
  font-size: 11px; color: #c8b8ff;
  letter-spacing: 1px;
}
