/* F-ANDY デモプレイヤー（HTMLで描く「動画」）共通スタイル */
:root {
  --ink: #1d2433; --sub: #5b6475; --faint: #8a93a3; --line: #e3e7ee; --panel: #f6f8fb;
  --brand: #3a2a6e; --brand2: #6b55c4; --ok: #1f8a5b; --warn: #c27a00; --ng: #c23b3b; --hi: #fff4c2;
  --page: #111111; --cap: #ffffff; --capsub: #b0b0b0; --accent: #d6c9f5; --cink: #c9b8f0; --ctl: #555; --seg: #3a3a3a; --disc: #8c8c8c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--cap); font-family: "Noto Sans JP", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.player { width: 100%; }
.viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0b0b; border: 1px solid #3a3a3a; }
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; background: #fff; color: var(--ink); font-size: 18px; overflow: hidden; }

/* アプリの枠 */
.appbar { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--brand); color: #fff; }
.appbar .logo { font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.appbar .logo small { font-weight: 400; font-size: 16px; opacity: .85; margin-left: 10px; }
.appbar .sp { flex: 1; }
.appbar .who { font-size: 16px; opacity: .9; }
.appbar .tag { font-size: 14px; border: 1px solid rgba(255,255,255,.5); padding: 2px 10px; border-radius: 999px; }
.body { position: absolute; top: 64px; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 220px 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 0; }
.side p { margin: 0; padding: 12px 24px; font-size: 17px; color: var(--sub); }
.side p.act { color: var(--brand); font-weight: 700; background: #ebe7f8; border-left: 4px solid var(--brand2); padding-left: 20px; }
.main { position: relative; padding: 26px 32px; }
.main h3 { margin: 0 0 4px; font-size: 26px; }
.main .meta { margin: 0 0 18px; color: var(--sub); font-size: 16px; }

/* シーン */
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s ease; }
.scene.cur { opacity: 1; visibility: visible; }
[data-at] { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
[data-at].on { opacity: 1; transform: none; }
[data-at].pop { transform: scale(.94); }
[data-at].pop.on { transform: none; }

/* 部品 */
.card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 16px 18px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi .l { font-size: 15px; color: var(--sub); margin: 0; }
.kpi .v { font-size: 34px; font-weight: 700; margin: 2px 0 0; }
.kpi .v small { font-size: 16px; font-weight: 400; color: var(--sub); margin-left: 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 16px; }
.t th { text-align: left; font-weight: 500; color: var(--sub); font-size: 15px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr.sel td { background: var(--hi); }
.pill { display: inline-block; font-size: 14px; padding: 2px 10px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.pill.ng { background: #fde8e8; color: var(--ng); }
.pill.warn { background: #fff1d6; color: var(--warn); }
.pill.ok { background: #e2f4ea; color: var(--ok); }
.pill.info { background: #ebe7f8; color: var(--brand); }
.bar { height: 14px; background: #edf0f5; border-radius: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand2); border-radius: 7px; transition: width 1.4s ease; }
.on .bar i, .bar.on i { width: var(--w); }
.btn { display: inline-block; padding: 10px 22px; border-radius: 8px; background: var(--brand2); color: #fff; font-weight: 500; font-size: 17px; transition: transform .15s ease, background .3s ease; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand2); }
.btn.clicked { background: var(--ok); }
.note { position: absolute; right: 18px; bottom: 12px; font-size: 14px; color: var(--faint); }
.badge-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(29,36,51,.92); color: #fff; border-radius: 16px; padding: 30px 44px; text-align: center; width: 760px; }
.badge-big[data-at] { transform: translate(-50%, -46%); }
.badge-big[data-at].on { transform: translate(-50%, -50%); }
.badge-big b { display: block; font-size: 30px; margin-bottom: 8px; }
.badge-big span { font-size: 19px; color: #d7dbe4; }

/* 終わりの画面 */
.endcard { position: fixed; inset: 0; z-index: 60; background: linear-gradient(135deg, #2c2058, #3a2a6e 55%, #4b3a8c); color: #fff; display: grid; place-items: center; text-align: center; }
.endcard .eb { font-size: 18px; letter-spacing: .2em; color: var(--accent); margin: 0 0 14px; }
.endcard h2 { font-size: 46px; margin: 0 0 18px; font-weight: 700; line-height: 1.35; }
.endcard p { font-size: 22px; margin: 0; color: #e6e2f5; line-height: 1.7; }

/* カーソル */
.cursor { position: absolute; left: 0; top: 0; width: 30px; height: 30px; pointer-events: none; z-index: 50; display: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.cursor.show { display: block; }
.cursor::after { content: ""; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand2); opacity: 0; }
.cursor.tap::after { animation: tap .5s ease-out; }
@keyframes tap { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }

/* 字幕・操作（ステージの外＝縮小されない） */
.capbox { padding: 14px 4px 6px; min-height: 92px; }
.capbox .step { font-family: Montserrat, sans-serif; font-size: 14px; letter-spacing: .14em; color: var(--cink); margin: 0 0 4px; }
.capbox .txt { font-size: 18px; line-height: 1.6; margin: 0; color: var(--cap); }
.ctrl { display: flex; align-items: center; gap: 14px; padding: 6px 4px 4px; }
.ctrl button { background: transparent; border: 1px solid var(--ctl); color: var(--cap); width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 16px; }
.ctrl button:hover, .ctrl button:focus-visible { border-color: var(--cink); color: var(--cink); outline: none; }
.track { position: relative; flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 4px; }
.track .seg { flex: 1; height: 6px; background: var(--seg); cursor: pointer; position: relative; border: 0; padding: 0; }
.track .seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--cink); }
.track .seg:focus-visible { outline: 1px solid var(--cink); outline-offset: 4px; }
.time { font-family: Montserrat, sans-serif; font-size: 14px; color: var(--capsub); min-width: 86px; text-align: right; }
.disclaimer { font-size: 13px; color: var(--disc); margin: 6px 4px 0; }
/* 白地の節に置くとき（LP から ?theme=light） */
html[data-theme="light"] { --page: transparent; --cap: #111111; --capsub: #555555; --cink: #5a3e98; --ctl: #b5b5b5; --seg: #dedede; --disc: #666666; }
html[data-theme="light"] .viewport { background: #f2f2f2; border-color: #cfcfcf; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
@media (max-width: 560px) {
  .capbox { min-height: 112px; }
  .capbox .txt { font-size: 16px; }
  .time { display: none; }
  .ctrl { gap: 8px; }
  .ctrl button { width: 38px; height: 38px; font-size: 13px; }
  .track .seg { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scene, [data-at], .bar i { transition: none; }
}
