/* Noto Sans JP / Noto Serif JP が利用可能な場合のみ使用（オフライン対応） */
/* Google Fonts は削除し、システムフォントにフォールバック */

/* ── リセット ── */
* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── デザイントークン（星降る学園カラー） ── */
:root {
  /* キャラ配置 dev設定 */
  --dev-chara-top: 9.0em;
  --dev-chara-x: 0px;
  --dev-chara-w: 70vw;
  /* 選択肢位置 dev設定 */
  --dev-choices-offset: 0px;
  /* テキストウィンドウ dev設定 */
  --dev-textwin-alpha: 0.65;
  --dev-textwin-blur: 2px;
  /* キャラ画面 dev設定（デフォルト・フォールバック） */
  --dev-ci-w: 60vw;
  --dev-ci-x: 0px;
  --dev-ci-bottom: 0px;
  --dev-ci-card-alpha: 0.78;
  --dev-ci-card-blur: 0px;

  /* アクセント：スターライト紫 */
  --accent:      #b8a0e8;
  --accent-dim:  rgba(184, 160, 232, .42);
  --accent-glow: rgba(184, 160, 232, .12);
  --accent-line: rgba(184, 160, 232, .55);
  --otome-rose:      #ff8dbd;
  --otome-rose-deep: #e65f9d;
  --otome-rose-dim:  rgba(255, 141, 189, .46);
  --otome-rose-soft: rgba(255, 185, 214, .18);
  --otome-gold:      #f4c86e;
  --otome-gold-soft: rgba(244, 200, 110, .22);
  --otome-cream:     #fff7fb;
  --otome-lilac:     #d8c2ff;
  --otome-ink:       #352344;
  --otome-glass:     rgba(255, 247, 251, .88);
  --otome-glass-soft: rgba(255, 247, 251, .7);

  /* パネル：深い夜空ブルー */
  --panel:       rgba(6, 5, 18, .95);
  --panel-soft:  rgba(10, 8, 26, .88);

  /* テキスト */
  --text:     rgba(232, 225, 248, .96);
  --text-sub: rgba(180, 165, 210, .78);

  /* キャラカラー */
  --ren-color:   #7eb8ff;
  --yota-color:  #ffb347;
  --akira-color: #c9a0dc;
  --sou-color:   #ff7eb8;
  /* キャラカラーエイリアス（日本語キー対応） */
  --蓮-color:   var(--ren-color);
  --陽太-color: var(--yota-color);
  --暁-color:   var(--akira-color);
  --颯-color:   var(--sou-color);

  /* セーフエリア */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* テキストウィンドウ高さ */
  --textwin-h: clamp(120px, 22vh, 160px);

  /* テキストサイズスケール */
  --text-scale: 1;
  --font-size-adjust: 1;

  /* メインフォント */
  --font-main: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

/* ── フルスクリーン固定 ── */
html {
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
}
body {
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 215, 235, .18), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(216, 194, 255, .16), transparent 30%),
    linear-gradient(180deg, #120816 0%, #27102b 52%, #0b0612 100%);
  color: var(--text);
  overflow: hidden;
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#game {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  overflow: hidden;
}

/* 周辺ビネット（映画的な雰囲気） */
#game::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 26%, rgba(255,255,255,.16) 0 1px, transparent 2px 100%),
    radial-gradient(circle at 78% 18%, rgba(255,220,236,.18) 0 1px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255,198,224,.09), transparent 32%, rgba(12,0,16,.24) 100%),
    radial-gradient(ellipse at 50% 38%, transparent 55%, rgba(25,0,18,.46) 100%);
  background-size: auto, auto, auto, auto;
}

/* ── 背景 ── */
#bg {
  position: absolute;
  inset: 0;
  transition: background 1.2s ease;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.bg-title     { background: linear-gradient(180deg, #0d1b3e 0%, #1a1040 40%, #2d1854 100%); }
.bg-school    { background: linear-gradient(180deg, #87CEEB 0%, #c8e8ff 40%, #f5e6d3 100%); }
.bg-classroom { background: linear-gradient(180deg, #f5e6d3 0%, #ffecd2 50%, #fff8f0 100%); }
.bg-hallway   { background: linear-gradient(180deg, #d4e4f7 0%, #e8d5c4 50%, #f0e0d0 100%); }
.bg-library   { background: linear-gradient(180deg, #1c100a 0%, #2c1810 40%, #3d2817 100%); }
.bg-rooftop   { background: linear-gradient(180deg, #ff7e5f 0%, #feb47b 40%, #ffe0c0 100%); }
.bg-night     { background: linear-gradient(180deg, #050518 0%, #0a0a2e 40%, #16163a 100%); }
.bg-garden    { background: linear-gradient(180deg, #87CEEB 0%, #b8e4c0 40%, #7cc47c 100%); }

/* ── 一時表示CG ── */
#cg-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#cg-layer.active {
  opacity: 1;
}
#cg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,5,18,.02) 40%, rgba(5,5,18,.56) 100%);
}

/* ── タイトル スタートボタン ── */
.title-start-btn {
  background:
    linear-gradient(90deg, rgba(26,10,34,.88), rgba(80,26,68,.76) 48%, rgba(26,10,34,.88)),
    linear-gradient(180deg, rgba(255,255,255,.08), transparent);
  border: 1px solid rgba(244, 200, 110, .66);
  border-left: 4px solid rgba(255, 141, 189, .9);
  border-right: 4px solid rgba(255, 141, 189, .9);
  color: #fff7fb;
  padding: .62em 2.1em;
  font-size: .88rem;
  font-family: var(--font-main);
  letter-spacing: .32em;
  cursor: pointer;
  border-radius: 0;
  transition: all .28s;
  min-width: 170px;
  min-height: 42px;
  position: relative;
  overflow: hidden;
  margin-top: 1.05em;
  text-shadow: 0 0 8px rgba(255, 170, 215, .68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 0 0 1px rgba(255,220,236,.08),
    0 10px 24px rgba(0,0,0,.26);
}
.title-start-btn::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(244, 200, 110, .42);
  border-radius: inherit;
  pointer-events: none;
}
.title-start-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 12%, rgba(255,255,255,.18) 48%, transparent 82%);
  opacity: 0; transition: opacity .3s;
}
.title-start-btn:hover::after { opacity: 1; }
.title-start-btn:hover  { border-color: rgba(255,210,232,.95); color: #b74083; }
.title-start-btn:active { transform: scale(.97); background: rgba(184,160,232,.1); }
.title-continue-btn { margin-top: .5em; font-size: .88rem; opacity: .85; }

/* ── 星パーティクル ── */
.stars { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.star  { position: absolute; background: #fff; border-radius: 50%; animation: twinkle 2s infinite alternate; }
@keyframes twinkle {
  0%   { opacity: .14; transform: scale(.75); }
  100% { opacity: .88; transform: scale(1.2); }
}

/* ══════════════════════════════════════════
   タイトル画面
══════════════════════════════════════════ */
#title-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 12;
  padding: calc(var(--safe-top) + 3.7em) 1.4em 0;
  gap: 0;
}

/* 上部装飾ライン */
#title-screen::before {
  content: '';
  display: block;
  width: clamp(100px, 48vw, 190px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), var(--otome-rose), var(--otome-gold), rgba(255,255,255,.72), transparent);
  margin-bottom: 1.6em;
}

#title-screen h1 {
  font-family: var(--font-main);
  font-size: clamp(1.82rem, 6.7vw, 3rem);
  color: #fff7fb;
  text-shadow:
    0 0 16px rgba(255,190,220,.72),
    0 0 34px rgba(184,160,232,.48),
    0 0 64px rgba(255,159,199,.24);
  letter-spacing: .18em;
  margin-bottom: .08em;
  animation: titleGlow 3.5s ease-in-out infinite alternate;
  text-align: center;
  line-height: 1.48;
}
@keyframes titleGlow {
  0%   { text-shadow: 0 0 16px rgba(255,190,220,.68), 0 0 34px rgba(184,160,232,.42), 0 0 64px rgba(255,159,199,.22); }
  100% { text-shadow: 0 0 24px rgba(255,225,240,.94), 0 0 48px rgba(210,180,255,.68), 0 0 86px rgba(255,159,199,.34); }
}

/* サブタイトル */
#title-screen p {
  font-size: .56rem;
  color: rgba(255, 226, 242, .88);
  letter-spacing: .34em;
  margin-bottom: 0;
}
/* 下部装飾ライン */
#title-screen p::after {
  content: '';
  display: block;
  width: clamp(90px, 38vw, 148px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--otome-gold), var(--otome-rose), transparent);
  margin: .85em auto 0;
}

.title-btns {
  display: flex;
  flex-direction: column;
  gap: .65em;
  align-items: center;
  width: 100%;
  margin-top: 1.8em;
}
.title-btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,228,241,.86));
  border: 1px solid rgba(255,184,218,.72);
  color: #9b346f;
  padding: .82em 3em;
  font-size: .92rem;
  font-family: var(--font-main);
  letter-spacing: .22em;
  cursor: pointer;
  border-radius: 0;
  transition: all .28s;
  min-width: 195px;
  min-height: 48px;
  position: relative;
  overflow: hidden;
}
/* ホバー時シマー */
.title-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, var(--accent-glow) 50%, transparent 80%);
  opacity: 0;
  transition: opacity .3s;
}
.title-btn:hover::after { opacity: 1; }
.title-btn:hover  { border-color: rgba(255,184,218,.95); color: #b74083; }
.title-btn:active { transform: scale(.97); background: rgba(255,214,233,.88); }

/* ══════════════════════════════════════════
   HUD（好感度バー・ボタン）
══════════════════════════════════════════ */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 25;
  padding: calc(var(--safe-top) + .6em) .8em .4em;
  display: none;
  pointer-events: none;
}
#hud.active { display: flex; justify-content: space-between; align-items: flex-start; }

#affection-display {
  display: flex;
  flex-direction: column;
  gap: .28em;
  background:
    linear-gradient(135deg, rgba(255,247,251,.82), rgba(255,225,240,.64));
  border: 1px solid rgba(255,190,220,.5);
  padding: .48em .7em;
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 8px 22px rgba(80,20,60,.18);
}
.aff-row  { display: flex; align-items: center; gap: .4em; }
.aff-name { width: 2.2em; font-size: .68rem; text-align: right; color: rgba(72,45,92,.72); }
.aff-bar  { width: clamp(50px, 15vw, 120px); height: 4px; background: rgba(120,70,120,.14); border-radius: 999px; overflow: hidden; }
.aff-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.aff-fill-蓮   { background: linear-gradient(90deg, #3a80c0, #7eb8ff); }
.aff-fill-陽太  { background: linear-gradient(90deg, #c07820, #ffb347); }
.aff-fill-暁   { background: linear-gradient(90deg, #8050a8, #c9a0dc); }
.aff-fill-颯   { background: linear-gradient(90deg, #c04880, #ff7eb8); }
/* 完全達成時の光の演出 */
.aff-fill.aff-max {
  animation: affGlow .6s ease-in-out infinite;
  box-shadow: 0 0 8px currentColor, inset 0 0 4px rgba(255,255,255,.4);
}
.aff-stage {
  font-size: .6rem;
  color: var(--text-sub);
  opacity: .8;
  min-width: 4em;
  text-align: right;
}

#hud-btns { display: flex; gap: .38em; pointer-events: all; }
.hud-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: rgba(255, 247, 251, .82);
  border: 1px solid rgba(255,190,220,.64);
  color: rgba(156,52,111,.9);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
  transition: all .2s;
}
.hud-btn:active { background: rgba(255,159,199,.2); border-color: var(--otome-rose); }

#week-display {
  font-size: .65rem;
  color: var(--accent);
  opacity: .9;
  text-align: center;
  padding-top: .25em;
  margin-top: .15em;
  border-top: 1px solid rgba(184, 160, 232, .15);
  width: 100%;
  transition: color .8s ease;
}

/* ══════════════════════════════════════════
   キャラクター立ち絵
══════════════════════════════════════════ */
#character {
  position: absolute;
  top: calc(var(--safe-top) + var(--dev-chara-top, 6.5em));
  left: calc(50% + var(--dev-chara-x, 0px));
  transform: translateX(-50%);
  z-index: 5;
  width: var(--dev-chara-w, 60vw);
  height: auto;
  transition: opacity .4s;
  pointer-events: none;
}
#character svg,
#character img {
  width: 100%;
  height: auto;
  display: block;
  animation: charaBreathe 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 22px rgba(0,0,8,.6));
}
/* 実写スプライト：チェッカー背景を透過表示、縦長にトリミング */
#character img.chara-photo {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  mix-blend-mode: normal;
  filter: drop-shadow(0 8px 32px rgba(0,0,20,.75));
}
@keyframes charaBreathe {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

@keyframes affGlow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 4px currentColor); }
  50%      { filter: brightness(1.3) drop-shadow(0 0 12px currentColor); }
}

/* ══════════════════════════════════════════
   テキストウィンドウ
══════════════════════════════════════════ */

/* テキストウィンドウ上部のフェードイン */
#text-window::before {
  content: '';
  position: absolute;
  top: -42px; left: 0; right: 0; height: 42px;
  background: linear-gradient(180deg, transparent, rgba(255, 213, 232, .42));
  pointer-events: none;
  z-index: 1;
}
/* 上部装飾ライン（スターライト色） */
#text-window::after {
  content: '';
  position: absolute;
  top: 8px; left: 9%; right: 9%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,200,110,.78), rgba(255,141,189,.72), rgba(244,200,110,.78), transparent);
  box-shadow: 0 0 14px rgba(255,159,199,.24);
}

