/* The Endless path as cut paper (paper.js): layers of card, a paper road
   and paper discs for the levels, over Crease's dotted sky with paper clouds
   and cranes drifting behind (like Wing It's backdrop). */

body { background: var(--sky); }
/* Behind everything: Wing It's hazy pixel style, with a scene per biome
   (scenes.js). The colours and the scene follow the biome you settle on. */
.backdrop {
  --bd-sky: var(--sky); --bd-far: #c2daf1; --bd-shade: #b7d2ec; --bd-cloud: #f4f9fe;
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(rgba(46, 36, 64, 0.12) 1.5px, transparent 1.5px) 0 0 / 22px 22px;
  background-color: var(--bd-sky);
  transition: background-color 2s ease;
}
.backdrop svg { display: block; width: 100%; height: auto; }
.backdrop > div, .backdrop .sp { transition: color 2s ease; }
.bd-cloud { position: absolute; left: 0; opacity: 0.7; animation: bd-drift linear infinite; }
.bd-far, .bd-near { position: absolute; left: 0; right: 0; bottom: 0; }
.bd-far svg { height: 22vh; }
.bd-near svg { height: 12vh; }
/* (written as .backdrop > .scene so it beats the colour rule above, which would
   otherwise replace the fade and make scenes snap) */
.backdrop > .scene { position: absolute; inset: 0; opacity: 0; transition: opacity 2s ease, color 2s ease; }
.path-head { transition: background-color 2s ease, box-shadow 2s ease; }
.backdrop > .scene.on { opacity: 1; }
.backdrop.still, .backdrop.still * { transition: none !important; }
.sp { position: absolute; }
.sp .bd-sails { position: absolute; left: 50%; top: 4%; width: 170%; transform: translate(-50%, -50%); animation: spin 24s linear infinite; }
.sp.peck { transform-origin: 50% 100%; animation: peck 2.4s steps(2) infinite; }
.sp.peck.flip { animation-name: peck-b; animation-delay: -1.1s; transform: scaleX(-1); }
.sp.bob { animation: bob 5s ease-in-out infinite; }
.sp.bob.slow { animation-duration: 8s; animation-delay: -3s; }
.sp.sway { animation: sway 6s ease-in-out infinite; }
/* Narrower screens: the path covers the middle, so just sky and hills */
@media (max-width: 899px) { .scene { display: none; } }
@keyframes bd-drift { from { transform: translateX(-200px); } to { transform: translateX(110vw); } }
@keyframes peck { 50% { transform: rotate(18deg) translateY(1px); } }
@keyframes peck-b { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) rotate(18deg) translateY(1px); } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes sway { 50% { transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) { .bd-cloud, .sp, .sp .bd-sails { animation: none !important; } }

/* (unused now: a fibre texture, kept for a later idea) */
:root { --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg stroke='%23fff' stroke-opacity='.6' stroke-linecap='round'%3E%3Cpath d='M8 12l4 1M30 5l3 3M60 18l5-1M75 40l2 4M15 50l4-2M44 34l3 2M68 70l4 1M25 78l3-3M50 60l-3 3M84 12l-2 4'/%3E%3C/g%3E%3Cg stroke='%232e2440' stroke-opacity='.07' stroke-linecap='round'%3E%3Cpath d='M20 25l3 2M55 8l2 3M40 72l4-1M80 55l-3 2M10 88l3-2M66 44l2 3'/%3E%3C/g%3E%3C/svg%3E"); }

.path-head { position: sticky; top: 0; z-index: 10; width: 100%; max-width: 600px; margin: 0 auto; padding: 14px 16px 14px; background: var(--head-sky, var(--sky)); box-shadow: 0 12px 14px -10px var(--head-sky, var(--sky)); }
.path-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back-link { font-weight: 800; text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.path-top .btn { background: var(--butter); }
.path-head h1 { margin: 8px 0 2px; font: 600 36px/1.05 var(--serif); letter-spacing: -0.01em; }
.path-head p { margin: 0; color: var(--plum-soft); font-weight: 800; font-size: 14px; }
.path-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.path-chips:empty { display: none; }
.path-chips :is(span, a) { padding: 4px 10px; text-decoration: none; color: inherit; border: 2px solid var(--plum); border-radius: 999px; background: #fff; color: var(--plum-soft); font-size: 13px; }
.path-chips b { color: var(--plum); }

.path { position: relative; width: 100%; max-width: 600px; margin: 0 auto; padding-bottom: 40px; overflow-x: clip; }
.paper-land { position: absolute; top: 0; left: 0; z-index: 0; display: block; pointer-events: none; }
@media (min-width: 640px) { .path { border-radius: 28px 28px 0 0; box-shadow: 0 0 0 1px rgba(46, 36, 64, 0.06), 0 10px 30px rgba(46, 36, 64, 0.10); } }
.path-note { position: relative; z-index: 2; width: fit-content; margin: 18px auto; padding: 4px 12px; border-radius: 10px; background: rgba(251, 246, 234, 0.8); text-align: center; color: var(--plum-soft); font-weight: 800; font-size: 14px; }
.biome { position: relative; padding: 30px 0 26px; }
/* Labels are paper too: cut card with a soft shadow, held on with tape */
.biome-banner, .sign { position: relative; z-index: 2; width: fit-content; margin: 0 auto 10px; padding: 10px 20px 9px; border-radius: 4px; background: #fffaf0; color: var(--plum); text-align: center; box-shadow: 0 4px 0 rgba(46, 36, 64, 0.12); transform: rotate(-1.5deg); }
.biome-banner::before, .sign::before { content: ""; position: absolute; top: -9px; left: 50%; width: 58px; height: 18px; translate: -50% 0; rotate: 3deg; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 5px, transparent 5px 10px), rgba(242, 161, 154, 0.75); box-shadow: 0 1px 2px rgba(46, 36, 64, 0.12); }
.biome-banner b { display: block; font: 600 22px/1.15 var(--serif); }
.biome-banner span { font: 800 12px/1.2 var(--sans); color: var(--plum-soft); }
.sign { width: min(280px, 78%); margin: 18px auto 4px; background: #fdf0bf; transform: rotate(1.2deg); }
.sign::before { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 5px, transparent 5px 10px), rgba(159, 211, 182, 0.8); rotate: -4deg; }
.sign b { display: block; font: 600 18px/1.15 var(--serif); }
.sign span { font: 800 12px/1.3 var(--sans); color: var(--plum-soft); }
.stop-row { position: relative; z-index: 2; height: 72px; }
/* Levels are paper discs: cut card with a ring pressed into it and a soft shadow */
/* Levels are paper discs: flat card with a ring pressed into it and a shadow */
.stop { position: absolute; left: var(--x); top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; min-width: 50px; height: 50px; padding: 0 8px; border-radius: 50%; background: #fffaf0; color: var(--plum); text-decoration: none; box-shadow: inset 0 0 0 5px #fffaf0, inset 0 0 0 6.5px #efe3cb, 3px 5px 0 rgba(46, 36, 64, 0.16); transition: transform 0.15s; }
a.stop:hover { transform: translate(-50%, -54%); }
.stop b { font: 900 17px/1 var(--sans); }
.stop.done { background: #f8b9ab; box-shadow: inset 0 0 0 5px #f8b9ab, inset 0 0 0 6.5px #ec9d8d, 3px 5px 0 rgba(46, 36, 64, 0.16); }
.stop.current { min-width: 64px; height: 64px; background: #ffe27a; box-shadow: inset 0 0 0 6px #ffe27a, inset 0 0 0 7.5px #e6b93a, 3px 5px 0 rgba(46, 36, 64, 0.18); }
.stop.current b { font-size: 20px; }
.stop em { position: absolute; bottom: -24px; padding: 3px 7px 2px; border-radius: 6px; background: rgba(251, 246, 234, 0.92); box-shadow: 0 2px 0 rgba(46, 36, 64, 0.10); font: 900 11px/1 var(--sans); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum); white-space: nowrap; }
.stop.ahead { background: #ffffff; color: var(--plum-soft); box-shadow: none; outline: 1.5px dashed rgba(46, 36, 64, 0.3); outline-offset: -1.5px; }
/* Skipped: still to fold, and holding your level back until you do */
.stop.gap { background: #ffffff; box-shadow: 3px 5px 0 rgba(46, 36, 64, 0.12); outline: 2px dashed #c4574a; outline-offset: -2px; }
.stop.gap em { color: #c4574a; }
.stop-stars { position: absolute; bottom: -19px; display: flex; gap: 1px; padding: 2px 4px; border-radius: 6px; background: rgba(251, 246, 234, 0.85); }
.stop-stars i { width: 11px; height: 11px; background: rgba(46, 36, 64, 0.2); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.stop-stars i.on { background: #f2b72e; }

/* Flags: the player to beat next, and crew mates, on their level */
.stop-flag { position: absolute; left: calc(100% + 6px); top: 50%; translate: 0 -50%; z-index: 3; max-width: 150px; overflow: hidden; padding: 3px 9px; border: 2px solid var(--plum); border-radius: 10px 10px 10px 3px; background: #fff; color: var(--plum); font: 900 11.5px/1.3 var(--sans); white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 2px 0 var(--plum); pointer-events: none; }
.stop-flag.rival { background: #fde2dc; }
.stop-flag.crew { background: var(--mint, #c9ebda); }
.stop-flag.left { left: auto; right: calc(100% + 6px); border-radius: 10px 10px 3px 10px; }
