/* No scrolling, zooming, text selection or long-press menus (design D6). */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #13679f;
  color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
}

canvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.panel {
  max-width: min(560px, 100%);
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: clamp(12px, 3.5vmin, 28px) clamp(16px, 4.5vmin, 36px);
  border-radius: 20px;
  background: rgba(6, 34, 64, 0.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
}

h1,
h2 {
  margin: 0 0 0.3em;
  font-size: clamp(30px, min(9vw, 11vh), 60px);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 0.6em;
  font-size: clamp(15px, min(4.2vw, 4.8vh), 21px);
  line-height: 1.35;
}

.result {
  font-size: clamp(22px, min(6vw, 7vh), 34px);
  font-weight: 700;
}

.newbest {
  color: #ffd447;
  font-weight: 700;
}

.big {
  margin: 0;
  font-size: clamp(18px, min(5vw, 6vh), 28px);
  font-weight: 700;
}

.hint {
  margin: 0.5em 0 0;
  opacity: 0.75;
}

button {
  margin-top: 0.2em;
  padding: 0.4em 1.6em;
  border: 0;
  border-radius: 999px;
  background: #ffd447;
  color: #0a3a66;
  font: inherit;
  font-size: clamp(20px, min(6vw, 7vh), 30px);
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

button:active {
  transform: scale(0.96);
}

/* Instructions for the current device: touch on phones, keys elsewhere. */
.touch-only,
.tip {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .touch-only {
    display: block;
  }
  .keys-only {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .tip {
    display: block;
    opacity: 0.85;
  }
}
