main {
  width: 100%;
  text-align: center;
  padding-top: 12px;
  padding-bottom: 20px;
  color: #0000dc;
}

.simulation-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 0 0.75rem;
}

#unity-canvas {
  display: block;
  width: min(100%, 900px);
  max-width: 900px;
  height: auto;
  aspect-ratio: 900 / 506;
  margin: 0 auto;
  border: 2px solid #0000ff;
  background: #231F20;
}

@media screen and (max-width: 640px) {
  .simulation-shell {
    padding: 0;
  }

  #unity-canvas {
    border-width: 1px;
  }
}

/* Phones turned sideways: the whole simulation fits the screen height */
@media screen and (orientation: landscape) and (max-height: 500px) {
  #unity-canvas {
    width: min(100%, 900px, calc(80vh * 900 / 506));
  }
}

/* Focus button: phones only (narrow, or short when turned sideways) */
.focus-toggle {
  display: none;
}

@media screen and (max-width: 767.98px), screen and (max-height: 500px) {
  /* Room below the footer, so the floating button never covers a link */
  body {
    padding-bottom: 56px;
  }

  /* Floats at the lower right, like the speaker button on the Support page */
  .focus-toggle {
    display: inline-block;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1001;
    padding: 0.4rem 0.8rem;
    font: 600 0.85rem system-ui, sans-serif;
    color: hsl(233, 81%, 45%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(58, 121, 247, 0.4);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(22, 43, 208, 0.12);
    cursor: pointer;
  }
}

/* Focus mode: the simulation alone fills the screen */
body.sim-focus header,
body.sim-focus footer,
body.sim-focus .simulation-shell h2 {
  display: none;
}

body.sim-focus #unity-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  border: 0;
  z-index: 1000;
}
