.ferry-main { padding-bottom: 38px; background: #fff8ed; }
.ferry-page-header { color: #fff; background: linear-gradient(115deg, #315b35, #527c3d); border-bottom: 1px solid #6f8d57; }
.ferry-header-inner { width: min(1080px, 100%); margin: 0 auto; padding: 13px 20px 18px; }
.ferry-page-header h1 { margin: 3px 0 2px; font-size: clamp(1.75rem, 5vw, 2.65rem); }
.ferry-page-header p:last-child { margin: 0; color: #eef6df; }
.section-label { margin: 7px 0 0; color: #ffefaa; font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.back-link { display: inline-block; color: #fff; font-size: .9rem; font-weight: 700; text-underline-offset: 3px; }

button { touch-action: manipulation; }
.ferry-card { width: min(1080px, calc(100% - 28px)); margin: 20px auto 0; padding: 22px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow-card); }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.game-heading h2, .game-heading p { margin: 0; }
.game-heading p { margin-top: 4px; color: var(--color-muted); }
.game-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.game-heading button, .game-heading .print-puzzle-link, .hint-panel button, .result-card button { min-height: 44px; padding: 9px 15px; border: 1px solid var(--color-border); border-radius: 9px; color: var(--color-ink); background: #fff; font-weight: 800; cursor: pointer; }
.game-heading .print-puzzle-link { display: inline-flex; align-items: center; text-decoration: none; }
.game-heading button:hover, .game-heading .print-puzzle-link:hover, .hint-panel button:hover, .result-card button:hover { background: #f7ead9; }
button:focus-visible, .drop-zone:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
button:disabled { cursor: default; opacity: .52; }

.game-stats { display: flex; gap: 24px; margin-top: 15px; font-variant-numeric: tabular-nums; }
.game-stats strong { color: #315b35; }
.game-status { min-height: 1.5em; margin: 8px 0 2px; color: var(--color-muted); font-weight: 700; }
.game-status.warning-status { color: #a52e27; }
.game-status.success-status { color: #246b3f; }
.selection-help { margin: 0 0 11px; color: var(--color-muted); font-size: .86rem; }

.river-scene { position: relative; min-height: 390px; display: grid; grid-template-columns: minmax(150px, 27%) minmax(260px, 46%) minmax(150px, 27%); overflow: hidden; border: 0; border-radius: 16px; background: transparent; isolation: isolate; }
.sky-details { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.cloud { position: absolute; top: 12px; width: 72px; height: 22px; background: #fff9; border-radius: 999px; filter: drop-shadow(0 2px 2px #477a9a30); animation: cloud-drift 24s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; bottom: 5px; background: inherit; border-radius: 50%; }
.cloud::before { left: 13px; width: 28px; height: 28px; }
.cloud::after { right: 9px; width: 34px; height: 34px; }
.cloud-one { left: 30%; }
.cloud-two { left: 66%; top: 43px; scale: .72; animation-duration: 31s; animation-delay: -14s; }
.drifting-leaf { position: absolute; z-index: 5; top: -24px; font-size: 1.05rem; animation: leaf-drift 13s linear infinite; }
.leaf-one { left: 8%; animation-delay: -3s; }
.leaf-two { left: 85%; animation-delay: -8s; animation-duration: 16s; }
.bank { position: relative; z-index: 1; min-width: 0; padding: 18px 10px 24px; background: linear-gradient(#a9d979 0 42%, #75ae55 42% 100%); box-shadow: inset 0 -22px 0 #609646; }
.bank::after { content: ""; position: absolute; inset: 40% 0 auto; height: 26px; background: radial-gradient(ellipse at 50% 0, #d9c08a 0 45%, transparent 48%) 0 0 / 34px 22px repeat-x; }
.bank-left { border-right: 6px solid #d9c08a; }
.bank-right { border-left: 6px solid #d9c08a; }
.scenery-bush { position: absolute; z-index: 2; right: 4px; bottom: 14px; width: 70px; height: 43px; background: #3f7e39; border: 4px solid #2e642d; border-radius: 55% 55% 30% 30%; box-shadow: -35px 9px 0 -5px #4b9040, -30px 9px 0 -1px #2e642d; }
.bank-right .scenery-bush { right: auto; left: 38%; }
.tree-branch { position: absolute; z-index: 2; right: 2px; top: 105px; width: 75px; height: 9px; background: #71421f; border-radius: 8px; transform: rotate(-8deg); }
.bank-left .tree-branch { right: auto; left: 2px; transform: rotate(8deg); }
.bank-sign { position: relative; z-index: 2; display: table; margin: 0 auto 17px; padding: 6px 11px; color: #fff7d3; background: #6a4025; border: 3px solid #4b2b17; border-radius: 4px; font-size: .72rem; font-weight: 900; letter-spacing: .1em; box-shadow: 0 5px 0 #4b2b17; }
.bank-items { position: relative; z-index: 3; min-height: 260px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; }

.river { position: relative; min-width: 0; overflow: hidden; background: linear-gradient(90deg, #5ea6d6, #83c9ed 48%, #5ea6d6); }
.water-lines { position: absolute; inset: 0; opacity: .48; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='88' viewBox='0 0 220 88'%3E%3Cg fill='none' stroke='%23dff5ff' stroke-width='3' stroke-linecap='round' opacity='.75'%3E%3Cpath d='M8 18c18-7 38-7 56 0s38 7 56 0 38-7 56 0 28 6 38 2'/%3E%3Cpath d='M-18 51c15-6 31-6 46 0s31 6 46 0 31-6 46 0 31 6 46 0 31-6 46 0'/%3E%3Cpath d='M24 78c10-4 21-4 31 0s21 4 31 0M137 78c10-4 21-4 31 0s21 4 31 0'/%3E%3C/g%3E%3C/svg%3E"); background-size: 220px 88px; animation: water-flow 8s linear infinite; }
.boat { position: absolute; z-index: 5; bottom: 54px; left: 4%; width: min(240px, 78%); height: 104px; padding: 7px 17px 22px; cursor: pointer; transition: left .85s ease-in-out; }
.boat.at-left { left: 4%; }
.boat.at-right { left: calc(96% - min(240px, 78%)); }
.boat.to-right { left: calc(96% - min(240px, 78%)); }
.boat.to-left { left: 4%; }
.boat-rim { position: absolute; inset: 27px 2px auto; height: 15px; z-index: 3; background: #a65b2a; border: 4px solid #573018; border-radius: 50%; }
.boat-hull { position: absolute; inset: 34px 8px auto; height: 49px; background: linear-gradient(#a65b2a, #74401f); border: 4px solid #573018; border-radius: 5px 5px 58% 58%; box-shadow: inset 0 -8px 0 #61361d; }
.boat-items { position: relative; z-index: 4; min-height: 62px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.oar { position: absolute; z-index: 2; top: 46px; right: -20px; width: 112px; height: 7px; background: #7a4a29; border-radius: 8px; transform: rotate(28deg); transform-origin: left center; }
.oar::after { content: ""; position: absolute; right: -7px; top: -5px; width: 24px; height: 17px; background: #8b5731; border-radius: 50%; }
.in-transit .oar { animation: row-oar .45s ease-in-out infinite alternate; }

.traveler { position: relative; z-index: 7; min-width: 0; min-height: 88px; padding: 5px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2c211a; background: transparent; border: 2px solid transparent; border-radius: 13px; font-weight: 900; cursor: grab; user-select: none; touch-action: none; box-shadow: none; }
.traveler:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.traveler.selected { border-color: #111; outline: 4px solid #ffd54b; outline-offset: 1px; }
.traveler-picture { font-size: clamp(2.2rem, 5.5vw, 3.4rem); line-height: 1; filter: drop-shadow(0 2px 1px #0002); }
.traveler-name { margin-top: 3px; font-size: .76rem; }
.boat-items .traveler { width: 43px; min-height: 61px; flex: 0 1 46px; padding: 2px 0; border-width: 1px; border-radius: 8px; }
.boat-items .traveler-picture { font-size: 1.8rem; }
.boat-items .traveler-name { font-size: .57rem; }
.traveler[data-item="farmer"] .traveler-picture { animation: farmer-idle 7s ease-in-out infinite; }
.traveler[data-item="dog"] .traveler-picture { animation: dog-idle 3.8s ease-in-out infinite; }
.traveler[data-item="chicken"] .traveler-picture { animation: chicken-idle 4.6s ease-in-out infinite; transform-origin: 50% 90%; }
.traveler[data-item="feed"] .traveler-picture { animation: feed-idle 5.2s ease-in-out infinite; transform-origin: 50% 90%; }
.traveler.just-moved { animation: moved-squash .42s ease-out; }
.drag-source { opacity: .35; }
.drag-ghost { position: fixed; z-index: 2000; width: 78px; pointer-events: none; transform: translate(-50%, -55%) rotate(-3deg); opacity: .9; }
.drop-target { outline: 5px solid #ffd54b; outline-offset: -6px; }
.is-locked .traveler { cursor: default; }
.river-scene .traveler:disabled { opacity: 1; }
.drag-source .traveler-picture { animation-play-state: paused; }
.in-transit .traveler[data-item="farmer"] { animation: farmer-row .42s ease-in-out infinite alternate; }

.effect-layer { position: absolute; inset: 0; z-index: 15; overflow: hidden; pointer-events: none; }
.action-caption { position: absolute; z-index: 18; left: 50%; bottom: 12px; max-width: calc(100% - 24px); margin: 0; padding: 8px 14px; color: #fff; background: #2d201bd9; border: 2px solid #fff9; border-radius: 999px; font-weight: 900; text-align: center; opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.action-caption.visible { opacity: 1; transform: translate(-50%, 0); }

/* Chicken versus feed */
.disaster-chicken-feed .traveler[data-item="chicken"] { z-index: 12; animation: chicken-look-around .5s .05s ease-in-out both, chicken-tip-toe 2s .55s ease-in-out both, chicken-gobble 1.25s 2.55s ease-in-out infinite, chicken-innocent .6s 4.75s ease-out both; }
.disaster-chicken-feed .traveler[data-item="chicken"] .traveler-picture { animation: chicken-belly 1s 3.55s ease-out both; }
.disaster-chicken-feed .traveler[data-item="feed"] { animation: feed-pecked .75s 1.85s ease-in-out both; }
.grain { position: absolute; z-index: 14; left: calc(12% + var(--i) * 3.5%); top: 55%; color: #efc14d; font-size: 1.8rem; opacity: 0; animation: grain-spray 1.25s calc(2s + var(--i) * 18ms) ease-out both; }
.comic-burst { position: absolute; z-index: 16; left: 21%; top: 42%; padding: 12px; color: #9b241f; background: #ffe34e; border: 4px solid #2f2018; clip-path: polygon(50% 0,61% 29%,85% 15%,72% 40%,100% 50%,71% 60%,85% 86%,59% 72%,50% 100%,40% 71%,15% 86%,28% 60%,0 50%,29% 40%,15% 15%,40% 29%); font-weight: 1000; opacity: 0; animation: comic-pop .6s 1.95s ease-out both; }
.burp-bubble { position: absolute; z-index: 16; left: 19%; top: 20%; padding: 8px 12px; background: #fff; border: 3px solid #2f2018; border-radius: 50%; font-weight: 1000; opacity: 0; animation: bubble-pop .9s 4.3s ease-out both; }
.chaos-right .disaster-chicken-feed .traveler[data-item="chicken"],
.chaos-right.disaster-chicken-feed .traveler[data-item="chicken"] { animation-name: chicken-look-around, chicken-tip-toe-left, chicken-gobble-left, chicken-innocent-left; }
.chaos-right .grain { left: auto; right: calc(12% + var(--i) * 3.5%); }
.chaos-right .comic-burst { left: auto; right: 21%; }
.chaos-right .burp-bubble { left: auto; right: 19%; }

/* Dog versus chicken */
.disaster-dog-chicken .traveler[data-item="dog"] { z-index: 12; animation: dog-notices .8s .2s ease-out both, dog-chase 2.4s 1.45s cubic-bezier(.45,.05,.55,.95) both; }
.disaster-dog-chicken .traveler[data-item="chicken"] { z-index: 13; animation: chicken-freeze .8s .55s ease-out both, chicken-flee 2.25s 1.6s cubic-bezier(.45,.05,.55,.95) both; }
.motion-mark { position: absolute; z-index: 14; left: calc(10% + var(--i) * 7%); top: calc(47% + var(--i) * 3%); color: #fff; font-size: 2rem; opacity: 0; animation: motion-mark 1.4s calc(1.7s + var(--i) * 90ms) linear both; }
.dust-cloud { position: absolute; z-index: 16; left: 12%; bottom: 40px; width: 190px; height: 110px; display: grid; place-items: center; padding: 18px; color: #6a4329; background: #e9d2a4e8; border: 4px solid #7a5a3c; border-radius: 50%; font-weight: 1000; text-align: center; opacity: 0; animation: dust-eruption 1.65s 3.35s ease-out both; }
.branch-chicken { position: absolute; z-index: 17; right: 4%; top: 76px; font-size: 3.4rem; opacity: 0; filter: drop-shadow(0 3px 1px #0003); animation: branch-escape .8s 4.85s cubic-bezier(.2,.8,.3,1.3) both; }
.chaos-left .branch-chicken { right: auto; left: 4%; }
.chaos-right .dust-cloud { left: auto; right: 12%; }
.chaos-right.disaster-dog-chicken .traveler[data-item="dog"],
.chaos-right.disaster-barnyard-chaos .traveler[data-item="dog"] { animation-name: dog-notices, dog-chase-left; }
.chaos-right.disaster-dog-chicken .traveler[data-item="chicken"],
.chaos-right.disaster-barnyard-chaos .traveler[data-item="chicken"] { animation-name: chicken-freeze, chicken-flee-left; }
.disaster-barnyard-chaos .traveler[data-item="dog"] { animation: dog-chase 2.5s 1.1s ease-in-out both; }
.disaster-barnyard-chaos .traveler[data-item="chicken"] { animation: chicken-flee 2.5s 1.1s ease-in-out both; }
.disaster-barnyard-chaos .traveler[data-item="feed"] { animation: feed-pecked 1.1s 1.7s ease-in-out both; }
.disaster-barnyard-chaos .grain { animation-delay: calc(2s + var(--i) * 18ms); }
.disaster-barnyard-chaos .dust-cloud { animation-delay: 3.2s; }
.disaster-barnyard-chaos .branch-chicken { animation-delay: 5s; }

/* Overloaded boat */
.disaster-overloaded .boat { z-index: 14; animation: overloaded-boat 5.25s .35s ease-in-out both; }
.disaster-overloaded .boat .traveler[data-item="farmer"] { animation: worried-farmer 1.1s .15s ease-in-out 2, grab-hat .8s 3.25s ease-in-out both; }
.disaster-overloaded .boat .traveler[data-item="dog"] { animation: panicked-passenger .4s 3.2s ease-in-out 3; }
.disaster-overloaded .boat .traveler[data-item="chicken"] { animation: panicked-passenger .28s 3.15s ease-in-out 5; }
.water-trickle { position: absolute; z-index: 16; left: calc(38% + var(--i) * 5%); top: 61%; font-size: 1.2rem; opacity: 0; animation: water-over-edge .9s calc(2.1s + var(--i) * 80ms) ease-in both; }
.splash { position: absolute; z-index: 16; left: calc(32% + var(--i) * 5%); top: 53%; font-size: 2.7rem; opacity: 0; animation: giant-splash 1.15s calc(4.2s + var(--i) * 45ms) ease-out both; }
.bubble { position: absolute; z-index: 16; left: calc(37% + var(--i) * 3%); bottom: 22%; color: #effbff; font-size: calc(1rem + var(--i) * .08rem); opacity: 0; animation: rising-bubble 1.3s calc(4.65s + var(--i) * 80ms) ease-out both; }
.life-ring { position: absolute; z-index: 17; top: 58%; font-size: 2.1rem; white-space: nowrap; opacity: 0; animation: safe-pop-up .8s 5.15s cubic-bezier(.2,.8,.3,1.35) both, floaty 1.3s 5.9s ease-in-out infinite alternate; }
.ring-farmer { left: 35%; }
.ring-dog { left: 48%; }
.ring-chicken { left: 59%; }
.floating-feed { position: absolute; z-index: 17; left: 68%; top: 64%; font-size: 2.6rem; opacity: 0; animation: safe-pop-up .7s 5.3s ease-out both, floaty 1.4s 6s ease-in-out infinite alternate; }

/* Unattended boat and waterfall */
.disaster-drifting-boat .boat { z-index: 14; }
.disaster-drifting-boat .boat.from-left { animation: drift-from-left 5.45s .2s cubic-bezier(.42,.05,.75,.7) both; }
.disaster-drifting-boat .boat.from-right { animation: drift-from-right 5.45s .2s cubic-bezier(.42,.05,.75,.7) both; }
.disaster-drifting-boat .boat .traveler { animation: confused-passenger .65s 1.25s ease-in-out 4; }
.warning-sign { position: absolute; z-index: 17; top: 16%; left: 50%; padding: 10px 13px; color: #fff; background: #c63026; border: 4px solid #fff; border-radius: 7px; font-size: clamp(.75rem, 2.4vw, 1.05rem); font-weight: 1000; letter-spacing: .04em; opacity: 0; transform: translateX(-50%) scale(.2) rotate(-8deg); animation: warning-arrives .75s 3.35s cubic-bezier(.2,.8,.3,1.4) both; }
.waterfall { position: absolute; z-index: 13; right: 18%; top: 44%; width: 20%; height: 0; background: linear-gradient(90deg, #fff8, #6bc5ef 35%, #e9fbff 58%, #55a9d7); border-radius: 8px 8px 50% 50%; opacity: 0; animation: waterfall-opens 1.1s 3.65s ease-out both; }
.waterfall-splash { left: calc(60% + var(--i) * 3%); top: 72%; animation-delay: calc(5.15s + var(--i) * 45ms); }
.downstream-ring { right: 7%; top: 76%; animation-delay: 5.9s; }
.downstream-dog { right: 5%; }
.downstream-chicken { right: 19%; }
.downstream-feed { left: auto; right: 32%; animation-delay: 5.9s; }

/* Victory */
.victory-celebration .boat-items { opacity: 0; }
.victory-cast { position: absolute; z-index: 17; right: 10%; bottom: 16%; font-size: 3.25rem; filter: drop-shadow(0 3px 1px #0003); opacity: 0; }
.cast-farmer { right: 19%; animation: victory-bounce .75s .1s ease-out both; }
.cast-dog { right: 11%; animation: dog-jump .7s .45s ease-in-out 2 both; }
.cast-chicken { right: 28%; animation: chicken-triumph .32s .35s ease-in-out 5 both; }
.cast-feed { right: 4%; animation: victory-bounce .65s .75s ease-out both; }
.flying-hat { position: absolute; z-index: 18; right: 20%; bottom: 31%; font-size: 2.2rem; opacity: 0; animation: hat-toss 1.35s .2s ease-out both; }
.confetti-piece { position: absolute; z-index: 19; top: -14px; left: calc(2% + var(--i) * 2.25%); width: 8px; height: 14px; background: var(--confetti); animation: ferry-confetti 1.7s calc(var(--i) * 19ms) linear both; }

.failure-note { color: var(--color-muted); font-size: .9rem; }

.crossing-actions { display: flex; justify-content: center; margin: 14px 0 2px; }
.cross-button { min-width: min(360px, 100%); min-height: 54px; padding: 11px 24px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: #fff; background: #315b35; border: 2px solid #24462a; border-radius: 12px; font-size: 1.08rem; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #203c24; }
.cross-arrow { min-width: 1.15em; font-size: 1.45em; line-height: .7; }
.cross-button:hover:not(:disabled) { background: #3e7044; }
.cross-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #203c24; }

.hint-panel { margin-top: 18px; padding: 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff8ed; }
.hint-panel h3, .hint-panel p { margin: 0; }
.hint-panel p { margin-top: 3px; color: var(--color-muted); font-size: .88rem; }
.hint-list { grid-column: 1 / -1; margin: 3px 0 0; padding-left: 24px; }
.hint-list li + li { margin-top: 5px; }
.rules-card { margin-top: 14px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
.rules-card summary { padding: 13px 15px; font-weight: 800; cursor: pointer; }
.rules-content { padding: 0 16px 10px; line-height: 1.5; }
.rules-content p:first-child { margin-top: 0; }

.result-overlay[hidden] { display: none; }
.result-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: #25160ea8; }
.result-card { width: min(450px, 100%); padding: 28px; text-align: center; background: var(--color-surface); border: 3px solid var(--color-accent); border-radius: 18px; box-shadow: 0 18px 60px #0006; }
.result-kicker { margin: 0; color: var(--color-brand); font-size: .8rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.result-card h2 { margin: 8px 0; }
.result-card p:not(.result-kicker) { line-height: 1.5; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.result-card .primary-action { color: #fff; background: #315b35; border-color: #315b35; }
.result-card .primary-action:hover { background: #3e7044; }
.victory-card { border-color: #5d9a50; }

@keyframes water-flow { to { background-position: 220px 8px; } }
@keyframes row-oar { to { transform: rotate(58deg); } }
@keyframes farmer-row { from { transform: translateX(-2px) rotate(-5deg); } to { transform: translateX(3px) rotate(7deg); } }
@keyframes cloud-drift { from { transform: translateX(-140px); } to { transform: translateX(760px); } }
@keyframes leaf-drift { from { transform: translate3d(-25px,-30px,0) rotate(0); } to { transform: translate3d(95px,430px,0) rotate(620deg); } }
@keyframes farmer-idle { 0%,42%,55%,100% { transform: rotate(0) translateY(0); } 47% { transform: rotate(-7deg) translateY(-2px); } 51% { transform: rotate(5deg); } }
@keyframes dog-idle { 0%,65%,100% { transform: rotate(0); } 72% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
@keyframes chicken-idle { 0%,72%,100% { transform: rotate(0) translateY(0); } 77% { transform: rotate(14deg) translateY(5px); } 83% { transform: rotate(0); } 89% { transform: rotate(14deg) translateY(5px); } }
@keyframes feed-idle { 0%,80%,100% { transform: rotate(0); } 86% { transform: rotate(-4deg); } 92% { transform: rotate(4deg); } }
@keyframes moved-squash { 0% { transform: scale(.72,1.2); } 55% { transform: scale(1.12,.88); } 100% { transform: scale(1); } }
@keyframes chicken-tip-toe { 0% { transform: translate(0) rotate(0); } 30% { transform: translate(18px,-5px) rotate(-7deg); } 60% { transform: translate(37px,1px) rotate(7deg); } 100% { transform: translate(58px,22px) rotate(-5deg); } }
@keyframes chicken-look-around { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-13deg) scaleX(.94); } 70% { transform: rotate(13deg) scaleX(1.05); } }
@keyframes chicken-gobble { 0%,100% { transform: translate(58px,22px) rotate(-12deg) scaleY(.92); } 50% { transform: translate(58px,29px) rotate(14deg) scaleY(1.08); } }
@keyframes chicken-innocent { to { transform: translate(42px,5px) rotate(0); } }
@keyframes chicken-tip-toe-left { 0% { transform: translate(0) rotate(0); } 30% { transform: translate(-18px,-5px) rotate(7deg); } 60% { transform: translate(-37px,1px) rotate(-7deg); } 100% { transform: translate(-58px,22px) rotate(5deg); } }
@keyframes chicken-gobble-left { 0%,100% { transform: translate(-58px,22px) rotate(12deg) scaleY(.92); } 50% { transform: translate(-58px,29px) rotate(-14deg) scaleY(1.08); } }
@keyframes chicken-innocent-left { to { transform: translate(-42px,5px) rotate(0); } }
@keyframes chicken-belly { from { transform: scale(1); } 70% { transform: scale(1.52,1.35); } to { transform: scale(1.35); } }
@keyframes feed-pecked { 0% { transform: rotate(0); } 18%,54% { transform: rotate(-9deg); } 36%,72% { transform: rotate(9deg); } 100% { transform: rotate(0) scale(.82); filter: grayscale(.3); } }
@keyframes grain-spray { 0% { opacity: 0; transform: translate(0) scale(.2); } 28% { opacity: 1; } 100% { opacity: .9; transform: translate(calc((var(--i) - 10) * 5px), calc(45px + var(--i) * 2px)) scale(1); } }
@keyframes comic-pop { 0% { opacity: 0; transform: scale(.1) rotate(-18deg); } 70% { opacity: 1; transform: scale(1.18) rotate(5deg); } 100% { opacity: 1; transform: scale(1); } }
@keyframes bubble-pop { 0% { opacity: 0; transform: translateY(15px) scale(.2); } 65% { opacity: 1; transform: translateY(-8px) scale(1.12); } 100% { opacity: 1; transform: translateY(-14px); } }
@keyframes dog-notices { 0% { transform: rotate(0); } 45% { transform: rotate(-12deg) scale(1.05); } 100% { transform: rotate(9deg) scale(1.08); } }
@keyframes chicken-freeze { to { transform: scale(1.08); filter: drop-shadow(0 0 5px #fff); } }
@keyframes dog-chase { 0% { transform: translate(0); } 25% { transform: translate(45px,-20px) rotate(8deg); } 55% { transform: translate(85px,34px) rotate(-8deg); } 100% { transform: translate(105px,115px) scale(.65); opacity: 0; } }
@keyframes chicken-flee { 0% { transform: translate(0); } 20% { transform: translate(38px,-35px) rotate(-12deg); } 55% { transform: translate(90px,15px) rotate(13deg); } 100% { transform: translate(115px,120px) scale(.6); opacity: 0; } }
@keyframes dog-chase-left { 0% { transform: translate(0); } 25% { transform: translate(-45px,-20px) rotate(-8deg); } 55% { transform: translate(-85px,34px) rotate(8deg); } 100% { transform: translate(-105px,115px) scale(.65); opacity: 0; } }
@keyframes chicken-flee-left { 0% { transform: translate(0); } 20% { transform: translate(-38px,-35px) rotate(12deg); } 55% { transform: translate(-90px,15px) rotate(-13deg); } 100% { transform: translate(-115px,120px) scale(.6); opacity: 0; } }
@keyframes motion-mark { 0% { opacity: 0; transform: translateX(-20px); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateX(95px); } }
@keyframes dust-eruption { 0% { opacity: 0; transform: scale(.15) rotate(-8deg); } 45% { opacity: 1; transform: scale(1.18) rotate(7deg); } 75% { transform: scale(.93) rotate(-4deg); } 100% { opacity: 1; transform: scale(1); } }
@keyframes branch-escape { 0% { opacity: 0; transform: translateY(75px) rotate(-20deg); } 70% { opacity: 1; transform: translateY(-10px) rotate(9deg); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes worried-farmer { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(8deg) translateY(-3px); } }
@keyframes grab-hat { 50% { transform: translateY(-9px) rotate(-12deg); } 100% { transform: translateY(4px) rotate(9deg); } }
@keyframes panicked-passenger { 0%,100% { transform: translateX(-2px) rotate(-6deg); } 50% { transform: translateX(2px) rotate(6deg); } }
@keyframes water-over-edge { 0% { opacity: 0; transform: translateY(-8px) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(45px) scale(1); } }
@keyframes overloaded-boat { 0% { transform: translateY(0) rotate(0); } 18% { transform: translateY(12px) rotate(-2deg); } 34% { transform: translateY(18px) rotate(3deg); } 48% { transform: translateY(22px) rotate(-5deg); } 61% { transform: translateY(28px) rotate(7deg); } 74% { transform: translateY(33px) rotate(-10deg); } 84% { transform: translateY(52px) rotate(8deg); opacity: 1; } 100% { transform: translateY(175px) rotate(-13deg); opacity: 0; } }
@keyframes giant-splash { 0% { opacity: 0; transform: translateY(35px) scale(.25); } 55% { opacity: 1; transform: translateY(-32px) scale(1.25); } 100% { opacity: 0; transform: translateY(10px) scale(.8); } }
@keyframes rising-bubble { 0% { opacity: 0; transform: translateY(35px) scale(.4); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(-65px) scale(1.2); } }
@keyframes safe-pop-up { 0% { opacity: 0; transform: translateY(70px) scale(.4); } 75% { opacity: 1; transform: translateY(-12px) scale(1.08); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes floaty { to { transform: translateY(7px) rotate(4deg); } }
@keyframes confused-passenger { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg) translateY(-3px); } }
@keyframes drift-from-left { 0% { transform: translate(0) rotate(0); } 20% { transform: translate(70px,-12px) rotate(16deg); } 42% { transform: translate(145px,8px) rotate(130deg); } 63% { transform: translate(225px,20px) rotate(310deg); } 82% { transform: translate(310px,68px) rotate(365deg) scale(.8); opacity: 1; } 100% { transform: translate(390px,250px) rotate(410deg) scale(.45); opacity: 0; } }
@keyframes drift-from-right { 0% { transform: translate(0) rotate(0); } 20% { transform: translate(-70px,-12px) rotate(-16deg); } 42% { transform: translate(-145px,8px) rotate(-130deg); } 63% { transform: translate(-190px,20px) rotate(-310deg); } 82% { transform: translate(-220px,68px) rotate(-365deg) scale(.8); opacity: 1; } 100% { transform: translate(-260px,250px) rotate(-410deg) scale(.45); opacity: 0; } }
@keyframes warning-arrives { 0% { opacity: 0; transform: translateX(-50%) scale(.2) rotate(-8deg); } 70% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(4deg); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes waterfall-opens { 0% { opacity: 0; height: 0; } 100% { opacity: .95; height: 58%; } }
@keyframes victory-bounce { 0% { opacity: 0; transform: translateY(70px) scale(.5); } 70% { opacity: 1; transform: translateY(-15px) scale(1.1); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes dog-jump { 0%,100% { opacity: 1; transform: translateY(0) rotate(-4deg); } 50% { opacity: 1; transform: translateY(-42px) rotate(8deg); } }
@keyframes chicken-triumph { 0%,100% { opacity: 1; transform: rotate(-13deg) scaleX(.92); } 50% { opacity: 1; transform: rotate(13deg) scaleX(1.12); } }
@keyframes hat-toss { 0% { opacity: 0; transform: translate(0,30px) rotate(0); } 25% { opacity: 1; } 70% { opacity: 1; transform: translate(-45px,-115px) rotate(410deg); } 100% { opacity: 1; transform: translate(-75px,-30px) rotate(650deg); } }
@keyframes ferry-confetti { 0% { transform: translateY(-20px) rotate(0); } 100% { transform: translateY(420px) translateX(calc((var(--i) - 20) * 1px)) rotate(720deg); } }

@media (max-width: 720px) {
    .ferry-card { width: calc(100% - 12px); margin-top: 8px; padding: 13px 7px; }
    .game-heading, .game-stats, .game-status, .selection-help { margin-inline: 5px; }
    .game-heading { align-items: flex-start; }
    .game-toolbar { flex-direction: column; align-items: stretch; }
    .game-toolbar button { min-height: 40px; padding: 7px 9px; font-size: .76rem; }
    .game-heading h2 { font-size: 1.2rem; }
    .game-heading p { font-size: .86rem; }
    .river-scene { min-height: 350px; grid-template-columns: 28% 44% 28%; }
    .bank { padding-inline: 4px; }
    .bank-items { grid-template-columns: 1fr; gap: 5px; }
    .bank-sign { padding: 5px 6px; font-size: .62rem; }
    .traveler { min-height: 61px; padding: 3px 1px; }
    .traveler-picture { font-size: 2.15rem; }
    .traveler-name { font-size: .67rem; }
    .boat { bottom: 46px; width: 96%; max-width: 175px; padding-inline: 7px; }
    .boat.at-right, .boat.to-right { left: calc(96% - min(175px, 96%)); }
    .boat-items .traveler { width: 31px; flex-basis: 31px; }
    .boat-items .traveler-picture { font-size: 1.5rem; }
    .boat-items .traveler-name { display: none; }
    .hint-panel { grid-template-columns: 1fr; }
    .hint-panel button { width: 100%; }
    .hint-list { grid-column: 1; }
}

@media (max-width: 390px) {
    .ferry-header-inner { padding: 10px 12px 13px; }
    .ferry-page-header h1 { font-size: 1.6rem; }
    .game-stats { justify-content: space-between; gap: 8px; font-size: .84rem; }
    .river-scene { min-height: 330px; }
    .boat { max-width: 160px; }
    .boat.at-right, .boat.to-right { left: calc(96% - min(160px, 96%)); }
}

.orientation-gate { display: none; }
.orientation-gate-card { width: min(360px, calc(100% - 40px)); padding: 28px 24px; color: #253b25; background: #fffaf0; border: 3px solid #527c3d; border-radius: 18px; box-shadow: 0 18px 60px #1d321f55; text-align: center; }
.orientation-gate-icon { display: block; margin-bottom: 9px; color: #315b35; font-size: 4rem; line-height: 1; }
.orientation-gate h2 { margin: 0 0 8px; font-size: 1.6rem; }
.orientation-gate p { margin: 0; font-weight: 700; line-height: 1.45; }
.orientation-return { min-height: 44px; margin-top: 20px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #315b35; border: 2px solid #24462a; border-radius: 10px; font-weight: 900; text-decoration: none; box-shadow: 0 3px 0 #203c24; }
.orientation-return:hover, .orientation-return:focus-visible { color: #fff; background: #3e7044; outline: 3px solid #f0b32f; outline-offset: 3px; }

@media (max-width: 900px) and (orientation: portrait) {
    body { overflow: hidden; }
    .orientation-gate { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #e6f3d8, #c9e7f4); }
}

@media (max-height: 600px) and (orientation: landscape) and (pointer: coarse) {
    html, body { height: 100%; overflow: hidden; }
    body.site-frame { padding-top: 0 !important; }
    #site-header, #site-footer, .ferry-page-header, .hint-panel, .rules-card,
    .selection-help, .game-heading > div:first-child, .print-puzzle-link { display: none !important; }
    .ferry-main { width: 100%; max-width: none; height: 100dvh; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
    .ferry-card { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 5px 7px; display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; }
    .game-heading { flex: 0 0 auto; justify-content: center; gap: 0; }
    .game-toolbar { width: 100%; flex-direction: row; align-items: center; justify-content: center; gap: 6px; }
    .game-heading button { min-height: 34px; padding: 5px 10px; font-size: .72rem; }
    .game-stats { flex: 0 0 auto; justify-content: center; gap: 22px; margin: 3px 6px 0; font-size: .74rem; line-height: 1; }
    .game-status { flex: 0 0 auto; min-height: 1.2em; margin: 3px 6px; font-size: .76rem; line-height: 1.15; text-align: center; }
    .river-scene { width: 100%; height: auto; min-height: 0; flex: 1 1 auto; grid-template-columns: 24% 52% 24%; border-radius: 10px; }
    .bank { padding: 6px 4px 8px; }
    .bank-sign { margin-bottom: 5px; padding: 3px 6px; font-size: .56rem; box-shadow: 0 3px 0 #4b2b17; }
    .bank-items { min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
    .traveler { min-height: 49px; padding: 2px 1px; }
    .traveler-picture { font-size: 1.85rem; }
    .traveler-name { margin-top: 1px; font-size: .58rem; }
    .boat { bottom: 30px; height: 88px; }
    .crossing-actions { flex: 0 0 auto; margin: 4px 0 2px; }
    .cross-button { min-height: 38px; padding: 5px 18px; font-size: .86rem; box-shadow: 0 2px 0 #203c24; }
}

@media (prefers-reduced-motion: reduce) {
    .water-lines, .in-transit .oar, .cloud, .drifting-leaf, .traveler, .traveler-picture,
    .effect-layer *, .disaster-overloaded .boat, .disaster-drifting-boat .boat { animation: none !important; }
    .boat { transition-duration: .2s; }
    .effect-layer .comic-burst, .effect-layer .dust-cloud, .effect-layer .warning-sign,
    .effect-layer .branch-chicken, .effect-layer .life-ring, .effect-layer .floating-feed,
    .effect-layer .victory-cast, .effect-layer .flying-hat { opacity: 1; transform: none; }
    .effect-layer .warning-sign { transform: translateX(-50%); }
}
