/* Cloud Hop's bundled fonts (latin + Polish latin-ext) from the shared ../fonts, so the game looks the same offline.
   License: ../fonts/OFL-*.txt */
@font-face {
  font-family: "Nunito";
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/nunito-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/nunito-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Pixelify Sans";
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/pixelify-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Pixelify Sans";
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/pixelify-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  background: #0b1119;
  color: #fff;
  font-family: "Nunito", system-ui, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 0;
}

canvas {
  display: block;
  border-radius: 18px;
  touch-action: none;
  cursor: pointer;
}

/* Player name entry, shown over the game. */
.name-dialog {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 9, 20, 0.7);
}

.name-dialog[hidden] { display: none; }

.name-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 320px);
  padding: 20px;
  border: 2px solid #9fd8ff;
  border-radius: 14px;
  background: #121c4c;
  font-family: "Pixelify Sans", "Nunito", system-ui, sans-serif;
}

.name-box label { color: #ffd23f; font-size: 20px; font-weight: 700; }

.name-box input {
  padding: 10px 12px;
  border: 2px solid #3d4b8f;
  border-radius: 10px;
  background: #0b1130;
  color: #fff;
  font: inherit;
  font-size: 20px;
  user-select: text;
}

.name-box input:focus { outline: none; border-color: #ffe680; }

.name-actions { display: flex; gap: 10px; justify-content: flex-end; }

.name-actions button {
  min-width: 64px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: #253045;
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.name-actions button[type="submit"] { background: #1c4ea8; }

/* Short landscape screens: car displays, tablets, laptops, TVs. */
@media (orientation: landscape) and (max-height: 820px) {
  body {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  canvas { border-radius: 12px; }
}
