/* The page around the game: a deliberately plain, generic front door,
   styled by the browser's own light/dark scheme rather than any game's
   palette. Once the game starts, the page is hidden and the canvas
   fills the window. */

:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  line-height: 1.4;
}

html,
body {
  margin: 0;
  height: 100%;
}

/* The game fits its canvas to the body. 100dvh matches the visible
   viewport on iOS Safari, where 100vh extends under the URL bar. */
body {
  height: 100dvh;
}

/* Touches are the game's: no scrolling or zooming the page. */
#glcanvas {
  display: block;
  touch-action: none;
}

#page {
  position: fixed;
  inset: 0;
  overflow: auto;
  display: grid;
  place-content: center;
  grid-template-columns: min(24rem, 100vw - 2rem);
  gap: 1.25rem;
  background: Canvas;
}

/* `hidden` always hides, whatever display a rule gives the element. */
[hidden] {
  display: none !important;
}

[data-view] {
  display: grid;
  gap: 1.25rem;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.15rem;
}

p {
  margin: 0;
}

section,
form {
  display: grid;
  gap: 0.35rem;
}

.row {
  display: flex;
  gap: 0.5rem;
}

.button,
button,
input {
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 4px;
  background: transparent;
  color: inherit;
}

.button {
  text-decoration: none;
  text-align: center;
}

.button,
button {
  cursor: pointer;
  touch-action: manipulation;
}

.button:hover,
button:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

input {
  flex: 1;
  min-width: 0;
}

input[name="room"] {
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

input::placeholder {
  text-transform: none;
  letter-spacing: normal;
}

.code {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

.notice {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
