:root {
  --bg-top: #ffd7c2;
  --bg-bottom: #fff5ef;
  --card: rgba(255, 252, 248, 0.82);
  --card-border: rgba(150, 96, 63, 0.16);
  --text: #4e372a;
  --accent: #ff7a59;
  --accent-2: #ffc76b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

canvas {
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 24px;
  z-index: 10;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(87, 47, 36, 0.22);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal.is-open {
  display: grid;
}

.modal-card {
  max-width: 520px;
  padding: 28px 28px 24px;
  border-radius: 28px;
  background: rgba(255, 248, 244, 0.92);
  border: 1px solid rgba(150, 96, 63, 0.16);
  box-shadow: 0 24px 80px rgba(107, 58, 31, 0.2);
}

.modal-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4.6vw, 2.6rem);
  line-height: 1.02;
}

.card {
  max-width: 420px;
  padding: 28px 28px 24px;
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 80px rgba(107, 58, 31, 0.16);
  pointer-events: auto;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 800;
  color: #d0714c;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 0.95;
}

.lead {
  margin: 14px 0 18px;
  font-size: 1.05rem;
}

.controls {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.controls span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  width: 100%;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 28px rgba(255, 122, 89, 0.28);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(255, 122, 89, 0.32);
}

.hint,
.hud {
  position: fixed;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  z-index: 5;
  font-weight: 700;
  pointer-events: none;
}

.hint {
  bottom: 18px;
  font-size: 0.92rem;
  color: rgba(78, 55, 42, 0.86);
}

.hud {
  top: 18px;
  align-items: center;
  color: #6b452e;
}

.hud span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.72);
  border: 1px solid rgba(151, 96, 65, 0.12);
  backdrop-filter: blur(10px);
}

.playing .overlay {
  opacity: 0;
  transition: opacity 220ms ease;
}

.playing .modal {
  opacity: 1;
}

.playing .card,
.playing .hint {
  pointer-events: none;
}

@media (max-width: 720px) {
  .hud,
  .hint {
    left: 12px;
    right: 12px;
    font-size: 0.82rem;
  }

  .hud {
    top: 12px;
  }

  .hint {
    bottom: 12px;
  }

  .card {
    padding: 22px 18px 20px;
  }
}
