@font-face {
  font-family: 'Lexend';
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/Lexend-Bold.woff2') format('woff2');
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #660103;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas#game {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#start-controls {
  position: fixed;
  top: 53%;
  left: 50%;
  width: min(82vw, 310px);
  transform: translateX(-50%);
  text-align: center;
}

#start-caption {
  margin: 0 auto 12px;
  max-width: 28ch;
  color: #fff;
  font: 700 clamp(12px, 2vh, 15px)/1.35 'Lexend', sans-serif;
  text-shadow: 0 1px 4px #400c0d;
}

#start-button {
  width: min(70vw, 27vh, 300px);
  min-width: 128px;
  padding: 16px 24px;
  border: 0;
  color: #fff;
  background: #000;
  font: 700 clamp(16px, 3vh, 24px) Arial, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  animation: start-pulse 1.6s ease-in-out infinite;
}

#start-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  animation: none;
}

@keyframes start-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  #start-button { animation: none; }
}

#tutorial {
  position: fixed;
  inset: 0;
  z-index: 1;
  place-items: center;
  padding: 16px;
  background: rgb(64 12 13 / 84%);
}

#tutorial:not([hidden]) {
  display: grid;
}

.tutorial-card {
  width: min(100%, 28rem);
  padding: clamp(16px, 4vh, 36px);
  color: #fff;
  text-align: center;
  background: #820104;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 20px;
}

#tutorial-title {
  font: 700 clamp(24px, 5vw, 36px)/1.1 'Lexend', sans-serif;
}

#tutorial-instructions {
  max-width: 30ch;
  margin: 12px auto 16px;
  font: 700 clamp(14px, 3vw, 18px)/1.4 'Lexend', sans-serif;
}

#tutorial-target {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(100px, 32vh, 216px);
  aspect-ratio: 1;
  margin: auto;
  padding: 8%;
  background: rgb(255 255 255 / 12%);
  border: 2px dashed rgb(255 224 161 / 45%);
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
}

#tutorial-target img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

#tutorial-target:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

#tutorial-target::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(#ffe0a1 var(--tutorial-progress, 1turn), rgb(255 224 161 / 20%) 0);
  mask-image: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  pointer-events: none;
}

.tutorial-countdown {
  margin-top: 18px;
  color: #ffe0a1;
  font: 700 clamp(18px, 4vh, 24px)/1 'Lexend', sans-serif;
  font-variant-numeric: tabular-nums;
}
