/* Tutorial overlay (client/tutorial.js): blockers around a spotlight hole, a pulsing ring, a pointing hand and the
   guide's speech box. Sits above sheets (20), toasts (30) and the recruit reveal (40); below the restart overlay, the
   photo viewer (9999) and the rotate-your-phone hint (90). */
#tut { position: fixed; inset: 0; z-index: 60; pointer-events: none; font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#tut.hidden { display: none; }
.tut-blk { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; touch-action: none; background: transparent; }
#tut.dim .tut-blk:not(.b4) { background: rgba(4, 8, 5, .6); }
/* the hole is a clipped box the size of the target; its inner shape is rounded and throws the dark into the corners */
.tut-hole { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.tut-hole i { position: absolute; inset: 0; border-radius: 14px; box-shadow: 0 0 0 200px rgba(4, 8, 5, .6), inset 0 0 0 2px rgba(255, 221, 130, .95), inset 0 0 14px rgba(255, 200, 90, .55); }
.tut-hole.off, .tut-ring.off { display: none; }
.tut-ring { position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 14px; pointer-events: none; }
.tut-ring::after { content: ''; position: absolute; inset: -5px; border-radius: inherit; border: 3px solid #ffd76a; opacity: 0; animation: tutPulse 1.25s ease-out infinite; }
.tut-ring.nudge { animation: tutNudge .32s ease-out; }
@keyframes tutPulse { 0% { transform: scale(.94); opacity: .95; } 100% { transform: scale(1.32); opacity: 0; } }
@keyframes tutNudge { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 4px #ffd76a, 0 0 18px 6px rgba(255, 215, 106, .8); } }
.tut-hand { position: fixed; left: 0; top: 0; width: 44px; height: 44px; margin: 0; pointer-events: none; font-size: 36px; line-height: 44px; text-align: center;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.tut-hand.off { display: none; }
.tut-hand span { display: block; animation: tutPoke .8s ease-in-out infinite; --mx: 0px; --my: 10px; }
.tut-hand.down span { --my: -10px; } .tut-hand.left span { --mx: 10px; --my: 0px; } .tut-hand.right span { --mx: -10px; --my: 0px; }
@keyframes tutPoke { 0%, 100% { transform: translate(var(--mx), var(--my)); } 50% { transform: translate(0, 0); } }

/* the guide's speech box */
.tut-box { position: fixed; left: 0; top: 0; width: min(380px, calc(100vw - 16px)); pointer-events: auto; touch-action: manipulation;
  display: grid; grid-template-columns: 58px 1fr; gap: 4px 10px; padding: 10px 12px 9px; border-radius: 16px; color: #f4ead6;
  background: linear-gradient(#3b2b19, #22170a); border: 2px solid #c8912a; box-shadow: 0 8px 24px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12); }
.tut-box.off { display: none; }
.tut-box.compact { grid-template-columns: 40px 1fr; padding: 7px 10px; }
.tut-ava { grid-row: 1 / span 3; align-self: start; width: 58px; height: 58px; border-radius: 12px; overflow: hidden; border: 2px solid #ffd76a; background: #1b2520; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.tut-box.compact .tut-ava { width: 40px; height: 40px; border-radius: 9px; grid-row: 1 / span 2; }
.tut-ava img, .tut-ava > div { display: block; width: 100% !important; height: 100% !important; object-fit: cover; object-position: 50% 12%; border-radius: 0; }
.tut-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tut-head b { font: 900 14px/1.1 system-ui; color: #ffd76a; letter-spacing: .02em; white-space: nowrap; }
.tut-head i { margin-left: auto; font: 700 11px/1 system-ui; font-style: normal; color: #c9b48e; white-space: nowrap; }
.tut-say { grid-column: 2; font-size: 14.5px; line-height: 1.32; overflow-wrap: anywhere; }
.tut-say em { display: block; margin-top: 4px; font-style: normal; font-weight: 800; color: #ffe08a; }
.tut-say em.only { margin-top: 0; }
.tut-say u { text-decoration: none; font-variant-numeric: tabular-nums; color: #9fe6a0; font-weight: 800; }
.tut-box.compact .tut-head { display: none; }
.tut-rw { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.tut-rw small { font-size: 11px; color: #c9b48e; text-transform: uppercase; letter-spacing: .05em; }
.tut-rw span { padding: 2px 7px; border-radius: 999px; font: 800 12.5px/1.4 system-ui; background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .45); white-space: nowrap; }
.tut-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 0; }
.tut-foot:empty { display: none; }
.tut-skip { margin-right: auto; padding: 6px 2px; border: 0; background: none; font-size: 12px; color: #b8a888; text-decoration: underline; }
.tut-btn { min-width: 96px; min-height: 40px; padding: 7px 16px; border-radius: 12px; font: 900 15px/1 system-ui; color: #2a1a03; border: 1px solid #ffe7a6;
  background: linear-gradient(#ffd97a, #e3a12f 55%, #b8761a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 rgba(0, 0, 0, .45); text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.tut-btn:active { transform: translateY(1px) scale(.98); }
.tut-btn.plain { color: #f4ead6; border-color: #6b5637; background: linear-gradient(#4b3a25, #2f2212); text-shadow: none; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.tut-btn.pulse { animation: tutBtn 1.3s ease-in-out infinite; }
@keyframes tutBtn { 0%, 100% { filter: none; } 50% { filter: brightness(1.14) drop-shadow(0 0 7px rgba(255, 215, 106, .8)); } }

/* while the guide is talking the idle notices and the Queue tab keep quiet (the "queue" step shows the tab) */
body.tut-on #nt { display: none !important; }
body.tut-on #toast { pointer-events: none; }
#toast.tut-away { visibility: hidden; }                        /* a toast never swallows the tap on the target */
body.tut-on.tut-base #march-banner { display: none !important; }    /* "Squad 1 has marched." belongs to the map */
body.tut-on:not(.tut-queue) #qp-tab { display: none !important; }

@media (max-height: 460px) {
  .tut-box { padding: 7px 10px 7px; grid-template-columns: 44px 1fr; }
  .tut-ava { width: 44px; height: 44px; }
  .tut-say { font-size: 13.5px; line-height: 1.26; }
  .tut-btn { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .tut-ring::after, .tut-hand span, .tut-btn.pulse { animation-duration: 2.4s; } }

/* ---------- dialogue scenes ---------- */
.tut-scene { position: fixed; inset: 0; pointer-events: auto; touch-action: manipulation; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: calc(10px + var(--safe-top, 0px)) 8px calc(10px + var(--safe-bottom, 0px)); background: linear-gradient(rgba(4, 8, 5, .5), rgba(4, 8, 5, .82) 55%, rgba(4, 8, 5, .93)); }
.tut-scene.off { display: none; }
.tut-scene-skip { position: absolute; right: 10px; top: calc(10px + var(--safe-top, 0px)); padding: 7px 12px; border-radius: 999px; font: 800 13px/1 system-ui; color: #f4ead6; background: rgba(30, 22, 12, .86); border: 1px solid #c8912a; }
.tut-stage { width: min(460px, 100%); display: grid; gap: 22px; }
.tut-cast { display: flex; justify-content: center; align-items: flex-end; gap: 12px; min-height: 0; }
.tut-actor { --size: 112px; width: var(--size); display: grid; justify-items: center; gap: 4px; transform: scale(.86); transform-origin: 50% 100%; filter: brightness(.5) saturate(.7); transition: transform .22s ease-out, filter .22s ease-out; }
.tut-scene[data-cast="3"] .tut-actor { --size: 104px; } .tut-scene[data-cast="4"] .tut-actor { --size: 80px; }
.tut-actor.on { transform: scale(1.06); filter: none; z-index: 1; }
.tut-actor > b { max-width: 100%; padding: 2px 8px; border-radius: 999px; font: 800 11.5px/1.3 system-ui; color: #c9b48e; background: rgba(0, 0, 0, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-actor.on > b { color: #2a1a03; background: linear-gradient(#ffd97a, #e3a12f); }
/* the frame never changes size: picture, clips and the fallback face parts all lie in the same square */
.tut-frame { position: relative; width: var(--size); height: var(--size); border-radius: 16px; overflow: hidden; background: #1b2520; border: 2px solid #6b5637; box-shadow: 0 6px 16px rgba(0, 0, 0, .6); }
.tut-actor.on .tut-frame { border-color: #ffd76a; box-shadow: 0 0 0 2px rgba(255, 215, 106, .35), 0 8px 20px rgba(0, 0, 0, .65); }
.tut-frame img, .tut-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tut-frame img { animation: tutBreath 4.2s ease-in-out infinite; animation-delay: var(--ph, 0s); transform-origin: 50% 100%; }
.tut-frame video { opacity: 0; transition: opacity .25s; } .tut-frame video.on { opacity: 1; }
@keyframes tutBreath { 0%, 100% { transform: scale(1.02) translateY(0); } 50% { transform: scale(1.045) translateY(-1.2%); } }
/* no clip for this hero: the still portrait breathes, nods along while its hero talks, and a voice meter pulses in its corner */
.tut-scene.talking .tut-actor.on .tut-frame img { animation: tutBreath 4.2s ease-in-out infinite, tutNod .62s ease-in-out infinite; }
@keyframes tutNod { 0%, 100% { translate: 0 0; rotate: 0deg; } 30% { translate: 0 1.4%; rotate: -.5deg; } 65% { translate: 0 .3%; rotate: .45deg; } }
.tut-wave { position: absolute; right: 5px; bottom: 5px; display: flex; align-items: flex-end; gap: 2px; height: 16px; padding: 3px 5px; border-radius: 8px; background: rgba(0, 0, 0, .62); opacity: 0; transition: opacity .15s; }
.tut-wave i { width: 3px; height: 3px; border-radius: 1px; background: #ffd76a; }
.tut-scene.talking .tut-actor.on .tut-wave { opacity: 1; }
.tut-scene.talking .tut-actor.on .tut-wave i { animation: tutBar .46s ease-in-out infinite; }
.tut-wave i:nth-child(2) { animation-delay: -.12s !important; } .tut-wave i:nth-child(3) { animation-delay: -.29s !important; } .tut-wave i:nth-child(4) { animation-delay: -.2s !important; }
.tut-frame.clip .tut-wave { display: none; }
.tut-line { position: relative; padding: 16px 14px 10px; border-radius: 16px; color: #f4ead6; background: linear-gradient(#3b2b19, #22170a); border: 2px solid #c8912a; box-shadow: 0 8px 24px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12); }
.tut-who { position: absolute; left: 12px; top: -13px; display: flex; align-items: center; gap: 7px; padding: 3px 12px; border-radius: 999px; background: linear-gradient(#ffd97a, #e3a12f 55%, #b8761a); border: 1px solid #ffe7a6; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.tut-who b { font: 900 14px/1.2 system-ui; color: #2a1a03; }
.tut-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.tut-bars i { width: 3px; height: 3px; border-radius: 1px; background: #2a1a03; }
.tut-scene.talking .tut-bars i { animation: tutBar .5s ease-in-out infinite; } .tut-scene.talking .tut-bars i:nth-child(2) { animation-delay: -.17s; } .tut-scene.talking .tut-bars i:nth-child(3) { animation-delay: -.34s; }
@keyframes tutBar { 0%, 100% { height: 3px; } 50% { height: 10px; } }
.tut-line p { margin: 0; min-height: 3.9em; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.tut-line p .rest { visibility: hidden; }
.tut-line small { display: block; text-align: right; font-size: 11.5px; color: #c9b48e; visibility: hidden; }
.tut-scene.full .tut-line small { visibility: visible; animation: tutBtn 1.3s ease-in-out infinite; }
@media (max-height: 460px) { /* phone held sideways: the cast stands left of the text */
  .tut-stage { width: min(760px, 100%); grid-template-columns: auto 1fr; align-items: end; gap: 14px; }
  .tut-actor { --size: 92px; } .tut-scene[data-cast="3"] .tut-actor { --size: 84px; } .tut-scene[data-cast="4"] .tut-actor { --size: 66px; }
  .tut-cast { gap: 8px; } .tut-line p { font-size: 15px; min-height: 3.9em; }
}
@media (prefers-reduced-motion: reduce) { .tut-frame img { animation: none !important; } }

/* ---------- construction: the Build sheet of a plot (client/panels-building.js build) and the "a plot is free" card (client/plots.js) ---------- */
.bp .bd-name { justify-content: center; flex-wrap: wrap; }
.bp-tag { padding: 2px 9px; border-radius: 999px; font: 800 11px/1.5 system-ui; color: #2a1a03; background: linear-gradient(#ffd97a, #e3a12f); white-space: nowrap; }
.bp-tag.lock { color: #d8d2c0; background: #3a3f3a; } .bp-tag.run { color: #fff; background: linear-gradient(#7fd4ff, #2f86d8); }
.bp-about { margin: 0 2px; text-align: left; font-size: 14px; }
.bp-track { margin: 0 4px; }
.bp-unlocks .k { white-space: normal; overflow: visible; line-height: 1.3; padding: 3px 0; }
.bp .bd-stat { min-width: 0; } .bp .bd-stat .k { min-width: 0; }
.pn-need { margin: 6px 2px 12px; font-size: 15px; line-height: 1.4; }
.plot-tell { position: absolute; left: 50%; top: 78px; z-index: 8; transform: translateX(calc(-50% - 26px)); width: min(356px, calc(100% - 134px)); display: grid; grid-template-columns: 44px 1fr 26px; gap: 8px; align-items: start;
  padding: 7px 8px; border-radius: 14px; color: #f4ead6; background: linear-gradient(rgba(59, 43, 25, .97), rgba(34, 23, 10, .97)); border: 1.5px solid #c8912a; box-shadow: 0 6px 16px rgba(0, 0, 0, .55); cursor: pointer; animation: plotIn .25s ease-out; }
@keyframes plotIn { from { opacity: 0; } }
.plot-face { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; border: 2px solid #ffd76a; background: #1b2520; }
.plot-face img, .plot-face > div { display: block; width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 0; }
.plot-tx { min-width: 0; display: grid; gap: 1px; }
.plot-tx b { font: 900 12.5px/1.2 system-ui; color: #ffd76a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .plot-tx b small { font-weight: 700; color: #c9b48e; }
.plot-tx span { font-size: 13px; line-height: 1.28; } .plot-tx i { font-style: normal; font-size: 11px; color: #c9b48e; }
.plot-x { width: 26px; height: 26px; padding: 0; border-radius: 50%; font-size: 12px; background: rgba(0, 0, 0, .35); border: 1px solid #6b5637; color: #f4ead6; }
html.land .plot-tell { top: 56px; }

/* Skip tutorial next to Skip scene (top-left, so the two never overlap) */
.tut-scene-skip.all { left: 12px; right: auto; }
