/* EverythingButTheMaidel desktop layout, 2026-10-27-b (replaces -a).
   Mendel, Oct 27: tabs centered across the top, everything in one centered column,
   games that fill the screen. Every rule sits inside a min-width media query,
   so phones (and anything under 900px) render exactly as before. */

/* ---------- 900px and up: games fill the whole window ---------- */
@media (min-width:900px){
  html #lateRoot:not([hidden]),
  html #mdRoot:not([hidden]),
  html #mergeRoot:not([hidden]),
  html #stackRoot:not([hidden]){
    position:fixed !important;
    inset:auto !important; top:0 !important; left:0 !important; right:auto !important; bottom:auto !important;
    width:var(--dk-gw,100vw) !important; height:var(--dk-gh,100vh) !important;
    max-width:none !important; max-height:none !important;
    transform:scale(var(--dk-gz,1)) !important; transform-origin:0 0 !important;
    border-radius:0 !important; border:0 !important; box-shadow:none !important;
  }
  html #lateRoot .late-more-h{text-align:center}
  html #mdRoot .md-sheet{box-sizing:border-box;max-height:calc(var(--dk-gh,100vh) - 24px);overflow-y:auto}

  /* full-screen toggle added by desktop-2026-10-27-b.js (44px circle, top right of a game) */
  .dk-fs-btn{position:fixed;bottom:18px;right:18px;z-index:9700;width:44px;height:44px;min-width:44px;padding:0;border-radius:50%;
    display:grid;place-items:center;border:1px solid rgba(189,144,56,.65);background:rgba(20,33,61,.82);color:#f1d79a;cursor:pointer;
    box-shadow:0 6px 18px -8px rgba(0,0,0,.55);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
  .dk-fs-btn:hover{background:#14213d;color:#fff}
  .dk-fs-btn svg{width:20px;height:20px}
  .dk-fs-btn[hidden]{display:none}
}

/* ---------- 1024px and up: the full desktop layout ---------- */
@media (min-width:1024px){
  :root{ --dk-col:820px; --dk-pad:48px; --dk-brand:96px; }

  body{border:0 !important;border-radius:0 !important;box-shadow:none !important;margin:0 auto !important;max-width:none !important;min-height:100vh}

  /* ----- no sidebar: the app is one column, tabs on top ----- */
  #app:not(.hidden){width:100% !important;margin-left:0 !important;display:flex !important;flex-direction:column;min-height:100vh}
  #app > .topbar{order:1}
  #app > #viewRoot{order:2;width:100%}
  #app > .nav{order:0}

  /* centered top bar: logo on top, tabs in a centered row; the logo scrolls away and the tab row stays */
  .nav{
    position:sticky !important; top:calc(-1 * var(--dk-brand)) !important;
    inset:auto !important; left:auto !important; right:auto !important; bottom:auto !important;
    transform:none !important;
    width:100% !important; max-width:none !important; height:auto !important;
    display:flex !important; flex-direction:row !important; flex-wrap:wrap !important;
    justify-content:center !important; align-items:center !important; gap:4px !important;
    padding:12px 24px 10px !important;
    border:0 !important; border-bottom:1px solid var(--line2) !important;
    box-shadow:0 10px 28px -26px rgba(20,33,61,.55) !important;
    z-index:100 !important;
  }
  .desktop-nav-brand{flex:0 0 100% !important;height:calc(var(--dk-brand) - 12px);box-sizing:border-box;display:flex !important;justify-content:center;align-items:center;
    padding:0 0 10px !important;margin:0 !important;border:0 !important}
  .desktop-nav-brand picture{display:block;height:100%}
  .desktop-nav-brand img{width:auto !important;height:100% !important;max-height:none !important;margin:0 auto}
  .desktop-nav-user{display:none !important}
  .nav-item{flex:0 0 auto !important;width:auto !important;min-height:46px !important;margin:0 !important;padding:0 18px 0 8px !important;
    border-radius:999px !important;justify-content:center !important;gap:9px !important;box-shadow:none !important;text-align:center;color:var(--ink)}
  .nav-item::before{display:none !important}
  .nav-item .nav-emoji{width:32px !important;height:32px !important;border-radius:50% !important;opacity:1 !important}
  .nav-item .nav-label{font:600 15px/1.2 var(--sans) !important;letter-spacing:.01em !important;text-transform:none !important;color:var(--ink);opacity:.85;white-space:nowrap}
  .nav-item:hover{background:var(--gold-soft)}
  .nav-item:hover .nav-label{opacity:1}
  .nav-item.active{background:var(--gold-soft) !important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 45%,transparent) !important}
  .nav-item.active .nav-label{opacity:1;color:var(--gold-deep)}

  /* page header: greeting / page name centered, side switch and profile centered under it */
  .topbar{position:relative !important;top:auto !important;flex-direction:column !important;justify-content:center !important;align-items:center !important;
    text-align:center !important;gap:12px !important;min-height:0 !important;padding:26px var(--dk-pad) 6px !important;
    background:transparent !important;border:0 !important;-webkit-backdrop-filter:none !important;backdrop-filter:none !important;box-shadow:none !important}
  .topbar-title,.topbar-pagename{text-align:center !important;justify-content:center !important;align-items:center !important;margin:0 auto !important}
  .topbar-pagename{flex-direction:column !important}
  .topbar-user{position:static !important;inset:auto !important;margin:0 auto !important;justify-content:center !important}

  /* ----- one centered column on every tab ----- */
  .view,
  .home-view,.planner-view,.notes-view,.history-view,.guide-view,.places-view{
    max-width:calc(var(--dk-col) + 2 * var(--dk-pad)) !important;
    width:100% !important;
    margin-left:auto !important;margin-right:auto !important;
    padding-left:var(--dk-pad) !important;padding-right:var(--dk-pad) !important;
    padding-top:28px !important;
    box-sizing:border-box;
  }
  .vkicker,.vtitle,.vsub,.sync-note,.places-summary,.flag-stage-note,.divider-text,.home-section-rule{text-align:center !important}
  .vsub{max-width:62ch;margin-left:auto !important;margin-right:auto !important}
  .places-summary,.home-section-rule{justify-content:center !important}

  /* sub-tabs (Notes / History) centered above the column */
  #viewRoot > .subtabs{width:fit-content !important;max-width:none !important;margin:20px auto 0 !important}
  #viewRoot > .subtabs + .view{padding-top:20px !important}

  /* home: every block stacked, one under the other */
  .home-view{display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:0 !important;row-gap:0 !important}
  .home-view > *{grid-column:1 / -1 !important;grid-row:auto !important}
  .home-view > .home-list,.home-view > .home-recent,.home-view > .home-continue-card{margin-top:18px !important}
  .home-view > .home-resume-rule{margin-top:34px !important}
  .home-view > .home-recent{margin-top:34px !important}
  .home-recent-head{justify-content:center !important;gap:14px;text-align:center}
  .home-recent-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
  .home-footer{margin-top:44px;text-align:center}
  .home-footer-bottom{justify-content:center !important;flex-wrap:wrap;gap:12px}
  .side-switch-wrap{text-align:center}

  /* places: centered search, chips and sort; cards two across inside the column */
  .places-toolbar{max-width:600px;margin-left:auto !important;margin-right:auto !important}
  .quick-chips,.places-sort,.date-tabs,.filter-row,.chips{justify-content:center !important;flex-wrap:wrap}
  .places-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:18px !important;align-items:stretch !important}
  .places-grid .place{height:100%;display:flex;flex-direction:column;transition:box-shadow .18s ease, transform .18s ease}
  .places-grid .place:hover{box-shadow:0 14px 34px -18px rgba(20,33,61,.45);transform:translateY(-2px)}
  .places-more{justify-content:center !important;text-align:center}

  /* plan a date and date notes: one section on top, the next below it */
  .planner-desktop-grid,.notes-desktop-grid{display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:22px !important}
  .planner-desktop-grid > *,.notes-desktop-grid > *{grid-column:1 / -1 !important;grid-row:auto !important;position:static !important;top:auto !important;width:auto !important;max-width:none !important}
  .planner-results{border-left:0 !important;padding-left:0 !important}

  /* coach: centered switch and choices */
  .coach-mode-toggle{max-width:440px;margin-left:auto !important;margin-right:auto !important}
  .coach-choice{max-width:none;margin-left:auto !important;margin-right:auto !important}
  .chat-wrap .bubble{max-width:62ch}

  /* guide: a single centered column of cards */
  .guide-view{display:grid !important;grid-template-columns:minmax(0,1fr) !important}
  .guide-view > *{grid-column:1 / -1 !important}

  /* pop-up sheets become centered dialogs */
  .help-backdrop{inset:0 !important;width:100vw !important;max-width:none !important;z-index:9000 !important;display:flex !important;align-items:center !important;justify-content:center !important;padding:32px !important;background:rgba(10,19,40,.55) !important}
  .help-sheet{position:relative !important;inset:auto !important;transform:none !important;width:min(640px,100%) !important;max-height:calc(100vh - 64px) !important;overflow:auto !important;border-radius:20px !important;margin:0 !important;box-shadow:0 30px 80px -24px rgba(0,0,0,.55) !important}
  .help-handle{display:none !important}
  .wt-card{width:440px !important;max-width:calc(100vw - 64px) !important}

  /* the feature hint and toasts follow the centered column (no sidebar offset) */
  .feature-hint{left:28px !important;right:28px !important;max-width:560px;margin-left:auto !important;margin-right:auto !important}
  /* section labels and question headings centered too */
  .view .label,.flag-section-head .label{text-align:center !important}
  .flag-section-head{justify-content:center !important;align-items:center !important;gap:14px !important;text-align:center}
  .pq-words > summary,.pq-q{text-align:center !important}
  .history-view{display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:22px !important}
  .history-view > *{grid-column:1 / -1 !important;grid-row:auto !important}
  .history-view > .empty,.history-view > p{text-align:center}
  .topbar:not(.topbar-home){padding-top:22px !important}
}