#text-window {
  position: absolute;
  bottom: calc(56px + var(--safe-bottom)); left: 0; right: 0;
  z-index: 20;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,255,255,.9), transparent 30%),
    linear-gradient(180deg, rgba(255, 250, 253, .94), rgba(255, 229, 241, .82)),
    rgba(255, 247, 251, var(--dev-textwin-alpha, .86));
  backdrop-filter: blur(var(--dev-textwin-blur, 10px));
  -webkit-backdrop-filter: blur(var(--dev-textwin-blur, 10px));
  border-top: 1px solid rgba(255,190,220,.86);
  border-left: 1px solid rgba(255,190,220,.46);
  border-right: 1px solid rgba(255,190,220,.46);
  border-radius: 24px 24px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    inset 0 -14px 22px rgba(255,141,189,.08),
    0 -8px 24px rgba(80,10,60,.18),
    0 -1px 24px rgba(255,159,199,.18);
  padding: 1.28em 1.45em 1.12em;
  min-height: var(--textwin-h);
  cursor: pointer;
  display: none;
}
#text-window.active { display: block; }

/* テキストウィンドウ非表示モード */
#text-window.hide-ui {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  min-height: auto;
  padding: 0;
}
#text-window.hide-ui::before,
#text-window.hide-ui::after {
  display: none !important;
}

/* キャラクター名プレート */
#speaker {
  font-family: var(--font-main);
  font-size: calc(.88rem * var(--text-scale));
  font-weight: 700;
  margin-bottom: .55em;
  padding: .18em 1.1em .18em .7em;
  display: inline-block;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,224,240,.9));
  border: 1px solid rgba(255,160,205,.72);
  border-left: 4px solid var(--otome-rose-deep);
  border-right: 4px solid rgba(244,200,110,.72);
  border-radius: 999px;
  letter-spacing: .1em;
  min-width: 3.5em;
  text-align: center;
  color: #9b346f;
  text-shadow: 0 1px 0 rgba(255,255,255,.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 5px 14px rgba(255,100,170,.16);
}
.speaker-default { color: rgba(92,58,112,.76); border-left-color: var(--otome-rose-dim); }
.speaker-蓮    { color: var(--ren-color);   border-left-color: var(--ren-color); }
.speaker-陽太  { color: var(--yota-color);  border-left-color: var(--yota-color); }
.speaker-暁    { color: var(--akira-color); border-left-color: var(--akira-color); }
.speaker-颯    { color: var(--sou-color);   border-left-color: var(--sou-color); }
#text {
  font-size: calc(clamp(.86rem, 2.5vw, .97rem) * var(--text-scale) * var(--font-size-adjust));
  line-height: 2.05;
  color: var(--otome-ink);
  letter-spacing: .05em;
  white-space: pre-wrap;
}
#click-indicator {
  position: absolute;
  bottom: .8em;
  right: 1.4em;
  font-size: .68rem;
  color: rgba(196,80,142,.7);
  animation: blink 1.6s infinite;
}
@keyframes blink { 0%,100%{ opacity:.38 } 50%{ opacity:1 } }

/* ══════════════════════════════════════════
   選択肢ボタン
══════════════════════════════════════════ */
#choices {
  position: absolute;
  bottom: calc(var(--textwin-h) + var(--dev-choices-offset, 0px));
  left: 0; right: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: .48em;
  padding: 0 1.15em 1em;
}
#choices.active { display: flex; }

.choice-btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,229,241,.92));
  border: 1px solid rgba(255,168,210,.74);
  border-left: 5px solid rgba(255,141,189,.9);
  color: var(--otome-ink);
  padding: .9em 1.22em .9em 1em;
  font-size: calc(.9rem * var(--text-scale));
  font-family: var(--font-main);
  cursor: pointer;
  border-radius: 18px;
  transition: all .22s;
  text-align: left;
  backdrop-filter: blur(8px);
  min-height: 50px;
  letter-spacing: .04em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 8px 20px rgba(80,20,60,.16),
    0 0 0 3px rgba(255,220,236,.08);
}
.choice-btn::before {
  content: '恋';
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  margin-right: .55em;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,141,189,.95), rgba(230,95,157,.9));
  color: #fff;
  font-size: .72em;
  box-shadow: 0 0 0 2px rgba(244,200,110,.32);
  vertical-align: middle;
}
.choice-btn:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(255,214,233,.96));
  border-color: rgba(255,141,189,.95);
  border-left-color: var(--otome-gold);
  transform: translateX(6px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 10px 24px rgba(255,120,180,.12);
}
.choice-btn--locked {
  opacity: .38;
  border-color: rgba(184,160,232,.15);
  border-left-color: rgba(184,160,232,.18);
  color: rgba(184,160,232,.28);
  cursor: default;
  pointer-events: none;
}
.choice-btn--locked::before { color: rgba(184,160,232,.2); }
.choice-btn--locked::after  { content: ' 🔒'; font-size: .72em; }
.choice-btn:active {
  transform: translateX(4px) scale(.99);
  background: rgba(255,214,233,.95);
}

/* ══════════════════════════════════════════
   好感度ポップアップ
══════════════════════════════════════════ */
#affection-popup {
  position: fixed;
  top: 17%; left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: .48em 2em;
  border-radius: 2px;
  font-size: .82rem;
  font-family: var(--font-main);
  opacity: 0;
  transition: opacity .5s, transform .5s;
  pointer-events: none;
  background: rgba(8, 6, 22, .9);
  border: 1px solid rgba(184,160,232,.48);
  border-top-color: var(--accent);
  color: rgba(210,190,250,.95);
  backdrop-filter: blur(8px);
  letter-spacing: .06em;
}
#affection-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* ══════════════════════════════════════════
   メニューオーバーレイ
