@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("../fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Pacifico"; font-weight: 400; font-display: swap; src: url("../fonts/pacifico-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Dancing Script"; font-weight: 700; font-display: swap; src: url("../fonts/dancing-script-latin-700-normal.woff2") format("woff2"); }

:root {
  --blue: #2f5fa8;
  --blue-l: #dce8f8;
  --red: #d6453d;
  --red-l: #fbdad6;
  --cream: #fff8ef;
  --ink: #1f2d4d;
  --blue-d: color-mix(in srgb, var(--blue) 72%, #0b1a3a);
  --red-d: color-mix(in srgb, var(--red) 78%, #3a0b08);
  --paper: #fffdf9;
  --sand: #f3e3cf;
  --radius: 26px;
  --script: "Dancing Script", "Brush Script MT", cursive;
  --brand: "Pacifico", "Dancing Script", cursive;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--blue-l) 70%, transparent) 0, transparent 38%),
    radial-gradient(circle at 92% 22%, color-mix(in srgb, var(--red-l) 65%, transparent) 0, transparent 34%),
    radial-gradient(circle at 20% 96%, color-mix(in srgb, var(--red-l) 55%, transparent) 0, transparent 36%),
    radial-gradient(circle at 95% 92%, color-mix(in srgb, var(--blue-l) 65%, transparent) 0, transparent 36%);
  background-attachment: fixed;
  overflow-x: hidden;
}
button { font-family: inherit; color: inherit; }

.app {
  max-width: 540px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 28px);
}
.app.has-dock { padding-bottom: calc(env(safe-area-inset-bottom) + 230px); }

/* ---------- topo ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 8px; }
.brand { font-family: var(--brand); color: var(--red); font-size: 19px; line-height: 1; white-space: nowrap; }
.steps { display: flex; gap: 6px; }
.step {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 5px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--blue-l) 55%, white); color: color-mix(in srgb, var(--blue) 60%, white);
}
.step i { font-style: normal; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: white; font-size: 10px; }
.step.on { background: var(--blue); color: white; }
.step.on i { color: var(--blue); }
.step.done { background: var(--red-l); color: var(--red-d); }
.step.done i { background: var(--red); color: white; }
.step span { display: none; }
.top { justify-content: center; }
.steps { gap: 5px; }
.step { padding: 4px 8px; }
.step.on span { display: inline; }

.namebar { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 2px 0 12px; flex-wrap: wrap; }
.namebar small { width: 100%; text-align: center; font-size: 11px; font-weight: 800; color: color-mix(in srgb, var(--ink) 60%, white); letter-spacing: .1em; text-transform: uppercase; }
.tiles { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; perspective: 600px; }
.tile {
  width: 34px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
  background: var(--paper); border: 2px dashed color-mix(in srgb, var(--blue) 35%, white); color: color-mix(in srgb, var(--blue) 45%, white);
  transition: background .3s, color .3s;
}
.tile.on { background: var(--blue); border: 2px solid var(--blue); color: white; }
.tile.pop { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.tiles.big { gap: 8px; }
.tiles.big .tile { width: 52px; height: 66px; border-radius: 16px; font-size: 34px; }
.tiles.big .tile.on { background: var(--red); border-color: var(--red); }
.tiles.big .tile.flip { animation: flip .7s ease both; }

/* ---------- cartões ---------- */
.card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--blue-l);
  border-radius: var(--radius);
  padding: 16px 14px 18px;
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--blue) 70%, transparent), 0 2px 0 white inset;
}
.card + .card { margin-top: 14px; }
.sheet { padding-top: 6px; }
.arch { display: block; width: 132px; height: auto; margin: 4px auto 0; }
.arch.lg { width: 220px; }
.title { font-family: var(--script); font-weight: 700; color: var(--red); text-align: center; margin: 0; font-size: 38px; line-height: 1.05; }
.title.brand { font-family: var(--brand); font-weight: 400; font-size: 34px; }
.kicker { text-align: center; text-transform: uppercase; letter-spacing: .22em; font-size: 11px; font-weight: 800; color: var(--blue); margin: 2px 0 0; }
.lead { text-align: center; margin: 8px 6px 14px; font-size: 14.5px; line-height: 1.5; color: color-mix(in srgb, var(--ink) 82%, white); }
.rule { height: 2px; margin: 12px 18px; border: 0; background: repeating-linear-gradient(90deg, var(--blue-l) 0 8px, transparent 8px 14px); }

