/*
 * PR30 — title/header and scale-scene polish.
 * This sheet follows viewport-fit.css; all changes are presentational.
 * Do not zoom/transform #scene, #rooms-row, or the hand: those native
 * coordinates are used for real wicker basket interactions.
 */

/* The header mascot uses the EXACT sprite layers from the floor: fuzzy body,
 * two blinking eyes, tiny feet, breathing/wiggle and restrained home-sized hop.
 * No flat double-eye placeholder, external image or animation dependency. */
.brand-sprite-frame{
  display:block;position:relative;flex:none;width:37px;height:37px;
  overflow:hidden;border:1px solid #9d8052;border-radius:50%;
  background:radial-gradient(circle at 38% 26%,#485951,#172524 79%);
  box-shadow:inset 0 0 8px #080f0eb0,0 0 0 2px #b6975940
}
.brand-sprite-frame .brand-sprite-actor{
  position:absolute;left:5px;top:6px;width:46px;height:47px;
  transform:scale(.59);transform-origin:0 0;
  --hop-height:-6px;--hop-half:-3px;--hop-period:2600ms;
  --wiggle-period:2100ms;--blink-period:4900ms;
  --blink-delay:-800ms;--wiggle-left:-3deg;--wiggle-right:3deg
}
.brand-sprite-frame .sprite-body{left:2px;bottom:4px}
.brand-sprite-frame .sprite-motion{will-change:auto}
.brand-sprite-frame .sprite-ground-shadow{opacity:.4}
.site-brand .brand-sprite-frame{width:37px;height:37px}
.site-brand:hover .brand-sprite-frame,
.game-sprite-home:hover:not(:disabled) .brand-sprite-frame{
  border-color:#ebc98b;box-shadow:inset 0 0 9px #090d0c99,0 0 0 3px #dcb77765
}
.game-sprite-home{
  display:grid;place-items:center;flex:none;padding:2px;
  width:42px;height:42px;border:0;border-radius:50%;
  color:var(--paper);background:transparent;cursor:pointer
}
.game-sprite-home:disabled{opacity:.45;cursor:not-allowed}
.game-sprite-home:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.game-sprite-home:active:not(:disabled) .brand-sprite-frame{transform:scale(.95)}

/* A slim top bar and a ONE-LINE level rail immediately below it. The compact
 * stage indicator remains legible, but avoids an unnecessary three-line stack.
 * Use a wrapping fallback only where a real laptop cannot fit preview tools. */
.app-shell .topbar{
  min-height:0;padding:5px 3px;display:flex;align-items:center;
  justify-content:space-between;flex-wrap:nowrap;gap:10px
}
.app-shell .identity{display:flex;align-items:center;gap:7px;flex:none;min-width:0}
.app-shell .identity .eyebrow{display:none}
.app-shell .identity h1{
  font-size:clamp(1.08rem,1.43vw,1.33rem);font-weight:500;
  line-height:1.06;margin:0;white-space:nowrap
}
.app-shell .header-actions{
  display:flex;flex:0 1 auto;min-width:0;align-items:center;justify-content:flex-end;
  flex-wrap:wrap;gap:5px
}
.app-shell .top-icon{
  min-height:32px;padding:5px 9px;font-size:.72rem;line-height:1.15;
  border-radius:7px
}
.app-shell #campaign-hand-mode:not([hidden]){
  position:relative;display:flex;flex-direction:row;align-items:center;
  min-height:32px;padding:4px 9px;gap:5px;border-radius:7px
}
.app-shell #campaign-hand-mode strong{font-size:.84rem;line-height:1.15;white-space:nowrap}
.app-shell #campaign-hand-mode .eyebrow,
.app-shell #campaign-hand-mode small{
  /* Preserve the explanatory role=status text for screen readers. */
  position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
  white-space:nowrap;margin:-1px;padding:0;border:0
}
.app-shell .labelled-select{gap:3px;font-size:.59rem;letter-spacing:.025em}
.app-shell .labelled-select select{
  min-height:32px;min-width:118px;max-width:155px;padding:4px 7px;font-size:.74rem
}
.app-shell .chapter-strip{
  flex:0 0 auto;min-width:0;padding:3px 3px 4px;
  gap:10px;align-items:center;flex-wrap:nowrap
}
.app-shell .chapter-strip > div:first-child{
  display:flex;flex-wrap:wrap;align-items:baseline;min-width:0;gap:3px 9px
}
.app-shell .chapter-strip #chapter{font-size:.57rem;letter-spacing:.08em;white-space:nowrap}
.app-shell .chapter-strip #level-title{
  font-size:clamp(1.0rem,1.5vw,1.25rem);line-height:1.18;
  margin:0;font-weight:normal
}
.app-shell .chapter-strip .chapter-status{
  margin:0;line-height:1.2;font-size:.60rem;letter-spacing:.025em
}
body[data-workshop-chapter] .app-shell .chapter-strip{
  padding-bottom:4px;border-bottom:1px solid var(--chapter-accent)
}
.app-shell .step-dots{flex:none;gap:5px}
.app-shell .progress-dot{width:22px;height:7px}

/* Preserve stage, controls and focus when Windows display scaling leaves
 * 900–1100 CSS pixels of usable width. */
