/* sausages: site look (black, bold Inter, sharp corners). The sausages bring the colour. */

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.game {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 16px 16px max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.links {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

.links a {
  color: var(--dim);
}

.links a:hover {
  color: var(--fg);
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#gl {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

#gl.dragging {
  cursor: grabbing;
}

#fx {
  pointer-events: none;
}

.nogl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 24px;
  text-align: center;
  color: var(--dim);
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  text-align: center;
  color: var(--dim);
  font-size: 15px;
  pointer-events: none;
  text-shadow: 0 1px 8px #000, 0 0 3px #000;
  transition: opacity 0.4s;
}

.hint.gone {
  opacity: 0;
}

/* Celebration text */

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 47%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  pointer-events: none;
}

.banner-text {
  margin: 0;
  padding: 0 8px;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(30px, 9vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: #fff;
  text-shadow: 0 3px 0 #b3261e, 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
}

.banner-text.pop {
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

.banner-text.party {
  font-size: clamp(44px, 14vw, 72px);
  color: #ffd166;
  animation: pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards, wiggle 0.7s ease-in-out 0.55s infinite alternate;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-6deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes wiggle {
  from {
    transform: rotate(-3deg) scale(1);
  }
  to {
    transform: rotate(3deg) scale(1.06);
  }
}

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 20px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 0;
  cursor: pointer;
  pointer-events: auto;
}

.btn:hover {
  background: #ccc;
  border-color: #ccc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .banner-text.pop,
  .banner-text.party {
    animation: none;
    opacity: 1;
  }
}
