/* =====================================================
   VFPrep Char Picker - Stylesheet v14 (lite-effects)
   - ボタン中央揃え（プレイ／結果）
   - Top1強調＆コンフェティ据え置き
   - 動画クロスフェードの軽量化（blur/saturate/brightness削除）
   - GPUヒント・省モード（prefers-reduced-motion / lite）対応
   - Review Overlayを最前面＆中央揃えフッター
   ===================================================== */

:root{
  --cp-bg: #ffffff;
  --cp-text: #0f172a;
  --cp-accent: #32bae7;          /* brand */
  --cp-surface: #f8fafc;
  --cp-border: #dde3e9;
  --cp-subtle: #64748b;
  --cp-yes: #32bae7;             /* YESボタン */
  --cp-no-bg: #f7c6cf;           /* NOボタン */
  --cp-no-fg: #412126;
}

/* ===== Root / Container ===== */
#char-picker-root[data-cp]{
  color: var(--cp-text);
  background: var(--cp-bg);
  min-height: 100svh;
  position: relative;
  z-index: 2147483000;
  pointer-events: auto;
}
#char-picker-root .cp-container{ max-width: 560px; margin: 0 auto; padding: 16px 12px 24px; position: relative; z-index: 100; pointer-events: auto; }
.cp-temp-hide{ display: none !important; }

/* ===== Header / Progress ===== */
.main-catch-title{ font-weight: 900; font-size: 24px; line-height: 1.2; margin: 6px 4px 10px; text-align: center; }
.main-catch-title .prep{ color: var(--cp-accent); }
.cp-header{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin:4px 0 12px; }
.cp-progress{ flex:1; height:8px; background: var(--cp-border); border-radius:8px; overflow:hidden; margin:0 8px; }
.cp-progress>i{ display:block; height:100%; width:0%; background: var(--cp-accent); }

