/* ============================================================
   運命の2人 - スタイル
   テーマ: 夜桜 × 星空 × 金の縁結び
   ============================================================ */
:root {
  --bg: #120b28;
  --panel: #221338;
  --panel2: #2d1a4a;
  --gold: #d9b45b;
  --gold-bright: #ffd76a;
  --sakura: #ff9ac2;
  --sakura-deep: #ff5d8f;
  --text: #f2e9f4;
  --text-dim: #b9a9c9;
  --accent: #b18cff;
  --line: #06c755;
  --radius: 14px;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
}

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

html, body { height: 100%; }

body {
  background: radial-gradient(120% 100% at 50% 0%, #241238 0%, var(--bg) 60%, #080414 100%);
  color: var(--text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---------------- 画面共通 ---------------- */
.screen { display: none; flex: 1; flex-direction: column; min-height: 100dvh; }
.screen.active { display: flex; animation: screenIn .5s ease both; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

button { font-family: var(--serif); cursor: pointer; }

.btn-primary {
  display: block; width: 100%;
  padding: 16px;
  font-size: 17px; letter-spacing: .12em;
  color: #3d0a20;
  background: linear-gradient(180deg, #ffd4e4, var(--sakura) 45%, var(--sakura-deep));
  border: 1px solid #ffe3ee;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(255,93,143,.4), inset 0 1px 0 #fff0f6;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: scale(.97); }

.btn-second {
  display: block; width: 100%;
  margin-top: 12px; padding: 14px;
  font-size: 15px; letter-spacing: .1em;
  color: #2a1a04;
  background: linear-gradient(180deg, #ffe9ac, var(--gold-bright) 45%, #c99a3c);
  border: 1px solid #fff3cf;
  border-radius: 999px;
  box-shadow: 0 5px 20px rgba(217,180,91,.3);
  transition: transform .15s ease;
}
.btn-second:active { transform: scale(.97); }

.btn-ghost {
  display: block; width: 100%;
  margin-top: 12px; padding: 13px;
  font-size: 14px; letter-spacing: .12em;
  color: var(--sakura);
  background: rgba(255,154,194,.06);
  border: 1px solid rgba(255,154,194,.45);
  border-radius: 999px;
  transition: background .15s ease;
}
.btn-ghost:active { background: rgba(255,154,194,.16); }

.btn-line {
  display: block; width: 100%;
  padding: 15px; font-size: 15px; letter-spacing: .08em; font-weight: 700;
  color: #fff; background: var(--line);
  border: none; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(6,199,85,.35);
}
.btn-share {
  display: block; width: 100%;
  padding: 15px; font-size: 15px; letter-spacing: .1em;
  color: #fff; background: #1d9bf0;
  border: none; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(29,155,240,.35);
}

/* ---------------- タイトル ---------------- */
#screen-title { justify-content: flex-end; position: relative; overflow: hidden; }

#title-visual {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% 36%, rgba(255,154,194,.25), transparent 70%),
    radial-gradient(100% 80% at 50% 100%, #3d1f4d, transparent),
    linear-gradient(180deg, #150c2e 0%, #33184d 55%, #0e0722 100%);
}
#title-visual::after {
  content: "💞";
  position: absolute; left: 50%; top: 20%;
  transform: translate(-50%, -50%);
  font-size: 86px;
  filter: drop-shadow(0 0 28px rgba(255,154,194,.65));
  animation: heartbeat 2.2s ease infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  12% { transform: translate(-50%, -50%) scale(1.12); }
  24% { transform: translate(-50%, -50%) scale(1); }
  36% { transform: translate(-50%, -50%) scale(1.08); }
  48% { transform: translate(-50%, -50%) scale(1); }
}
#title-visual.has-img::after { content: none; }
#title-visual::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(18,11,40,.68) 62%, rgba(18,11,40,.97) 82%);
  z-index: 1;
}

.title-content { position: relative; z-index: 2; text-align: center; padding: 0 24px 44px; }

.title-sub {
  color: var(--sakura);
  letter-spacing: .45em;
  font-size: 12px;
  margin-bottom: 10px;
}
.title-logo {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: .1em;
  background: linear-gradient(180deg, #ffe6f0 15%, var(--sakura) 50%, #c04a78 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 30px rgba(255,154,194,.35);
  margin-bottom: 8px;
}
.title-desc { color: var(--text-dim); font-size: 13px; line-height: 1.9; margin-bottom: 26px; text-shadow: 0 1px 8px rgba(8,4,20,.9); }
.title-desc small { font-size: 11px; opacity: .8; }

/* 桜の花びら */
.petal {
  position: absolute; top: -4%;
  width: 10px; height: 7px;
  background: radial-gradient(circle at 30% 30%, #ffd4e4, var(--sakura));
  border-radius: 60% 40% 55% 45%;
  box-shadow: 0 0 8px rgba(255,154,194,.5);
  animation: petalFall 7.5s linear infinite;
  opacity: 0;
  z-index: 1;
}
@keyframes petalFall {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  6%   { opacity: .95; }
  55%  { transform: translateY(46dvh) translateX(-26px) rotate(200deg); opacity: .8; }
  100% { transform: translateY(96dvh) translateX(18px) rotate(420deg); opacity: 0; }
}

/* ---------------- 招待の受信 ---------------- */
#screen-receive { justify-content: center; }
.receive-wrap { padding: 32px 26px; text-align: center; }
.receive-letter {
  font-size: 72px;
  filter: drop-shadow(0 0 24px rgba(255,154,194,.7));
  animation: floaty 3s ease-in-out infinite;
  margin-bottom: 18px;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.receive-title { font-size: 21px; line-height: 1.7; letter-spacing: .05em; margin-bottom: 16px; }
#receive-from { color: var(--gold-bright); font-weight: 700; }
.receive-desc { color: var(--text-dim); font-size: 13.5px; line-height: 2; margin-bottom: 26px; }
.receive-desc strong { color: var(--sakura); }
.receive-note { color: var(--text-dim); font-size: 11px; margin-top: 12px; letter-spacing: .1em; }

/* ---------------- 名前入力 ---------------- */
#screen-name { justify-content: center; }
.name-wrap { padding: 32px 26px; }
#name-heading { text-align: center; font-size: 22px; letter-spacing: .15em; color: var(--sakura); margin-bottom: 10px; }
#name-desc { text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.9; margin-bottom: 26px; }
.name-row { display: block; margin-bottom: 16px; }
.name-row span { display: block; font-size: 12px; color: var(--gold); letter-spacing: .15em; margin-bottom: 6px; }
.name-row input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: var(--serif);
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,154,194,.45);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.name-row input:focus {
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px rgba(255,154,194,.18);
}
.name-row input::placeholder { color: rgba(185,169,201,.55); }
#btn-name-start { margin-top: 10px; }

/* ---------------- ゲーム画面 ---------------- */
#screen-game { position: relative; }

.hud {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(18,11,40,.75);
  border-bottom: 1px solid rgba(255,154,194,.25);
  backdrop-filter: blur(4px);
  position: relative; z-index: 5;
}
#hud-chapter { font-size: 12px; color: var(--sakura); letter-spacing: .1em; white-space: nowrap; }

#hud-progress { flex: 1; display: flex; gap: 4px; justify-content: center; }
#hud-progress i {
  width: 12px; height: 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,154,194,.4);
  clip-path: path("M6 11 L1.2 6.2 A3.2 3.2 0 0 1 6 2.2 A3.2 3.2 0 0 1 10.8 6.2 Z");
  transition: background .3s ease, box-shadow .3s ease;
}
#hud-progress i.on {
  background: linear-gradient(180deg, #ffd4e4, var(--sakura-deep));
  box-shadow: 0 0 6px rgba(255,93,143,.8);
}

#hud-reso {
  font-size: 13px; color: var(--sakura); white-space: nowrap;
  filter: drop-shadow(0 0 6px rgba(255,154,194,.8));
}

#hud-mode {
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: #2a1a04;
  padding: 5px 8px;
  background: linear-gradient(90deg, transparent, rgba(255,215,106,.9) 18%, rgba(255,215,106,.9) 82%, transparent);
  position: relative; z-index: 5;
}

/* 舞台 */
.stage {
  position: relative;
  height: 36dvh; min-height: 210px;
  overflow: hidden;
}
#stage-bg { position: absolute; inset: 0; transition: background .4s ease; }
#stage-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,11,40,.25), transparent 30%, transparent 60%, rgba(18,11,40,.85));
}

.stage-actor {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: opacity .5s ease, transform .5s ease;
  z-index: 2;
}
.stage-actor.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.stage-actor img { height: 23dvh; max-height: 210px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.actor-ph {
  font-size: 80px;
  filter: drop-shadow(0 0 22px rgba(255,154,194,.8));
  animation: floaty 3s ease-in-out infinite;
  padding-bottom: 8px;
}

/* 共鳴バースト */
#reso-burst { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.reso-heart {
  position: absolute; bottom: 6%;
  animation: resoUp 2.1s ease-out forwards;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255,154,194,.9));
}
@keyframes resoUp {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(-30dvh) scale(1.25); opacity: 0; }
}