══════════════════════════════════════════ */
#menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(4, 3, 14, .8);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .78em;
  padding: 1.5em;
}
#menu-overlay.active { display: flex; }
#menu-overlay h2 {
  font-family: var(--font-main);
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: .22em;
  margin-bottom: .3em;
}
#menu-overlay h2::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin-top: .38em;
}
.menu-btn {
  width: min(278px, 80%);
  min-height: 50px;
  padding: .72em 1.5em;
  background: rgba(255, 247, 251, .84);
  border: 1px solid rgba(255,184,218,.5);
  color: var(--otome-ink);
  font-size: .92rem;
  font-family: var(--font-main);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: .14em;
  transition: all .2s;
  text-align: center;
}
.menu-btn:hover  { border-color: rgba(255,184,218,.86); background: rgba(255,229,241,.92); }
.menu-btn:active { background: rgba(255,214,233,.92); border-color: var(--otome-rose); }
.menu-btn.danger { color: #e08080; border-color: rgba(200,100,100,.3); }

/* ══════════════════════════════════════════
   セーブ / ロード
══════════════════════════════════════════ */
#saveload-screen {
  position: absolute;
  inset: 0;
  z-index: 65;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,220,236,.16), transparent 32%),
    rgba(18, 8, 24, .96);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 2em) 1.5em calc(56px + var(--safe-bottom) + 2em);
  gap: 1em;
  overflow-y: auto;
}
#saveload-screen.active { display: flex; }
#saveload-screen h2 {
  font-family: var(--font-main);
  font-size: 1.15rem;
  color: var(--otome-rose);
  letter-spacing: .18em;
  margin-bottom: .3em;
}
.save-slots { display: flex; flex-direction: column; gap: .6em; width: 100%; max-width: 400px; }
.save-slot {
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,232,244,.78));
  border: 1px solid rgba(255,184,218,.45);
  border-radius: 14px;
  padding: 1em 1.2em;
  cursor: pointer;
  transition: all .2s;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .28em;
}
.save-slot:hover  { border-color: rgba(255,184,218,.78); background: rgba(255,232,244,.9); }
.save-slot:active { background: rgba(255,214,233,.9); border-color: var(--otome-rose); }
.save-slot-header {
  border-radius: 8px 8px 0 0; padding: 6px 12px;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 28px; margin: -1em -1.2em 6px -1.2em;
}
.save-slot-chara-name { font-size: 0.85rem; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.save-slot-aff { font-size: 0.75rem; color: rgba(255,255,255,.85); }
.save-slot-num   { font-size: .7rem;  color: rgba(184,160,232,.48); }
.save-slot-info  { font-size: .86rem; color: var(--otome-ink); }
.save-slot-time  { font-size: .68rem; color: rgba(85,58,110,.65); }
.save-slot-empty { color: rgba(85,58,110,.38); font-size: .8rem; }
.saveload-close  { margin-top: .5em; }

/* ========== セーブ確認ダイアログ ========== */
.sl-dialog { position:fixed; inset:0; z-index:999; display:flex; align-items:center; justify-content:center; }
.sl-dialog[hidden] { display:none; }
.sl-dialog-overlay { position:absolute; inset:0; background:rgba(0,0,0,.6); }
.sl-dialog-box { position:relative; background:rgba(10,8,28,.98); border:1px solid rgba(184,160,232,.4); border-radius:12px; padding:1.6em 1.4em; width:min(300px,88vw); text-align:center; }
.sl-dialog-msg { color:var(--text); font-size:.95rem; margin:0 0 1.2em; line-height:1.7; }
.sl-dialog-btns { display:flex; gap:.7em; justify-content:center; }
.sl-btn { padding:.55em 1.3em; border-radius:20px; border:none; cursor:pointer; font-size:.85rem; font-weight:600; }
.sl-btn-primary { background:var(--accent); color:#fff; }
.sl-btn-danger  { background:#be185d; color:#fff; }
.sl-btn-ghost   { background:transparent; color:var(--text-sub); border:1px solid rgba(184,160,232,.3); }

/* セーブ/ロード切り替えトグル */
.sl-mode-toggle { display:flex; border-radius:8px; overflow:hidden; border:1px solid rgba(184,160,232,.3); margin-bottom:.8em; }
.sl-mode-btn { flex:1; padding:.5em 0; background:transparent; color:var(--text-sub); font-size:.82rem; border:none; cursor:pointer; transition:all .2s; }
.sl-mode-btn.sl-active { background:rgba(184,160,232,.2); color:var(--accent); font-weight:600; }

/* 削除ボタン */
.sl-delete-btn { margin-left:auto; width:20px; height:20px; border-radius:50%; background:rgba(190,24,93,.7); color:#fff; border:none; font-size:.7rem; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sl-delete-btn:hover { background:#be185d; }

/* オートセーブトグル行 */
.sl-autosave-row { display:flex; align-items:center; justify-content:space-between; margin-top:.8em; padding:.7em .2em; border-top:1px solid rgba(184,160,232,.15); }
.sl-autosave-label { color:var(--text-sub); font-size:.82rem; }
.sl-toggle { position:relative; display:inline-block; width:42px; height:22px; }
.sl-toggle input { opacity:0; width:0; height:0; }
.sl-toggle-track { position:absolute; inset:0; background:rgba(184,160,232,.2); border-radius:22px; cursor:pointer; transition:.2s; }
.sl-toggle input:checked + .sl-toggle-track { background:var(--accent); }
.sl-toggle-track::before { content:''; position:absolute; width:16px; height:16px; border-radius:50%; background:#fff; left:3px; top:3px; transition:.2s; }
.sl-toggle input:checked + .sl-toggle-track::before { transform:translateX(20px); }

/* AUTO セパレーター・バッジ */
.sl-auto-sep { text-align:center; font-size:.7rem; color:rgba(184,160,232,.4); margin:.6em 0 .4em; letter-spacing:.15em; }
.sl-auto-badge { font-size:.6rem; background:rgba(184,160,232,.2); color:var(--accent); border-radius:4px; padding:1px 5px; margin-left:auto; }

/* ロード不可スロット */
.sl-slot-disabled { opacity:.45; cursor:default; pointer-events:none; }

/* ══════════════════════════════════════════
   ギャラリー
══════════════════════════════════════════ */
#gallery-screen {
  position: absolute;
  inset: 0;
  z-index: 65;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,220,236,.16), transparent 32%),
    rgba(18, 8, 24, .96);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 2em) 1.5em calc(56px + var(--safe-bottom) + 1.5em);
  overflow-y: auto;
  gap: 1em;
}
#gallery-screen.active { display: flex; }
#gallery-screen h2 {
  font-family: var(--font-main);
  font-size: 1.15rem;
  color: var(--otome-rose);
  letter-spacing: .18em;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .62em;
  width: 100%;
}
.gallery-card {
  background: rgba(30, 14, 42, .82);
  border: 1px solid rgba(184,160,232,.22);
  border-radius: 14px;
  padding: .85em .9em;
  cursor: pointer;
  transition: all .22s;
  height: 100px;
  display: flex;
  flex-direction: column;
  gap: .32em;
  justify-content: center;
  overflow: hidden;
}
.gallery-card.unlocked { border-color: rgba(255,184,218,.55); }
.gallery-card.unlocked:hover  { background: rgba(60, 24, 68, .9); border-color: rgba(255,141,189,.88); }
.gallery-card.unlocked:active { background: rgba(80, 30, 80, .92); }
.gallery-card-dot   { width: 9px; height: 9px; border-radius: 50%; margin-bottom: .18em; }
.gallery-card-title { font-size: .76rem; line-height: 1.55; color: #f0e8ff; }
.gallery-card-count { font-size: .65rem; color: rgba(220,190,255,.75); margin-top: .3em; letter-spacing: .05em; }
.gallery-card-lock  { font-size: 1.25rem; opacity: .35; }
.gallery-close      { margin-top: .3em; }
.gallery-card-cg {
  min-height: 132px;
  height: auto;
  padding: .5em;
  justify-content: flex-end;
  position: relative;
}
.gallery-card-cg .gallery-card-title {
  position: relative;
  z-index: 1;
  padding: .4em .45em;
  background: rgba(4, 3, 14, .72);
  border: 1px solid rgba(184,160,232,.12);
  border-radius: 3px;
}
.gallery-cg-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .86;
}
.gallery-card-cg.locked .gallery-cg-thumb {
  opacity: .16;
  filter: grayscale(1);
}
.gallery-cg-status {
  position: absolute;
  top: .5em;
  right: .5em;
  z-index: 1;
  font-size: .62rem;
  color: var(--text);
  background: rgba(6,5,18,.76);
  border: 1px solid rgba(184,160,232,.18);
  border-radius: 3px;
  padding: .18em .45em;
}

/* ─ ギャラリー統計ヘッダー ─ */
.gallery-stats {
  background: rgba(184, 160, 232, .1);
  border: 1px solid rgba(184, 160, 232, .22);
  border-radius: .4em;
  padding: .8em 1em;
  margin-bottom: 1.2em;
}
.gs-overall {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6em;
}
.gs-overall-text {
  font-size: .85rem;
  color: var(--text);
}
.gs-pct {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
}
.gs-progress-track {
  height: 6px;
  background: rgba(184, 160, 232, .12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .8em;
}
.gs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a080d8);
  transition: width 0.6s ease;
}
.gs-chars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6em;
  margin-bottom: .8em;
}
.gs-char-item {
  display: flex;
  align-items: center;
  gap: .4em;
  font-size: .75rem;
}
.gs-char-name {
  width: 2.2em;
  color: var(--text);
  font-weight: 500;
}
.gs-char-track {
  flex: 1;
  height: 4px;
  background: rgba(184, 160, 232, .12);
  border-radius: 2px;
  overflow: hidden;
}
.gs-char-fill {
  height: 100%;
  transition: width 0.5s ease;
}
.gs-char-num {
  width: 2.2em;
  text-align: right;
  color: rgba(184, 160, 232, .72);
}
.gs-meta {
  display: flex;
  flex-direction: column;
  gap: .3em;
  font-size: .7rem;
  color: rgba(184, 160, 232, .65);
}
.gs-most {
  word-break: break-word;
}

/* ─ ギャラリーセクション ─ */
.gallery-section {
  margin-bottom: 2em;
}
.gallery-section-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1em;
  padding-bottom: .6em;
  border-bottom: 1px solid rgba(184, 160, 232, .22);
  letter-spacing: .08em;
}
.gallery-subhead {
  font-size: .8rem;
  color: rgba(184, 160, 232, .72);
  margin: 1.2em 0 .8em 0;
  padding-left: .4em;
  font-weight: 500;
}
.gallery-grid-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .62em;
  width: 100%;
}

/* ══════════════════════════════════════════
   エンディング画面
══════════════════════════════════════════ */
#ending-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 16, .94);
  text-align: center;
  padding: calc(var(--safe-top) + 2em) 2em calc(var(--safe-bottom) + 2em);
}
#ending-screen.active { display: flex; }

