/* Pure-CSS micro-theater guide dialog. */
.pass-guide {
  --guide-pad: clamp(16px, 4vw, 26px);
  width: min(532px, calc(100% - 32px));
  max-width: none;
  max-height: min(675px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid #bbbca8;
  border-radius: 15px;
  background: #fffefa;
  color: var(--ink);
  box-shadow: 0 3px 0 #e4e3d8, 0 22px 44px -18px #1f251b4d;
  overflow: hidden;
  overscroll-behavior: contain;
}
.pass-guide[open] { display: flex; flex-direction: column; }
.pass-guide::backdrop { background: #1e211b52; backdrop-filter: blur(2px); }
body:has(.pass-guide[open]) { overflow: hidden; }

.pass-guide-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px var(--guide-pad);
  background: var(--paper);
  border-bottom: 1px solid #d7cfb7;
}

.guide-book {
  flex: none;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid #203b9e;
  border-radius: 6px;
  background: var(--blue);
  color: #fffaf0;
  transform: rotate(-6deg);
}
.guide-book .icon { width: 20px; height: 20px; }

.pass-guide h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 25px);
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -.045em;
}

.guide-dismiss {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0 -7px 0 auto;
  border: none;
  border-radius: 50%;
  background: transparent;
}
.guide-dismiss .icon { width: 19px; height: 19px; }

