/* Camp actors own their art's motion; their names, focus rings and hit areas stay put. */
body.game-mode .camp-atmosphere-host{overflow:hidden}
body.game-mode .camp-atmosphere{position:absolute;pointer-events:none;image-rendering:pixelated}
body.game-mode .camp-screen--living{
 --camp-art-size:clamp(88px,9vw,132px);
 position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
 grid-template-rows:minmax(0,1fr) auto;gap:18px 20px;width:100%;height:100%;min-height:0;
 padding:76px 26px 24px;overflow:visible;
}
body.game-mode .camp-screen--living .camp-clearing{
 position:relative;grid-column:1/-1;grid-row:1;min-width:0;min-height:0;isolation:isolate;
}
body.game-mode .camp-screen--living .camp-sign{
 display:block;position:absolute;inset:8% auto auto 50%;transform:translateX(-50%);
 padding:7px 18px;font:600 24px/1.2 Pixelify,monospace;white-space:nowrap;z-index:2;
}
body.game-mode .camp-screen--living .camp-companions{
 position:absolute;inset:21% 9% 18%;width:auto;max-width:920px;height:auto;min-height:0;margin-inline:auto;transform:none;
 display:grid;grid-template-columns:repeat(min(3,var(--camp-columns)),minmax(0,1fr));grid-template-rows:minmax(0,1fr);
 align-items:end;justify-content:center;gap:18px clamp(18px,4vw,58px);pointer-events:auto;z-index:3;
}
body.game-mode .camp-screen--living:is([data-camp-count="4"],[data-camp-count="5"],[data-camp-count="6"]) .camp-companions{grid-template-rows:repeat(2,minmax(0,1fr))}
body.game-mode .camp-screen--living .camp-companions .camp-companion{
 position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
 width:100%;min-width:44px;max-width:190px;height:100%;min-height:44px;margin:0 auto;padding:4px 2px;
 gap:7px;background:none;border:0;border-radius:3px;box-shadow:none;transform:none;overflow:visible;
}
/* A small fixed offset gives the two ranks depth without moving hit targets during idle. */
@media(min-width:701px) and (min-height:601px){
 body.game-mode .camp-screen--living:is([data-camp-count="4"],[data-camp-count="5"],[data-camp-count="6"]) .camp-companions .camp-companion:nth-child(-n+3){left:-16px}
 body.game-mode .camp-screen--living:is([data-camp-count="4"],[data-camp-count="5"],[data-camp-count="6"]) .camp-companions .camp-companion:nth-child(n+4){left:16px}
}
body.game-mode .camp-screen--living .camp-companion:hover{background:linear-gradient(0deg,#b8f1c019,transparent 70%)}
body.game-mode .camp-screen--living .camp-companion:focus-visible{outline:3px solid #ffe09b;outline-offset:2px;background:linear-gradient(0deg,#fff4b427,transparent 80%)}
body.game-mode .camp-screen--living .camp-companion__art{
 display:block;position:relative;flex:none;width:100%;height:var(--camp-art-size);max-height:calc(100% - 52px);min-height:32px;
}
body.game-mode .camp-screen--living .camp-companion__idle{
 position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;transform-origin:50% 94%;
 animation:camp-idle-breathe var(--camp-idle-duration) steps(12,end) var(--camp-idle-delay) infinite;
}
body.game-mode .camp-screen--living .camp-companion[data-camp-idle=sway] .camp-companion__idle{animation-name:camp-idle-sway}
body.game-mode .camp-screen--living .camp-companion[data-camp-idle=hop] .camp-companion__idle{animation-name:camp-idle-hop;animation-duration:calc(var(--camp-idle-duration) + 2s)}
body.game-mode .camp-screen--living .camp-companions .camp-companion .sprite{
 display:block;width:100%;height:100%;max-width:var(--camp-art-size);max-height:100%;min-height:0;margin:0;
 object-fit:contain;object-position:center bottom;image-rendering:pixelated;animation:none;transform:none;
}
body.game-mode .camp-screen--living .camp-companions .camp-ground{
 display:block;position:absolute;left:22%;right:22%;bottom:0;width:auto;height:10%;min-height:5px;max-height:17px;
 border-radius:50%;background:#173e3a69;box-shadow:0 3px 0 #234e3a24;filter:blur(1px);transform:none;z-index:-1;
}
body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name{
 display:flex;flex:none;flex-direction:column;justify-content:center;align-items:center;gap:2px;max-width:100%;width:max-content;min-height:40px;
 box-sizing:border-box;min-width:0;
 padding:4px 9px;border:1px solid #9bc9a880;background:#233e43d9;color:#fff3d7;
 font:600 clamp(17px,1.5vw,23px)/1.08 Pixelify,monospace;text-align:center;white-space:normal;overflow-wrap:anywhere;
 box-shadow:0 2px #1639329c;pointer-events:none;
}
body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name>span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name small{display:block;margin:0;font:500 12px/1.15 var(--body);color:#d6e6d8}
body.game-mode .camp-screen--living .camp-companion__shiny{margin-left:4px;color:#ffe09b;font:600 13px/1 var(--body);font-style:normal}
body.game-mode .camp-screen--living .camp-companion__rest{position:absolute;right:18%;top:24%;color:#e2eaf3;text-shadow:2px 2px #23434d;font:600 22px/1 Pixelify,monospace;transform:rotate(-8deg)}
body.game-mode .camp-screen--living .camp-companion:not([data-camp-state=awake]) .camp-companion__idle{animation:none;transform:scaleY(.97)}

/* A small hearth and foreground tufts belong to the clearing, behind the party. */
body.game-mode .camp-screen--living .camp-hearth{position:absolute;left:50%;bottom:3%;width:56px;height:56px;transform:translateX(-50%);pointer-events:none;z-index:1;image-rendering:pixelated}
body.game-mode .camp-screen--living .camp-hearth__glow{position:absolute;left:-70px;right:-70px;bottom:-9px;height:67px;border-radius:50%;background:radial-gradient(ellipse,#ffd07e3d,transparent 68%);animation:camp-hearth-glow 4s steps(7,end) infinite}
body.game-mode .camp-screen--living .camp-hearth__logs{position:absolute;left:4px;right:4px;bottom:3px;height:11px;background:#694937;box-shadow:0 4px #294a3a,-5px -3px #496357,5px -3px #496357;transform:rotate(-7deg)}
body.game-mode .camp-screen--living .camp-hearth__logs:after{content:'';position:absolute;inset:2px 3px;background:#a67547;box-shadow:0 3px #49392e;transform:rotate(17deg)}
body.game-mode .camp-screen--living .camp-hearth__flame{position:absolute;left:15px;bottom:12px;width:28px;height:32px;background:#ffb45b;clip-path:polygon(50% 0,64% 30%,78% 18%,89% 53%,100% 75%,83% 100%,17% 100%,0 77%,13% 46%,28% 63%);transform-origin:50% 100%;animation:camp-hearth-flame 1.6s steps(4,end) infinite}
body.game-mode .camp-screen--living .camp-hearth__flame:after{content:'';position:absolute;inset:14px 8px 0;background:#ffe6a4;clip-path:polygon(50% 0,100% 78%,83% 100%,17% 100%,0 78%)}
body.game-mode .camp-screen--living .camp-hearth__spark{position:absolute;left:29px;bottom:38px;width:3px;height:3px;background:#ffe39a;animation:camp-hearth-spark 3.5s steps(10,end) infinite}
body.game-mode .camp-screen--living .camp-clearing__grass{position:absolute;bottom:2%;width:45px;height:24px;pointer-events:none;background:#477d52;clip-path:polygon(0 100%,7% 37%,24% 70%,32% 0,51% 65%,69% 15%,76% 78%,100% 48%,92% 100%);transform-origin:50% 100%;animation:camp-grass 5.3s steps(8,end) infinite;z-index:1}
body.game-mode .camp-screen--living .camp-clearing__grass--left{left:7%}
body.game-mode .camp-screen--living .camp-clearing__grass--right{right:7%;height:18px;animation-delay:-2.4s}

/* Both command windows stay in normal grid flow, outside the creature clearing. */
body.game-mode .camp-screen--living .camp-dialogue,
body.game-mode .camp-screen--living .camp-dialogue:has(+.camp-commands .camp-primary){
 position:relative;inset:auto;grid-column:1;grid-row:2;width:auto;height:auto;min-height:176px;max-height:none;
 display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:center;gap:5px 12px;padding:14px 18px;overflow:visible;z-index:6;
}
body.game-mode .camp-screen--living .camp-dialogue .dialogue-speaker{position:static;grid-column:1;grid-row:1;max-width:100%;overflow-wrap:anywhere;font:600 12px/1.25 var(--body)}
body.game-mode .camp-screen--living .camp-dialogue p{grid-column:1;grid-row:2;margin:0;font:600 clamp(23px,2vw,30px)/1.12 Pixelify,monospace}
body.game-mode .camp-screen--living .camp-dialogue .dialogue-subtext{grid-column:1/-1;grid-row:3;font:400 13px/1.4 var(--body)}
body.game-mode .camp-screen--living .camp-dialogue .camp-discoveries{position:static;grid-column:2;grid-row:1/3;align-self:center;min-height:44px;padding:7px 9px;font:600 12px/1.2 var(--body)}
body.game-mode .camp-screen--living .camp-commands,
body.game-mode .camp-screen--living .camp-commands:has(.camp-primary){
 position:relative;inset:auto;grid-column:2;grid-row:2;width:auto;height:auto;min-height:176px;
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:60px minmax(94px,auto);gap:6px;padding:8px;overflow:visible;z-index:7;
}
body.game-mode .camp-screen--living .camp-commands button{display:flex;align-items:center;justify-content:flex-start;min-width:44px;min-height:44px;height:auto;padding:8px 11px;gap:8px;white-space:normal}
body.game-mode .camp-screen--living .camp-commands button:not(.camp-primary){font:700 14px/1.25 var(--body)}
body.game-mode .camp-screen--living .camp-commands .camp-primary{grid-column:1/-1;min-height:60px;padding:6px 10px}
body.game-mode .camp-screen--living .camp-commands .camp-primary>.icon{display:block;width:21px;height:21px}
body.game-mode .camp-screen--living .camp-commands .camp-primary>b{display:block}
body.game-mode .camp-screen--living .camp-primary__text{display:block;min-width:0;flex:1}
body.game-mode .camp-screen--living .camp-commands .camp-primary strong{display:block;font:600 23px/1.1 Pixelify,monospace}
body.game-mode .camp-screen--living .camp-commands .camp-primary small{display:block;font:500 12px/1.3 var(--body);margin-top:3px}
body.game-mode .camp-screen--living .camp-secondary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(44px,auto);gap:6px;min-width:0}
body.game-mode .camp-screen--living .camp-secondary-actions button{background:linear-gradient(125deg,#2e5065,#30354c);border-color:#7bb6be;box-shadow:inset 0 2px #c7fff622,inset 0 -3px #142a40;color:#fff2d6}
body.game-mode .camp-screen--living .camp-secondary-actions>button:last-child:nth-child(odd){grid-column:1/-1}
body.game-mode .camp-screen--living .camp-secondary-actions button>span{display:block;flex:1;min-width:0;font:inherit;color:inherit}
body.game-mode .camp-screen--living .camp-secondary-actions .icon{flex:none;width:18px;height:18px}
body.game-mode .camp-screen--living .camp-care-label small{display:inline-block;margin-left:5px;padding:2px 4px;border:1px solid #9dba8299;color:#d9ebc0;font:700 9px/1 var(--body);letter-spacing:.5px}

@media(max-width:700px) and (min-height:501px){
 body.game-mode .camp-screen--living{--camp-art-size:clamp(50px,calc((100dvh - 490px)/2),104px);grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(174px,1fr) auto auto;gap:10px;padding:70px 12px 12px}
 body.game-mode .camp-screen--living .camp-clearing{grid-column:1;grid-row:1}
 body.game-mode .camp-screen--living .camp-sign{display:block;top:0;padding:4px 12px;font-size:18px}
 body.game-mode .camp-screen--living .camp-companions{inset:30px 0 18px;grid-template-columns:repeat(min(3,var(--camp-columns)),minmax(0,1fr));gap:3px 4px}
 body.game-mode .camp-screen--living:is([data-camp-count="4"],[data-camp-count="5"],[data-camp-count="6"]) .camp-companions{grid-template-rows:repeat(2,minmax(0,1fr))}
 body.game-mode .camp-screen--living .camp-companions .camp-companion,
 body.game-mode .camp-screen--living .camp-companions .camp-companion:nth-child(n){left:auto;padding:0 1px;gap:3px;max-width:240px}
 body.game-mode .camp-screen--living .camp-companion__art{height:var(--camp-art-size);max-height:calc(100% - 39px)}
 body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name{min-height:29px;padding:2px 4px;gap:0;font-size:16px;line-height:1.05}
 body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name small{font-size:12px;line-height:1.1}
 body.game-mode .camp-screen--living .camp-companion__shiny{font-size:10px;margin-left:2px}
 body.game-mode .camp-screen--living .camp-hearth{bottom:0;transform:translateX(-50%) scale(.5);transform-origin:50% 100%}
 body.game-mode .camp-screen--living .camp-clearing__grass{height:16px;width:30px;bottom:0}
 body.game-mode .camp-screen--living .camp-dialogue,
 body.game-mode .camp-screen--living .camp-dialogue:has(+.camp-commands .camp-primary){grid-column:1;grid-row:2;min-height:0;padding:12px 15px;gap:6px 9px}
 body.game-mode .camp-screen--living .camp-dialogue p{font-size:24px;line-height:1.1}
 body.game-mode .camp-screen--living .camp-dialogue .dialogue-subtext{font-size:13px;line-height:1.4}
 body.game-mode .camp-screen--living .camp-dialogue .dialogue-speaker{font-size:11px}
 body.game-mode .camp-screen--living .camp-dialogue .camp-discoveries{padding:5px 7px;font-size:11px}
 body.game-mode .camp-screen--living .camp-commands,
 body.game-mode .camp-screen--living .camp-commands:has(.camp-primary){grid-column:1;grid-row:3;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:68px minmax(93px,auto);gap:5px;padding:6px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary{min-height:68px;padding:7px 10px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary strong{font-size:22px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary small{margin-top:3px;font-size:12px}
 body.game-mode .camp-screen--living .camp-commands button:not(.camp-primary){font-size:13px;padding:5px 8px;gap:6px}
 body.game-mode .camp-screen--living .camp-secondary-actions{gap:5px}
}
@media(max-width:700px) and (min-height:501px) and (max-height:650px){
 body.game-mode .camp-screen--living{--camp-art-size:50px;gap:7px;padding:66px 10px 8px;grid-template-rows:minmax(174px,1fr) auto auto}
 body.game-mode .camp-screen--living .camp-sign{display:none}
 body.game-mode .camp-screen--living .camp-companions{top:0;bottom:8px}
 body.game-mode .camp-screen--living .camp-hearth{display:none}
 body.game-mode .camp-screen--living .camp-dialogue,
 body.game-mode .camp-screen--living .camp-dialogue:has(+.camp-commands .camp-primary){padding:5px 10px;gap:3px 6px}
 body.game-mode .camp-screen--living .camp-dialogue p{font-size:19px;line-height:1.05}
 body.game-mode .camp-screen--living .camp-dialogue .dialogue-subtext{font-size:12px;line-height:1.3}
 body.game-mode .camp-screen--living .camp-commands,
 body.game-mode .camp-screen--living .camp-commands:has(.camp-primary){grid-template-rows:68px minmax(93px,auto);gap:4px;padding:6px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary{min-height:68px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary strong{font-size:21px}
}

@media(max-height:500px) and (min-width:480px), (max-height:600px) and (min-width:701px){
 body.game-mode .camp-screen--living{--camp-art-size:72px;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);grid-template-rows:92px minmax(0,1fr);gap:7px 10px;padding:60px 10px 8px}
 body.game-mode .camp-screen--living .camp-clearing{grid-column:1;grid-row:2}
 body.game-mode .camp-screen--living .camp-sign{display:none}
 body.game-mode .camp-screen--living .camp-companions{inset:0;grid-template-columns:repeat(min(3,var(--camp-columns)),minmax(0,1fr));gap:2px 4px;align-items:stretch}
 body.game-mode .camp-screen--living:is([data-camp-count="4"],[data-camp-count="5"],[data-camp-count="6"]) .camp-companions{grid-template-rows:repeat(2,minmax(0,1fr));--camp-art-size:54px}
 body.game-mode .camp-screen--living .camp-companions .camp-companion,
 body.game-mode .camp-screen--living .camp-companions .camp-companion:nth-child(n){left:auto;padding:0;gap:2px;height:100%;max-width:190px}
 body.game-mode .camp-screen--living .camp-companion__art{height:var(--camp-art-size);max-height:calc(100% - 32px);min-height:16px}
 body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name{min-height:30px;height:30px;padding:1px 3px;gap:0;font-size:13px;line-height:1.05}
 body.game-mode .camp-screen--living .camp-companions .camp-companion .camp-companion__name small{font-size:11px;line-height:1.1}
 body.game-mode .camp-screen--living .camp-companion__shiny{font-size:9px;margin-left:2px}
 body.game-mode .camp-screen--living .camp-companion__rest{font-size:14px;top:8%}
 body.game-mode .camp-screen--living :is(.camp-hearth,.camp-clearing__grass){display:none}
 body.game-mode .camp-screen--living .camp-dialogue,
 body.game-mode .camp-screen--living .camp-dialogue:has(+.camp-commands .camp-primary){grid-column:1;grid-row:1;min-height:0;padding:7px 10px;gap:4px 6px;align-content:center;overflow:auto}
 body.game-mode .camp-screen--living .camp-dialogue :is(.dialogue-speaker,.dialogue-subtext){display:none}
 body.game-mode .camp-screen--living .camp-dialogue p{grid-row:1;font-size:20px;line-height:1.05}
 body.game-mode .camp-screen--living .camp-dialogue .camp-discoveries{grid-row:1;font-size:10px;padding:4px 5px;min-height:44px}
 body.game-mode .camp-screen--living .camp-commands,
 body.game-mode .camp-screen--living .camp-commands:has(.camp-primary){grid-column:2;grid-row:1/3;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(78px,1fr) minmax(93px,auto);gap:5px;padding:6px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary{grid-column:1;min-height:78px;padding:5px 7px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary>.icon,
 body.game-mode .camp-screen--living .camp-commands .camp-primary>b{display:none}
 body.game-mode .camp-screen--living .camp-commands .camp-primary strong{font-size:21px}
 body.game-mode .camp-screen--living .camp-commands .camp-primary small{font-size:12px;line-height:1.25;margin-top:3px}
 body.game-mode .camp-screen--living .camp-commands button:not(.camp-primary){font-size:12px;padding:4px 5px;gap:5px}
 body.game-mode .camp-screen--living .camp-secondary-actions{gap:5px}
 body.game-mode .camp-screen--living .camp-secondary-actions .icon{width:16px;height:16px}
 body.game-mode .camp-screen--living .camp-care-label small{display:block;width:max-content;margin:2px 0 0;padding:1px 3px;font-size:8px}
}

@media(max-width:600px) and (max-height:500px){
 body.game-mode .camp-screen--living .camp-secondary-actions .icon{display:none}
}

@keyframes camp-idle-breathe{0%,100%{transform:scale(1,1)}50%{transform:translateY(-1px) scale(1.012,1.025)}}
@keyframes camp-idle-sway{0%,100%{transform:rotate(-.8deg)}50%{transform:translateX(1px) rotate(.8deg)}}
@keyframes camp-idle-hop{0%,58%,76%,100%{transform:translateY(0)}64%{transform:translateY(1px) scale(1.015,.98)}68%{transform:translateY(-4px) scale(.99,1.015)}73%{transform:translateY(0) scale(1.015,.985)}}
@keyframes camp-hearth-glow{0%,100%{opacity:.65;transform:scaleX(.95)}50%{opacity:1;transform:scaleX(1.08)}}
@keyframes camp-hearth-flame{0%,100%{transform:scale(1,.95)}35%{transform:scale(.92,1.05)}70%{transform:scale(1.06,1)}}
@keyframes camp-hearth-spark{0%,30%{opacity:0;transform:translate(0,0)}35%{opacity:1}75%,100%{opacity:0;transform:translate(7px,-31px)}}
@keyframes camp-grass{0%,100%{transform:skewX(-3deg)}50%{transform:skewX(4deg)}}
body[data-camp-motion=paused] .camp-screen--living *,
body[data-camp-motion=paused] .camp-screen--living *:before,
body[data-camp-motion=paused] .camp-screen--living *:after{animation-play-state:paused!important}
.reduced-motion .camp-screen--living *{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){.camp-screen--living *{animation:none!important;transition:none!important}}