/* ---------- botões ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 800; font-size: 16px; letter-spacing: .01em;
  background: var(--red); color: white;
  box-shadow: 0 5px 0 var(--red-d), 0 12px 20px -8px color-mix(in srgb, var(--red) 70%, transparent);
  transition: transform .12s, box-shadow .12s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-d); }
.btn.blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d), 0 12px 20px -8px color-mix(in srgb, var(--blue) 70%, transparent); }
.btn.blue:active { box-shadow: 0 2px 0 var(--blue-d); }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue-l); }
.btn.small { padding: 9px 16px; font-size: 14px; box-shadow: 0 3px 0 var(--blue-d); }
.btn.small.ghost { box-shadow: inset 0 0 0 2px var(--blue-l); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.center { display: flex; justify-content: center; margin-top: 8px; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- caça-palavras ---------- */
.wordlist { list-style: none; margin: 10px 0 12px; padding: 0 2px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 6px; }
.wordlist li {
  font-weight: 800; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink);
}
.wordlist li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.wordlist li:nth-child(even)::before { background: var(--blue); }
.wordlist li.riddle { grid-column: 1 / -1; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; font-style: italic; align-items: flex-start; line-height: 1.35; }
.wordlist li.riddle::before { margin-top: 5px; border-radius: 2px; transform: rotate(45deg); }
.wordlist li.found { color: color-mix(in srgb, var(--blue) 70%, white); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.wordlist li.found.riddle { text-transform: uppercase; font-style: normal; font-weight: 800; letter-spacing: .05em; }
.wordlist li.found::before { background: var(--blue); }
.wordlist li.just { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }

.board {
  position: relative; container-type: inline-size;
  width: 100%; aspect-ratio: 1; margin: 0 auto;
  background: white; border: 2px solid var(--blue-l); border-radius: 16px; padding: 4px;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.board .grid { position: relative; z-index: 1; display: grid; width: 100%; height: 100%; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); }
.board svg.lines { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); z-index: 0; pointer-events: none; overflow: visible; }
.cell { display: grid; place-items: center; font-weight: 800; color: var(--ink); font-size: 4.6vw; font-size: calc(100cqw / var(--n) * .55); line-height: 1; pointer-events: none; }
.cell.hint { color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.board.shake { animation: shake .35s; }
.line-found { opacity: .5; stroke-linecap: round; }
.line-sel { stroke: var(--red); opacity: .38; stroke-linecap: round; }
.hint-text { text-align: center; font-size: 12.5px; color: color-mix(in srgb, var(--ink) 65%, white); margin: 10px 4px 0; }
.bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.progress { flex: 1; height: 12px; border-radius: 999px; background: var(--blue-l); overflow: hidden; }
.progress b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--blue)); transition: width .5s; }
.count { font-weight: 800; font-size: 14px; color: var(--blue); min-width: 44px; text-align: right; }

/* ---------- cruzada ---------- */
.cw-wrap { margin-top: 12px; display: flex; justify-content: center; }
.cw-board { display: grid; gap: 2px; width: 100%; --cols: 13; grid-template-columns: repeat(var(--cols), 1fr); container-type: inline-size; padding: 2px; }
.cw-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  background: white; border-radius: 6px; border: 1.5px solid color-mix(in srgb, var(--blue) 28%, white);
  font-weight: 800; color: var(--ink); text-transform: uppercase;
  font-size: 4.4vw; font-size: calc(100cqw / var(--cols) * .5);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.cw-cell.void { visibility: hidden; pointer-events: none; }
