/* The orange plate and character art come from the game itself. */
.game-spread .spread-intro {
  position:relative;
  isolation:isolate;
  background:linear-gradient(125deg,#2d252c,#241e25 61%);
}
.game-spread .spread-intro h3 span { display:inline-block; white-space:nowrap; }
.game-spread .gd-takes {
  position:relative;
  display:flex;
  align-items:center;
  width:min(100%,230px);
  margin-top:clamp(22px,2.8vw,42px);
  border-bottom:1px solid #8d777459;
}
.gd-takes::after {
  content:""; position:absolute; bottom:-1px; left:0;
  width:24%; height:2px; background:#efc87b;
}
.gd-takes i, .gd-motion-strip .pose-steps i {
  display:block; aspect-ratio:1;
  background-image:url("assets/chapters/kick-keys.webp");
  background-size:400% 100%; background-position:var(--pose-x,0%) center;
}
.gd-takes i { width:25%; }
.gd-takes i:nth-child(2), .gd-motion-strip button:nth-child(2) i { --pose-x:33.3333%; }
.gd-takes i:nth-child(3), .gd-motion-strip button:nth-child(3) i { --pose-x:66.6667%; }
.gd-takes i:nth-child(4), .gd-motion-strip button:nth-child(4) i { --pose-x:100%; }
.game-spread .project-gallery { position:relative; }
.game-spread .project-plates { background:#282028; }
.game-spread .project-plates figure[data-sample="cover"] { isolation:isolate; }
.game-spread .spread-visual::after {
  content:""; pointer-events:none; position:absolute; inset:0;
  background:url("assets/chapters/spark-home-wide.webp") center / cover no-repeat;
  clip-path:polygon(0 0,12% 0,0 62%);
  filter:grayscale(1) contrast(.9); opacity:.84;
}
.gd-print-lines {
  position:absolute; inset:0; pointer-events:none; overflow:hidden;
  background:linear-gradient(114deg,transparent 4%,#e9cbbd55 calc(4% + 1px),transparent calc(4% + 2px));
}
.gd-print-lines::before {
  content:""; position:absolute; width:111%; height:56%; left:38%; top:57%;
  border:1px solid #f8d5a1a1; border-radius:50%; transform:rotate(-25deg);
}
.gd-print-lines::after {
  content:""; position:absolute; width:14%; height:2px;
  top:82%; right:0; background:linear-gradient(90deg,#ffdf86 0 13%,#e5b99a6b 13%);
}
.game-spread .gallery-choices { border-top:1px solid #8e727357; }
.game-spread .gallery-choices button[aria-pressed="true"] { text-decoration-color:#f5ce83; }
.game-spread .gallery-detail { background:radial-gradient(ellipse at center,#3f323a,#272029 76%); }
.game-spread .gallery-detail figcaption { letter-spacing:-.025em; }

/* Keep the existing game board and controls together; the objective opens the room. */
.gd-mission {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:clamp(12px,1.7vw,19px) clamp(13px,2vw,24px);
  border-bottom:1px solid #ded6cf;
}
.gd-mission .gd-goal { font-size:clamp(16px,1.7vw,20px); color:#332a30; letter-spacing:-.025em; }
.gd-level-menu { position:relative; flex:none; }
.gd-level-menu summary {
  display:flex; align-items:center; gap:10px; list-style:none;
  min-height:44px; padding:4px 11px; border:1px solid #d4c9c2;
  border-radius:9px; white-space:nowrap; color:#514149; background:#fffdfa;
}
.gd-level-menu summary::-webkit-details-marker { display:none; }
.gd-level-menu summary strong { font-size:15px; font-weight:600; }
.gd-level-menu summary::after {
  content:""; width:7px; height:7px; border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor; transform:translateY(-2px) rotate(45deg);
}
.gd-level-menu[open] summary::after { transform:translateY(2px) rotate(225deg); }
.gd-level-menu .gd-picker {
  position:absolute; top:calc(100% + 4px); right:0; z-index:3;
  grid-template-columns:1fr; min-width:154px; padding:5px; gap:1px;
  border-radius:10px; border:1px solid #cbbeba; background:#faf7f2;
  box-shadow:0 5px 18px #2d20263b;
}
.gd-story .gd-level-menu .gd-picker button { text-align:left; padding:8px 13px; }
.gd-story .gd-level-menu button[aria-pressed="true"] { background:#e8ded8; color:#452b39; box-shadow:none; }
.gd-story .gd-board-panel { justify-content:center; }
.gd-story .gd-board-pad { padding-top:4px; }
.gd-story .gd-board-head { margin:0; min-height:24px; }
.gd-help .gd-legend { justify-content:flex-start; color:#4d454b; padding:0 0 10px; }
.gd-help .gd-legend-seal { color:#885123; }
.gd-help .gd-legend-exit { color:#286247; }
.gd-help .gd-legend-bars { color:#5b5362; }
.gd-story .gd-control-set { justify-content:center; }
.gd-story .gd-session { justify-content:center; }
.gd-story .gd-feedback { text-align:center; }

/* A contact sheet of the four native poses; the active drawing stays in colour. */
.gd-motion-strip {
  display:block; color:#fbf1e6; background:#29242b; border-radius:18px;
}
.gd-motion-paper {
  padding:clamp(18px,3.4vw,44px) clamp(10px,2.8vw,35px) 8px;
  background:radial-gradient(ellipse at 72% 90%,#493840,#27242b 74%);
}
.gd-motion-strip .pose-steps {
  position:relative; isolation:isolate; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0;
  border-block:1px solid #74626b;
}
.gd-motion-strip .pose-steps::before {
  content:""; pointer-events:none; position:absolute; top:60%; left:0; right:0;
  border-top:1px solid #e3c5a256; transform:skewY(-4deg);
}
.gd-motion-strip .pose-steps button {
  position:relative; display:grid; grid-template-rows:1fr auto; align-items:end;
  min-width:0; padding:4px 3px 11px; border:0; border-radius:0;
  color:#dacfd1; background:transparent;
}
.gd-motion-strip .pose-steps button + button { border-left:1px solid #76646b57; }
.gd-motion-strip .pose-steps i {
  width:min(100%,200px); margin:auto;
  filter:grayscale(.96); opacity:.66;
}
.gd-motion-strip .pose-steps span { font-size:16px; font-weight:600; }
.gd-motion-strip .pose-steps button[aria-pressed="true"] { background:#ffffff09; color:#ffe7b5; }
.gd-motion-strip .pose-steps button[aria-pressed="true"] i { filter:none; opacity:1; }
.gd-motion-strip .pose-steps button[aria-pressed="true"]::after {
  content:""; position:absolute; bottom:-1px; left:18%; right:18%; height:3px; background:#f6d38b;
}
.gd-motion-play { display:flex; justify-content:flex-end; }
.gd-story .gd-motion-play .pose-play { color:#f4ded0; font-size:16px; margin:4px 0 0; padding-inline:8px; }
.gd-motion-strip :focus-visible { outline-color:#ffe3a4!important; }
@media(max-width:700px) {
  .game-spread .spread-intro {
    display:grid; grid-template-columns:auto minmax(0,1fr); gap:0 12px;
    padding-block:24px;
  }
  .game-spread .spread-intro :is(h3,.spread-lead) { grid-column:1/-1; }
  .game-spread .gd-takes { align-self:end; justify-self:end; width:min(100%,132px); margin:0; }
  .game-spread .spread-visual::after { background-image:url("assets/chapters/spark-home.webp"); }
  .gd-story .gd-motion-paper { padding-inline:10px; }
}
@media(max-width:430px) {
  .gd-story .gd-mission { padding:8px 10px; gap:8px; }
  .gd-level-menu summary { padding-inline:8px; gap:7px; }
  .gd-level-menu summary strong { font-size:14px; }
  .gd-story .gd-board-panel { padding-top:9px; }
  .gd-story .gd-board-pad { padding-block:1px 7px; }
  .gd-story .gd-control-panel { padding:10px 7px 6px; gap:6px; }
  .gd-story .gd-feedback:has(.gd-sr) { min-height:0; }
  .gd-motion-strip .pose-steps span { font-size:15px; }
}
@media(prefers-reduced-motion:no-preference) {
  .gd-motion-strip .pose-steps i { transition:opacity .16s ease-out,filter .16s ease-out; }
}
@media(forced-colors:active) {
  .gd-motion-strip .pose-steps button[aria-pressed="true"] { outline:2px solid Highlight; outline-offset:-3px; }
  .gd-motion-strip .pose-steps i, .gd-takes i { forced-color-adjust:none; }
}
