/* The website player's own UI (engine/embed.js): the start screen, the
   in-depth link, and the public player bar's tuning. All of it sits outside
   the 1920 x 1080 stage, sized in the frame's own CSS pixels, so it reads the
   same at any embed size. The ending's topic menu is part of the picture and
   lives with its scene (chapters/07-close). Brand values come from
   brand/tokens.css. */

.kd { font-family: var(--kp-font); }

/* Before the first play the player bar is hidden, so the start screen is
   just the opening frame and one button. */
body.kd-before .kr-hud { display: none; }

/* ---------- start ---------- */
/* The opening lockup fills the left 46% of the stage, so a centred button
   lands on the title. The button is centred in the empty right side instead
   (73% across). The page's frame is 16:9, so the stage fills it exactly and
   that holds at every embed size. */
.kd-start {
  position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding-left: 46%;
  background: radial-gradient(ellipse at 73% 50%, rgba(8, 8, 30, .28), rgba(8, 8, 30, .05) 60%); cursor: pointer;
}
.kd-start__btn {
  width: clamp(56px, 11vmin, 96px); height: clamp(56px, 11vmin, 96px); border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: #fff; color: var(--kp-blue-700);
  box-shadow: 0 10px 40px rgba(8, 8, 30, .35), 0 0 0 10px rgba(255, 255, 255, .16);
  transition: box-shadow .2s, background .2s;
}
.kd-start__btn:hover { box-shadow: 0 10px 40px rgba(8, 8, 30, .45), 0 0 0 14px rgba(255, 255, 255, .22); }
.kd-start__btn:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.kd-start__btn svg { width: 46%; height: 46%; fill: currentColor; margin-left: 6%; }
.kd-start__label { margin: 0; font-size: clamp(12px, 2.2vmin, 16px); font-weight: 700; color: #fff; letter-spacing: .04em; text-shadow: 0 1px 8px rgba(8, 8, 30, .5); }
.kd-start__len { font-weight: 400; opacity: .8; margin-left: 6px; }
/* A returning visitor's other choice: quiet, under the main one. */
.kd-start__over {
  margin: -4px 0 0; padding: 4px 6px; border: 0; background: none; cursor: pointer;
  font: 400 clamp(11px, 2vmin, 14px)/1.2 var(--kp-font); color: rgba(255, 255, 255, .78);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .4);
}
.kd-start__over:hover { color: #fff; text-decoration-color: #fff; }
.kd-start__over:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 3px; }

/* ---------- the in-depth link ----------
   Bottom left, above the player bar (which shows whenever the video is
   paused), so the two never overlap. Dark glass reads on light and dark
   scenes alike. It fades in and out rather than popping; while off it takes
   no clicks. A short frame (a phone) has no room for it: the page under the
   player carries the same link there. */
.kd-rel {
  position: fixed; left: 18px; bottom: 106px; z-index: 105; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 36px); box-sizing: border-box; padding: 10px 14px 10px 16px; border-radius: 999px;
  font: 700 14px/1.2 var(--kp-font); color: #fff; text-decoration: none;
  background: rgba(12, 12, 36, .74); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(8, 8, 30, .25);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .35s, transform .35s, background-color .15s, border-color .15s;
}
.kd-rel.is-on { opacity: 1; transform: none; pointer-events: auto; }
.kd-rel__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-rel svg { flex: none; width: 16px; height: 16px; fill: currentColor; transition: transform .2s; }
.kd-rel:hover { background: rgba(12, 12, 36, .9); border-color: rgba(255, 255, 255, .45); }
.kd-rel:hover svg { transform: translateX(3px); }
.kd-rel:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-height: 299px) { .kd-rel { display: none; } }

/* ---------- the public player bar ---------- */
.kr-hud--embed { padding: 22px 18px 10px; }
.kr-hud--embed .kr-hud__bar { gap: 10px; }
.kr-hud--embed button { padding: 7px 9px; }
.kr-hud--embed button svg { width: 18px; height: 18px; }
.kr-hud--embed .kr-hud__time { min-width: 0; margin: 0 4px; }
.kr-hud--embed .kr-hud__where b { color: rgba(255, 255, 255, .45); margin: 0 6px; }
.kr-hud--embed .kr-hud__fill { background: #6b69e6; }
@media (max-width: 560px) {
  .kr-hud--embed { padding: 16px 10px 6px; font-size: 12px; }
  .kr-hud--embed .kr-hud__where, .kr-hud--embed .kr-hud__ch span { display: none; }
  .kr-hud--embed .kr-hud__track { height: 22px; }
  .kr-hud--embed .kr-hud__chs { top: 8px; }
  .kr-hud--embed .kr-hud__fill { top: 8px; }
  .kr-hud--embed .kr-hud__head { top: 3px; }
}
