/* Engine `fence` (DESIGN §13.1, §5.8): every selector starts with `.fe-` (state classes `.is-*` allowed). Package C.
   The garden (filled solid), fence posts and rails, Sporko's counting walk, the rope, the picket spool, the piglets.
   Motion is transform / opacity only; no filters. */

/* ---------------------------------------------------------------- ground */
.fe-grass { fill: #EEF7DC; stroke: #D3E8B5; stroke-width: 2; }
.fe-tuft { fill: none; stroke: #9CCB6B; stroke-width: 2.4; stroke-linecap: round; }
.fe-paper-sk { fill: #FFFBF1; stroke: #E8DDC4; stroke-width: 2; }
.fe-sk-line { stroke: #DCE8FF; stroke-width: 1.6; }
.fe-sk-margin { stroke: #FFC2CF; stroke-width: 2; }
.fe-board .st-grid-paper { fill: #FFFBF1; }
.fe-board .st-grid-lines { stroke: #D6E2D0; }
.fe-name { font-size: 22px; }
.fe-k { fill: #24263B; }

/* ---------------------------------------------------------------- the garden and its fence */
.fe-soil { fill: #D9B98C; stroke: #B48A55; stroke-width: 2; stroke-linejoin: round; }
.fe-garden.is-sketch .fe-soil { fill: #FFF1C2; stroke: none; opacity: .65; }
.fe-sk-shape { fill: none; stroke: #3B4A6B; stroke-width: 4; stroke-linejoin: round; }
.fe-sprout.is-grown { animation: fe-grow .5s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(var(--i, 0) * .08s); transform-box: fill-box; transform-origin: center bottom; }
@keyframes fe-grow { from { transform: scale(.2); opacity: 0; } }
.fe-rail-out { stroke: #24263B; stroke-width: 7; stroke-linecap: round; }
.fe-rail-in { stroke: #D9A866; stroke-width: 3.6; stroke-linecap: round; }
.fe-rail.is-walked .fe-rail-in { stroke: #FFC53D; }
.fe-rail.is-bad .fe-rail-in { stroke: #FF9636; }
.fe-rail.fe-light .fe-rail-in { animation: fe-light .5s ease-out backwards; animation-delay: calc(var(--i, 0) * .07s); }
@keyframes fe-light { from { stroke: #D9A866; } 50% { stroke: #FFF6B0; } }
.fe-post.is-peg rect { fill: #8A6232; }
.fe-num circle { fill: #fff; stroke: #24263B; stroke-width: 2.4; }
.fe-num text { font-weight: 1000; fill: #24263B; }
.fe-numg.fe-pop { animation: fe-pop .4s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(var(--i, 0) * .07s); transform-box: fill-box; transform-origin: center; }
@keyframes fe-pop { from { transform: scale(.3); opacity: 0; } }
.fe-board .st-trace-done { stroke: #FFE27A; stroke-width: 10; opacity: .55; }
.fe-board .st-trace-head { fill: rgba(255, 197, 61, .35); stroke: #F5A300; stroke-width: 3; }

/* ---------------------------------------------------------------- rope, picket tape, spool, tags */
.fe-rope-out { fill: none; stroke: #24263B; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.fe-rope-in { fill: none; stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
.fe-rope-tw { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 3 6; opacity: .6; stroke-linecap: round; }
.fe-rope.fe-new { animation: fe-pop .35s ease-out; }
.fe-rope.fe-snap { animation: fe-snapback 1s ease-in forwards; }
.fe-rope.fe-snap .fe-rope-in { stroke: #FF9636; }
@keyframes fe-snapback { 40% { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }
.fe-knot { fill: #C9A26B; stroke: #24263B; stroke-width: 2.4; }
.fe-ghost { fill: none; stroke: #9AA6BE; stroke-width: 3; stroke-dasharray: 8 6; stroke-linejoin: round; }
.fe-picket-rail { stroke: #24263B; stroke-width: 3; }
.fe-pickets path { fill: #fff; stroke: #24263B; stroke-width: 1.8; stroke-linejoin: round; }
.fe-tag-box { fill: #FFF6DC; stroke: #24263B; stroke-width: 2.4; }
.fe-tag.is-drag .fe-tag-box { fill: #FFE9A8; }
.fe-tag.is-glow .fe-tag-box { stroke: #F5A300; stroke-width: 4.5; }
.fe-tag-t { font-weight: 900; fill: #24263B; }
.fe-tag.is-used .fe-tag-box { fill: #DDF3D3; }
.fe-tag-ok { fill: none; stroke: #17A565; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.fe-tagdrag { cursor: grab; }
.fe-qtag circle { fill: #fff; stroke: #9AA6BE; stroke-width: 2.4; stroke-dasharray: 5 4; }
.fe-qtag text { font-weight: 1000; font-size: 20px; fill: #9AA6BE; }
.fe-badtag { animation: fe-shake .35s ease-in-out 2; }
.fe-badtag .fe-tag-box { fill: #FFE1C2; stroke: #FF9636; }

/* ---------------------------------------------------------------- piglets, mud, bush, signs, the pumpkin */
.fe-mud { fill: #8A6232; opacity: .8; }
.fe-mudg, .fe-splash { animation: fe-pop .4s ease-out; transform-box: fill-box; transform-origin: center; }
.fe-rolling .fe-pig-body { animation: fe-roll .8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes fe-roll { 50% { transform: rotate(16deg) translateY(-3px); } }
.fe-bush circle { fill: #5FB34A; stroke: #24263B; stroke-width: 2.6; }
.fe-bush .fe-berry { fill: #EC4A3D; stroke-width: 1.4; }
.fe-bushg { cursor: grab; }
.fe-sign-n { font-weight: 1000; fill: #24263B; }
.fe-sign-glow { fill: #FFE27A; opacity: .5; animation: fe-breathe 1.2s ease-in-out infinite; }
.fe-signg.fe-shake { animation: fe-shake .35s ease-in-out 2; }
.fe-pumpkin-in { animation: fe-pop .6s cubic-bezier(.3, 1.5, .5, 1); transform-box: fill-box; transform-origin: center bottom; }
.fe-pop-garden { animation: fe-pop .5s ease-out; transform-box: fill-box; transform-origin: center; }

/* ---------------------------------------------------------------- Sporko */
.fe-walking .fe-sporko { visibility: hidden; }
.fe-walker.fe-dance > svg { animation: fe-dance 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes fe-dance { 25% { transform: rotate(-10deg) scaleY(1.06); } 75% { transform: rotate(10deg) scaleY(.95); } }

/* ---------------------------------------------------------------- gags and hints (orange, never red) */
.fe-wrongline { stroke: #FF9636; stroke-width: 6; stroke-dasharray: 8 6; stroke-linecap: round; }
.fe-miss { fill: rgba(255, 150, 54, .25); stroke: #FF9636; stroke-width: 4; }
.fe-fall { animation: fe-fall 1s ease-in forwards; }
@keyframes fe-fall { 30% { transform: translateY(0); opacity: 1; } to { transform: translateY(18px); opacity: 0; } }
@keyframes fe-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.fe-hint-ring { fill: rgba(255, 197, 61, .28); stroke: #F5A300; stroke-width: 4; animation: fe-breathe .9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fe-hint-seg { stroke: #FFE27A; stroke-width: 22; stroke-linecap: round; opacity: .7; animation: fe-breathe .9s ease-in-out infinite; }
@keyframes fe-breathe { 50% { opacity: .35; } }
.st-tool.fe-hint-btn { animation: fe-btn-pulse .9s ease-in-out infinite; }
.st-lamp.fe-hint-btn { animation: fe-btn-pulse .9s ease-in-out infinite; }
@keyframes fe-btn-pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 197, 61, .55); } }

/* ---------------------------------------------------------------- the adding tape in the wide dock */
.fe-dock { display: none; }
html[data-layout="wide"] .fe-dock:not([hidden]), html[data-layout="square"] .fe-dock:not([hidden]) { display: block; }
.fe-tape { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; background: #fff; border: 3px solid #24263B; border-radius: 16px; box-shadow: 0 4px 0 #24263B; }
.fe-term { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 12px; border: 3px solid #24263B; background: var(--c, #FFF6DC); color: #fff; font-weight: 1000; font-size: 24px; box-sizing: border-box; }
.fe-term b { paint-order: stroke; -webkit-text-stroke: 1px #24263B; }
.fe-term.is-empty { background: #FFF6DC; border-style: dashed; }
.fe-term.is-q { background: #FFE9A8; color: #24263B; }
.fe-op { font-weight: 1000; font-size: 24px; color: #24263B; }
.fe-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; margin-bottom: 8px; background: #fff; border: 3px solid #24263B; border-radius: 16px; box-shadow: 0 4px 0 #24263B; }
.fe-count-l { font-weight: 900; font-size: 18px; color: #24263B; }
.fe-count b { font-weight: 1000; font-size: 32px; color: #B98200; min-width: 40px; text-align: right; }
.fe-dots { display: flex; gap: 6px; }
.fe-dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #24263B; background: #F4F1EA; }
.fe-dots i.is-on { background: #E8574A; }

@media (prefers-reduced-motion: reduce) {
  .fe-sign-glow, .fe-hint-ring, .fe-hint-seg, .fe-rolling .fe-pig-body, .fe-walker.fe-dance > svg { animation: none !important; }
}
html[data-motion="reduce"] .fe-sign-glow, html[data-motion="reduce"] .fe-hint-ring, html[data-motion="reduce"] .fe-hint-seg, html[data-motion="reduce"] .fe-rolling .fe-pig-body { animation: none !important; }