#ending-screen h2 {
  font-family: var(--font-main);
  font-size: clamp(1.15rem, 3.8vw, 1.85rem);
  color: #f0e8ff;
  margin-bottom: .5em;
  letter-spacing: .18em;
  line-height: 1.65;
  text-shadow: 0 0 22px rgba(184,160,232,.5);
  position: relative;
}
/* エンディングタイトル 装飾ライン */
#ending-screen h2::before,
#ending-screen h2::after {
  content: '';
  display: block;
  width: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: .48em auto;
}
#ending-screen p {
  font-size: .9rem;
  line-height: 2.25;
  max-width: 510px;
  color: rgba(210, 198, 235, .82);
  margin-bottom: 1.5em;
  white-space: pre-line;
}
.ending-star {
  font-size: 1.8rem;
  color: var(--accent);
  opacity: .6;
  margin-bottom: .4em;
  animation: pulse 2s ease-in-out infinite;
}
.ending-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7em;
  margin-top: .5em;
}
.ending-ep-btn {
  letter-spacing: .18em;
  min-width: 200px;
  background: rgba(184,160,232,.15);
  border-color: var(--accent);
  color: var(--accent);
}
.ending-back-btn {
  letter-spacing: .22em;
  min-width: 200px;
  opacity: .7;
  font-size: .82rem;
}

/* ══════════════════════════════════════════
   キャラ選択画面
══════════════════════════════════════════ */
#chara-select-screen {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: none;
  flex-direction: column;
  align-items: center;
  background: rgba(4, 3, 14, .97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: calc(var(--safe-top) + 1.4em) 1.2em calc(var(--safe-bottom) + 1.2em);
  gap: .8em;
  overflow-y: auto;
}
#chara-select-screen.active { display: flex; }
.cs-header { text-align: center; }
.cs-star {
  font-size: 1.5rem;
  color: var(--accent);
  opacity: .6;
  animation: pulse 2s ease-in-out infinite;
}
.cs-title {
  font-family: var(--font-main);
  font-size: 1.25rem;
  color: #f0e8ff;
  letter-spacing: .22em;
  text-shadow: 0 0 16px rgba(184,160,232,.5);
  margin: .2em 0 .1em;
}
.cs-sub {
  font-size: .72rem;
  color: var(--text-sub);
  letter-spacing: .1em;
}
.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75em;
  width: 100%;
  max-width: 440px;
}
.cs-card {
  background: rgba(10, 8, 28, .75);
  border: 1px solid rgba(184,160,232,.18);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cs-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--cs-color, var(--accent));
  border-radius: 8px 8px 0 0;
}
.cs-card:active {
  background: rgba(184,160,232,.08);
  border-color: var(--cs-color, var(--accent));
  transform: scale(.97);
}
.cs-sprite {
  width: 100%;
  aspect-ratio: 1 / 1.4;
  object-fit: cover;
  object-position: top;
}
.cs-sprite-svg {
  width: 80%;
  aspect-ratio: 1 / 1.4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.cs-sprite-svg svg {
  width: 100%;
  height: auto;
}
.cs-info {
  padding: .5em .6em .7em;
  text-align: center;
  width: 100%;
  background: rgba(6,5,18,.5);
}
.cs-name {
  font-family: var(--font-main);
  font-size: .84rem;
  color: var(--cs-color, var(--accent));
  letter-spacing: .08em;
}
.cs-type {
  font-size: .65rem;
  color: var(--text-sub);
  letter-spacing: .06em;
  margin-top: .15em;
}
.cs-back-btn {
  margin-top: auto;
  min-width: 200px;
  letter-spacing: .2em;
  opacity: .7;
  font-size: .82rem;
}

/* ══════════════════════════════════════════
   オートボタン ON 状態
══════════════════════════════════════════ */
.hud-btn.auto-on {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(184,160,232,.15);
}

/* ══════════════════════════════════════════
   バックログ
══════════════════════════════════════════ */
#backlog-screen {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: rgba(4, 3, 14, .96);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: calc(56px + var(--safe-bottom));
}
#backlog-screen.active { display: flex; }

.backlog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7em 1.2em .6em;
  border-bottom: 1px solid rgba(184,160,232,.18);
  flex-shrink: 0;
}
.backlog-title {
  font-family: var(--font-main);
  font-size: .95rem;
  color: var(--accent);
  letter-spacing: .22em;
}
.backlog-close {
  background: none;
  border: none;
  color: rgba(184,160,232,.55);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .3em .5em;
  transition: color .2s;
}
.backlog-close:hover { color: var(--accent); }

#backlog-list {
  flex: 1;
  overflow-y: auto;
  padding: .8em 1.2em;
  display: flex;
  flex-direction: column-reverse; /* 新しいものが下 */
  gap: .1em;
}

.backlog-entry {
  padding: .55em 0;
  border-bottom: 1px solid rgba(184,160,232,.07);
}
.backlog-entry:last-child { border-bottom: none; }
.backlog-speaker {
  font-size: .72rem;
  font-family: var(--font-main);
  letter-spacing: .12em;
  margin-bottom: .2em;
  opacity: .75;
}
.backlog-text {
  font-size: .85rem;
  line-height: 1.85;
  color: rgba(210,198,235,.82);
  white-space: pre-wrap;
  letter-spacing: .04em;
}

/* ══════════════════════════════════════════
   フェードオーバーレイ
══════════════════════════════════════════ */
#fade-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s;
}
#fade-overlay.active { opacity: 1; pointer-events: all; }

/* ══════════════════════════════════════════
   お名前登録画面
══════════════════════════════════════════ */
#name-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 2em) 1.5em calc(env(safe-area-inset-bottom, 0px) + 2em);
  background:
    radial-gradient(circle at 50% 26%, rgba(255,232,244,.22), transparent 34%),
    radial-gradient(ellipse at 50% 38%, rgba(48,18,62,.78) 0%, rgba(12,5,18,.95) 100%);
}

.name-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2em;
  width: 100%;
  max-width: 360px;
}

.name-screen-inner::before {
  content: 'お名前登録';
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: #fff7fb;
  letter-spacing: .32em;
  text-shadow: 0 0 18px rgba(255,141,189,.68);
}

.name-screen-inner::after {
  content: '';
  display: block;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  margin-top: -.5em;
}

.name-screen-sub {
  font-size: .74rem;
  color: var(--text-sub);
  letter-spacing: .18em;
  text-align: center;
  margin-top: -.3em;
}

.name-input-wrap {
  background: rgba(255, 247, 251, .9);
  border: 1px solid rgba(255,184,218,.74);
  border-bottom: 2px solid var(--otome-rose);
  padding: .65em 1.2em;
  width: 100%;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.88),
    0 8px 24px rgba(255,100,170,.16);
}

#name-input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  font-family: var(--font-main);
  font-size: 1.55rem;
  color: var(--otome-ink);
  letter-spacing: .28em;
  text-align: center;
  caret-color: var(--otome-rose);
}

#name-input::placeholder {
  color: rgba(155,52,111,.3);
  font-size: 1rem;
  letter-spacing: .1em;
}

.name-preset-btns {
  display: flex;
  gap: .5em;
  flex-wrap: wrap;
  justify-content: center;
}

.name-preset {
  background: rgba(255, 247, 251, .78);
  border: 1px solid rgba(255,184,218,.48);
  color: rgba(92,58,112,.76);
  padding: .38em .9em;
  font-size: .8rem;
  font-family: var(--font-main);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: .1em;
  transition: all .2s;
}

.name-preset:hover  { border-color: var(--otome-rose); color: var(--otome-ink); }
.name-preset:active { background: rgba(255,214,233,.82); }

.name-confirm-btn { width: 100%; margin-top: .5em; letter-spacing: .3em; }

/* ══════════════════════════════════════════
   スパークルエフェクト
══════════════════════════════════════════ */
#sparkles {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparklePop 1s ease-out forwards;
  font-size: .7rem;
  color: rgba(255, 235, 120, .95);
  text-shadow: 0 0 6px rgba(255,220,80,.7);
}

@keyframes sparklePop {
  0%   { opacity: 1; transform: scale(0) translateY(0) rotate(0deg); }
  40%  { opacity: .9; transform: scale(1.4) translateY(-16px) rotate(60deg); }
  100% { opacity: 0; transform: scale(.4) translateY(-36px) rotate(120deg); }
}

/* ══════════════════════════════════════════
   テキストウィンドウ 隅装飾
══════════════════════════════════════════ */
/* コーナー装飾はCSSで追加（追加のHTML要素不要） */
#text-window {
  /* 既存スタイルに加えて角の光を追加 */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    inset 0 -14px 22px rgba(255,141,189,.08),
    inset 1px 0 0 rgba(255,190,220,.22),
    inset -1px 0 0 rgba(255,190,220,.22),
    0 -8px 28px rgba(80,10,60,.2),
    0 -1px 26px rgba(255,159,199,.2);
}

/* 好感度バーの幅をもう少し広く */
.aff-bar { width: 68px; }

/* 選択肢エリアをキャラの上に来るよう調整（タブバー分も上に） */
#choices {
  bottom: calc(var(--textwin-h) + 56px + var(--safe-bottom) + 8px + var(--dev-choices-offset, 0px));
}

/* チャラ男カラーのスパークル */
.sparkle-sou { color: rgba(255, 160, 200, .9); text-shadow: 0 0 6px rgba(255,100,180,.6); }

/* ══════════════════════════════════════════
   固定タブバー
══════════════════════════════════════════ */
#tab-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 75;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 247, 251, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,184,218,.48);
  display: flex;
  align-items: stretch;
}

#tab-bar.tab-hidden {
  display: none;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18em;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(92,58,112,.42);
  transition: color .2s;
  padding: 0;
  position: relative;
  z-index: 76;
}
.tab-item::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 2px;
  background: linear-gradient(90deg, var(--otome-rose), var(--otome-gold));
  border-radius: 0 0 999px 999px;
  opacity: 0;
  transition: opacity .2s;
}
.tab-item.tab-active {
  color: rgba(178,54,126,.96);
  text-shadow: 0 0 12px rgba(255,159,199,.28);
}
.tab-item.tab-active::before { opacity: 1; }
.tab-item:active { color: rgba(255,190,220,.82); }

.tab-icon  { font-size: 1.15rem; line-height: 1; }
.tab-label { font-size: .6rem; letter-spacing: .1em; font-family: var(--font-main); }

