:root {
  --bg-top: #fff0f6;
  --bg-bottom: #ffe1ec;
  --ink: #6b3b53;
  --muted: #c58ba6;
  --accent: #ff6b9d;
  --card: #fffafc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
}

h1 {
  margin: 4px 0 2px;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 800;
}
h1 small { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0; }

#hud {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
#hud b { color: var(--accent); font-weight: 800; }
#hud .fase-info b { color: var(--accent); }
#hud.hidden { visibility: hidden; }

#dots { display: inline-flex; align-items: center; gap: 6px; }
#dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f3c9da;
  border: 1.5px solid #ecb3cd;
  display: inline-block;
}
#dots .dot.feita { background: var(--accent); border-color: var(--accent); }
#dots .dot.atual { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,107,157,0.25); }
#dots .sep { width: 10px; display: inline-block; }

canvas {
  background: transparent;
  max-width: 96vw;
  max-height: calc(100vh - 70px);
  height: auto;
  cursor: pointer;
}

/* ===== Util buttons ===== */
#util-btns {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 5;
}
#util-btns button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
#util-btns button:active { transform: scale(0.88); }
#util-btns button.off { opacity: 0.5; text-decoration: line-through; }

/* ===== Overlays ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 224, 236, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 26px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 50px rgba(255, 107, 157, 0.28);
  border: 2px solid #ffd0e2;
  animation: pop 0.35s ease;
}
.card.big { max-width: 420px; }

@keyframes pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.card h2 { margin: 0 0 12px; color: var(--accent); font-size: 24px; }
.card p { margin: 8px 0; font-size: 15px; line-height: 1.5; }
.card .dica { color: var(--muted); font-size: 13px; }

.legenda { list-style: none; padding: 0; margin: 14px 0; text-align: left; font-size: 14px; }
.legenda li { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.amostra { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.amostra.certo    { background: #79c98a; }
.amostra.presente { background: #f3c563; }
.amostra.ausente  { background: #cdaebd; }

.card button {
  margin-top: 16px;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.4);
}
.card button:active { transform: scale(0.95); }

/* ===== Pedido ===== */
.coracao-grande {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
  color: #ff3d77;
  filter: drop-shadow(0 4px 10px rgba(255, 61, 119, 0.4));
}
.coracao-grande.pulsa { animation: bate 0.9s ease-in-out infinite; }
@keyframes bate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.18); }
  50% { transform: scale(1); }
}

.card .nome { font-size: 30px; color: #ff3d77; margin: 0; }

.botoes-pedido {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
#btn-sim {
  margin-top: 0;
  font-size: 22px;
  padding: 16px 40px;
  animation: bate 1.1s ease-in-out infinite;
}
#btn-nao {
  margin-top: 0;
  background: #d9c0cc;
  font-size: 14px;
  padding: 8px 16px;
  box-shadow: none;
  transition: transform 0.12s ease;
}

/* ===== Final ===== */
.final .card { border-color: #ff9ec4; }
.final .nome { font-size: 18px; color: var(--accent); margin-top: 8px; }

/* ===== Mobile ===== */
body.mobile h1 { font-size: 18px; }
body.mobile #hud { font-size: 12px; }
body.mobile .card { padding: 22px 18px; }