/* 章オーバーレイ */
#chapter-overlay {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(10,6,24,.78);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
#chapter-overlay.show { opacity: 1; }
#chapter-no { color: var(--gold); font-size: 13px; letter-spacing: .5em; }
#chapter-name {
  font-size: 34px; letter-spacing: .3em; font-weight: 700;
  background: linear-gradient(180deg, #ffe6f0 20%, var(--sakura) 60%, #c04a78 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-left: .3em;
}
#chapter-sub { color: var(--text-dim); font-size: 12px; letter-spacing: .3em; }

/* テキストボックス */
.textarea-wrap { flex: 1; display: flex; flex-direction: column; padding: 14px; gap: 12px; }

#textbox {
  position: relative;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid rgba(255,154,194,.5);
  border-radius: var(--radius);
  padding: 18px 18px 26px;
  min-height: 120px;
  box-shadow: 0 8px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  cursor: pointer;
}
#textbox::before {
  content: "";
  position: absolute; inset: 4px;
  border: 1px solid rgba(255,154,194,.18);
  border-radius: 10px; pointer-events: none;
}
#textbox-text { font-size: 15px; line-height: 2; letter-spacing: .03em; white-space: pre-line; }

#textbox-next {
  position: absolute; right: 16px; bottom: 8px;
  color: var(--sakura); font-size: 14px;
  opacity: 0;
}
#textbox-next.show { opacity: 1; animation: bounce 1s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* 選択肢 */
#choices { display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; padding-bottom: 20px; }
#choices.show { opacity: 1; transform: translateY(0); }