@media (max-width:1100px){
  .app-shell .topbar{gap:5px}
  .app-shell .identity h1{font-size:1.10rem}
  .app-shell .header-actions{gap:4px}
  .app-shell .top-icon{padding:5px 7px;font-size:.69rem}
  .app-shell #campaign-hand-mode:not([hidden]){padding:4px 6px}
  .app-shell .chapter-strip{gap:5px}
  .app-shell .chapter-strip #level-title{font-size:1.01rem}
}
@media (min-width:900px) and (min-height:500px){
  .app-shell .topbar{padding:2px 2px 3px}
  .app-shell .chapter-strip{padding:1px 2px 2px}
  body[data-workshop-chapter] .app-shell .chapter-strip{padding-bottom:2px}
  .app-shell .game-sprite-home{width:37px;height:37px;padding:1px}
  .app-shell .game-sprite-home .brand-sprite-frame{width:34px;height:34px}
  .app-shell .game-sprite-home .brand-sprite-actor{left:4px;top:4px}
}
@media (min-width:900px) and (min-height:500px) and (max-height:649px){
  .app-shell .topbar{padding:1px 2px 2px}
  .app-shell .game-sprite-home{height:34px;width:34px}
  .app-shell .game-sprite-home .brand-sprite-frame{width:31px;height:31px}
  .app-shell .game-sprite-home .brand-sprite-actor{transform:scale(.5);top:5px}
  .app-shell .chapter-strip{padding:1px 2px}
  body[data-workshop-chapter] .app-shell .chapter-strip{padding-bottom:1px}
  .app-shell .chapter-strip #level-title{font-size:.98rem}
  .app-shell .top-icon{min-height:29px;padding:3px 6px;font-size:.67rem}
  .app-shell #campaign-hand-mode:not([hidden]){min-height:29px}
}
@media (max-width:899px){
  .app-shell .topbar{display:flex;flex-wrap:wrap;align-items:center;padding:8px 2px}
  .app-shell .header-actions{flex:1 1 100%;justify-content:flex-start;gap:6px}
  .app-shell .identity h1{font-size:1.18rem}
  .app-shell .chapter-strip{padding:6px 3px}
}
@media (max-width:600px){
  .app-shell .header-actions{
    display:grid;width:100%;grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;justify-content:stretch
  }
  .app-shell .top-icon{min-height:44px}
  .app-shell #campaign-hand-mode:not([hidden]){
    grid-column:1/span 2;min-height:44px;justify-content:center
  }
  .app-shell .header-actions .labelled-select:not(.legacy-controls){
    grid-column:1/span 2
  }
  .app-shell .header-actions .labelled-select select{min-height:44px}
  .app-shell .header-actions #motion-toggle{grid-column:3;min-height:44px}
  .app-shell .chapter-strip{flex-wrap:wrap;gap:5px}
  .app-shell .chapter-strip #level-title{font-size:1.04rem}
  .app-shell .game-sprite-home{width:43px;height:43px}
  .app-shell .game-sprite-home .brand-sprite-frame{width:38px;height:38px}
}

/* The decorative second arch/roof was not attached to a chamber. Removing it
 * from HTML must not move pans or beam: maintain only its previous *spacing*
 * inside the chamber. Crucially, no transform or coordinate-system changes. */
.playfield .chamber{padding-top:30px}
@media (max-width:800px){.playfield .chamber{padding-top:20px}}
@media (max-width:600px){.playfield .chamber{padding-top:15px}}
@media (min-width:900px) and (min-height:500px) and (max-height:649px){
  .playfield .chamber{padding-top:19px}
}

/* Quiet, uncluttered room silhouettes. Remove the redundant lab-name banner
 * and gold strip across the scene, keep the window/moon well behind the scale. */
.playfield::before{content:none!important}
.playfield .ambient-window{opacity:.50;overflow:hidden}
.playfield .ambient-window .moon{
  left:50%;top:37px;width:42px;height:42px;transform:translateX(-50%);
  opacity:.28;box-shadow:0 0 34px 7px rgba(235,222,174,.13)
}
.playfield .shelf{opacity:.25}
.playfield .room-interior:before{border-color:rgba(210,184,131,.13)}
.playfield .room-arch{border-color:rgba(205,191,140,.10)}
.playfield .room-window{opacity:.56}

/* Unbalanced/awaiting explanation remains available to assistive technology,
 * but never floats across or competes with a scene full of actual objects. */
.scene-status-visually-hidden{
  position:absolute!important;left:0!important;top:0!important;
  width:1px!important;height:1px!important;padding:0!important;
  margin:-1px!important;border:0!important;overflow:hidden!important;
  clip-path:inset(50%)!important;white-space:nowrap!important
}

/* Hover and focus are intentional: clicking this actual sprite goes home.
 * The icon's own subtle animation respects the existing reduced-motion toggle. */
.reduce-motion .brand-sprite-frame .sprite-motion,
.reduce-motion .brand-sprite-frame .sprite-body,
.reduce-motion .brand-sprite-frame .sprite-eyes i,
.reduce-motion .brand-sprite-frame .sprite-ground-shadow{animation:none!important}