/* ══════════════════════════════════════════
   タイトル画面 キャラクター立ち絵
══════════════════════════════════════════ */
#title-chars {
  position: absolute;
  bottom: calc(56px + var(--safe-bottom) - 2px); left: -18px; right: -18px;
  z-index: 8;
  display: none;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  pointer-events: none;
}
#title-chars.active { display: flex; }
.title-chara {
  width: 28%;
  max-width: 150px;
  cursor: pointer;
  pointer-events: all;
  transition: transform .28s, filter .28s;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.55));
  position: relative;
  margin: 0 -10px;
}
.title-chara img,
.title-chara svg { width: 100%; height: auto; display: block; }
.title-chara:nth-child(1) { transform: translateY(12px) rotate(-2deg); z-index: 2; }
.title-chara:nth-child(2) { transform: translateY(-4px) scale(1.08); z-index: 4; }
.title-chara:nth-child(3) { transform: translateY(2px) scale(1.06); z-index: 3; }
.title-chara:nth-child(4) { transform: translateY(14px) rotate(2deg); z-index: 1; }
.title-chara:hover  { transform: translateY(-6px) scale(1.04); }
.title-chara:active { transform: translateY(-3px) scale(1.01); }
/* 各キャラの色グロー */
.title-chara-蓮   { filter: drop-shadow(0 0 12px rgba(126,184,255,.45)) drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
.title-chara-陽太  { filter: drop-shadow(0 0 12px rgba(255,179, 71,.45)) drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
.title-chara-暁   { filter: drop-shadow(0 0 12px rgba(201,160,220,.45)) drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
.title-chara-颯   { filter: drop-shadow(0 0 12px rgba(255,126,184,.45)) drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
/* キャラ名ラベル */
.title-chara-label {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: .6rem;
  color: #fff7fb;
  letter-spacing: .1em;
  text-shadow: 0 1px 6px rgba(0,0,0,.9), 0 0 10px rgba(255, 141, 189, .55);
  white-space: nowrap;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   キャラクター紹介画面
══════════════════════════════════════════ */
#chara-intro-screen {
  position: absolute;
  inset: 0;
  z-index: 68;
  background:
    radial-gradient(circle at 74% 16%, rgba(255,220,236,.16), transparent 32%),
    rgba(18, 8, 24, .96);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  align-items: stretch;
  padding-top: var(--safe-top);
  overflow: hidden;
}

/* スライドアニメーション */
@keyframes ci-from-right {
  from { opacity: 0; transform: translateX(52px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ci-from-left {
  from { opacity: 0; transform: translateX(-52px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ci-chara-from-right {
  from { opacity: 0; transform: translateX(64px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ci-chara-from-left {
  from { opacity: 0; transform: translateX(-64px); }
  to   { opacity: 1; transform: none; }
}
.ci-slide-right { animation: ci-from-right .22s cubic-bezier(.25,.46,.45,.94); }
.ci-slide-left  { animation: ci-from-left  .22s cubic-bezier(.25,.46,.45,.94); }
#chara-intro-screen.active { display: flex; }

/* タブバー */
.ci-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,184,218,.3);
  background: rgba(255, 247, 251, .08);
  flex-shrink: 0;
}
.ci-tab {
  flex: 1;
  padding: .7em .2em .6em;
  font-size: .78rem;
  font-family: var(--font-main);
  letter-spacing: .08em;
  cursor: pointer;
  border: none;
  background: none;
  color: rgba(255,220,236,.5);
  border-bottom: 2px solid transparent;
  transition: all .2s;
  position: relative;
  bottom: -1px;
}
.ci-tab.active {
  color: var(--text);
  border-bottom-color: var(--ci-tab-color, var(--accent));
}
.ci-tab:hover { color: var(--text-sub); }

/* 本文エリア */
.ci-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* キャラ立ち絵（背面・全身） */
.ci-chara-wrap {
  position: absolute;
  bottom: calc(56px + var(--safe-bottom, 0px) + var(--dev-ci-bottom, 0px));
  left: calc(50% + var(--dev-ci-x, 0px));
  transform: translateX(-50%);
  width: clamp(150px, var(--dev-ci-w, 60vw), 600px);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.55));
  animation: charaBreathe 3.2s ease-in-out infinite;
}
.ci-chara-wrap svg { width: 100%; height: auto; display: block; }
.ci-chara-wrap img { width: 100%; height: auto; display: block; }
.ci-body.ci-slide-right .ci-chara-wrap { animation: ci-chara-from-right .22s cubic-bezier(.25,.46,.45,.94) 0s, charaBreathe 3.2s ease-in-out infinite .22s; }
.ci-body.ci-slide-left .ci-chara-wrap { animation: ci-chara-from-left .22s cubic-bezier(.25,.46,.45,.94) 0s, charaBreathe 3.2s ease-in-out infinite .22s; }

/* プロフィールカード（前面・下部オーバーレイ） */
.ci-card {
  position: absolute;
  bottom: calc(56px + var(--safe-bottom, 0px) + .8em);
  left: 1.2em;
  right: 1.2em;
  z-index: 2;
  max-height: 55%;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,232,244,var(--dev-ci-card-alpha, .78)));
  backdrop-filter: blur(var(--dev-ci-card-blur, 0px));
  -webkit-backdrop-filter: blur(var(--dev-ci-card-blur, 0px));
  border: 1px solid rgba(255,184,218,.48);
  border-radius: 20px;
  padding: 1.1em 1.3em;
  display: flex;
  flex-direction: column;
  gap: .6em;
}
/* キャラ名 */
.ci-name {
  font-family: var(--font-main);
  font-size: 1.45rem;
  color: var(--otome-ink);
  letter-spacing: .16em;
  text-shadow: 0 0 16px var(--ci-tab-color, var(--accent));
  line-height: 1.3;
}
.ci-furigana {
  font-size: .7rem;
  color: rgba(92,58,112,.68);
  letter-spacing: .22em;
  margin-top: -.3em;
}
/* ステータスバッジ */
.ci-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4em;
  margin-top: .1em;
}
.ci-badge {
  font-size: .68rem;
  padding: .2em .75em;
  border-radius: 0;
  border: 1px solid rgba(255,184,218,.45);
  color: rgba(92,58,112,.74);
  letter-spacing: .08em;
}
.ci-badge-type {
  border-color: var(--ci-tab-color, var(--accent));
  color: var(--ci-tab-color, var(--accent));
}
/* 区切り線 */
.ci-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,160,232,.25), transparent);
}
/* プロフィール本文 */
.ci-desc {
  font-size: .86rem;
  line-height: 2.1;
  color: var(--otome-ink);
  white-space: pre-line;
  letter-spacing: .04em;
}
/* とじるボタン */
.ci-close-btn {
  margin: 0 auto calc(var(--safe-bottom) + .8em);
  letter-spacing: .22em;
  min-width: 180px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   設定画面
══════════════════════════════════════════ */
#settings-screen {
  position: absolute;
  inset: 0;
  z-index: 65;
  background: rgba(4, 3, 14, .97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 2em) 1.5em calc(56px + var(--safe-bottom) + 1.5em);
  gap: .5em;
  overflow-y: auto;
}
#settings-screen.active { display: flex; }
.sc-hd h2 {
  font-family: var(--font-main);
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: .18em;
  margin-bottom: .5em;
}
.settings-list {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: .5em;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 8, 28, .72);
  border: 1px solid rgba(184,160,232,.2);
  border-radius: 6px;
  padding: .9em 1.1em;
  gap: 1em;
}
.set-row-danger {
  cursor: pointer;
  background: rgba(180, 40, 40, .22);
  border-color: rgba(255, 90, 90, .7);
  color: #ff8080;
}
.set-row-danger .set-label { color: #ff8080; }
.set-row-danger .set-arr   { color: #ff8080; }
.set-row-danger:active { background: rgba(220, 60, 60, .35); }
.set-label {
  font-size: .88rem;
  color: var(--text);
  letter-spacing: .06em;
  flex-shrink: 0;
}
.set-arr { color: rgba(220,100,100,.7); font-size: 1.2rem; }

/* トグルボタン */
.tog-btn {
  font-size: .78rem;
  padding: .3em .9em;
  border-radius: 20px;
  border: 1px solid rgba(184,160,232,.35);
  background: rgba(10, 8, 28, .5);
  color: rgba(184,160,232,.4);
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .1em;
}
.tog-btn.tog-on {
  background: rgba(184, 160, 232, .18);
  border-color: var(--accent);
  color: var(--accent);
}

/* スライダー */
.set-slider-wrap {
  display: flex;
  align-items: center;
  gap: .6em;
  flex: 1;
}
.set-slider-wrap input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(184,160,232,.25);
  outline: none;
}
.set-slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(184,160,232,.5);
}
.set-slider-wrap span {
  font-size: .75rem;
  color: var(--text-sub);
  min-width: 2.2em;
  text-align: right;
}

/* テキスト速度・文字サイズボタン */
.speed-btns, .size-btns, .style-btns {
  display: flex;
  gap: .4em;
}
.speed-btn, .size-btn, .style-btn {
  font-size: .76rem;
  padding: .3em .75em;
  border-radius: 4px;
  border: 1px solid rgba(184,160,232,.25);
  background: rgba(10, 8, 28, .5);
  color: rgba(184,160,232,.4);
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .06em;
}
.speed-btn.speed-active, .size-btn.size-active, .style-btn.style-active {
  background: rgba(184, 160, 232, .18);
  border-color: var(--accent);
  color: var(--accent);
}

/* フォントボタン */
.font-btns {
  display: flex;
  gap: .4em;
}
.font-btn {
  font-size: .76rem;
  padding: .3em .75em;
  border-radius: 4px;
  border: 1px solid rgba(184, 160, 232, .28);
  background: none;
  color: var(--text-sub);
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .06em;
}
.font-btn.font-active {
  background: rgba(184, 160, 232, .18);
  border-color: var(--accent);
  color: var(--accent);
}
.set-close-btn {
  margin-top: 1em;
  min-width: 180px;
  letter-spacing: .22em;
}

/* ================================================================
   パーティクルエフェクト
   ================================================================ */
#particle-layer {
  position: absolute; inset: 0; z-index: 15;
  pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute;
  top: -40px;
  will-change: transform, opacity;
  user-select: none;
  line-height: 1;
}
@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(480deg); opacity: 0; }
}
@keyframes heartFloat {
  0%   { transform: translateY(0) scale(0.6);     opacity: 1; }
  60%  { opacity: 0.9; }
  100% { transform: translateY(-80vh) scale(1.2); opacity: 0; }
}

/* ================================================================
   画面フラッシュ
   ================================================================ */