.choice-btn {
  text-align: left;
  padding: 13px 16px;
  font-size: 14px; line-height: 1.6;
  color: var(--text);
  background: rgba(177,140,255,.1);
  border: 1px solid rgba(177,140,255,.5);
  border-radius: 12px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.choice-btn::before { content: "💞 "; font-size: 11px; }
.choice-btn:hover { background: rgba(177,140,255,.22); border-color: var(--sakura); }
.choice-btn:active { transform: scale(.98); }

/* ---------------- 招待画面 ---------------- */
#screen-invite { align-items: center; padding: 40px 20px 60px; overflow-y: auto; justify-content: flex-start; }
.invite-wrap { width: 100%; text-align: center; }
.invite-letter {
  font-size: 64px;
  filter: drop-shadow(0 0 24px rgba(255,154,194,.75));
  animation: floaty 3s ease-in-out infinite;
}
.invite-title { font-size: 20px; letter-spacing: .2em; color: var(--sakura); margin: 12px 0 14px; }
#invite-msg { color: var(--text-dim); font-size: 13.5px; line-height: 2.1; margin-bottom: 20px; }
#invite-msg strong { color: var(--gold-bright); }

.invite-block {
  background: rgba(34,19,56,.85);
  border: 1px solid rgba(255,154,194,.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}
.invite-block h3 {
  font-size: 12px; color: var(--gold);
  letter-spacing: .25em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.invite-block h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217,180,91,.5), transparent); }

.invite-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.invite-note { color: var(--text-dim); font-size: 11px; line-height: 1.9; letter-spacing: .04em; }

/* ---------------- 結果画面 ---------------- */
#screen-result { align-items: center; padding: 28px 18px 60px; overflow-y: auto; justify-content: flex-start; }

.result-heading { color: var(--sakura); letter-spacing: .35em; font-size: 13px; margin-bottom: 4px; }
.result-heading-sub { color: var(--text-dim); font-size: 11px; letter-spacing: .2em; margin-bottom: 16px; }

#result-names { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#result-names .rn { font-size: 19px; letter-spacing: .05em; color: var(--text); }
#result-names .rx { color: var(--sakura); font-size: 15px; }

#solo-badge {
  font-size: 11px; color: #2a1a04;
  background: linear-gradient(180deg, #ffe9ac, var(--gold-bright));
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 8px;
  letter-spacing: .05em;
}

/* スコアサークル */
#score-wrap { text-align: center; margin: 10px 0 6px; }
#score-circle {
  width: 148px; height: 148px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: baseline; justify-content: center;
  padding-top: 44px;
  background:
    radial-gradient(closest-side, rgba(18,11,40,.92) 78%, transparent 79%),
    conic-gradient(from 220deg, var(--sakura-deep), var(--gold-bright), var(--accent), var(--sakura-deep));
  box-shadow: 0 0 34px rgba(255,93,143,.35);
}
#score-num {
  font-size: 52px; font-weight: 700; line-height: 1;
  background: linear-gradient(180deg, #fff 30%, var(--sakura));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#score-pct { font-size: 20px; color: var(--sakura); margin-left: 2px; }
#score-rank {
  margin-top: 10px;
  font-size: 19px; letter-spacing: .3em; color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(255,215,106,.6);
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.9,.3,1.4);
}
#score-rank.show { opacity: 1; transform: translateY(0) scale(1); }
#score-note { margin-top: 6px; color: var(--text-dim); font-size: 12px; line-height: 1.8; min-height: 1.8em; }

