/* =========================================================
   Amigo Secreto — tema claro, festivo e "clean"
   ========================================================= */

:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #221d35;
  --muted: #6f6a82;
  --line: #f0e5d6;
  --field: #fffcf7;

  --red: #ff4d5e;     --red-dark: #d93445;   --red-soft: #ffe4e7;
  --yellow: #ffc53d;  --yellow-dark: #e0a51c; --yellow-soft: #fff3cf;
  --green: #16a36b;   --green-dark: #0f7d51; --green-soft: #dcf6e9;
  --blue: #4d7cfe;    --blue-dark: #3360dc;  --blue-soft: #e4ebff;
  --purple: #8b5cf6;  --purple-dark: #6d3fe0; --purple-soft: #efe7fe;
  --orange: #ff8a3d;  --orange-dark: #e06c1f; --orange-soft: #ffe9d9;

  --radius: 24px;
  --shadow: 0 1px 0 rgba(34, 29, 53, .04), 0 18px 40px -22px rgba(34, 29, 53, .28);
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg opacity='.28'%3E%3Crect x='20' y='30' width='12' height='5' rx='2.5' fill='%23FF4D5E' transform='rotate(30 26 32)'/%3E%3Ccircle cx='130' cy='42' r='3.5' fill='%23FFC53D'/%3E%3Crect x='186' y='96' width='12' height='5' rx='2.5' fill='%234D7CFE' transform='rotate(-40 192 98)'/%3E%3Ccircle cx='64' cy='128' r='3.5' fill='%2316A36B'/%3E%3Crect x='118' y='170' width='12' height='5' rx='2.5' fill='%238B5CF6' transform='rotate(70 124 172)'/%3E%3Ccircle cx='212' cy='206' r='3' fill='%23FF8A3D'/%3E%3Crect x='30' y='204' width='10' height='5' rx='2.5' fill='%23FFC53D' transform='rotate(-20 35 206)'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 80px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 9vw, 3.4rem); font-weight: 700; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--red); font-weight: 700; }
small, .muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand span { font-size: 1.6rem; }

.hero { position: relative; text-align: center; padding: 28px 0 22px; }
.hero h1 { margin-bottom: 10px; }
.hero h1 em {
  font-style: normal; color: var(--red);
  background: linear-gradient(transparent 62%, var(--yellow-soft) 62%);
  padding: 0 .08em;
}
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 470px; margin: 0 auto; }
.hero-gift {
  font-size: 5.2rem; line-height: 1; display: inline-block; margin-bottom: 8px;
  filter: drop-shadow(0 14px 18px rgba(255, 77, 94, .25));
  animation: bob 3.2s ease-in-out infinite;
}
.floaty { position: absolute; font-size: 1.9rem; pointer-events: none; animation: float 6s ease-in-out infinite; opacity: .9; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(12deg); } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 22px; }
.step {
  background: var(--card); border-radius: 18px; padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow); font-weight: 700; font-size: .9rem;
}
.step b { display: block; font-size: 1.9rem; line-height: 1.2; margin-bottom: 2px; }
.step small { display: block; font-weight: 600; font-size: .78rem; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  margin-bottom: 16px;
}
@media (min-width: 560px) { .card { padding: 28px; } }
.card.center { text-align: center; }

.sec-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.sec-title h2, .sec-title h3 { margin: 0; }
.sec-title p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.sec-title + .sec-title { margin-top: 28px; }
.emoji-badge {
  flex: none; width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--yellow-soft);
}
.emoji-badge.red { background: var(--red-soft); }
.emoji-badge.green { background: var(--green-soft); }
.emoji-badge.blue { background: var(--blue-soft); }
.emoji-badge.purple { background: var(--purple-soft); }
.divider { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 18px); border: 0; margin: 26px 0; }

/* ---------- campos ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 800; font-size: .88rem; margin-bottom: 6px; }
.field small { font-weight: 600; }

input, textarea, select {
  width: 100%;
  font: inherit; font-size: 16px; font-weight: 600;
  color: var(--ink);
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #b3aabd; font-weight: 600; }
textarea { resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236f6a82' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px var(--blue-soft); }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--red); flex: none; }

.grid2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* segmented control (data) */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: #f6eee3; border-radius: 16px; margin-bottom: 10px; }
.segmented button {
  font: inherit; font-weight: 800; font-size: .86rem; color: var(--muted);
  border: 0; background: transparent; border-radius: 12px; padding: 9px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: background .15s, color .15s, transform .1s;
}
.segmented button:active { transform: scale(.96); }
.segmented .seg-icon { font-size: 1.35rem; line-height: 1; }
.segmented button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(34, 29, 53, .2); }
.month-pane { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }

/* ---------- botões (estilo "3D" de jogo) ---------- */
.btn {
  --b: var(--card); --s: var(--line); --t: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  min-height: 48px; padding: 10px 18px;
  border-radius: 16px; border: 2px solid var(--s);
  background: var(--b); color: var(--t);
  box-shadow: 0 4px 0 var(--s);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, box-shadow .08s, filter .15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 4px;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--s); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { --b: var(--red); --s: var(--red-dark); --t: #fff; }
.btn.green { --b: var(--green); --s: var(--green-dark); --t: #fff; }
.btn.blue { --b: var(--blue); --s: var(--blue-dark); --t: #fff; }
.btn.yellow { --b: var(--yellow); --s: var(--yellow-dark); --t: var(--ink); }
.btn.danger { --t: var(--red); --s: var(--red-soft); }
.btn.ghost { --b: transparent; box-shadow: none; border-style: dashed; margin-bottom: 0; }
.btn.ghost:active { transform: scale(.97); }
.btn.big { width: 100%; min-height: 62px; font-size: 1.25rem; border-radius: 20px; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .9rem; border-radius: 13px; box-shadow: 0 3px 0 var(--s); }
.btn.small:active { transform: translateY(3px); }
.btn.icon { min-width: 44px; padding: 6px; }

.btn.shine { overflow: hidden; }
.btn.shine::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
.btn .dice { display: inline-block; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.btn:hover .dice { transform: rotate(200deg) scale(1.15); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions > .btn { flex: 1 1 auto; }

/* ---------- tickets de participantes (cadastro) ---------- */
.tickets { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ticket {
  --c: var(--red); --cs: var(--red-soft);
  position: relative; display: grid; grid-template-columns: 54px 1fr;
  border-radius: 20px; background: var(--field); border: 2px solid var(--line);
  animation: ticketIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.ticket.out { animation: ticketOut .25s ease-in forwards; }
@keyframes ticketIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes ticketOut { to { opacity: 0; transform: translateX(30px) scale(.95); } }
.ticket .stub {
  background: var(--c); color: #fff; border-radius: 17px 0 0 17px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  border-right: 2px dashed rgba(255, 255, 255, .7);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; left: 45px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line);
}
.ticket::before { top: -10px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
.ticket .body { padding: 12px; display: grid; gap: 8px; min-width: 0; }
.ticket input { background: #fff; }
.ticket .name-row { display: flex; gap: 4px; align-items: center; }
.ticket .name-row input { flex: 1; min-width: 0; }
.ticket .name-row .x-btn { flex: none; }
.ticket .tools { display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; }
.ticket.red { --c: var(--red); --cs: var(--red-soft); }
.ticket.yellow { --c: var(--yellow-dark); --cs: var(--yellow-soft); }
.ticket.green { --c: var(--green); --cs: var(--green-soft); }
.ticket.blue { --c: var(--blue); --cs: var(--blue-soft); }
.ticket.purple { --c: var(--purple); --cs: var(--purple-soft); }
.ticket.orange { --c: var(--orange); --cs: var(--orange-soft); }

.pill-btn {
  font: inherit; font-weight: 800; font-size: .82rem;
  border: 2px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.pill-btn:hover { border-color: var(--muted); }
.pill-btn.on { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.pill-btn .count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.x-btn {
  width: 36px; height: 36px; border-radius: 12px; border: 0; background: transparent;
  color: var(--muted); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center;
}
.x-btn:hover { background: var(--red-soft); color: var(--red); }

.chips-panel { background: #fff; border: 2px dashed var(--red-soft); border-radius: 14px; padding: 10px; animation: ticketIn .25s ease-out; }
.chips-panel p { margin: 0 0 8px; font-size: .85rem; color: var(--muted); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle {
  font: inherit; font-weight: 700; font-size: .88rem;
  border: 2px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: all .15s;
}
.chip-toggle[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; text-decoration: line-through; text-decoration-thickness: 2px; }
.restr-summary { font-size: .82rem; color: var(--red); font-weight: 700; }

.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.row-actions .btn { flex: 1 1 auto; }

.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: .95rem; font-weight: 700; cursor: pointer; }

details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 800; font-size: .9rem; padding: 6px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "⚙️ "; }


/* ---------- overlay "sorteando" ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(255, 248, 239, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.slot-card { width: min(380px, 100%); text-align: center; background: #fff; border-radius: 28px; padding: 26px 20px; box-shadow: 0 30px 60px -20px rgba(34, 29, 53, .35); animation: pop .4s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.slot-card h2 { margin: 6px 0 16px; }
.slot-window {
  position: relative; height: 84px; overflow: hidden; border-radius: 18px;
  background: var(--ink); box-shadow: inset 0 6px 14px rgba(0, 0, 0, .5);
}
.slot-window::before, .slot-window::after { content: ""; position: absolute; left: 0; right: 0; height: 26px; z-index: 1; pointer-events: none; }
.slot-window::before { top: 0; background: linear-gradient(var(--ink), transparent); }
.slot-window::after { bottom: 0; background: linear-gradient(transparent, var(--ink)); }
.slot-reel { will-change: transform; }
.slot-reel div {
  height: 84px; display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem;
  white-space: nowrap; overflow: hidden; padding: 0 12px;
}
.slot-done { font-size: 4.5rem; line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.slot-lights { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.slot-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); animation: blink .6s infinite alternate; }
.slot-lights i:nth-child(2n) { background: var(--red); animation-delay: .3s; }
@keyframes blink { to { opacity: .25; transform: scale(.7); } }

/* ---------- painel admin ---------- */
.admin-hero { position: relative; overflow: hidden; padding-top: 26px; }
.admin-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 24px, var(--yellow) 24px 48px, var(--green) 48px 72px, var(--blue) 72px 96px, var(--purple) 96px 120px);
}
.admin-hero h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .84rem; font-weight: 800; padding: 5px 11px; border-radius: 999px;
  background: #f6eee3; color: var(--ink);
}
.chip.ok { background: var(--green-soft); color: var(--green-dark); }
.chip.info { background: var(--blue-soft); color: var(--blue-dark); }
.chip.warn { background: var(--yellow-soft); color: #8a5d00; }
.chip.bad { background: var(--red-soft); color: var(--red-dark); }

.linkbox {
  display: flex; gap: 8px; align-items: center;
  background: var(--yellow-soft); border: 2px dashed var(--yellow);
  border-radius: 16px; padding: 8px 8px 8px 14px; margin: 16px 0 6px;
}
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; font-weight: 700; color: #8a5d00; }
.linkbox .btn { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 16px; }
.stat { border-radius: 18px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat span { font-size: .78rem; font-weight: 800; }
.stat .e { font-size: 1.3rem; display: block; }
.stat.s1 { background: var(--purple-soft); color: var(--purple-dark); }
.stat.s2 { background: var(--blue-soft); color: var(--blue-dark); }
.stat.s3 { background: var(--green-soft); color: var(--green-dark); }
.progress { height: 12px; background: #f6eee3; border-radius: 99px; overflow: hidden; margin: 0 0 18px; display: flex; }
.progress > div { height: 100%; transition: width .6s cubic-bezier(.2, 1, .3, 1); }
.progress .p-done { background: var(--green); }
.progress .p-seen { background: var(--blue); }

.people { display: flex; flex-direction: column; gap: 14px; }
.person {
  --c: var(--red); --cs: var(--red-soft);
  position: relative; border-radius: 22px; background: var(--field); border: 2px solid var(--line);
  padding: 14px; transition: border-color .2s;
}
.person.red { --c: var(--red); --cs: var(--red-soft); }
.person.yellow { --c: var(--yellow-dark); --cs: var(--yellow-soft); }
.person.green { --c: var(--green); --cs: var(--green-soft); }
.person.blue { --c: var(--blue); --cs: var(--blue-soft); }
.person.purple { --c: var(--purple); --cs: var(--purple-soft); }
.person.orange { --c: var(--orange); --cs: var(--orange-soft); }
.person-head { display: flex; gap: 12px; align-items: center; }
.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 2rem; background: var(--cs);
}
.person-info { flex: 1; min-width: 0; }
.person-info strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; overflow-wrap: anywhere; }
.person-info .gift { display: block; font-size: .9rem; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.person .status { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.assign {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding: 8px 8px 8px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--line);
  position: relative;
}
.assign label { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.assign select { padding: 8px 36px 8px 10px; border-radius: 12px; }
.lock-veil {
  position: absolute; inset: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: repeating-linear-gradient(135deg, #f7f0e6 0 10px, #fbf6ef 10px 20px);
  font-weight: 800; font-size: .88rem; color: var(--muted);
}
body.show-secrets .lock-veil { display: none; }

.person-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.person-actions .btn { margin-bottom: 3px; }
.person-actions .wide { grid-column: 1 / -1; }
.more-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.more-actions .btn { flex: 1 1 auto; }

.edit-form { display: grid; gap: 8px; margin-top: 12px; }

.rules { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.rules li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--red-soft); font-weight: 700; font-size: .95rem;
}
.rule-form { display: grid; gap: 8px; grid-template-columns: 1fr; align-items: center; }
.rule-form .sep { text-align: center; color: var(--red); font-weight: 800; font-size: .9rem; }
@media (min-width: 600px) { .rule-form { grid-template-columns: 1fr auto 1fr; } }

details.section > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { margin: 0; flex: 1; font-size: 1.25rem; }
details.section > summary::after {
  content: "+"; font-family: var(--font-display); font-size: 1.6rem; color: var(--muted);
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #f6eee3;
  transition: transform .25s;
}
details.section[open] > summary::after { transform: rotate(45deg); }
details.section[open] > summary { margin-bottom: 18px; }
details.section[open] > summary ~ * { animation: ticketIn .3s ease-out; }

.note { font-size: .92rem; font-weight: 600; padding: 12px 14px; border-radius: 16px; background: var(--blue-soft); color: var(--blue-dark); margin: 0 0 14px; }
.note.yellow { background: var(--yellow-soft); color: #8a5d00; }

/* ---------- animação ao rolar ---------- */
.sr { opacity: 0; transform: translateY(22px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.2, 1, .3, 1); transition-delay: var(--d, 0ms); }
.sr.in { opacity: 1; transform: none; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100% - 32px));
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: 18px; font-weight: 700; font-size: .95rem;
  background: var(--ink); color: #fff; box-shadow: 0 16px 32px -10px rgba(34, 29, 53, .5);
  animation: toastIn .35s cubic-bezier(.2, 1.5, .4, 1);
}
.toast-icon { font-size: 1.2rem; line-height: 1.2; }
.toast.error { background: var(--red-dark); }
.toast.warn { background: #8a5d00; }
.toast.ok { background: var(--green-dark); }
.toast.out { animation: toastOut .25s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

.loading { text-align: center; padding: 80px 0; color: var(--muted); font-weight: 700; }
.loading .spin { display: inline-block; font-size: 3rem; animation: bob 1s ease-in-out infinite; }

.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

.label-caps { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--muted); font-weight: 800; }
.huge-emoji { font-size: 6.5rem; line-height: 1; display: block; margin: 6px 0 12px; }

/* =========================================================
   Página de revelação — minimalista: raspadinha + contador
   ========================================================= */
body.reveal-page { background: #f4f2ee; background-image: none; }
.reveal-wrap {
  max-width: 420px; margin: 0 auto; padding: 24px 20px;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.reveal-wrap .hi { margin: 0 0 14px; color: var(--muted); font-weight: 700; }

.scratch {
  position: relative; border-radius: 20px; overflow: hidden;
  background: #fff; border: 1px solid #e6e1d9;
  min-height: 190px; display: grid; place-items: center; padding: 24px 16px;
  user-select: none; -webkit-user-select: none;
}
.scratch .who {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: clamp(2.2rem, 10vw, 3rem); line-height: 1.1; overflow-wrap: anywhere;
}
.scratch .gift-line { margin-top: 10px; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .4s ease; }
.scratch canvas.gone { opacity: 0; pointer-events: none; }
.scratch.locked .who, .scratch.locked .gift-line { filter: blur(14px); transition: filter .5s; }

.scratch-hint { margin: 12px 0 0; color: var(--muted); font-weight: 700; font-size: .9rem; }

.countdown { margin-top: 18px; }
.countdown p { margin: 0 0 10px; font-weight: 700; }
.countdown b { font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: #e6e1d9; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--ink); transform-origin: left; transition: transform 1s linear; }

.locked-msg { margin-top: 18px; }
.locked-msg h1 { font-size: 1.4rem; margin: 0 0 6px; }
.locked-msg p { margin: 0; color: var(--muted); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sr { opacity: 1; transform: none; }
}