#flash-overlay {
  position: absolute; inset: 0; z-index: 30;
  pointer-events: none;
  opacity: 0;
}
#flash-overlay.flash-pink  { background: #ffe0f0; }
#flash-overlay.flash-white { background: #ffffff; }
@keyframes flashPop {
  0%   { opacity: 0;    }
  20%  { opacity: 0.5;  }
  100% { opacity: 0;    }
}

/* ================================================================
   スキップボタン
   ================================================================ */
/* ボタンコンテナ */
#text-btns {
  position: absolute; top: 0.6em; right: 0.8em;
  display: flex; gap: 0.4em;
  display: none;
  opacity: 0.6;
  transition: opacity .2s;
}
#text-window.active #text-btns { display: flex; }
#text-btns:hover { opacity: 0.95; }

#skip-btn, #hide-btn {
  font-size: 0.6rem; letter-spacing: 0.05em;
  color: rgba(220, 200, 255, 0.7);
  background: rgba(140, 100, 220, 0.12);
  border: 1px solid rgba(200, 160, 255, 0.25);
  border-radius: 16px; padding: 2px 8px;
  cursor: pointer;
  line-height: 1.4;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
#skip-btn.skip-on, #hide-btn.hide-on {
  background: rgba(200,180,240,.12);
  border-color: rgba(200,180,240,.32);
  color: rgba(220,190,255,.9);
}

/* ================================================================
   タイトルへ戻る確認モーダル
   ================================================================ */
#title-confirm-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65);
}
.title-confirm-box {
  background: var(--panel); border: 1px solid rgba(184,160,232,.28);
  border-radius: 16px; padding: 2em 1.8em; text-align: center;
  max-width: 280px; box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.title-confirm-box p {
  margin: 0; font-size: 0.95rem; line-height: 1.6;
  color: var(--text);
}
.title-confirm-btns {
  display: flex; gap: 1em; justify-content: center; margin-top: 1.2em;
}
.title-confirm-btns button {
  padding: 0.6em 1.4em; border-radius: 8px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 600; transition: all .2s;
}
.title-confirm-btns button:first-child {
  background: var(--accent); color: #fff;
}
.title-confirm-btns button:first-child:active {
  transform: scale(.96); opacity: .9;
}
.title-confirm-btns button:last-child {
  background: rgba(255,255,255,.1); color: var(--text);
}
.title-confirm-btns button:last-child:active {
  background: rgba(255,255,255,.15);
}

/* ================================================================
   ローディング画面
   ================================================================ */
#loading-screen {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, #0a0a15 0%, #150a2e 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-inner {
  text-align: center;
  color: var(--text);
}
.loading-title {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
  font-weight: 300;
  line-height: 1.6;
}
.loading-bar-wrap {
  width: 200px;
  height: 4px;
  background: rgba(184, 160, 232, 0.15);
  border-radius: 2px;
  margin: 0 auto 1.5rem;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #b8a0e8 0%, #d4bfff 100%);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s ease-out;
}
.loading-msg {
  font-size: 0.75rem;
  color: rgba(180, 165, 210, 0.7);
  letter-spacing: 0.05em;
}

/* ================================================================
   設定画面：キャッシュクリア行
   ================================================================ */
.set-row-warn {
  background: rgba(180, 110, 30, .2);
  border-color: rgba(255, 180, 60, .7);
  cursor: pointer;
}
.set-row-warn .set-label { color: #ffb84a; }
.set-row-warn .set-arr   { color: #ffb84a; }
.set-row-warn:active {
  background: rgba(200, 130, 40, .35);
}

/* ================================================================
   設定画面：アプリバージョン
   ================================================================ */
.app-version {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(180, 165, 210, 0.4);
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ================================================================
   ギャラリー：NEWバッジ
   ================================================================ */
.gallery-new-badge {
  font-size: .55rem;
  background: #ff6090;
  color: #fff;
  border-radius: 3px;
  padding: .1em .4em;
  letter-spacing: .05em;
  margin-left: .4em;
  vertical-align: middle;
}

/* ================================================================
   開発者パネル
   ================================================================ */
#dev-panel {
  display: none;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 380px);
  background: rgba(10, 6, 30, .95);
  border: 1px solid rgba(184,160,232,.35);
  border-radius: 12px;
  padding: 0 0 12px;
  z-index: 200;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0,0,0,.7);
  color: #c8b4f0;
  font-size: .8rem;
  touch-action: none;
}
#dev-panel.active { display: block; }
.dev-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(184,160,232,.15);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.dev-hd > span { font-size: .82rem; font-weight: 600; color: #b89de0; flex-shrink: 0; }
.dev-tabs { display: flex; gap: 4px; flex: 1; }
.dev-tab {
  flex: 1;
  font-size: .7rem;
  padding: .25em .4em;
  border-radius: 4px;
  border: 1px solid rgba(184,160,232,.2);
  background: none;
  color: rgba(184,160,232,.5);
  cursor: pointer;
  letter-spacing: .04em;
}
.dev-tab.dev-tab-active {
  background: rgba(184,160,232,.18);
  border-color: rgba(184,160,232,.5);
  color: #d4c0f4;
}
.dev-close {
  background: none;
  border: none;
  color: #b89de0;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.dev-section { padding: 10px 12px 0; }
.dev-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: .75rem;
  color: rgba(200,180,240,.7);
  cursor: pointer;
}
.dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.dev-label {
  width: 3.6em;
  flex-shrink: 0;
  color: rgba(200,180,240,.6);
  font-size: .72rem;
}
.dev-row input[type=range] {
  flex: 1;
  height: 4px;
  accent-color: #b89de0;
}
.dev-val {
  width: 5em;
  text-align: right;
  font-size: .72rem;
  color: #d4c0f4;
  font-variant-numeric: tabular-nums;
}
.dev-btns {
  display: flex;
  gap: 8px;
  margin: 10px 12px 0;
}
.dev-btn {
  flex: 1;
  font-size: .75rem;
  padding: .4em .6em;
  border-radius: 6px;
  border: 1px solid rgba(184,160,232,.3);
  background: rgba(184,160,232,.1);
  color: #c8b4f0;
  cursor: pointer;
  letter-spacing: .05em;
  transition: background .15s;
}
.dev-btn:active { background: rgba(184,160,232,.25); }
.dev-btn.dev-copy { border-color: rgba(150,220,180,.4); color: #a0e0c0; }

/* ================================================================
   ルート選択画面
   ================================================================ */
#route-select {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 32;
  background:
    radial-gradient(circle at 20% 14%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(180deg, rgba(255,190,220,.2), rgba(25, 8, 30, .76)),
    rgba(18, 8, 24, .76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + .8em) clamp(.8em, 4vw, 1.4em) calc(56px + var(--safe-bottom) + .8em);
}
#route-select.active { display: flex; }

/* 一人ずつ選ぶルート選択 */
.rs-single {
  position: relative;
  width: min(92vw, 390px);
  height: min(74vh, 36em);
  max-height: calc(100dvh - 56px - var(--safe-bottom) - var(--safe-top) - 3.2em);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rs-single-main {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid rgba(255,190,220,.62);
  border-top: 3px solid var(--rs-color, #b8a0e8);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.2), transparent 34%),
    linear-gradient(180deg, rgba(255,247,251,.2), rgba(39,14,48,.46) 35%, rgba(255,232,244,.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 18px 42px rgba(80,20,60,.28),
    0 0 32px rgba(255,159,199,.2);
}
.rs-single-portrait {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: .8em 1.2em 0;
  overflow: hidden;
}
.rs-single-portrait img,
.rs-single-portrait svg {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.58));
}
.rs-single-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,229,241,.9));
  border-top: 1px solid rgba(255,190,220,.58);
  padding: .88em 1em 1em;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rs-nav-btn {
  position: absolute;
  top: 39%;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,190,220,.74);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,224,240,.9));
  color: #b74083;
  font-size: 1.7rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
}
.rs-nav-prev { left: -.65rem; }
.rs-nav-next { right: -.65rem; }
.rs-nav-btn:active { transform: scale(.94); background: rgba(255,159,199,.22); }