/* カード（3D反転） */
#card-scene-wrap {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
  text-align: center;
  margin-top: 12px;
}
#card-scene-wrap.show { opacity: 1; transform: translateY(0); }

.card-scene { perspective: 1200px; margin-bottom: 8px; }
#result-card {
  --glow: rgba(255,154,194,.5);
  width: min(64vw, 250px);
  aspect-ratio: 2 / 3;
  position: relative;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
  cursor: pointer;
  /* 注意: ここに filter を付けると preserve-3d が平面化されて反転が壊れる */
}
#result-card.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 2px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 34px var(--glow), inset 0 0 0 1px rgba(255,255,255,.15);
}
.card-face.back {
  background:
    radial-gradient(45% 32% at 50% 50%, rgba(255,154,194,.3), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 50%, #2a1440 0deg 15deg, #3d1f4d 15deg 30deg);
}
#card-back-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  background-position: center;
  background-size: cover;
}
.card-face.front { transform: rotateY(180deg); background: var(--panel); display: flex; flex-direction: column; }

#card-art {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 84px;
  background: linear-gradient(160deg, #3a1a3d, #6b2a55 55%, #1a1136);
}
.card-plate {
  padding: 10px 8px 12px;
  text-align: center;
  background: linear-gradient(180deg, rgba(18,11,40,.55), rgba(18,11,40,.92));
  border-top: 1px solid rgba(217,180,91,.55);
}
#card-rarity { font-size: 11px; letter-spacing: .3em; font-weight: 700; }
#card-stars { color: var(--gold-bright); font-size: 12px; letter-spacing: .2em; text-shadow: 0 0 8px rgba(255,215,106,.8); }
#card-name { font-size: 16px; letter-spacing: .08em; margin-top: 2px; }

#tap-hint { color: var(--sakura); font-size: 13px; letter-spacing: .2em; margin: 12px 0 4px; animation: bounce 1.2s ease infinite; }

/* 結果詳細 */
#result-detail { width: 100%; opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
#result-detail.show { opacity: 1; transform: translateY(0); }

.result-title-row { text-align: center; margin: 18px 0 4px; }
#result-rarity-badge {
  display: inline-block;
  color: #1c1430; font-size: 11px; font-weight: 700; letter-spacing: .2em;
  padding: 3px 14px; border-radius: 999px;
  margin-bottom: 8px;
}
#result-name { font-size: 25px; letter-spacing: .06em; }
#result-catch { text-align: center; color: var(--gold-bright); font-size: 13px; margin: 6px 0 18px; letter-spacing: .05em; }

.result-block {
  background: rgba(34,19,56,.85);
  border: 1px solid rgba(255,154,194,.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  width: 100%;
}
.result-block h3 {
  font-size: 12px; color: var(--gold);
  letter-spacing: .25em; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.result-block h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217,180,91,.5), transparent); }
.result-block p { font-size: 14px; line-height: 2; color: var(--text); }

.result-block.friction { border-color: rgba(255,93,115,.5); }
.result-block.friction h3 { color: #ff8296; }
.result-block.friction h3::after { background: linear-gradient(90deg, rgba(255,93,115,.5), transparent); }

/* 相性メーター */
.meter { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.meter:last-child { margin-bottom: 0; }
.meter-label { font-size: 12px; color: var(--text-dim); width: 6.4em; letter-spacing: .05em; white-space: nowrap; }
.meter-bar {
  flex: 1; height: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,154,194,.25);
  border-radius: 999px;
  overflow: hidden;
}
.meter-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--c, var(--sakura)), var(--gold-bright));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 8px var(--c, var(--sakura));
}
.meter-val { font-size: 12px; color: var(--gold-bright); width: 3.2em; text-align: right; white-space: nowrap; }