/* ===== Buttons ===== */
.cp-btn{ border:1px solid var(--cp-border); border-radius:12px; padding:12px 14px; background:#fff; color:var(--cp-text); font-weight:700; cursor:pointer; user-select:none; }
.cp-btn:active{ transform: translateY(1px); }
.cp-btn.primary{ background: var(--cp-accent); color:#fff; border-color: var(--cp-accent); }
.cp-btn.cp-yes{ background: var(--cp-yes); color:#fff; border-color: var(--cp-yes); }
.cp-btn.cp-no{ background: var(--cp-no-bg); color: var(--cp-no-fg); border-color: var(--cp-no-bg); }

/* 中央揃え（プレイ画面のNO/YES） */
.cp-actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:12px; position:relative; z-index:120; pointer-events:auto; }
.cp-actions .cp-btn{ flex:0 0 auto; min-width:120px; pointer-events:auto; }

/* ===== Question Card ===== */
.cp-card{ position:relative; background: var(--cp-surface); border:1px solid var(--cp-border); border-radius:16px; padding:16px; box-shadow:0 2px 8px rgba(2,6,23,.06); min-height:220px; z-index:110; }
.cp-title{ font-size:18px; font-weight:800; margin-bottom:6px; }
.cp-desc{ font-size:14px; color:var(--cp-subtle); margin-bottom:12px; }
.cp-illus{ height:96px; background: var(--cp-surface); border-radius:8px; }
.cp-pin{ display:flex; align-items:center; justify-content:center; gap:8px; font-size:14px; margin-top:8px; }
.cp-pin input{ width:18px; height:18px; }
.cp-tiny{ font-size:12px; color:var(--cp-subtle); }

/* ===== Result Cards ===== */
.cp-result-card{ position:relative; background: var(--cp-surface); border:1px solid var(--cp-border); border-radius:16px; padding:12px; display:grid; grid-template-columns:72px 1fr; gap:12px; align-items:center; margin-top:8px; overflow:hidden; }
.cp-result-card img{ width:72px; height:72px; border-radius:12px; object-fit:cover; background:#eee; }
.cp-result-card .name{ font-weight:800; margin-bottom:2px; }
.cp-result-card .desc{ color:var(--cp-subtle); font-size:12px; display:block; }
.cp-result-card.top1{ border-color: var(--cp-accent); box-shadow:0 6px 16px rgba(50,186,231,.15); }
.cp-result-card.top1 img{ width:88px; height:88px; }
.cp-result-card.top1 .name{ font-size:18px; }

/* Top1 コンフェティ */
.cp-confetti{ position:absolute; top:-12px; left:0; right:0; height:0; pointer-events:none; }
.cp-confetti i{ position:absolute; width:8px; height:12px; opacity:0; animation:cp-fall 1400ms ease-in forwards; transform:translateY(-20px) rotate(0deg); border-radius:2px; }
@keyframes cp-fall{ 0%{opacity:0;} 10%{opacity:1;} 100%{opacity:0; transform:translateY(120px) rotate(540deg);} }

/* ===== Sections / Tags ===== */
.cp-section{ background: var(--cp-surface); border:1px solid var(--cp-border); border-radius:16px; padding:12px; margin-top:10px; }
.cp-sec-title{ font-weight:900; font-size:16px; display:flex; align-items:center; gap:8px; border-bottom:1px dashed var(--cp-border); padding-bottom:6px; margin-bottom:8px; justify-content:space-between; }
.cp-sec-title .small{ font-size:12px; color:var(--cp-subtle); font-weight:600; }
.cp-bullets{ display:grid; gap:10px; }
.cp-bullets .item{ display:flex; align-items:flex-start; gap:8px; font-size:14px; }
.cp-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.cp-tag{ display:inline-block; padding:4px 8px; border-radius:999px; border:1px solid var(--cp-border); background:#fff; font-size:12px; color:var(--cp-subtle); }

/* ===== Spotlight (Top1 videos) – LITE EFFECTS ===== */
.cp-spotlight{ position:relative; width:100%; aspect-ratio:16/9; border-radius:12px; overflow:hidden; background:#000; margin-top:8px; }
/* Vignette （軽量） */
.cp-spotlight::after{ content:""; position:absolute; inset:0; pointer-events:none; background:radial-gradient(120% 80% at 50% 50%, rgba(0,0,0,0) 55%, rgba(0,0,0,.30) 100%); }
/* Fade + 軽量Ken Burns（opacityのみtransition） */
.cp-spotlight video{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block;
  opacity:0; transform:translateZ(0) scale(1.02);
  transition:opacity 480ms ease; will-change:opacity,transform;
}
.cp-spotlight video.active{ opacity:1; animation:cp-ken 6000ms ease-in-out forwards; }
@keyframes cp-ken{ from{ transform:translateZ(0) scale(1.04); } to{ transform:translateZ(0) scale(1.0); } }
/* Light Sweep overlay（軽量・省モードでは非表示） */
.cp-spotlight .cp-sweep{ position:absolute; inset:0; pointer-events:none; z-index:2;
  background:linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.22) 20%, rgba(255,255,255,0) 40%);
  filter:blur(6px); transform:translateX(-120%); opacity:0; }
.cp-spotlight .cp-sweep.run{ animation:cp-sweep 800ms ease; }
@keyframes cp-sweep{ 0%{ transform:translateX(-120%); opacity:0; } 20%{ opacity:.7; } 100%{ transform:translateX(120%); opacity:0; } }
/* 省モード or 低スペック向け */
.cp-spotlight.lite video{ animation:none; }
.cp-spotlight.lite .cp-sweep{ display:none; }
@media (prefers-reduced-motion: reduce){
  .cp-spotlight video{ animation:none; }
  .cp-spotlight .cp-sweep{ display:none; }
}

/* ===== Sticky Footer ===== */
.cp-sticky-footer{ position:sticky; bottom:0; left:0; right:0; background: linear-gradient(to top, rgba(15,23,42,.08), rgba(15,23,42,0)), rgba(248,250,252,.92); padding:10px 6px calc(12px + env(safe-area-inset-bottom,0)); margin-top:12px; border-top:1px solid var(--cp-border); }
.cp-sticky-footer .row{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }

/* ===== Review Overlay (結果まとめ) ===== */
#review-overlay{ position:fixed; inset:0; display:none; z-index:2147483647 !important; pointer-events:auto; background: rgba(15,23,42,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity:0; transition: opacity .18s ease; }
#review-overlay.open{ display:block; opacity:1; }
#review-overlay .panel{ position:absolute; inset:0; margin:0; background:#f8fafc !important; color:#0f172a; border-radius:0; display:flex; flex-direction:column; transform: scale(.985); opacity:.01; transition: transform .22s cubic-bezier(.2,.6,.2,1), opacity .22s ease; }
#review-overlay.open .panel{ transform:scale(1); opacity:1; }
#review-overlay .header{ padding:12px 16px; display:flex; align-items:center; gap:12px; border-bottom:1px solid rgba(2,6,23,0.08); }
#review-overlay .header .title{ font-size:16px; font-weight:700; flex:1; }
#review-overlay .header .stars-counter{ font-size:12px; opacity:.85; }
#review-overlay .list{ flex:1; overflow:auto; padding:12px 12px 88px; display:flex; flex-direction:column; gap:10px; scrollbar-gutter: stable both-edges; }
#review-overlay .row{ display:grid; grid-template-columns:36px 1fr 128px; align-items:center; gap:8px; padding:10px 8px; border-bottom:1px solid rgba(2,6,23,0.06); }
#review-overlay .row .q-title{ font-size:14px; line-height:1.3; }
#review-overlay .star-btn{ width:28px; height:28px; border-radius:50%; border:1px solid rgba(2,6,23,0.22); display:grid; place-items:center; cursor:pointer; user-select:none; font-size:16px; }
#review-overlay .star-btn.active{ background:#ffd54d; color:#523c00; border-color:#ffd54d; }
#review-overlay .star-btn.disabled{ opacity:.35; pointer-events:none; }
#cp-review-overlay .star .ico{ color:#cbd5e1; }      /* 未設定＝グレー */
#cp-review-overlay .star.on .ico{ color:#f59e0b; }   /* 設定済み＝オレンジ */

#review-overlay .seg{ display:grid; grid-template-columns:1fr 1fr; border-radius:12px; border:1px solid rgba(2,6,23,0.18); overflow:hidden; }
#review-overlay .seg button{ font-size:13px; padding:10px 0; border:none; background:transparent; color:inherit; cursor:pointer; }
#review-overlay .seg button.active[data-kind="yes"]{ background: var(--cp-yes); color:#fff; border-color: var(--cp-yes); }
#review-overlay .seg button.active[data-kind="no"]{ background: var(--cp-no-bg); color: var(--cp-no-fg); border-color: var(--cp-no-bg); }
#review-overlay .footer{ position:sticky; bottom:0; display:flex; justify-content:center; align-items:center; width:100%; background: linear-gradient(to top, rgba(15,23,42,.08), rgba(15,23,42,0)), rgba(248,250,252,.92); padding:10px 0 calc(12px + env(safe-area-inset-bottom,0)); }
#review-overlay .footer .confirm{ margin:0 auto; }
#review-overlay .toast{ position:fixed; left:50%; bottom:64px; transform:translateX(-50%); background:rgba(20,20,20,.95); color:#fff; padding:10px 14px; border-radius:10px; font-size:12px; display:none; }

/* Binary-only: 不要要素を安全に隠す（存在すれば） */
.binary-only-hide{ display:none !important; }

/* 追加：Top1動画のミュートボタン（任意で使える） */
.cp-spot .mute{ position:absolute; top:8px; right:8px; z-index:6; background:none; border:none; padding:6px; color:#fff; font-size:20px; line-height:1; cursor:pointer; opacity:.92; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); }
.cp-spot .mute:hover{ opacity:1; }
.cp-spot .mute:focus-visible{ outline:2px solid #fff; outline-offset:2px; border-radius:6px; }

.cp-session-bars { margin: 8px 0 4px; display: grid; gap: 10px; }
.cp-session-bars__head { font-size: 12px; color: var(--muted,#888); margin: 8px 0 4px; }
.cp-session-bars__item { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 8px; }
.cp-session-bars__label { font-size: 12px; color: var(--fg,#444); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-session-bars__bars { position: relative; height: 22px; display: grid; grid-template-rows: 10px 10px; gap: 2px; background: transparent; }
.cp-session-bars__bar { height: 10px; border-radius: 6px; opacity: 0.95; }
.cp-session-bars__bar.is-top  { background: linear-gradient(90deg, #6ee7b7, #34d399); } /* 緑: Top理論比 */
.cp-session-bars__bar.is-self { background: linear-gradient(90deg, #93c5fd, #60a5fa); } /* 青: 自己理論比 */
.cp-session-bars__note { font-size: 12px; color: var(--muted,#777); white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .cp-session-bars__label { color:#ddd; }
  .cp-session-bars__note  { color:#aaa; }
}