.pass-guide-body {
  flex: 0 1 auto;
  min-height: 0;
  padding: 3px var(--guide-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pass-guide-steps { list-style: none; margin: 0; padding: 0; }
.guide-step {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding-block: 17px;
}
.guide-step + .guide-step { border-top: 1px solid #e1e0d5; }

.guide-instruction h3 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -.02em;
  line-height: 1.4;
}
.guide-instruction p { margin: 0; color: #565b50; font-size: 13.5px; line-height: 1.65; }
.guide-instruction strong { font-weight: 680; color: #353b30; }

.pass-guide-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 14px var(--guide-pad) max(16px, env(safe-area-inset-bottom));
  border-top: 1px dashed #c9c6b4;
}

.guide-start {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 16px;
  border: 1px solid #223ea4;
  border-radius: 7px;
  background: var(--blue);
  box-shadow: 0 2px 0 #183389;
  font-size: 14px;
  font-weight: 650;
  color: #ffffff;
}
.guide-start .icon { width: 17px; height: 17px; }

.copy-tip { margin-top: 5px; }
.copy-tip summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding-block: 3px;
}
.copy-tip summary::-webkit-details-marker { display: none; }
.copy-tip summary .icon { width: 13px; height: 13px; }
.copy-tip[open] summary .icon { transform: rotate(180deg); }
.copy-tip[open] p { border-left: 2px solid #c4cfb5; padding-left: 8px; margin-top: 4px; font-size: 12.5px; }
.copy-tip kbd {
  padding: 1px 4px;
  border: 1px solid #d0cfc4;
  border-radius: 3px;
  background: #f5f4ec;
  font: 650 .88em var(--mono);
  color: var(--ink);
}

/* Miniature CSS Stage Diagrams */
.guide-art {
  position: relative;
  height: 76px;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #cbc9b7;
  border-radius: 7px;
  color: #394a72;
  background-color: #f4e8ce;
}
.guide-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .35;
  background: radial-gradient(#94836a .65px, transparent .9px) 0 0 / 4px 4px;
  mask-image: radial-gradient(ellipse at 55% 55%, black 30%, transparent 78%);
}
.art-copy { background-color: #e7edf6; }
.art-paste { background-color: #eaf0db; }

.guide-no {
  position: absolute;
  left: 5px;
  top: 4px;
  color: #656652;
  font: 650 8px/1 var(--mono);
  letter-spacing: .045em;
}

.demo-window, .demo-pass {
  position: absolute;
  left: 17%;
  top: 24%;
  width: 65%;
  height: 56%;
  border: 1px solid #53617a;
  border-radius: 4px;
  background: #fffdf5;
  box-shadow: 2px 3px 0 #34486c28;
  transform: rotate(-6deg);
}
.demo-chrome {
  display: block;
  height: 19%;
  border-radius: 3px 3px 0 0;
  border-bottom: 1px solid #9da4a5;
  background: radial-gradient(circle, #758098 0 1px, transparent 1.1px) 4px center / 4px 4px repeat-x;
  background-clip: content-box;
  padding-right: calc(100% - 16px);
}
.demo-flare { position: absolute; width: 11px; height: 11px; left: 10%; top: 36%; color: var(--blue); }
.demo-button { position: absolute; width: 32%; height: 14%; bottom: 18%; right: 13%; border-radius: 2px; background: var(--blue); }
.demo-pointer {
  position: absolute;
  width: 14px;
  height: 18px;
  right: 13%;
  bottom: 13%;
  background: #e77535;
  clip-path: polygon(5% 0, 98% 58%, 61% 62%, 76% 90%, 56% 100%, 41% 71%, 13% 95%);
}

.art-copy .demo-window { transform: rotate(4deg); }
.demo-selection, .demo-fields { position: absolute; left: 9%; right: 9%; border-radius: 2px; }
.demo-selection {
  top: 12%;
  height: 23%;
  border: 1px solid #a2b1d1;
  background: linear-gradient(90deg, #bbcdf9 68%, #edf1f9 68%);
}
.demo-fields {
  top: 47%;
  height: 33%;
  background: repeating-linear-gradient(to bottom, #d5d9ce 0 2px, transparent 2px 5px);
}

.demo-clip, .demo-check {
  display: grid;
  place-items: center;
  position: absolute;
  right: 7%;
  width: 22px;
  height: 22px;
  border: 1px solid #3b465c;
  box-shadow: 1px 2px 0 #34486c26;
}
.demo-clip { top: 19%; transform: rotate(9deg); border-radius: 4px; background: #f5a361; color: #3e372a; }
.demo-clip .icon { width: 14px; height: 14px; }

.demo-pass { transform: rotate(-3deg); }
.demo-pass > .demo-flare { top: 12%; height: 9px; width: 9px; }
.demo-field {
  position: absolute;
  inset: 47% 9% 17%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 3px;
  border: 1px solid #b2bc9e;
  border-radius: 2px;
  color: #53663e;
}
.demo-field .icon { width: 9px; height: 9px; }
.demo-field::after { content: ""; width: 42%; height: 2px; background: #96ab84; }

.demo-check { bottom: 12%; border-radius: 50%; background: #c6db87; color: #334633; transform: rotate(6deg); }
.demo-check .icon { width: 15px; height: 15px; stroke-width: 2.4; }

@keyframes demo-click {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(-6px, -4px); }
  60% { transform: translate(-6px, -4px) scale(.86); }
}
@keyframes demo-clip-hop {
  0%, 100% { transform: rotate(9deg); }
  50% { transform: translate(-3px, -3px) rotate(0deg) scale(1.06); }
}
@keyframes demo-check-pop {
  0%, 100% { transform: rotate(6deg) scale(1); }
  50% { transform: rotate(0deg) scale(1.12); }
}

@media screen {
  html[data-motion="playing"] .pass-guide[open] {
    opacity: 1;
    transform: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  }
  html[data-motion="playing"] .pass-guide[open]::backdrop {
    opacity: 1;
    transition: opacity 180ms ease;
  }
  @starting-style {
    html[data-motion="playing"] .pass-guide[open]:not([data-closing]) { opacity: 0; transform: translateY(9px) scale(.98); }
    html[data-motion="playing"] .pass-guide[open]:not([data-closing])::backdrop { opacity: 0; }
  }
  html[data-motion="playing"] .pass-guide[data-closing] {
    opacity: 0;
    transform: translateY(5px) scale(.99);
    transition-duration: 160ms;
  }
  html[data-motion="playing"] .pass-guide[data-closing]::backdrop { opacity: 0; transition-duration: 160ms; }
  html[data-motion="playing"] .pass-guide[open] .demo-pointer { animation: demo-click 2.6s var(--ease-io) infinite; }
  html[data-motion="playing"] .pass-guide[open] .demo-clip { animation: demo-clip-hop 2.8s .3s var(--ease-io) infinite; }
  html[data-motion="playing"] .pass-guide[open] .demo-check { animation: demo-check-pop 2.6s .5s var(--ease-io) infinite; }
}

@media (hover: hover) and (pointer: fine) {
  .copy-tip summary:hover { text-decoration: underline; }
  .guide-dismiss:hover { background-color: #e9dcc0; }
  .guide-start:hover { background-color: #193bab; }
  html[data-motion="playing"] .guide-start:hover .icon { transform: translateX(3px); }
}

@media (max-width: 440px) {
  .pass-guide { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  .pass-guide-head { gap: 8px; min-height: 60px; padding-block: 8px; }
  .guide-book { width: 26px; height: 26px; }
  .guide-book .icon { width: 17px; height: 17px; }
  .pass-guide h2 { font-size: 19px; }
  .guide-step { grid-template-columns: 74px minmax(0, 1fr); gap: 11px; padding-block: 13px; }
  .guide-art { height: 66px; }
  .guide-instruction h3 { font-size: 15px; }
  .guide-instruction p { font-size: 13px; }
  .pass-guide-foot { padding-top: 11px; }
  .guide-start { width: 100%; min-height: 44px; }
}
