/* Own camp is one continuous scene; friend camps keep their existing layout. */
#home-screen { background: #a8d7fa; }
#home-screen .statusbar, #home-screen .camp-nav { color: #192c3d; }
#home-screen .status-icons .icon { filter: brightness(0); }
#home-screen .camp-nav { flex-basis: 44px; }
#home-screen .camp-nav > strong { font-size: 19px; font-weight: 850; }
#home-screen .cp-home-tools { gap: 6px; }
#home-screen .cp-home-tools .icon-button { background: #ffffff54; width: 44px; }
#home-screen .cp-home-tools .icon { filter: brightness(0); width: 21px; height: 21px; }
#home-screen .home-scene { flex: 1 1 0; min-height: 0; container-type: size; background: #a8d7fa; --pet-ground: 75%; --pet-step: 2%; }
#home-screen .camp-background { object-position: center top; }
#home-screen .home-header { position: absolute; z-index: 7; top: 2.5%; left: 6%; right: 6%; padding: 0; pointer-events: none; color: #203145; text-align: center; }
#home-screen #home-title { font-size: 11px; line-height: 16px; margin: 0 0 4px; color: #324354; overflow-wrap: anywhere; }
#home-screen .home-header h2 { font-size: 28px; line-height: 36px; margin: 0; font-weight: 850; }
#home-screen .home-motto { color: #34495b; font-size: 12px; line-height: 19px; margin-top: 4px; }
#home-screen #cp-home-status { flex: 0 0 auto; font-size: 11px; line-height: 17px; margin: 0; color: #723148; background: #fffffff0; padding: 4px 12px; overflow-wrap: anywhere; }
#home-screen #cp-home-status:empty { display: none; }
#home-screen .tabs { flex-shrink: 0; background: #15151c; margin-top: 0; }
#home-screen .home-object-amu { left: 10%; top: 74%; width: min(42%, 25cqh); height: auto; aspect-ratio: 1; }
#home-screen .home-object-amu::before { content: ''; position: absolute; left: 26%; bottom: 4%; width: 58%; height: 7%; border-radius: 50%; background: #26352255; filter: blur(3px); pointer-events: none; }
#home-screen .home-workout-art { filter: drop-shadow(1px 2px 1px #26352230); }
#home-screen .home-object-amu:focus-visible { outline: 2px solid #203145; outline-offset: 2px; }
#home-screen .cp-home-pet { left: 62%; top: 70%; width: min(28%, 19cqh); height: auto; aspect-ratio: 1; min-width: 68px; min-height: 68px; }
#home-screen #cp-pet-tag { bottom: -12px; background: none; color: #25332d; font-size: 11px; line-height: 16px; padding: 0; box-shadow: none; text-shadow: 0 1px 2px #fff, 0 0 5px #fffff5; }
#home-screen .cp-home-pet:is([data-living="yard"], [data-living="moving"])::before { content: ''; position: absolute; left: 15%; bottom: 2%; width: 72%; height: 9%; border-radius: 50%; background: #26352250; filter: blur(3px); pointer-events: none; }
#home-screen .cp-home-pet:focus-visible { outline: 2px solid #203145; outline-offset: 2px; border-radius: 6px; }

