html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0px;
  border: 0;
  overflow: hidden; /*  Отключает скроллбары */
  display: block; 
}


div.Title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}


div.Title p {
    margin: 0;
    font-size: var(--font-title);
    font-family: "Bookman Old Style", serif;
    line-height: 0.875;
    font-weight: bold;
    text-align: center;
    overflow-wrap: break-word;

    color: var(--board-color);
    text-shadow: 
    1px  1px     #fff, 
   -1px  1px     #fff, 
    1px -1px     #fff, 
   -1px -1px     #fff,
    1px  1px 5px #555;
}

#ApplicationHeader {
  font-size: var(--font-subtitle);
  line-height: 1;
  color: var(--level4-color);
}

#divCanvas {
  border: 13px solid rgb(221, 221, 221);
  height: 100%;
  min-height: 0;
  box-shadow: 0px 0px 4px 3px rgba(0, 0, 0, 0.24);
  border-radius: 7px;
  background-color: white;
}

#divCanvasInner {
  /* border: 5px solid rgba(71, 71, 71, 0.418);  */
  position: relative;
  height: 100%;
  background: white;
  box-shadow: inset 0 0 10px #000000;
}

#divCanvasInner canvas {
  position: absolute;
  left: 0;
  top: 0;
}

#CanvasOverlay {
  z-index: 1;
  touch-action: none;
}

#divControls {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 13px solid rgba(255, 178, 36, 0.767);
  border-top-color: rgba(255, 215, 140, 0.767);
  border-bottom-color: rgba(255, 215, 140, 0.767);
  background: white;
  box-shadow: 0px 0px 4px 3px rgba(0, 0, 0, 0.24);
  border-radius: 7px;
}

#divControlsInner {
  border: 5px solid rgb(196, 127, 0);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--board-color);
  box-shadow: inset 0 0 10px #000000;
}

#BoardFrame {
  display: block;
  height: 100%;
}

#divMenu {
  position: relative;
  min-width: 0;
  min-height: 0;
  color: white;
  border: 13px solid rgba(255, 178, 36, 0.767);
  border-top-color: rgba(255, 215, 140, 0.767);
  border-bottom-color: rgba(255, 215, 140, 0.767);
  box-shadow: 0px 0px 4px 3px rgba(0, 0, 0, 0.24);
  border-radius: 7px;
  background-color: rgba(168, 168, 168, 0.1);
}

#divMenuInner {
  border: 5px solid rgb(196, 127, 0);
  padding: var(--menu-inner-padding);
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--board-color);
  box-shadow: inset 0 0 4px #000000;
}


* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
.grid-container {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  display: grid;
  grid-template-areas:
    ". . headerArea headerArea headerArea . ."
    ". . . . . . ."
    ". menuArea . contentArea . sidebarArea ."
    ". . . . . . ."
    ". footerArea footerArea footerArea footerArea footerArea .";
  grid-template-columns:
    var(--gutter-outer)
    minmax(0, var(--menu-width))
    var(--gutter-inner)
    minmax(0, 1fr)
    var(--gutter-inner)
    var(--controls-width)
    var(--gutter-outer);
  grid-template-rows:
    var(--header-height)
    var(--grid-gap)
    var(--stage-height)
    var(--grid-gap)
    var(--footer-height);
}
.headerArea {
  grid-area: headerArea;
  min-width: 0;
  min-height: 55px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 0;
  overflow: visible;
}
.menuArea {
  grid-area: menuArea;
  min-width: 0;
}
.sidebarArea {
  grid-area: sidebarArea;
  min-width: 0;
}
.contentArea {
  grid-area: contentArea;
  min-width: 0;
}
.footerArea {
  grid-area: footerArea;
}

/* Планшеты  */
@media (max-width: 1024px) {
  :root {
    --menu-width: max(9.5rem, 14%);
    --controls-width: max(12rem, 25%);
    --gutter-outer: 6px;
    --gutter-inner: 8px;
  }
}

/* Смартфоны: без жёсткого минимума 9.5rem */
@media (max-width: 600px) {
  :root {
    --menu-width: 30%;
    --controls-width: 42%;
    --gutter-outer: 4px;
    --gutter-inner: 4px;
  }
}

/* смартфоны, повернутые горизонтально  */
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --menu-width: 22%;
    --gutter-outer: 4px;
    --gutter-inner: 4px;
    --footer-height: 12px;
    --grid-gap: 4px;
  }

  html,
  body {
    overflow: auto;
  }

  .headerArea {
    min-height: 40px;
    padding: 2px 0;
  }
}
/* смартфоны, повернутые вертикально  */
@media (orientation: portrait) {
  :root {
    --stage-height: 50vh;
    --stage-height: 50dvh;
  }

  html,
  body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
  }

  .grid-container {
    height: auto;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
  }
}
