/* After Bingo's page: the game's olive edge to edge, the canvas at 9:16 as large as the window allows, centred and
   letterboxed in olive, the same in fullscreen. The colours are UiTheme's: Backdrop, Forward, Panel, Ink, Outline. */
:root {
  --olive: #3f4a26;
  --mustard: #f2b630;
  --cream: #fff3d9;
  --ink: #241810;
  --outline: #1b120b;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--olive);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

#frame {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--olive);
}

#game {
  position: relative;
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  container-type: inline-size;
}

/* A phone's address bar comes and goes: the dynamic viewport is the part that shows. */
@supports (height: 100dvh) {
  #game {
    width: min(100dvw, calc(100dvh * 9 / 16));
    height: min(100dvh, calc(100dvw * 16 / 9));
  }
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--olive);
  outline: none;
  touch-action: none;
}

#loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

#loader[hidden] {
  display: none;
}

#loader-name {
  color: var(--cream);
  font-size: 32px;
  font-size: clamp(22px, 9cqw, 48px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 var(--outline);
}

#loader-bar {
  width: 60%;
  height: 22px;
  box-sizing: border-box;
  border: 3px solid var(--outline);
  border-radius: 8px;
  background: var(--cream);
  overflow: hidden;
}

#loader-fill {
  width: 0;
  height: 100%;
  background: var(--mustard);
  transition: width 0.2s ease-out;
}

#loader-message {
  max-width: 80%;
  min-height: 1.4em;
  color: var(--cream);
  font-size: 15px;
  text-align: center;
}

#fullscreen {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#fullscreen.awake {
  opacity: 1;
  pointer-events: auto;
}

#fullscreen[hidden] {
  display: none;
}

#fullscreen svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#fullscreen .leave,
#fullscreen.on .enter {
  display: none;
}

#fullscreen.on .leave {
  display: inline;
}

#banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(90vw, 480px);
}

#banner div {
  padding: 8px 14px;
  border: 3px solid var(--outline);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
}

#banner .error {
  background: #d4553a;
  color: #fff;
}