#home-screen .home-station { position: absolute; z-index: 4; background: none; padding: 0; width: min(36%, 25cqh); min-width: 76px; text-align: center; color: #202632; }
/* Reserve the recorder caption and an 8px gap before Amu's hit area. */
#home-screen .home-voice { left: 8%; top: min(56%, calc(74% - min(20.667cqw, 12.667cqh) - 46px)); width: min(31%, 19cqh); }
#home-screen .home-radio { right: 8%; top: 45%; width: min(29%, 16cqh); }
#home-screen .home-station-art { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; }
#home-screen .home-station-art::before { content: ''; position: absolute; left: 10%; bottom: 1%; width: 82%; height: 9%; border-radius: 50%; background: #26352266; filter: blur(2px); pointer-events: none; }
#home-screen .home-radio .home-station-art { aspect-ratio: 1; }
#home-screen .home-station-art img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(1px 2px 1px #26352228); }
#home-screen .home-voice .home-station-art { transform-origin: 50% 90%; animation: home-speaker-bounce 2.4s ease-in-out infinite; }
#home-screen .home-station-label { display: block; position: relative; margin: 4px auto 0; width: max-content; max-width: 100%; padding: 0; color: #25332d; text-shadow: 0 1px 2px #fff, 0 0 5px #fffff5; }
#home-screen .home-station-label strong { display: block; font-size: 13px; line-height: 18px; font-weight: 800; }
#home-screen .home-station-label small { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; line-height: 16px; color: #344238; white-space: nowrap; }
#home-screen .home-station-label .icon { width: 10px; height: 10px; filter: brightness(0); }
#home-screen .home-radio .home-station-label { min-width: 84px; max-width: calc(100% + 24px); left: 50%; transform: translateX(-50%); margin-left: 0; margin-right: 0; }
#home-screen .home-unread-badge { position: absolute; z-index: 3; right: 0; top: 0; min-width: 24px; height: 24px; padding: 0 5px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50px; background: #d62c4b; color: #fff; font-size: 12px; line-height: 20px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: 0 2px 3px #42233140; }
#home-screen .home-unread-badge[hidden] { display: none; }
#home-screen .home-unread-badge[data-state="unavailable"] { background: #5d6068; }
#home-screen .home-station:focus-visible { outline: 2px solid #203145; outline-offset: 5px; border-radius: 6px; }
#home-screen .home-station:active { transform: translateY(2px); }
#home-screen .home-meter { position: absolute; display: flex; justify-content: center; align-items: center; gap: 5%; left: 35%; top: 54%; width: 31%; height: 7%; transform: rotate(-1deg); }
#home-screen .home-meter i { width: 7%; height: 100%; background: #c5ff57; border-radius: 1px; transform: scaleY(.35); animation: home-meter-level 1.1s ease-in-out infinite alternate; }
#home-screen .home-meter i:nth-child(2n) { animation-delay: -.7s; }
#home-screen .home-meter i:nth-child(3n) { animation-delay: -.35s; }
#home-screen .home-meter i:nth-child(4n) { animation-delay: -.95s; }
#home-screen .home-radio .home-meter { left: 48%; top: 73%; width: 23%; height: 4%; transform: rotate(-4deg); }
#home-screen .home-radio .home-meter i { background: #ffb0d9; animation-duration: .9s; }
#home-screen .home-device-light { position: absolute; left: 82%; top: 22%; width: 3%; aspect-ratio: 1; border-radius: 50%; background: #fff0b5; box-shadow: 0 0 6px 2px #ff83c2ba; animation: home-device-pulse 2.8s ease-in-out infinite; }
#home-screen .home-radio .home-device-light { left: 60.2%; top: 64.4%; width: 2.5%; background: #ffefb0; box-shadow: 0 0 5px 2px #ff726ed9; animation-delay: -1.4s; }
#home-screen .home-scene[inert] * { animation-play-state: paused !important; }
@keyframes home-meter-level { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes home-device-pulse { 50% { opacity: .55; } }
@keyframes home-speaker-bounce { 0%, 70%, 100% { transform: none; } 78% { transform: scale(1.008, .984); } 86% { transform: scale(.996, 1.008); } }
/* The pet stays on the open right-hand floor, below the two devices. */
@keyframes cp-pet-roam {
  0%, 8%, 100% { left: 62%; top: var(--pet-ground); }
  28%, 36% { left: 67%; top: calc(var(--pet-ground) + var(--pet-step)); }
  55%, 64% { left: 58%; top: calc(var(--pet-ground) + var(--pet-step)); }
  74% { left: 55%; top: calc(var(--pet-ground) + var(--pet-step)); }
  84%, 90% { left: 58%; top: var(--pet-ground); }
}
@media (max-height: 700px) {
  body.export #home-screen .home-header h2 { font-size: 25px; line-height: 31px; }
  body.export #home-screen .home-motto { font-size: 11px; }
  body.export #home-screen .home-station-label strong { font-size: 12px; }
}

/* House and water belong to the same camp; the pet button is shared with care. */
#home-screen .home-house-wide { display: none; }
#home-screen .home-pet-door { position: absolute; z-index: 5; padding: 0; background: none; perspective: 350px; overflow: visible; }
#home-screen .home-pet-door::after { content: ''; position: absolute; inset: 0 -5px; min-width: 44px; }
#home-screen .home-door-leaf { display: block; position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 3% 50%; }
#home-screen .home-door-well { position: absolute; inset: 3% 4% 3% 4%; background: #332d35; border-radius: 50% 50% 3% 3% / 22% 22% 2% 2%; box-shadow: inset 6px 4px 8px #0008; opacity: 0; }
#home-screen .home-pet-door.is-open .home-door-leaf { transform: rotateY(var(--home-door-angle, 0deg)); }
#home-screen .home-pet-door.is-open .home-door-well { opacity: 1; }
#home-screen .home-pet-sign { display: block; position: absolute; z-index: 2; top: 100%; left: 50%; transform: translateX(-50%); padding: 0; width: max-content; max-width: 132px; color: #25332d; text-shadow: -1px -1px 0 #fffff5, 1px -1px 0 #fffff5, -1px 1px 0 #fffff5, 1px 1px 0 #fffff5, 0 0 3px #fffff5; text-align: center; }
#home-screen .home-pet-sign strong { display: block; max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 17px; }
#home-screen .home-pet-sign small { display: block; white-space: nowrap; font-size: 10px; line-height: 15px; color: #344238; }
#home-screen .home-pet-door .home-pet-sign { margin-top: 8px; }
#home-screen .home-pet-door:focus-visible, #home-screen .home-pet-pool:focus-visible { outline: 2px solid #24384b; outline-offset: 5px; border-radius: 6px; }
#home-screen .home-pet-pool { position: absolute; z-index: 3; left: 5%; top: 24%; width: min(46%, 29cqh); aspect-ratio: 1.9; padding: 0; background: transparent; overflow: visible; }
#home-screen .home-pool-art { display: block; position: absolute; inset: 0; filter: drop-shadow(1px 4px 2px #26372255); }
#home-screen .home-pool-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
#home-screen .home-pool-water { position: absolute; inset: 28% 15% 34% 14%; overflow: hidden; border-radius: 50%; }
#home-screen .home-pool-surface { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: .95; mask-image: radial-gradient(ellipse 49% 40% at 50% 58%, #000 72%, #0000 100%); }
#home-screen .home-pool-surface[hidden] { display: none; }
#home-screen .home-pool-water i { position: absolute; width: 55%; height: 42%; left: 26%; top: 24%; border: 1.25px solid #e0ffffb0; border-radius: 50%; animation: home-pool-ripple 2.4s ease-out infinite; }
#home-screen .home-pool-water i:nth-child(2) { animation-delay: -1s; left: 45%; top: 4%; }
#home-screen .home-pool-water i:nth-child(3) { animation-delay: -2s; left: 4%; top: 38%; }
#home-screen .home-pet-pool .home-pet-sign { top: calc(100% + 10px); }
#home-screen .cp-home-pet[data-living="yard"] { top: var(--pet-ground); }
#home-screen .cp-home-pet[data-living="moving"] { animation: none; left: 0; top: 0; min-width: 0; min-height: 0; transform-origin: 0 0; z-index: 6; }
#home-screen .cp-home-pet[data-living="moving"] .cp-pet-walk-body { animation: none; }
#home-screen .cp-home-pet[data-living="moving"] #cp-pet-tag { display: none; }
#home-screen .cp-home-pet[data-living="pool"] { animation: none; left: var(--home-swim-x); top: var(--home-swim-y); width: var(--home-swim-size); height: var(--home-swim-size); min-width: 0; min-height: 0; }
#home-screen .cp-home-pet[data-living="pool"]::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); z-index: 4; }
#home-screen .cp-home-pet[data-living="pool"] .cp-pet-walk-body { position: relative; animation: home-pet-swim 6s ease-in-out infinite; }
#home-screen .cp-home-pet[data-living="pool"] .cp-pet-art { position: relative; z-index: 1; clip-path: inset(0 0 24% 0); }
#home-screen .cp-home-pet[data-living="pool"] #cp-pet-tag { display: none; }
#home-screen .home-swim-ring { display: none; position: absolute; left: -4%; top: 59%; width: 108%; height: 36%; border-radius: 50%; border: 8px solid #ffdf58; border-bottom-color: #e9a539; box-shadow: inset 0 2px 1px #fffba0, 0 3px 2px #277d9259; }
#home-screen [data-living="pool"] .home-swim-ring { display: block; }
#home-screen .home-ring-back { z-index: 0; }
#home-screen .home-ring-front { z-index: 2; clip-path: inset(48% -10% -30% -10%); }
#home-screen .home-pet-paused *, #home-screen .home-scene[inert] *, .paused #home-screen .home-scene *, .document-hidden #home-screen .home-scene * { animation-play-state: paused !important; }
@keyframes home-pool-ripple { from { opacity: .85; transform: scale(.55); } to { opacity: 0; transform: scale(1.8); } }
@keyframes home-pet-swim { 0%, 100% { transform: translate(-16%, 0) rotate(-6deg); } 25% { transform: translate(0, -3%) rotate(1deg); } 50% { transform: translate(16%, 2%) rotate(6deg); } 75% { transform: translate(0, 3%) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) {
  #home-screen .home-pool-water i, #home-screen .cp-home-pet[data-living="pool"] .cp-pet-walk-body { animation: none; }
  #home-screen .home-door-leaf { transition: none; }
}
@container (max-height: 470px) {
  #home-screen .home-object-amu { top: 74%; width: min(42%, 25cqh); }
  #home-screen .cp-home-pet { --pet-ground: 79%; --pet-step: 1%; }
  #home-screen .cp-home-pet[data-living="yard"] { width: min(28%, 17cqh); min-width: 60px; min-height: 60px; }
  #home-screen .home-pet-pool { top: 23%; width: min(46%, 27cqh); }
  #home-screen .home-pet-sign strong { line-height: 15px; }
  #home-screen .home-pet-sign small { line-height: 13px; }
  #home-screen .home-radio { top: 49%; width: min(32%, 17cqh); }
  #home-screen .home-voice { top: 50%; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 460px) {
  body.export #home-screen .statusbar { flex-basis: 24px; }
  body.export #home-screen .camp-nav { flex-basis: 44px; }
  body.export #home-screen .tabs { flex-basis: 62px; padding: 4px 13px 14px; min-height: 0; }
  body.export #home-screen .home-header { top: 4%; left: 4%; right: 4%; text-align: left; }
  body.export #home-screen #home-title { display: none; }
  body.export #home-screen .home-header h2 { font-size: 21px; line-height: 28px; }
  body.export #home-screen .home-motto { display: none; }
  body.export #home-screen .camp-background { object-position: center 54%; }
  body.export #home-screen .home-object-amu { left: 4%; top: 42%; width: min(22%, 53cqh); }
  body.export #home-screen .home-station { min-width: 64px; }
  body.export #home-screen .home-voice { left: 40%; top: 40%; width: min(18%, 31cqh); }
  body.export #home-screen .home-radio { right: auto; left: 56%; top: 30%; width: min(18%, 32cqh); }
  body.export #home-screen .home-radio .home-station-label { min-width: 80px; }
  body.export #home-screen .home-house-wide { display: block; position: absolute; right: 5%; top: 2%; width: min(25%, 83cqh); height: auto; }
  body.export #home-screen .home-pet-pool { left: 23%; top: 44%; width: min(20%, 43cqh); }
  body.export #home-screen .home-pet-pool .home-pet-sign { top: auto; bottom: calc(100% + 6px); }
  body.export #home-screen .cp-home-pet[data-living="yard"] { width: min(12%, 26cqh); min-width: 56px; min-height: 56px; left: 85%; top: 60%; animation-name: cp-pet-roam-wide; }
  body.export #home-screen #cp-pet-tag { bottom: 0; }
  @keyframes cp-pet-roam-wide {
    0%, 8%, 100% { left: 85%; top: 60%; }
    28%, 36% { left: 87%; top: 62%; }
    55%, 64% { left: 85%; top: 62%; }
    74% { left: 83%; top: 61%; }
    84%, 90% { left: 83%; top: 60%; }
  }
}
@media (orientation: landscape) and (min-width: 460px) and (max-width: 600px) and (max-height: 350px) {
  body.export #home-screen .home-pet-door .home-pet-sign { top: -38px; margin-top: 0; }
}
