/* The draft-animatic page shared by Cutscenes 002-004 (shell.js).
   Child-first and touch-first: the film comes straight after the title and is
   sized so the playback row fits on a landscape tablet with 40 px clear of the
   bottom edge; the main controls are 64 px tall; the picture itself plays and
   pauses on a tap; the ending offers "Watch again" and a way back to the game.
   The review notes and the shot list sit below the controls. */
* { box-sizing: border-box; }
body { margin: 0; background: #172722; color: #fff7e9; font: 16px system-ui, sans-serif; }
main { max-width: 1240px; margin: auto; padding: 14px 18px 40px; }
header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
h1 { font-size: clamp(20px, 3vw, 30px); margin: 0; }
p { margin: 6px 0 14px; color: #c2d3c8; }
a { color: #ead1a8; }
.draft { color: #f3d9a0; font-size: 14px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Header 68 px + playback row 92 px + 40 px clear of the bottom edge. */
#stage { position: relative; aspect-ratio: 16 / 9; background: #283c35; border-radius: 16px; overflow: hidden; max-height: calc(100dvh - 200px); margin: auto; cursor: pointer; touch-action: manipulation; }
canvas { display: block; width: 100%; height: 100%; }
#subtitle { position: absolute; bottom: 5%; left: 8%; right: 8%; text-align: center; font-size: clamp(15px, 2.1vw, 27px); font-weight: 650; line-height: 1.35; pointer-events: none; }
#subtitle span { display: inline-block; padding: 8px 16px; border-radius: 10px; background: #14231ded; box-shadow: 0 2px 6px #0004; }
#loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: #283c35f5; padding: 24px; cursor: default; }
#loading[hidden] { display: none; }

button, a.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; border: 1px solid #668b78; background: #304c3f; border-radius: 10px; color: inherit; font: 600 15px system-ui; padding: 8px 16px; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .45; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #f5d67b; outline-offset: 3px; }

#controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
#controls button { min-height: 64px; min-width: 64px; font-size: 18px; padding: 10px 18px; border-radius: 14px; }
#play { background: #f0cc83; color: #273b31; min-width: 150px; }
#seek { flex: 1; min-width: 160px; min-height: 44px; accent-color: #f0cc83; }
#time { font-variant-numeric: tabular-nums; }
#shots { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
#shots button { white-space: nowrap; flex: 0 0 auto; }
#shots button[aria-current=true] { border-color: #f0cc83; background: #57755e; }
#shotLabel { font-weight: 650; margin-bottom: 8px; }
footer { font-size: 12px; color: #a4b9ac; margin-top: 10px; }

/* On the picture: a big play button while paused, and the end card. */
/* Ids, so hidden wins over #endCard's own display. */
#bigPlay[hidden], #endCard[hidden], #village-return[hidden] { display: none; }
#bigPlay { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 112px; height: 112px; border-radius: 50%; border: 4px solid #fff7e9; background: #f0cc83ee; color: #273b31; font-size: 46px; padding: 0 0 0 8px; box-shadow: 0 6px 18px #0006; }
#endCard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; background: #14231dcc; cursor: default; text-align: center; }
#endCard strong { font-size: clamp(18px, 2.6vw, 28px); max-width: 32ch; }
#endCard .choices { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
#endCard button, #endCard a.button { min-height: 72px; min-width: 180px; font-size: 22px; border-radius: 16px; padding: 12px 24px; }
#endCard #watchAgain { background: #f0cc83; color: #273b31; }

@media (max-width: 650px) {
  main { padding: 10px 10px 32px; }
  header { align-items: flex-start; }
  #stage { max-height: none; }
  #controls { gap: 8px; }
  #seek { order: 5; flex-basis: 100%; }
  p { font-size: 13px; }
  #controls button { padding: 8px 12px; }
  #bigPlay { width: 88px; height: 88px; font-size: 36px; }
}
/* Short landscape screens (phones): the film fills the screen under the title;
   the picture's own play button and end card are the controls in view. */
@media (max-height: 560px) and (min-width: 651px) {
  main { padding-top: 8px; }
  header { margin-bottom: 6px; }
  #stage { max-height: calc(100dvh - 72px); }
  #endCard button, #endCard a.button { min-height: 64px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
