/* GAME HEADER + MENU
   While a game is on screen (its top bar #gtop is showing), hide the Oasis title, sound button and tabs: the screen
   starts with the game. The ☰ in the bar (js/ui/18-game-menu.js) opens them. Other tabs keep the normal header. */
body.ingame .wrap:has(> #view-play:not([hidden]) #gtop) > header,
body.ingame .wrap:has(> #view-play:not([hidden]) #gtop) > .tabs{display:none}

/* the bar is the same on every screen: ☰ at the left end, then Round · score · First to */
.gtop.gs .pbsc{position:relative}
.gmenu-btn{position:absolute;left:-8px;top:50%;transform:translateY(-50%);z-index:1;
  width:34px;height:30px;padding:0;border-radius:8px;border:1px solid var(--line);background:var(--surface,#fff);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer}
.gmenu-btn span{display:block;width:16px;height:2px;border-radius:1px;background:var(--ink,#222)}
.gmenu-btn:hover{border-color:var(--or)}
.gmenu-btn[aria-expanded="true"]{border-color:var(--or);box-shadow:inset 0 0 0 1px var(--or)}

/* desktop: the same bar, pinned across the top of the game. The score that sat between the deck tiles moves into
   it, and the phase hint row stays off (desktop shows its own hint and battle controls under the bar). */
@media (min-width:641px){
  .gtop.gs{display:block;position:sticky;top:env(safe-area-inset-top,0px);z-index:19;margin:0 0 12px;padding:6px 16px;
    background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 14px rgba(0,0,0,.07)}
  .gtop.gs .pbsc{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:14px}
  .gtop.gs .rl,.gtop.gs .rr{font-size:.92rem;color:var(--muted);white-space:nowrap}
  .gtop.gs .rl{text-align:right}
  .gtop.gs .sc{display:flex;align-items:baseline;gap:8px;font-family:var(--f-mono);font-size:1.6rem;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}
  .gtop.gs .sc b{font-weight:600}
  .gtop.gs .sc .a{color:var(--azure)}
  .gtop.gs .sc .b{color:var(--gules)}
  .gtop.gs .sc .dash{color:var(--muted)}
  .gtop.gs .gmenu-btn{left:-4px}
  .gtop.gs .pbhint{display:none}
  body:has(#view-play:not([hidden]) #gtop) .topboard .mid{display:none}
  body:has(#view-play:not([hidden]) #gtop) .topboard{grid-template-columns:1fr 1fr}
  /* the deck tiles, if they stick while scrolling, stop under the bar instead of behind it */
  body:has(#view-play:not([hidden]) #gtop) .board.topboard{top:calc(var(--bh,0px) + 8px + env(safe-area-inset-top,0px))}
  /* the battle buttons too (they stuck at the top, behind the bar, once the page scrolled) */
  body:has(#view-play:not([hidden]) #gtop) .battlectl{top:calc(var(--bh,0px) + env(safe-area-inset-top,0px))}
}

/* the menu */
.gmenu-pop{position:fixed;z-index:63;min-width:200px;max-width:calc(100vw - 16px);padding:6px;border-radius:10px;
  background:var(--surface,#fff);border:1px solid var(--line);box-shadow:0 8px 28px rgba(0,0,0,.22)}
.gmenu-pop[hidden]{display:none}
.gmenu-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;
  border:0;background:none;border-radius:7px;padding:10px 10px;font:inherit;font-weight:700;color:var(--ink);cursor:pointer}
.gmenu-item:hover{background:color-mix(in srgb, var(--or) 12%, transparent)}
.gmenu-here{font-weight:500;font-size:12px;color:var(--muted)}
.gmenu-sep{height:1px;background:var(--line);margin:4px 6px}
.gmenu-sw{position:relative;flex:none;width:34px;height:20px;border-radius:10px;background:var(--line);transition:background .15s}
.gmenu-sw i{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.gmenu-sw.on{background:var(--or)}
.gmenu-sw.on i{transform:translateX(14px)}
/* Load battle code (js/ui/18-game-menu.js): the paste box in the one pop-up */
.bcode .bcodeh{margin:0;font-family:Marcellus,serif;font-weight:400}
.bcode{display:flex;flex-direction:column;gap:10px;padding:4px 2px}
.bcode textarea{width:100%;box-sizing:border-box;min-height:110px;font:12px/1.4 ui-monospace,Menlo,Consolas,monospace;word-break:break-all;resize:vertical}
.bcode .err{margin:0}
