/* web/hud/centre_grid.css
   The centre as a grid, on a computer screen, while something sits beside or under the game
   window inside it: the room box at a side (web/hud/room_box.css), or the chat box anywhere
   (web/hud/chat_box.css). Six rows -- the room box on top, the game window's tabs, the game
   window, the chat box under it, the input line, the bar -- and four columns -- the room box at
   the left, the game window, the chat box beside it, the room box at the right. The input line
   and the bar run under all of them. A track nothing fills takes no room. The room box on top
   and the chat box under share the height left with the game window by their sizes, as
   --grid-top and --grid-under, the game window counting 60 to a Medium box's 40 -- so a box
   alone takes about what it would on its own, and two Large ones still leave the game window
   a third. Everything else in the centre is placed absolutely, or not shown on a computer. */

:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"], [data-chat-at="box"]) #centre {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-rows: var(--grid-top, 0px) auto minmax(0, 60fr) var(--grid-under, 0px) auto auto;
}
/* The room box at a side and the chat box beside, both showing: each takes its size's share of
   the width instead of its letters, the game window counting 60, since two boxes in letters
   leave it next to nothing between two open columns. While the Stage is open or sliding they
   are tucked away, and their tracks go too. */
:root:not([data-phone])[data-roombox="left"][data-chat-at="box"][data-chat-box="beside"] #centre:not(.staged, .sliding):has(> #roombox:not([hidden])):has(> #chatbox:not([hidden])) {
  grid-template-columns: minmax(0, var(--rbx-fr)) minmax(0, 60fr) minmax(0, var(--cbx-fr)) 0px;
}
:root:not([data-phone])[data-roombox="right"][data-chat-at="box"][data-chat-box="beside"] #centre:not(.staged, .sliding):has(> #roombox:not([hidden])):has(> #chatbox:not([hidden])) {
  grid-template-columns: 0px minmax(0, 60fr) minmax(0, var(--cbx-fr)) minmax(0, var(--rbx-fr));
}
:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"])[data-chat-at="box"][data-chat-box="beside"] #centre > :is(#roombox, #chatbox) {
  width: auto;
}
:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"], [data-chat-at="box"]) #centre > #wintabs { grid-row: 2; grid-column: 2; }
:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"], [data-chat-at="box"]) #centre > #screen { grid-row: 3; grid-column: 2; }
:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"], [data-chat-at="box"]) #centre > #prompt { grid-row: 5; grid-column: 1 / -1; }
:root:not([data-phone]):is([data-roombox="left"], [data-roombox="right"], [data-chat-at="box"]) #centre > #hud { grid-row: 6; grid-column: 1 / -1; }
