/* MUDHub on foldables and cover screens (classes from fold-core.js, logic in site-fold.js). */

/* ---------- two panes: game list on one side, the picked game's page on the other ---------- */
html.lay-two body.fold-split main.wrap { max-width: none; margin-left: 0;
  margin-right: calc(var(--fold-b, 50vw) + var(--fold-gap, 0px)); }
html.lay-two body.fold-split .grid { grid-template-columns: minmax(0, 1fr) !important; }
html.lay-two body.fold-split footer.emp-foot { margin-right: calc(var(--fold-b, 50vw) + var(--fold-gap, 0px)); }
html.seg-h body.fold-split { --fold-b: var(--seg-b, 50vw); --fold-gap: var(--seg-gap, 0px); }
html.lay-two:not(.seg-h) body.fold-split { --fold-b: 55vw; }
.fold-pane { display: none; }
html.lay-two body.fold-split .fold-pane { display: flex; flex-direction: column; position: fixed; right: 0; bottom: 0;
  top: var(--fold-top, 56px); width: var(--fold-b, 50vw); z-index: 50; background: var(--bg, #0b0f16);
  border-left: 1px solid var(--line, #223); }
html.seg-h body.fold-split .fold-pane { border-left: 0; }
.fold-pane-head { display: flex; align-items: center; gap: .5rem; padding: .4rem .7rem;
  border-bottom: 1px solid var(--line, #223); font-size: .85rem; color: var(--dim, #8a94a6); min-height: 44px; }
.fold-pane-head b { color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-pane-head a { flex: none; }
.fold-pane iframe { flex: 1; width: 100%; border: 0; background: transparent; }
.fold-pane-empty { margin: auto; padding: 1.5rem; text-align: center; color: var(--dim, #8a94a6); }
body.fold-split .gcard.fold-on { border-color: var(--accent, #3fb6c9); }

/* the page inside the right pane drops the site chrome */
html.in-fold-pane .emp-nav, html.in-fold-pane footer.emp-foot, html.in-fold-pane #chatSide,
html.in-fold-pane #bellSide, html.in-fold-pane .site-update { display: none !important; }
html.in-fold-pane main.wrap { padding-top: .6rem; }

/* ---------- compact: cover screens, one column, big taps, no sideways scroll ---------- */
html.lay-compact, html.lay-compact body { overflow-x: hidden; }
html.lay-compact main.wrap { padding-left: .5rem; padding-right: .5rem; max-width: 100%; }
html.lay-compact main.wrap img, html.lay-compact main.wrap video, html.lay-compact main.wrap canvas,
html.lay-compact main.wrap svg, html.lay-compact main.wrap iframe { max-width: 100%; height: auto; }
html.lay-compact main.wrap table { display: block; max-width: 100%; overflow-x: auto; }
html.lay-compact main.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
html.lay-compact main.wrap [class*="grid"], html.lay-compact main.wrap .cols, html.lay-compact main.wrap .row2 {
  grid-template-columns: minmax(0, 1fr) !important; }
html.lay-compact main.wrap .btn, html.lay-compact main.wrap button { min-height: 44px; }
html.lay-compact main.wrap * { min-width: 0; overflow-wrap: anywhere; }
html.lay-compact .emp-brand { font-size: .95rem; }
html.lay-compact h1 { font-size: 1.3rem; }
html.lay-compact h2 { font-size: 1.1rem; }

.mh-glance { display: none; }
html.lay-compact .mh-glance { display: flex; flex-direction: column; gap: .5rem; margin: .4rem 0 1rem; }
.mh-glance .g-card { background: var(--panel2, #121a26); border: 1px solid var(--line, #223); border-radius: 12px;
  padding: .7rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.mh-glance .g-big { font-size: 1.6rem; font-weight: 700; color: #fff; line-height: 1.1; }
.mh-glance .g-lab { font-size: .8rem; color: var(--dim, #8a94a6); }
.mh-glance .g-row { display: flex; align-items: center; gap: .6rem; }
.mh-glance .g-row > div { flex: 1; min-width: 0; }
.mh-glance .btn { display: flex; align-items: center; justify-content: center; min-height: 48px; width: 100%;
  text-align: center; font-size: 1rem; }
.mh-glance .g-name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-glance .g-more { background: none; border: 0; color: var(--accent, #3fb6c9); font: inherit; padding: .4rem 0;
  cursor: pointer; text-align: left; }
html.lay-compact body.glance-only main.wrap > :not(.mh-glance) { display: none !important; }

/* layout toggle in the footer */
.site-ver [data-layout-toggle] { margin-left: .6rem; }
