/* player.css — 動画の外側（枠・字幕・操作バー・章・脚注）。
   舞台の中身は css/scenes.css が持つ。 */

:root {
  --ink: #0b1512;
  --ink-2: #111f1b;
  --ivory: #f6f1e7;
  --ivory-dim: #cfc8ba;
  --emerald: #17a277;
  --teal: #0e7d73;
  --gold: #c9a25c;
  --line: rgba(246, 241, 231, .16);
  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}

* { box-sizing: border-box; }

html { background: #070d0b; }

body {
  margin: 0;
  padding: 28px 20px 56px;
  font-family: var(--sans);
  color: var(--ivory);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(23, 162, 119, .18), transparent 60%),
    #070d0b;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
}

/* ── ヘッダー ───────────────────────────── */
.shell-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.shell-brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .06em;
}

.shell-brand span {
  margin-left: .5em;
  padding: 3px 9px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  vertical-align: 3px;
}

.shell-note {
  margin: 0;
  color: var(--ivory-dim);
  font-size: 13px;
}

/* ── 舞台 ───────────────────────────────── */
.stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), 0 0 0 1px var(--line);
  /* 高さは基準キャンバスの比率でそのまま決まる（比例拡縮） */
  aspect-ratio: 1280 / 720;
}

.stage[data-mode="tall"] { aspect-ratio: 420 / 747; }

.canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
}

.stage[data-mode="tall"] .canvas { width: 420px; height: 747px; }

.stage-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(246, 241, 231, .12);
  z-index: 5;
}

.stage-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--emerald));
}

.bigplay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  background: rgba(7, 13, 11, .52);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: opacity .25s;
}

.bigplay span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--emerald);
  color: #04120d;
  font-size: 22px;
  padding-left: 4px;
  box-shadow: 0 12px 30px -8px rgba(23, 162, 119, .8);
}

.shell.is-started .bigplay { opacity: 0; pointer-events: none; }

/* 再生前は冒頭シーンを完成したポスターとして見せる。再生時は通常の動きに戻る。 */
.shell:not(.is-started) .sc-hook.is-active [data-anim] {
  animation-delay: -10s !important;
}
.shell:not(.is-started) .bigplay { background: rgba(7, 13, 11, .22); }

/* 一度始めたあとの一時停止では、画を隠さないよう覆いを薄くする */
.shell.is-started.is-paused .bigplay {
  opacity: 1;
  pointer-events: auto;
  background: rgba(7, 13, 11, .16);
  font-size: 0;
}

.shell.is-started.is-paused .bigplay span { width: 54px; height: 54px; font-size: 19px; }

/* 再生が終わったら覆いを外す。CTAを押せなくなるため（もう一度は下のボタンから）。
   上の一時停止の指定より詳細度を上げてある。 */
.shell.is-ended .bigplay,
.shell.is-started.is-paused.is-ended .bigplay { opacity: 0; pointer-events: none; }

/* ── 字幕（舞台の外） ────────────────────── */
.caption {
  min-height: 2.9em;
  margin: 14px 0 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(246, 241, 231, .05);
  border: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: .01em;
}

/* ── 操作バー ───────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ctrl {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 241, 231, .06);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}

.ctrl:hover { background: rgba(246, 241, 231, .12); }

.ctrl-main {
  min-width: 118px;
  border-color: transparent;
  background: var(--emerald);
  color: #04120d;
  font-weight: 700;
}

.ctrl-main:hover { background: #1cb686; }

.seek {
  flex: 1 1 220px;
  min-width: 160px;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.seek::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(246, 241, 231, .18);
}

.seek::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ivory);
}

.seek::-moz-range-track { height: 5px; border-radius: 3px; background: rgba(246, 241, 231, .18); }
.seek::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--ivory); }
.seek:focus-visible { outline: 2px solid var(--emerald); outline-offset: 4px; }

.time {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--ivory-dim);
  font-variant-numeric: tabular-nums;
}

/* ── 章 ─────────────────────────────────── */
.chapters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chapters button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ivory-dim);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}

.chapters button:hover { color: var(--ivory); border-color: rgba(246, 241, 231, .34); }

.chapters button[aria-current="true"] {
  border-color: var(--emerald);
  background: rgba(23, 162, 119, .16);
  color: var(--ivory);
}

/* ── 脚注 ───────────────────────────────── */
.shell-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #9aa39d;
  font-size: 12px;
  line-height: 1.8;
}

.shell-foot p { margin: 0 0 4px; }
.shell-foot a { color: #7fd8b6; }
.shell-foot code { font-size: 11px; color: var(--ivory-dim); }

@media (max-width: 560px) {
  body { padding: 16px 12px 40px; }
  .caption { font-size: 15px; min-height: 3.4em; }
  .shell-note { font-size: 12px; }
  .ctrl-main { min-width: 96px; }
  .seek { flex-basis: 100%; order: 5; }
  .time { order: 4; }
}

/* LiteWord のファーストビューに入れるときは、動画・字幕・操作だけを残す。 */
html.embed-mode,
html.embed-mode body { overflow: hidden; }
html.embed-mode body { padding: 0; }
html.embed-mode .shell { max-width: none; }
html.embed-mode .shell-head,
html.embed-mode .chapters,
html.embed-mode .shell-foot { display: none; }
html.embed-mode .stage { border-radius: 12px 12px 0 0; box-shadow: none; }
html.embed-mode .caption {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  min-height: 3.2em;
}
html.embed-mode .controls {
  margin: 0;
  padding: 10px 12px 12px;
  background: #0b1512;
  border-radius: 0 0 12px 12px;
}
@media (max-width: 560px) {
  html.embed-mode body { padding: 0; }
  html.embed-mode .caption { font-size: 15px; }
}
