/* Mobile menu stays inside the visual viewport and follows its trigger. */
@media(max-width:800px){
  .site-header .site-menu .menu-panel{
    position:fixed!important;top:var(--mobile-menu-top,76px)!important;
    left:max(8px,env(safe-area-inset-left,0px))!important;right:max(8px,env(safe-area-inset-right,0px))!important;
    bottom:auto!important;width:auto!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important;
    max-height:calc(100vh - var(--mobile-menu-top,76px) - 16px);max-height:calc(100dvh - var(--mobile-menu-top,76px) - 16px);
    overflow-x:hidden!important;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:1100;
  }
}
/* Keep game resources below the signed-in reader stats bar. */
.game-detail:has(.game-board) .game-resources{top:max(72px,calc(var(--site-notice-height,0px) + env(safe-area-inset-top,0px) + 12px));z-index:69}
@media(max-width:650px){.game-detail:has(.game-board) .game-resources{top:max(104px,calc(var(--site-notice-height,0px) + env(safe-area-inset-top,0px) + 12px))}}
.game-scene [data-game-focus]{scroll-margin-top:calc(var(--site-notice-height,0px) + 130px)}
@media(max-width:650px){.game-scene [data-game-focus]{scroll-margin-top:calc(var(--site-notice-height,0px) + 175px)}}
/* Compact comic cards give the homepage a four-story preview. */
.home-comic-section{padding:34px 0}
.home-comic-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.home-comic-card{position:relative;display:grid;grid-template-columns:76px minmax(0,1fr);align-items:stretch;gap:10px;min-width:0;min-height:106px;padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--strip-surface,var(--soft));color:var(--ink);text-decoration:none;transition:transform .18s,border-color .18s,box-shadow .18s}
.home-comic-card:hover{transform:translateY(-2px);border-color:var(--accent);box-shadow:0 8px 20px #292d2812}
.home-comic-card>img{display:block;width:76px;height:94px;object-fit:cover;border-radius:7px;background:var(--soft)}
.home-comic-copy{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;padding-right:12px}
.home-comic-card .section-kind{font-size:8px;line-height:1.5;letter-spacing:.06em;color:var(--accent)}
.home-comic-card h3{font-size:13px;line-height:1.55;margin:0;overflow-wrap:anywhere}
.home-comic-card p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:10px;line-height:1.55;color:var(--muted);margin:0}
.home-comic-arrow{position:absolute;right:9px;bottom:7px;color:var(--accent);font-size:12px}
@media(max-width:1000px){.home-comic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.home-comic-section{padding:27px 0}.home-comic-grid{grid-template-columns:1fr;gap:9px}.home-comic-card{grid-template-columns:68px minmax(0,1fr);min-height:92px;padding:9px}.home-comic-card>img{width:68px;height:78px}.home-comic-card h3{font-size:14px}.home-comic-card p{font-size:11px;-webkit-line-clamp:2}}
@media(prefers-reduced-motion:reduce){.home-comic-card{transition:none}}

/* Give the personal diary its own compact, clearly separate homepage block. */
.personal-notes-home{margin:38px 0 46px;padding:24px 26px;border:1px solid color-mix(in srgb,var(--line) 72%,var(--accent));border-radius:16px;background:color-mix(in srgb,var(--soft) 68%,var(--paper));}
.personal-notes-home .section-top{margin-bottom:14px}
.home-note-strips{display:grid;gap:9px}
.home-note-strip{display:grid;grid-template-columns:76px minmax(0,1fr) 28px;align-items:center;gap:14px;min-width:0;padding:9px 13px 9px 9px;border:1px solid var(--line);border-radius:11px;background:var(--paper);color:var(--ink);text-decoration:none;transition:border-color .18s,transform .18s,background .18s}
.home-note-strip:hover{border-color:var(--accent);background:var(--surface);transform:translateY(-1px)}
.home-note-art{display:block;width:76px;height:62px;overflow:hidden;border-radius:7px;background:var(--soft);color:var(--accent)}
.home-note-art img{display:block;width:100%;height:100%;object-fit:cover}
.home-note-art svg{display:block;width:100%;height:100%}
.home-note-copy{display:grid;gap:3px;min-width:0}
.home-note-copy strong{font-size:14px;line-height:1.55}
.home-note-copy>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:var(--muted);font-size:12px;line-height:1.65}
.home-note-arrow{justify-self:end;color:var(--accent);font-size:17px}
@media(max-width:600px){.personal-notes-home{margin:28px 0 36px;padding:18px 13px;border-radius:13px}.home-note-strip{grid-template-columns:62px minmax(0,1fr) 22px;gap:10px;padding:8px}.home-note-art{width:62px;height:56px}.home-note-copy strong{font-size:13px}.home-note-copy>span{font-size:11px}}