/* 旧グリッドビュー（互換用） */
.rs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(.55em, 2.4vw, .85em);
  width: min(92vw, 430px);
  justify-content: center;
  align-items: stretch;
  height: min(72vh, 34em);
  max-height: calc(100dvh - 56px - var(--safe-bottom) - 4.5em);
}
.rs-hint {
  font-size: .72rem;
  color: rgba(255,226,242,.8);
  letter-spacing: .12em;
  margin-top: .6em;
  flex-shrink: 0;
}
.rs-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform .2s;
  border: 1px solid rgba(184,160,232,.2);
  border-top-color: var(--rs-color, #b8a0e8);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  position: relative;
}
.rs-card:active { transform: scale(.97); }
/* 画像エリア（上部・フレックスで伸びる） */
.rs-portrait {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, rgba(8,6,22,.15) 0%, transparent 30%);
  overflow: hidden;
}
.rs-portrait img, .rs-portrait svg {
  width: auto;
  height: 92%;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center bottom;
}
/* 名前エリア（下部・固定高さ・背景付き） */
.rs-name-area {
  width: 100%;
  flex-shrink: 0;
  background: rgba(255, 247, 251, .9);
  border-top: 1px solid rgba(255,184,218,.4);
  padding: .35em .3em .45em;
  text-align: center;
}
.rs-name {
  font-size: clamp(.68rem, 2.7vw, .82rem);
  color: var(--otome-ink);
  letter-spacing: .04em;
  text-shadow: 0 0 8px var(--rs-color, #b8a0e8);
  white-space: nowrap;
}
.rs-furigana {
  font-size: clamp(.5rem, 2.1vw, .58rem);
  color: rgba(92,58,112,.62);
  letter-spacing: .04em;
  margin-top: .1em;
  white-space: nowrap;
}

/* 詳細ビュー */
.rs-detail {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.rs-detail-bg {
  position: absolute;
  bottom: 0;
  left: calc(50% + var(--dev-ci-x, 0px));
  transform: translateX(-50%);
  width: var(--dev-ci-w, 60vw);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.55));
  animation: charaBreathe 3.2s ease-in-out infinite;
}
.rs-detail-bg img, .rs-detail-bg svg {
  width: 100%;
  height: auto;
  display: block;
}
.rs-detail-card {
  position: relative;
  z-index: 2;
  margin: 0 1.2em;
  background: rgba(255, 247, 251, .9);
  border: 1px solid rgba(255,184,218,.5);
  border-top: 2px solid var(--rs-color, #b8a0e8);
  border-radius: 18px;
  padding: 1em 1.2em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rs-detail-name {
  font-family: var(--font-main);
  font-size: 1.3rem;
  color: var(--otome-ink);
  letter-spacing: .16em;
  text-shadow: 0 0 14px var(--rs-color, #b8a0e8);
  line-height: 1.3;
}
.rs-detail-furigana {
  font-size: .68rem;
  color: rgba(92,58,112,.66);
  letter-spacing: .2em;
  margin-top: .1em;
  margin-bottom: .5em;
}
.rs-detail-desc {
  font-size: .78rem;
  color: rgba(53,35,68,.78);
  line-height: 1.7;
  margin: .5em 0 .8em;
}
.rs-detail-btns {
  display: flex;
  gap: .6em;
  margin-top: .4em;
}
.rs-btn {
  flex: 1;
  padding: .7em .8em;
  border-radius: 0;
  border: 1px solid rgba(255,190,220,.32);
  font-size: .82rem;
  cursor: pointer;
  letter-spacing: .1em;
  transition: all .2s;
}
.rs-btn-back {
  background: rgba(255, 247, 251, .78);
  color: rgba(92,58,112,.72);
}
.rs-btn-back:active { background: rgba(255,214,233,.86); }
.rs-btn-confirm {
  background:
    linear-gradient(180deg, rgba(255,141,189,.95), rgba(230,95,157,.92));
  border-color: var(--rs-color, #b8a0e8);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.rs-btn-confirm:active { transform: scale(.97); }

/* ================================================================
   G-14 商業乙女VN寄せ再調整
   getdesign.md の思想に合わせ、表層ピンクではなく
   画面原則・トークン・部品の役割を明確にした最終上書き。
   ================================================================ */
:root {
  --vn-ink: #fff7fb;
  --vn-muted: rgba(239, 220, 238, .74);
  --vn-panel: rgba(18, 9, 28, .78);
  --vn-panel-strong: rgba(12, 6, 20, .9);
  --vn-line: rgba(244, 202, 139, .62);
  --vn-rose: #f08bb8;
  --vn-plum: #3b163e;
  --vn-shadow: rgba(7, 0, 18, .62);
}

body {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 225, 244, .16), transparent 30%),
    linear-gradient(180deg, #10071d 0%, #26103c 48%, #080511 100%);
}

#game::after {
  background:
    linear-gradient(180deg, rgba(255, 230, 246, .06), transparent 34%, rgba(8, 0, 18, .34) 100%),
    radial-gradient(ellipse at 50% 44%, transparent 46%, rgba(4, 0, 12, .64) 100%);
}

#title-screen {
  justify-content: flex-start;
  align-items: center;
  padding: calc(var(--safe-top) + 2.7em) 1.2em 0;
  z-index: 14;
  pointer-events: none;
}
#title-screen h1 {
  font-size: clamp(2rem, 7.6vw, 3.35rem);
  line-height: 1.22;
  letter-spacing: .16em;
  color: #fff8fc;
  text-shadow:
    0 1px 0 rgba(88, 24, 70, .84),
    0 0 18px rgba(255, 150, 208, .74),
    0 0 44px rgba(185, 142, 255, .44);
}
#title-screen p {
  margin-top: .45em;
  font-size: .52rem;
  letter-spacing: .26em;
  color: rgba(255, 235, 247, .8);
  text-shadow: 0 1px 6px rgba(0,0,0,.65);
}
#title-screen::before,
#title-screen p::after {
  opacity: .76;
}
.title-start-btn {
  pointer-events: all;
  min-width: 154px;
  min-height: 38px;
  padding: .54em 1.6em;
  margin-top: .95em;
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 0 9px, rgba(244,202,139,.9) 9px 10px, transparent 10px),
    linear-gradient(270deg, transparent 0 9px, rgba(244,202,139,.9) 9px 10px, transparent 10px),
    linear-gradient(180deg, rgba(45, 18, 52, .9), rgba(17, 7, 27, .86));
  border: 1px solid rgba(244, 202, 139, .76);
  color: #fff7fb;
  font-size: .82rem;
  letter-spacing: .24em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 8px 20px rgba(0,0,0,.32),
    0 0 18px rgba(240,139,184,.18);
}
.title-start-btn::before {
  inset: 3px;
  border-color: rgba(255, 230, 246, .22);
  border-radius: 1px;
}
.title-start-btn:hover { color: #fff; border-color: rgba(255, 221, 166, .95); }

#title-chars {
  left: -32px;
  right: -32px;
  bottom: calc(56px + var(--safe-bottom) - 10px);
  z-index: 9;
  justify-content: center;
  align-items: flex-end;
}
.title-chara {
  width: 31%;
  max-width: 178px;
  margin: 0 -18px;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.6));
}
.title-chara:nth-child(1) { transform: translateY(18px) rotate(-4deg) scale(.96); z-index: 2; }
.title-chara:nth-child(2) { transform: translateY(-2px) scale(1.12); z-index: 5; }
.title-chara:nth-child(3) { transform: translateY(6px) scale(1.08); z-index: 4; }
.title-chara:nth-child(4) { transform: translateY(22px) rotate(4deg) scale(.96); z-index: 1; }
.title-chara:hover { transform: translateY(-6px) scale(1.08); }
.title-chara-label {
  bottom: 12px;
  padding: .12em .62em;
  border: 1px solid rgba(244,202,139,.52);
  background: rgba(14, 6, 24, .68);
  color: #fff9fc;
  border-radius: 1px;
}

#text-window {
  left: .78em;
  right: .78em;
  bottom: calc(56px + var(--safe-bottom) + .72em);
  min-height: clamp(132px, 24vh, 172px);
  padding: 1em 1.18em .95em;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(33, 14, 45, .84), rgba(10, 5, 18, .84));
  border: 1px solid rgba(244, 202, 139, .52);
  color: var(--vn-ink);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    inset 0 0 34px rgba(240,139,184,.07),
    0 12px 32px var(--vn-shadow);
}
#text-window::before {
  top: -10px;
  left: 12px;
  right: 12px;
  height: 10px;
  background: linear-gradient(90deg, transparent, rgba(244,202,139,.7), rgba(240,139,184,.75), rgba(244,202,139,.7), transparent);
}
#text-window::after {
  top: 5px;
  left: 6px;
  right: 6px;
  height: calc(100% - 10px);
  border: 1px solid rgba(255, 232, 247, .12);
  background: none;
  box-shadow: none;
  pointer-events: none;
}
#speaker {
  margin-bottom: .48em;
  padding: .2em .86em;
  min-width: 4.2em;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(244,202,139,.92), rgba(240,139,184,.88));
  border: none;
  color: #24102d;
  text-shadow: none;
  box-shadow: 0 5px 12px rgba(0,0,0,.24);
}
#text {
  color: var(--vn-ink);
  line-height: 1.95;
  text-shadow: 0 1px 2px rgba(0,0,0,.48);
}
#click-indicator {
  color: rgba(244,202,139,.82);
}

#choices {
  gap: .5em;
  padding: 0 1.15em 1em;
}
.choice-btn {
  min-height: 48px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(244,202,139,.76) 0 3px, transparent 3px),
    linear-gradient(180deg, rgba(44, 18, 54, .92), rgba(17, 7, 28, .88));
  border: 1px solid rgba(244,202,139,.58);
  color: #fff7fb;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    0 8px 20px rgba(0,0,0,.3);
}
.choice-btn::before {
  content: '◆';
  display: inline;
  width: auto;
  height: auto;
  margin-right: .7em;
  border-radius: 0;
  background: none;
  color: rgba(244,202,139,.88);
  box-shadow: none;
}
.choice-btn:hover {
  background:
    linear-gradient(90deg, rgba(240,139,184,.9) 0 3px, transparent 3px),
    linear-gradient(180deg, rgba(64, 24, 70, .94), rgba(24, 8, 34, .9));
  border-color: rgba(255,221,166,.88);
}

#tab-bar {
  background: rgba(11, 5, 18, .88);
  border-top: 1px solid rgba(244,202,139,.32);
}
.tab-item {
  color: rgba(255,235,247,.46);
}
.tab-item.tab-active {
  color: #fff7fb;
  text-shadow: 0 0 10px rgba(240,139,184,.55);
}
.tab-item::before {
  background: linear-gradient(90deg, transparent, rgba(244,202,139,.9), rgba(240,139,184,.85), transparent);
}

#name-screen,
#saveload-screen,
#gallery-screen,
#chara-intro-screen,
#settings-screen {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 222, 242, .14), transparent 32%),
    rgba(12, 5, 19, .96);
}
.name-input-wrap,
.save-slot,
.gallery-card,
.ci-card,
.set-row {
  border-radius: 4px;
  background: rgba(23, 10, 33, .82);
  border: 1px solid rgba(244,202,139,.32);
  color: var(--vn-ink);
}
#name-input,
.save-slot-info,
.gallery-card-title,
.ci-name,
.ci-desc,
.set-label {
  color: var(--vn-ink);
}

#route-select {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 220, 242, .13), transparent 34%),
    rgba(12, 5, 19, .82);
}
.rs-single-main {
  border-radius: 6px;
  border-color: rgba(244,202,139,.58);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(20, 8, 31, .64) 42%, rgba(10, 5, 18, .92));
}
.rs-single-card,
.rs-name-area,
.rs-detail-card {
  background: rgba(14, 6, 24, .88);
  border-color: rgba(244,202,139,.38);
}
.rs-name,
.rs-detail-name {
  color: #fff7fb;
}
.rs-furigana,
.rs-detail-furigana,
.rs-detail-desc {
  color: var(--vn-muted);
}
.rs-nav-btn,
.rs-btn-confirm {
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(244,202,139,.9), rgba(176,104,132,.86));
  color: #22102c;
}
.rs-btn-back {
  border-radius: 2px;
  background: rgba(20, 8, 31, .72);
  color: var(--vn-muted);
}