/* ふたりの属性チャート */
.pc-legend { display: flex; gap: 16px; font-size: 11.5px; margin-bottom: 10px; }
.pc-legend .pc-a { color: var(--sakura); }
.pc-legend .pc-b { color: #7ec8ff; }
.pc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pc-row:last-child { margin-bottom: 0; }
.pc-label { font-size: 12px; color: var(--text-dim); width: 3.6em; letter-spacing: .05em; }
.pc-label small { display: block; font-size: 9px; opacity: .7; }
.pc-bars { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pc-bar {
  height: 7px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}
.pc-bar div { height: 100%; border-radius: 999px; transition: width 1s ease; }
.pc-bar.a div { background: linear-gradient(90deg, var(--sakura-deep), var(--sakura)); box-shadow: 0 0 6px rgba(255,154,194,.7); }
.pc-bar.b div { background: linear-gradient(90deg, #3f8fd8, #7ec8ff); box-shadow: 0 0 6px rgba(126,200,255,.7); }

/* 共鳴リスト */
#reso-list { list-style: none; }
#reso-list li { font-size: 13.5px; line-height: 2; letter-spacing: .03em; }
#reso-none { font-size: 13px; color: var(--text-dim); line-height: 1.9; }

/* ミニチャート（招待画面） */
.chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.chart-row:last-child { margin-bottom: 0; }
.chart-label { font-size: 12px; color: var(--text-dim); width: 3.6em; letter-spacing: .05em; }
.chart-label small { display: block; font-size: 9px; opacity: .7; }
.chart-bar {
  flex: 1; height: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,154,194,.25);
  border-radius: 999px;
  overflow: hidden;
}
.chart-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--c, var(--sakura)), var(--gold-bright));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 8px var(--c, var(--sakura));
}
.chart-val { font-size: 12px; color: var(--gold-bright); width: 1.6em; text-align: right; }

/* 結果ボタン群 */
.result-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.btn-cta {
  padding: 16px; font-size: 15px; line-height: 1.5; letter-spacing: .05em;
  color: #3d0a20;
  background: linear-gradient(180deg, #ffd4e4, var(--sakura) 45%, var(--sakura-deep));
  border: 1px solid #ffe3ee; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(255,93,143,.4);
  animation: ctaPulse 2.4s ease infinite;
}
@keyframes ctaPulse { 0%,100% { box-shadow: 0 6px 24px rgba(255,93,143,.4); } 50% { box-shadow: 0 6px 34px rgba(255,154,194,.8); } }
.btn-cta small { display: block; font-size: 11px; opacity: .8; }

/* SSR演出 */
#sparkle-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.sparkle {
  position: absolute; top: -5%;
  color: var(--gold-bright);
  animation: fall 3.2s linear forwards;
  text-shadow: 0 0 10px rgba(255,215,106,.9);
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(300deg); opacity: .6; }
}
body.ssr-mode #screen-result { background: radial-gradient(80% 40% at 50% 0%, rgba(255,215,106,.12), transparent 70%); }

/* ---------------- 図鑑 ---------------- */
#screen-dex { padding: 28px 18px 50px; }
.dex-title { text-align: center; color: var(--sakura); letter-spacing: .25em; font-size: 15px; margin-bottom: 4px; }
#dex-count { text-align: center; color: var(--text-dim); font-size: 12px; margin-bottom: 18px; }
#dex-comp {
  text-align: center; color: var(--gold-bright); font-size: 13px; line-height: 1.9;
  border: 1px solid rgba(255,215,106,.5); border-radius: var(--radius);
  padding: 12px; margin-bottom: 16px;
  background: rgba(255,215,106,.07);
}

#dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.dex-cell {
  aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(34,19,56,.85);
  border: 1px solid rgba(177,140,255,.3);
  border-radius: 12px;
  padding: 6px;
  opacity: .45;
}
.dex-cell.owned { opacity: 1; border-color: rgba(255,154,194,.55); box-shadow: 0 0 14px rgba(255,154,194,.15); }
.dex-art {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  border-radius: 8px;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}
.dex-name { font-size: 10.5px; text-align: center; line-height: 1.4; }
.dex-rar { font-size: 9px; letter-spacing: .2em; color: var(--text-dim); }

/* ---------------- トースト ---------------- */
#toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  max-width: 88vw;
  padding: 11px 22px;
  font-size: 13px; letter-spacing: .04em;
  color: var(--text);
  background: rgba(34,19,56,.96);
  border: 1px solid rgba(255,154,194,.5);
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- サウンドトグル ---------------- */
#btn-mute {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 100;
  width: 42px; height: 42px;
  font-size: 18px;
  background: rgba(34,19,56,.8);
  border: 1px solid rgba(255,154,194,.45);
  border-radius: 50%;
  backdrop-filter: blur(4px);
}
@media (min-width: 600px) {
  #btn-mute { right: calc(50% - 240px + 12px); }
}

/* PC調整 */
@media (min-width: 600px) {
  #app { border-left: 1px solid rgba(255,154,194,.15); border-right: 1px solid rgba(255,154,194,.15); }
  .stage { height: 40dvh; }
}
