/* Home-only layout: keep the castle independent of the menu's remaining height. */
.shell:has(> .home) > .home { display:flex; flex-direction:column; align-items:stretch; padding:0; overflow-y:auto; overflow-x:hidden; }
.shell:has(> .home) .home-scene { position:relative; flex:1 0 220px; width:100%; height:auto; min-height:220px; }
.shell:has(> .home) .home-video { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain; }
.shell:has(> .home) .home-controls { flex:0 0 auto; width:100%; max-width:none; padding:16px 20px 12px; }
.home .home-menus { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); grid-auto-flow:row; grid-auto-rows:1fr; gap:12px; }
.home .home-menus > .menu-card { display:grid; grid-template-columns:24px minmax(0,1fr); align-items:center; grid-column:auto; grid-row:auto; width:100%; height:auto; min-height:76px; padding:12px 10px; gap:10px; }
.home .home-menus .menu-label { min-width:0; width:100%; padding:0; text-align:center; }
.home .home-menus .home-menu-icon { justify-self:center; }
.home .home-menus .menu-label strong { white-space:normal; overflow-wrap:anywhere; word-break:keep-all; }
.home .creator-contact { display:flex; flex-wrap:wrap; justify-content:center; gap:4px 20px; font-size:clamp(16px,1.5vw,22px); line-height:1.65; margin:14px 0 0; padding:4px; text-align:center; }
.home .creator-feedback { min-width:0; overflow-wrap:anywhere; }
.home .home-scene .home-video-toggle { position:absolute; right:14px; bottom:14px; z-index:2; min-height:44px; margin:0; padding:9px 16px; font-size:14px; color:#f6e3b8; background:#172119ed; border:1px solid #bfa168; border-radius:5px; }
.home .home-scene .home-video-toggle:focus-visible { outline:2px solid #f1d595; outline-offset:3px; }
@media (max-width:1279px) {
  .home .home-menus { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:1100px) {
  .shell:has(> .home) { height:100dvh; min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:contain; }
  .shell:has(> .home) > .topbar { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; height:auto; min-height:0; max-height:none; padding:10px 12px; gap:8px; }
  .shell:has(> .home) > .topbar .top-title { grid-column:1; grid-row:1; width:100%; min-width:0; justify-content:center; }
  .shell:has(> .home) > .topbar .top-title h1 { margin:0; font-size:clamp(20px,3.2vw,28px); line-height:1.4; text-align:center; white-space:normal; }
  .shell:has(> .home) > .topbar .top-actions { grid-column:1; grid-row:2; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; max-width:560px; min-width:0; justify-self:center; gap:8px; }
  .shell:has(> .home) > .topbar .top-actions .ghost { display:flex; align-items:center; justify-content:center; width:100%; min-width:0; height:auto; min-height:44px; padding:7px 6px; font-size:clamp(12px,2.2vw,16px); line-height:1.35; white-space:normal; text-align:center; word-break:keep-all; }
  .shell:has(> .home) > .pc-optimized-note { padding:5px 12px 8px; font-size:12px; line-height:1.5; white-space:normal; }
  .shell:has(> .home) > .home { display:flex; flex:1 0 auto; flex-direction:column; overflow:visible; min-height:0; }
  .shell:has(> .home) .home-scene { flex:0 0 auto; width:100%; height:auto; min-height:0; aspect-ratio:8/5; }
  .shell:has(> .home) .home-controls { padding:14px 12px 16px; border-left:0; }
  .home .home-menus { width:100%; max-width:none; gap:10px; }
  .home .home-menus > .menu-card { min-height:76px; height:auto; padding:12px 8px; gap:8px; }
  .home .home-menus .home-menu-icon { display:block; flex:0 0 23px; width:23px; height:23px; }
  .home .home-menus .menu-label { display:flex; flex:0 1 auto; width:100%; gap:5px; }
  .home .home-menus .menu-label strong { font-size:18px; line-height:1.4; }
  .home .home-menus .menu-label small { display:block; font-size:12px; line-height:1.5; white-space:normal; }
  .home .creator-contact { flex-direction:column; gap:2px; font-size:16px; margin:14px 0 0; padding:0; }
  .home .creator-feedback { font-size:13px; }
  .shell:has(> .home) > .home-footer { flex:0 0 auto; min-height:0; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .home-footer .home-ratio-note { font-size:11px; }
  .menu-hub { padding:24px 16px; }
  .menu-hub-heading { margin-top:0; }
  .menu-hub-card { min-height:104px; padding:18px 16px; }
  .menu-hub-card strong { font-size:20px; }
  .menu-hub-card small { font-size:14px; }
}
@media (max-width:700px) {
  .home .home-menus { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home .home-menus .menu-label strong { font-size:17px; }
  .home .home-menus .menu-label small { font-size:11px; }
}
@media (max-width:380px) {
  .home .home-menus > .menu-card { padding:10px 6px; gap:6px; }
  .home .home-menus .home-menu-icon { flex-basis:19px; width:19px; height:19px; }
  .home .home-menus .menu-label strong { font-size:16px; }
}
@media (min-width:600px) and (max-width:1100px) and (max-height:550px) and (orientation:landscape) {
  .shell:has(> .home) > .home { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:start; }
  .shell:has(> .home) .home-scene { align-self:start; }
  .shell:has(> .home) .home-controls { padding:10px; }
  .home .home-menus { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .home .home-menus > .menu-card { min-height:64px; padding:8px 6px; }
  .home .home-menus .menu-label strong { font-size:16px; }
  .home .home-menus .menu-label small { font-size:10px; }
}