/* G-14追補: 現行素材品質に合わせ、タイトルは全身集合ではなく攻略対象カードにする */
#title-screen {
  padding-top: calc(var(--safe-top) + 2.35em);
}
#title-screen h1 {
  width: min(92vw, 360px);
  font-size: clamp(1.7rem, 6.2vw, 2.55rem);
  letter-spacing: .1em;
  line-height: 1.28;
}
#title-screen p {
  letter-spacing: .2em;
  font-size: .5rem;
}
.title-start-btn {
  margin-top: .78em;
}
#title-chars {
  left: .85em;
  right: .85em;
  bottom: calc(56px + var(--safe-bottom) + .9em);
  gap: .38em;
  align-items: stretch;
  z-index: 10;
}
.title-chara,
.title-chara:nth-child(1),
.title-chara:nth-child(2),
.title-chara:nth-child(3),
.title-chara:nth-child(4),
.title-chara:hover,
.title-chara:active {
  width: calc((100% - 1.14em) / 4);
  max-width: none;
  height: clamp(92px, 17vh, 118px);
  margin: 0;
  transform: none;
  rotate: none;
}
.title-chara {
  overflow: hidden;
  border: 1px solid rgba(244,202,139,.42);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(16, 6, 24, .78) 55%, rgba(8, 3, 14, .92)),
    radial-gradient(circle at 50% 18%, rgba(255, 220, 244, .16), transparent 42%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 10px 20px rgba(0,0,0,.38);
}
.title-chara::before {
  content: '';
  position: absolute;
  inset: 6px 6px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,202,139,.78), transparent);
}
.title-chara::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.55em;
  text-align: center;
  font-size: .48rem;
  letter-spacing: .1em;
  color: rgba(255,235,247,.68);
}
.title-chara:nth-child(1)::after { content: '生徒会長'; }
.title-chara:nth-child(2)::after { content: '王子様'; }
.title-chara:nth-child(3)::after { content: '文学少年'; }
.title-chara:nth-child(4)::after { content: 'ムードメーカー'; }
.title-chara img,
.title-chara svg {
  display: none;
}
.title-chara-label {
  left: 0;
  right: 0;
  bottom: 2.9em;
  transform: none;
  width: 100%;
  padding: 0 .15em;
  border: 0;
  border-top: 0;
  border-radius: 0;
  background: none;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .16em;
}

/* ================================================================
   R-01 v1.9.2 rollback override
   v1.9.3〜v1.9.5のデザイン試行を表示上無効化し、
   v1.9.2時点の暗色スターライトUIへ戻す。
   ================================================================ */
body {
  background: linear-gradient(180deg, #090510 0%, #12081d 44%, #080510 100%);
}

#game::after {
  background:
    linear-gradient(180deg, rgba(184,160,232,.03), transparent 28%, rgba(0,0,4,.18) 100%),
    radial-gradient(ellipse at 50% 38%, transparent 52%, rgba(0,0,4,.58) 100%);
  background-size: auto;
}

.title-start-btn {
  background: linear-gradient(160deg, rgba(18,12,40,.75), rgba(30,18,60,.88));
  border: 1px solid var(--accent-dim);
  color: var(--text);
  padding: .78em 3.2em;
  font-size: 1rem;
  letter-spacing: .32em;
  border-radius: 999px;
  min-width: 200px;
  min-height: 52px;
  margin-top: 1.6em;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 8px 24px rgba(0,0,0,.18);
  border-left-width: 1px;
  border-right-width: 1px;
}
.title-start-btn::before {
  display: none;
}
.title-start-btn:hover {
  border-color: rgba(184,160,232,.72);
  color: #f0e8ff;
}
.title-start-btn:active {
  transform: scale(.97);
  background: rgba(184,160,232,.1);
}

#title-screen {
  justify-content: center;
  z-index: 10;
  padding-top: var(--safe-top);
  padding-left: 0;
  padding-right: 0;
}
#title-screen h1 {
  width: auto;
  font-size: clamp(1.65rem, 5.2vw, 2.7rem);
  color: #f0e8ff;
  letter-spacing: .18em;
  line-height: 1.48;
  margin-bottom: .2em;
  text-shadow:
    0 0 16px rgba(184,160,232,.62),
    0 0 34px rgba(184,160,232,.38),
    0 0 64px rgba(184,160,232,.16);
}
#title-screen p {
  font-size: .68rem;
  color: rgba(210, 190, 250, .72);
  letter-spacing: .42em;
}
#title-screen::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
#title-screen p::after {
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

#title-chars {
  bottom: calc(56px + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 8;
  display: none;
  justify-content: space-around;
  align-items: flex-end;
  gap: 0;
  padding: 0 4px;
}
#title-chars.active { display: flex; }
.title-chara,
.title-chara:nth-child(1),
.title-chara:nth-child(2),
.title-chara:nth-child(3),
.title-chara:nth-child(4),
.title-chara:hover,
.title-chara:active {
  width: 23%;
  height: auto;
  max-width: 115px;
  margin: 0;
  transform: none;
  rotate: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: none;
  box-shadow: none;
}
.title-chara::before,
.title-chara::after {
  display: none;
}
.title-chara img,
.title-chara svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transform: none;
}
.title-chara-label {
  bottom: 4px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  font-size: .58rem;
  font-weight: 400;
  color: rgba(232,225,248,.72);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

#affection-display {
  background: rgba(10, 8, 28, .72);
  border: 1px solid rgba(184,160,232,.2);
  border-radius: 4px;
  box-shadow: none;
}
.aff-name {
  color: var(--text-sub);
}
.aff-bar {
  width: 68px;
  height: 3px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
}
.hud-btn {
  background: rgba(10, 8, 28, .72);
  border: 1px solid rgba(184,160,232,.26);
  color: rgba(210,190,250,.78);
}
.hud-btn:active {
  background: rgba(184,160,232,.14);
  border-color: var(--accent);
}

#text-window {
  bottom: calc(56px + var(--safe-bottom));
  left: 0;
  right: 0;
  min-height: var(--textwin-h);
  padding: 1.15em 1.4em 1.15em;
  border-radius: 0;
  background: rgba(6, 5, 18, var(--dev-textwin-alpha, .65));
  border-top: 1px solid rgba(184,160,232,.22);
  border-left: 0;
  border-right: 0;
  box-shadow:
    inset 0 1px 0 rgba(184,160,232,.06),
    0 -8px 32px rgba(0,0,12,.55),
    inset 1px 0 0 rgba(184,160,232,.04),
    inset -1px 0 0 rgba(184,160,232,.04);
}
#text-window::before {
  top: -38px;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(180deg, transparent, rgba(6, 5, 18, .56));
  border: 0;
}
#text-window::after {
  top: 0;
  left: 9%;
  right: 9%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-line), transparent);
  border: 0;
  box-shadow: 0 0 12px rgba(184,160,232,.28);
}
#speaker {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(184,160,232,.38);
  box-shadow: none;
  min-width: 0;
  text-align: left;
}
.speaker-default { color: var(--text-sub); }
#text {
  color: rgba(232,225,248,.96);
  text-shadow: none;
}
#click-indicator {
  color: var(--accent);
}

.choice-btn {
  background: rgba(10, 8, 28, .82);
  border: 1px solid rgba(184,160,232,.26);
  border-left: 3px solid var(--accent-line);
  color: var(--text);
  border-radius: 4px;
  padding: .88em 1.2em .88em 1em;
  box-shadow: none;
}
.choice-btn::before {
  content: '◇';
  display: inline;
  width: auto;
  height: auto;
  margin-right: .55em;
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-size: .78em;
  box-shadow: none;
}
.choice-btn:hover {
  background: rgba(184,160,232,.08);
  border-color: rgba(184,160,232,.55);
  border-left-color: var(--accent);
  transform: translateX(6px);
  box-shadow: none;
}
.choice-btn:active {
  background: rgba(184,160,232,.14);
}

.title-btn,
.menu-btn,
.name-preset {
  background: rgba(10, 8, 28, .72);
  border: 1px solid rgba(184,160,232,.26);
  color: var(--text);
  border-radius: 2px;
}
#tab-bar {
  background: rgba(6, 5, 18, .92);
  border-top: 1px solid rgba(184,160,232,.18);
}
.tab-item {
  color: rgba(210,185,230,.42);
}
.tab-item.tab-active {
  color: rgba(232,225,248,.96);
  text-shadow: 0 0 12px rgba(184,160,232,.28);
}
.tab-item::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

#name-screen {
  background: radial-gradient(ellipse at 50% 38%, rgba(30,14,60,.7) 0%, rgba(6,5,18,.95) 100%);
}
.name-input-wrap {
  background: rgba(8, 6, 22, .88);
  border: 1px solid rgba(184,160,232,.38);
  border-bottom: 2px solid var(--accent);
  border-radius: 2px 2px 0 0;
}
#name-input {
  color: #f0e8ff;
  caret-color: var(--accent);
}

#saveload-screen,
#gallery-screen,
#chara-intro-screen,
#settings-screen {
  background: rgba(4, 3, 14, .97);
}
.save-slot,
.gallery-card,
.ci-card,
.set-row {
  background: rgba(10, 8, 28, .72);
  border: 1px solid rgba(184,160,232,.2);
  border-radius: 4px;
  color: var(--text);
}
.save-slot-info,
.gallery-card-title,
.ci-name,
.ci-desc,
.set-label {
  color: var(--text);
}

#route-select {
  background: rgba(4, 3, 14, .72);
}
.rs-single-main {
  border: 1px solid rgba(184,160,232,.26);
  border-top: 2px solid var(--rs-color, #b8a0e8);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8,6,22,.15) 0%, rgba(5,4,16,.94) 100%),
    rgba(5,4,16,.92);
}
.rs-single-card,
.rs-name-area,
.rs-detail-card {
  background: rgba(6, 4, 18, .9);
  border-color: rgba(184,160,232,.18);
}
.rs-name,
.rs-detail-name {
  color: #f0e8ff;
}
.rs-furigana,
.rs-detail-furigana,
.rs-detail-desc {
  color: var(--text-sub);
}
.rs-nav-btn,
.rs-btn-confirm {
  border-radius: 0;
  background: rgba(10, 8, 28, .82);
  border: 1px solid rgba(184,160,232,.35);
  color: #f0e8ff;
}
.rs-btn-back {
  background: rgba(10,8,28,.8);
  color: rgba(184,160,232,.75);
}