.cw-cell .num { position: absolute; top: 1px; left: 3px; font-size: .42em; font-weight: 800; color: var(--blue); line-height: 1; }
.cw-cell .badge {
  position: absolute; right: 1px; bottom: 1px; min-width: 1.15em; height: 1.15em; padding: 0 .15em;
  display: grid; place-items: center; font-size: .4em; font-weight: 800;
  background: var(--blue); color: white; border-radius: 999px; line-height: 1;
}
.cw-cell.mark { box-shadow: inset 0 0 0 2px var(--blue); background: color-mix(in srgb, var(--blue-l) 55%, white); }
.cw-cell.inword { background: var(--red-l); }
.cw-cell.mark.inword { background: color-mix(in srgb, var(--red-l) 80%, var(--blue-l)); }
.cw-cell.active { background: var(--red); color: white; border-color: var(--red); }
.cw-cell.active .num { color: white; }
.cw-cell.solved { color: var(--blue-d); background: color-mix(in srgb, var(--blue-l) 80%, white); border-color: var(--blue-l); }
.cw-cell.solved.inword { background: var(--red-l); }
.cw-cell.solved.active { background: var(--red); color: white; }
.cw-cell.hinted .ch { color: var(--red); }
.cw-cell.err { background: #ffe1de; color: var(--red-d); animation: shake .35s; border-color: var(--red); }
.cw-cell.pop { animation: pop .5s; }

.cluebox { margin-top: 14px; }
.cluebox h3 { font-family: var(--script); font-size: 26px; color: var(--blue); margin: 4px 0 6px; }
.cluelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cluelist li {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 14px; cursor: pointer;
  font-size: 13.5px; line-height: 1.4; background: color-mix(in srgb, var(--blue-l) 30%, white);
}
.cluelist li b { flex: none; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: white; font-size: 12px; }
.cluelist li.cur { background: var(--red-l); }
.cluelist li.cur b { background: var(--red); }
.cluelist li.ok { opacity: .55; }
.cluelist li.ok span { text-decoration: line-through; text-decoration-color: var(--red); }
.cluelist li em { font-style: normal; color: color-mix(in srgb, var(--ink) 55%, white); font-size: 12px; white-space: nowrap; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 2px solid var(--blue-l);
  box-shadow: 0 -12px 30px -18px color-mix(in srgb, var(--blue) 60%, transparent);
}
.dock-in { max-width: 540px; margin: 0 auto; }
.clue-now { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.clue-now .txt { flex: 1; font-size: 13.5px; line-height: 1.3; font-weight: 600; }
.clue-now .txt b { color: var(--red); font-weight: 800; }
.round { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--blue-l); color: var(--blue); font-weight: 800; font-size: 16px; cursor: pointer; touch-action: manipulation; }
.dock-actions { display: flex; gap: 8px; margin: 4px 0 6px; justify-content: center; }
.kb { display: grid; gap: 5px; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.key {
  flex: 1; max-width: 40px; height: 40px; border: 0; border-radius: 9px; cursor: pointer;
  background: white; color: var(--ink); font-weight: 800; font-size: 16px; touch-action: manipulation;
  box-shadow: 0 2px 0 var(--blue-l), inset 0 0 0 1.5px var(--blue-l);
}
.key:active { background: var(--red-l); transform: translateY(1px); }
.key.wide { max-width: 56px; background: var(--blue-l); color: var(--blue); }

/* ---------- telas especiais ---------- */
.hero { text-align: center; padding-top: 10px; }
.hero .tiles { margin: 14px 0 6px; }
.hero .fine { font-size: 12.5px; color: color-mix(in srgb, var(--ink) 55%, white); margin-top: 14px; }
.facts { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.facts li { background: color-mix(in srgb, var(--blue-l) 40%, white); border-radius: 14px; padding: 10px 14px; font-size: 14px; text-align: center; font-weight: 600; }
.facts li b { color: var(--red); }

.reveal { text-align: center; padding: 10px 0 0; position: relative; }
.reveal .name {
  font-family: var(--brand); font-size: clamp(54px, 22vw, 104px); line-height: 1.15; margin: 8px 0 0;
  color: var(--red); text-shadow: 3px 3px 0 var(--blue-l), 6px 6px 0 color-mix(in srgb, var(--blue) 30%, transparent);
  animation: rise 1s cubic-bezier(.2, 1.4, .4, 1) both;
}
.reveal .welcome { font-family: var(--script); font-size: 30px; color: var(--blue); margin: 6px 0 0; animation: rise 1s .3s both; }
.reveal .sign { margin-top: 10px; font-size: 14px; color: color-mix(in srgb, var(--ink) 65%, white); animation: rise 1s .6s both; }
.reveal .after { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise 1s .9s both; }
.big-arch { animation: float 4s ease-in-out infinite; }
.pulse { animation: pulseBtn 1.6s ease-in-out infinite; }
.link { background: none; border: 0; color: color-mix(in srgb, var(--ink) 45%, white); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 8px; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 12px); left: 50%; z-index: 60;
  transform: translate(-50%, -140%); opacity: 0; max-width: 90vw;
  background: var(--ink); color: white; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; text-align: center;
  box-shadow: 0 10px 24px -8px rgba(31, 45, 77, .6); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1), opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.red { background: var(--red); }

.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(31, 45, 77, .45); display: grid; place-items: center; padding: 22px; animation: fade .25s; }
.modal { background: var(--paper); border-radius: 26px; padding: 22px 18px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.modal h3 { font-family: var(--script); color: var(--red); font-size: 32px; margin: 0 0 6px; }
.modal p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; }
.modal .row { display: flex; gap: 8px; justify-content: center; }

@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes pulseBtn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes flip { 0% { transform: rotateY(90deg) scale(.8); } 60% { transform: rotateY(-12deg) scale(1.1); } 100% { transform: rotateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.screen { animation: fade .35s; }

@media (min-width: 560px) {
  .step span { display: inline; }
  .tile { width: 38px; height: 46px; }
  .cell { font-size: calc(100cqw / var(--n) * .55); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.cw-card { padding-top: 10px; }
.cw-title { font-size: 30px; }
.cw-help { margin: 2px 4px 8px; text-align: center; font-size: 12px; line-height: 1.35; color: color-mix(in srgb, var(--ink) 70%, white); }
.cw-help b { color: var(--blue); }
.cw-tools { display: flex; align-items: center; gap: 8px; }
.cw-tools .btn.small { padding: 7px 14px; font-size: 13px; }
.cw-tools .count { margin-left: auto; }
.progress.thin { height: 6px; margin-top: 8px; }
.cw-wrap { margin-top: 10px; }
.key { height: 36px; }
.clue-now { min-height: 44px; }
.clue-now .txt { font-size: 13px; }
.has-dock .namebar { padding-bottom: 6px; }
.has-dock .namebar small { display: none; }
.has-dock .tile { width: 30px; height: 36px; font-size: 17px; border-radius: 9px; }
.has-dock .cw-title { display: none; }
.has-dock .top { padding-bottom: 4px; }

.vote { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.vote-btn {
  appearance: none; cursor: pointer; border-radius: 24px; padding: 22px 8px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 3px solid var(--blue-l); background: white; color: var(--blue); touch-action: manipulation;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.vote-btn small { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; opacity: .8; }
.vote-btn b { font-family: var(--brand); font-weight: 400; font-size: 28px; line-height: 1.2; }
.vote-btn.girl { border-color: var(--red-l); color: var(--red); }
.vote-btn.on { transform: scale(1.04); color: white; background: var(--blue); border-color: var(--blue); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--blue) 80%, transparent); }
.vote-btn.girl.on { background: var(--red); border-color: var(--red); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--red) 80%, transparent); }
.vote-msg { text-align: center; min-height: 18px; margin: 10px 0 8px; }
.field { display: block; margin-top: 12px; }
.field span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin: 0 6px 5px; }
.field.red span { color: var(--red); }
.field input {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); padding: 13px 16px; border-radius: 16px;
  border: 2px solid var(--blue-l); background: white; outline: none;
}
.field.red input { border-color: var(--red-l); }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.field.red input:focus { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent); }
a.btn { text-decoration: none; }
.guess { display: inline-block; margin-top: 12px; padding: 9px 16px; border-radius: 999px; font-size: 14px; animation: rise 1s .5s both; }
.guess.ok { background: var(--blue-l); color: var(--blue-d); }
.guess.no { background: var(--red-l); color: var(--red-d); }
