/* First page v0.5: only the home explorer is scroll-free. Complete rule evidence in the reader remains scrollable. */
html,body.home-compact{height:100%;overflow:hidden;overscroll-behavior:none}
body.home-compact{display:flex;flex-direction:column;min-width:300px;font-size:14px}
body.home-compact .site-header{position:relative;flex:0 0 auto;z-index:12}
body.home-compact .header-inner{height:52px;min-height:52px;max-width:1480px}
body.home-compact .header-status{color:#b7c5cc;font-size:12px;letter-spacing:.1px}
body.home-compact .shell{width:100%;max-width:1480px;flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;padding:10px 18px 12px;overflow:hidden}
body.home-compact .finder{flex:0 0 auto;margin:0;padding:7px 8px;border-radius:9px;box-shadow:none;z-index:10}
body.home-compact .search-row{flex-wrap:nowrap;gap:8px}
body.home-compact .search-box{min-height:44px;height:44px;flex-basis:auto;min-width:0}
body.home-compact .search-box input{font-size:15px}
body.home-compact .search-row select{height:44px;min-width:92px;padding:0 8px;font-size:13px}
body.home-compact .clear-search{height:44px}
.compact-home-content{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0}
.tool-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;flex:0 0 auto}
.compact-tool{height:48px;min-width:0;display:flex;align-items:center;justify-content:center;gap:10px;padding:0 13px;border:1px solid #29495c;border-radius:8px;background:#2c4c5d;color:#f7f9f9;font-size:14px;text-align:center}
.compact-tool strong{font-size:15px;font-weight:800}.compact-tool:hover{background:#365d71}.compact-tool .tool-symbol{color:#e5c88b;font-size:16px}.compact-tool>span:last-child{color:#c8d6de}
.compact-ui{display:grid;grid-template-columns:186px minmax(0,1fr);gap:10px;flex:1;min-height:0;min-width:0}
.compact-categories{display:grid;grid-template-columns:1fr;grid-template-rows:repeat(8,minmax(0,1fr));gap:7px;min-height:0}
.category-button{width:100%;min-height:0;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;border:1px solid #d7e0e1;border-radius:7px;background:#fff;color:#284351;padding:8px 12px;font-size:15px;font-weight:750;white-space:nowrap}
.category-button .category-count{font-weight:650;color:#768a95;font-size:11px}
.category-button.selected{background:#26495d;color:#fff;border-color:#26495d}.category-button.selected .category-count{color:#c5dce6}.category-button:hover:not(.selected){background:#edf3f3}
.compact-workspace{border:1px solid #d7dedf;background:#fff;border-radius:9px;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;padding:14px 14px 10px;gap:11px}
.compact-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;flex:0 0 auto}
.compact-heading{display:flex;align-items:baseline;gap:12px;min-width:0;white-space:nowrap}
.compact-heading h1{font-size:18px;letter-spacing:-.35px;line-height:1.3;margin:0;color:#233e50}
.compact-count{font-size:12px;color:#697c86}
#compact-filter{max-width:55%;width:230px;height:36px;border:1px solid #c4d1d5;background:#f8fafb;border-radius:7px;color:#294656;padding:0 8px;font-size:13px}
.compact-items{display:grid;grid-template-columns:repeat(var(--compact-cols,3),minmax(0,1fr));grid-auto-rows:var(--compact-card-height,59px);gap:9px;flex:1;min-height:0;overflow:hidden;align-content:start}
.compact-link{min-width:0;height:100%;border:1px solid #d7e1e4;border-radius:7px;background:#fcfdfd;display:flex;align-items:center;justify-content:space-between;padding:7px 11px;gap:5px}
.compact-link:hover{background:#edf5f7;border-color:#8eaebd}
.compact-link-text{min-width:0;display:flex;flex-direction:column;gap:2px}
.compact-link-text strong{font-size:13px;font-weight:750;line-height:1.35;color:#243d4b;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.compact-link-text small{font-size:10px;color:#738590;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%}
.compact-link-arrow{flex:0 0 auto;color:#658091;font-size:23px;font-weight:300}
.compact-pagination{display:flex;align-items:center;justify-content:center;gap:17px;flex:0 0 38px;border-top:1px solid #e9edee;padding-top:5px}
.compact-pagination button,.search-pager button{min-width:90px;height:32px;border:1px solid #c7d4d9;border-radius:6px;background:#f8fafb;color:#29495b;font-size:13px;font-weight:700}
.compact-pagination button:disabled,.search-pager button:disabled{opacity:.38;cursor:default}
.compact-pagination span{font-size:12px;color:#5b7281;min-width:47px;text-align:center;font-variant-numeric:tabular-nums}
.compact-empty{align-self:start;padding:18px;color:#697d88}
body.home-compact.search-mode .finder{display:flex;flex-direction:column;flex:1;min-height:0}
body.home-compact.search-mode #home-content{display:none}
body.home-compact .search-results{min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative;margin-top:7px}
body.home-compact .search-meta{flex:0 0 28px;padding:3px 8px 5px;font-size:12px}
.search-result-items{overflow:hidden;flex:1;min-height:0}
body.home-compact .search-result{height:54px;min-height:54px;padding:6px 10px;box-sizing:border-box}
body.home-compact .search-result strong{font-size:13px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.home-compact .search-result .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-pager{display:flex;justify-content:center;gap:12px;border-top:1px solid #e5ebee;flex:0 0 43px;align-items:center}
@container (max-width:780px){
body.home-compact .header-inner{height:47px;min-height:47px;padding:0 12px}
body.home-compact .header-status{font-size:10px}
body.home-compact .shell{padding:7px 8px 8px;gap:7px}
body.home-compact .finder{padding:5px 6px}
body.home-compact .search-row{gap:5px}
body.home-compact .search-box{height:42px;min-height:42px;padding:0 8px;gap:7px}
body.home-compact .search-box input{font-size:13px}
body.home-compact .search-box svg{width:17px;height:17px}
body.home-compact .search-row select{height:42px;min-width:67px;max-width:80px;padding:0 2px;font-size:11px}
body.home-compact .clear-search{height:42px}
.compact-home-content{gap:7px}
.tool-bar{gap:5px}
.compact-tool{height:43px;padding:0 5px;gap:5px;font-size:12px;border-radius:6px}
.compact-tool strong{font-size:12px}.compact-tool .tool-symbol{font-size:13px}.compact-tool>span:last-child{display:none}
.compact-ui{display:flex;flex-direction:column;gap:7px}
.compact-categories{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,43px);gap:5px;flex:0 0 auto}
.category-button{justify-content:center;font-size:12px;padding:4px 2px;gap:2px;flex-direction:column;line-height:1.25;border-radius:6px}
.category-button .category-name{overflow:hidden;text-overflow:ellipsis;max-width:100%}.category-button .category-count{font-size:9px}
.compact-workspace{padding:9px 9px 6px;gap:7px;flex:1}
.compact-panel-head{gap:8px;min-height:35px}
.compact-heading{gap:5px}.compact-heading h1{font-size:15px}.compact-count{font-size:10px}
#compact-filter{height:34px;max-width:52%;width:190px;font-size:12px;padding:0 3px}
.compact-items{grid-auto-rows:var(--compact-card-height,55px);gap:7px}
.compact-link{min-height:55px;height:100%;padding:5px 7px;gap:3px;border-radius:5px}
.compact-link-text strong{font-size:12px;line-height:1.3}.compact-link-text small{font-size:9px}
.compact-link-arrow{font-size:19px}
.compact-pagination{flex-basis:35px;padding-top:3px}
.compact-pagination button{height:30px;min-width:74px;font-size:12px}
body.home-compact .search-result{height:52px;min-height:52px}
}
@container (max-width:355px){body.home-compact .header-status{display:none}.compact-count{display:none}.compact-tool .tool-symbol{display:none}.compact-link-text strong{font-size:11px}}
@media(max-height:650px){
body.home-compact .shell{gap:5px;padding-top:5px;padding-bottom:5px}
.compact-home-content{gap:5px}
.compact-tool{height:36px}
.compact-categories{grid-template-rows:repeat(2,37px);gap:4px}
.compact-workspace{padding:6px;gap:5px}
.compact-panel-head{min-height:29px}
#compact-filter{height:29px}
.compact-pagination{flex-basis:31px}
}
@media(max-height:670px){
@container (min-width:781px){
body.home-compact .header-inner{height:46px;min-height:46px}
body.home-compact .shell{padding-top:7px;padding-bottom:7px;gap:7px}
.compact-tool{height:39px}
.compact-workspace{padding:8px;gap:7px}
.compact-panel-head{min-height:30px}
.compact-pagination{flex-basis:32px}
}

}

/* v0.6 — persistent, fixed-bottom layout switch. All game data is untouched. */
body.home-compact{height:100vh;height:100dvh;min-width:300px}
body.home-compact .app-viewport{display:flex;justify-content:center;flex:1 1 auto;min-height:0;min-width:0;width:100%;overflow:hidden}
body.home-compact .app-stage{container-type:inline-size;display:flex;flex-direction:column;flex:0 1 100%;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden}
body.home-compact[data-view="mobile"] .app-stage{flex:0 1 430px;max-width:100%}
.view-footer{display:flex;flex:0 0 44px;justify-content:center;align-items:center;border-top:1px solid #c8d5d7;background:#fff;z-index:20;padding:4px 10px max(4px,env(safe-area-inset-bottom));box-sizing:content-box}
.view-toggle{display:grid;grid-template-columns:1fr 1fr;gap:3px;border:1px solid #c4d3d9;border-radius:8px;background:#f1f5f6;padding:3px;min-width:250px;width:min(340px,100%);height:38px}
.view-toggle button{border:1px solid transparent;border-radius:6px;background:transparent;color:#355568;font-size:12px;font-weight:750;white-space:nowrap;padding:0 9px;line-height:1.4}
.view-toggle button[aria-pressed="true"]{background:#284d60;border-color:#284d60;color:#fff;box-shadow:0 1px 3px #102d3b22}
.view-toggle button:hover:not([aria-pressed="true"]){background:#e1eaee}
@container (max-width:780px){
 .app-stage .brand{font-size:13px;gap:7px}
 .app-stage .brand-square{width:28px;height:28px;font-size:12px}
 .app-stage .brand-suffix{font-size:11px}
 .app-stage .search-box kbd{display:none}
}
@container (max-width:380px){.app-stage .header-status{display:none}}
/* A PC layout requested on a narrow phone remains tappable: use a compact two-pane grid instead of scaling text down to unreadable pixels. */
@container (max-width:780px){
 .app-stage[data-view="desktop"] .compact-ui{display:grid;grid-template-columns:minmax(97px,33%) minmax(0,1fr);gap:6px}
 .app-stage[data-view="desktop"] .compact-categories{grid-template-columns:1fr;grid-template-rows:repeat(8,minmax(0,1fr));gap:4px;flex:1 1 auto}
 .app-stage[data-view="desktop"] .category-button{font-size:11px;flex-direction:row;justify-content:flex-start;min-width:0;padding:3px 5px;line-height:1.2;overflow:hidden;white-space:normal;text-align:left}
 .app-stage[data-view="desktop"] .category-count{display:none}
 .app-stage[data-view="desktop"] .compact-workspace{padding:6px;gap:5px}
 .app-stage[data-view="desktop"] .compact-panel-head{flex-wrap:wrap;align-items:flex-start;gap:3px;min-height:55px}
 .app-stage[data-view="desktop"] .compact-heading h1{font-size:13px}
 .app-stage[data-view="desktop"] .compact-count{display:none}
 .app-stage[data-view="desktop"] #compact-filter{max-width:100%;width:100%;height:27px;font-size:11px}
 .app-stage[data-view="desktop"] .compact-items{gap:5px}
 .app-stage[data-view="desktop"] .compact-link{min-height:47px;padding:4px 6px}
 .app-stage[data-view="desktop"] .compact-link-text strong{font-size:11px}
 .app-stage[data-view="desktop"] .compact-link-text small{font-size:9px}
 .app-stage[data-view="desktop"] .compact-pagination{gap:3px;flex-basis:31px}
 .app-stage[data-view="desktop"] .compact-pagination button{min-width:51px;font-size:11px;padding:0 3px}
 .app-stage[data-view="desktop"] .compact-pagination span{min-width:34px;font-size:11px}
}
@media(max-height:650px){.view-footer{flex-basis:37px}.view-toggle{height:32px}}
