/* Base copiada do app Cão Inteligente (cao-inteligente/assets/css/style.css): identidade, botões, jogo do timing, mascote e 'Veja na prática'. */
:root {
  --bg: #FFF8EF;
  --bg-alt: #FFF0DE;
  --surface: #FFFFFF;
  --ink: #1E2640;
  --ink-2: #4D5671;
  --ink-3: #7A829A;
  --line: #F1E2CC;
  --brand: #FF6B35;
  --brand-600: #E2551F;
  --brand-50: #FFE7DB;
  --teal: #0E9C93;
  --teal-600: #0A7C75;
  --teal-50: #DDF5F2;
  --violet: #5B5BD6;
  --violet-50: #E8E8FB;
  --sun: #FFC23D;
  --sun-50: #FFF4D6;
  --good: #16A34A;
  --good-50: #E6F6EC;
  --bad: #E5484D;
  --bad-50: #FDECEC;
  --r-lg: 28px;
  --r: 18px;
  --shadow: 0 1px 2px rgba(30, 38, 64, .05), 0 8px 24px rgba(30, 38, 64, .07);
  --shadow-lg: 0 2px 4px rgba(30, 38, 64, .05), 0 22px 50px rgba(30, 38, 64, .13);
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 .45em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; }
b, strong { font-weight: 800; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 8px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600);
  background: var(--brand-50); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 1rem/1.1 var(--font); padding: 15px 24px; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .12s, box-shadow .12s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 5px 0 var(--brand-600); }
.btn-primary:hover { background: #FF7A49; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-600); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn-ghost:hover { border-color: #E8D3B4; }
.btn-ghost:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.btn-done { background: var(--teal); color: #fff; box-shadow: 0 5px 0 var(--teal-600); }
.btn-done:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--teal-600); }
.btn-light { background: #fff; color: var(--brand-600); box-shadow: 0 5px 0 rgba(0, 0, 0, .15); }
.btn-light:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--ink-3); font-weight: 700; text-decoration: underline; cursor: pointer; }

.seg { display: inline-flex; background: var(--bg-alt); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  font: 800 .9rem var(--font); border: 0; background: transparent; padding: 9px 14px;
  border-radius: 9px; cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(30, 38, 64, .14); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
/* ---------- Jogo do timing ---------- */
.game-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 52px; align-items: center; }
.game-copy p { color: var(--ink-2); font-size: 1.08rem; }
.opt-group { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; }
.opt-group > span { font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.opt-group .seg { background: #fff; border: 2px solid var(--line); }
.opt-group .seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.score-legend { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: .9rem; }
.score-legend li { background: #fff; border-radius: 12px; padding: 8px 12px; border: 2px solid var(--line); font-weight: 700; color: var(--ink-2); }
.score-legend b { color: var(--ink); }
.best { margin-top: 16px; font-weight: 700; color: var(--ink-2); }

.game-card { background: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-lg); border: 2px solid var(--line); }
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.hud div { background: var(--bg); border-radius: 12px; padding: 8px 6px; text-align: center; }
.hud small { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.hud b { font: 700 1.4rem/1.15 var(--font-head); font-variant-numeric: tabular-nums; }
.stage {
  position: relative; height: clamp(300px, 32vw, 350px); border-radius: 20px; overflow: hidden; user-select: none;
  background: linear-gradient(180deg, #FFF3DF 0%, #FFEBCB 66%, #E9C089 66%, #DDB078 100%);
}
.stage::before { /* janela */
  content: ""; position: absolute; left: 8%; top: 10%; width: 21%; aspect-ratio: 1; border-radius: 10px;
  border: 6px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .05);
  background:
    linear-gradient(#fff, #fff) center / 5px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 5px no-repeat,
    linear-gradient(#BFE6FF, #E8F6FF);
}
.stage::after { /* tapete */
  content: ""; position: absolute; left: 50%; bottom: 5%; width: 72%; height: 13%;
  transform: translateX(-50%); background: #FF9F7A; border-radius: 50%; opacity: .5;
}
.stage-dog { position: absolute; left: 50%; bottom: 6%; width: 60%; transform: translateX(-50%); z-index: 1; }
.feedback {
  position: absolute; top: 14px; left: 50%; z-index: 3; transform: translate(-50%, -10px); opacity: 0;
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  max-width: 92%; text-align: center; transition: opacity .18s, transform .18s; pointer-events: none;
}
.feedback.show { opacity: 1; transform: translate(-50%, 0); }
.feedback.good { background: var(--good); }
.feedback.bad { background: var(--bad); }
.feedback.info { background: var(--violet); }
.stage-overlay {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(255, 248, 239, .86); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity .25s;
}
.stage-overlay.hidden { opacity: 0; pointer-events: none; }
.stage-overlay > div { max-width: 420px; }
.stage-overlay h3 { font-size: 1.4rem; margin-bottom: 6px; }
.stage-overlay p { color: var(--ink-2); margin-bottom: 12px; font-size: .96rem; line-height: 1.45; }
.ov-score { font: 700 3rem/1 var(--font-head) !important; color: var(--brand) !important; margin: 4px 0 8px !important; }
.ov-score small { font-size: 1.1rem; color: var(--ink-3); }
.ov-stats { font-weight: 800; font-size: .92rem; }
.kicker { font-weight: 800; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.isso-btn {
  width: 100%; margin-top: 14px; font: 700 1.7rem/1 var(--font-head); padding: 20px; border-radius: 18px; border: 0;
  background: var(--brand); color: #fff; box-shadow: 0 7px 0 var(--brand-600); cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .06s, box-shadow .06s, background .2s;
}
.isso-btn small { font: 700 .85rem var(--font); opacity: .85; margin-left: 6px; }
.isso-btn:active:not(:disabled), .isso-btn.press { transform: translateY(6px); box-shadow: 0 1px 0 var(--brand-600); }
.isso-btn:disabled { background: #DAD3CA; box-shadow: 0 7px 0 #C4BBB0; cursor: not-allowed; }
.sound-toggle { background: none; border: 0; font: 800 .82rem var(--font); color: var(--ink-3); cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.game-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
@media (max-width: 920px) { .game-grid { grid-template-columns: 1fr; gap: 28px; } }
.game-grid > *, .quiz-grid > *, .clicker-grid > *, .hero-grid > * { min-width: 0; }
@media (max-width: 480px) {
  .stage-dog { width: 86%; }
  .hud b { font-size: 1.2rem; }
  .score-legend { grid-template-columns: 1fr; }
}

/* ---------- Toast e confete ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, calc(100% + 60px));
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 16px; font-weight: 700; visibility: hidden;
  box-shadow: var(--shadow-lg); transition: transform .38s cubic-bezier(.2, 1.3, .4, 1), visibility .38s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99; }

/* ---------- Mascote (SVG) ---------- */
.dog { overflow: visible; }
.dog .pose { opacity: 0; transition: opacity .08s linear; transform-box: fill-box; transform-origin: 50% 100%; }
.dog[data-pose="stand"] .pose-stand,
.dog[data-pose="sit"] .pose-sit,
.dog[data-pose="down"] .pose-down,
.dog[data-pose="jump"] .pose-jump,
.dog[data-pose="sniff"] .pose-sniff { opacity: 1; animation: settle .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes settle { from { transform: scale(1.05, .93); } }
.dog .tail { transform-box: fill-box; transform-origin: 100% 100%; animation: wag .55s ease-in-out infinite alternate; }
.dog.happy .tail { animation-duration: .13s; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(12deg); } }
.dog .eye { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.dog .tongue { opacity: 0; transition: opacity .15s; }
.dog.happy .tongue, .dog.tongue .tongue { opacity: 1; }
.dog .hop { animation: hop .45s ease-in-out infinite alternate; }
@keyframes hop { from { transform: translateY(4px); } to { transform: translateY(-6px); } }
.dog .shadow { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .2s, opacity .2s; }
.dog[data-pose="jump"] .shadow { transform: scaleX(.62); opacity: .6; }
.dog .fx-hearts, .dog .fx-huh { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.dog.happy .fx-hearts { animation: floatUp .95s ease-out; }
.dog.huh .fx-huh { animation: huh .85s ease-out; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px) scale(.5); }
  25% { opacity: 1; transform: translateY(0) scale(1.08); }
  100% { opacity: 0; transform: translateY(-20px) scale(1); }
}
@keyframes huh {
  0% { opacity: 0; transform: scale(.3); }
  30% { opacity: 1; transform: scale(1.15); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}

/* ---------- Veja na prática (animação dentro da lição) ---------- */
.lp-wrap { margin-bottom: 30px; }
.lp-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; container-type: inline-size;
  background: linear-gradient(180deg, #FFF3DF 0%, #FFEBCB 62%, #EBC28C 62%, #DFB27A 100%);
  user-select: none; -webkit-user-select: none; border: 2px solid var(--line);
}
.lp-stage::before { /* quadro na parede */
  content: ""; position: absolute; left: 5%; top: 9%; width: 13%; aspect-ratio: 1; border-radius: 8px;
  border: 5px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .05);
  background:
    linear-gradient(#fff, #fff) center / 4px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 4px no-repeat,
    linear-gradient(#BFE6FF, #E8F6FF);
}
.lp-floor { position: absolute; left: 0; right: 0; top: 62%; bottom: 0; background: repeating-linear-gradient(90deg, rgba(120, 70, 20, .08) 0 2px, transparent 2px 12.5cqw); }
.lp-stage.moving .lp-floor { animation: floorMove .5s linear infinite; }
@keyframes floorMove { to { background-position: -12.5cqw 0; } }
.lp-under, .lp-over { position: absolute; inset: 0; pointer-events: none; }
.lp-prop { position: absolute; transform: translate(-50%, -50%); opacity: 0; transition: opacity .3s, left .6s ease-in-out, top .6s ease-in-out; }
.lp-prop.show { opacity: 1; }
.lp-prop svg { width: 100%; height: auto; display: block; }
.lp-puddle.show { animation: grow .6s ease-out; }
.lp-prop.chew svg { animation: chew .22s ease-in-out infinite alternate; transform-origin: 20% 60%; }
@keyframes chew { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes grow { from { transform: translate(-50%, -50%) scale(.2); } }
.lp-dog { position: absolute; width: 34%; left: 14%; bottom: 6%; transition: left .9s ease-in-out, bottom .45s ease; }
.lp-dog-in { transition: transform .25s; }
.lp-dog .dog { width: 100%; }
.lp-dog.walk .dog { animation: trot .24s ease-in-out infinite alternate; }
@keyframes trot { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-4%) rotate(1.5deg); } }
.lp-legs { position: absolute; width: 24%; left: 64%; bottom: 3%; display: none; transition: left .8s ease-in-out; }
.lp-legs-in { transition: transform .3s; }
.lp-legs svg { width: 100%; height: auto; display: block; }
.lp-legs .lg { transform-box: view-box; transform-origin: 68px 150px; }
.lp-legs.walk .lg-front { animation: legSwing .5s ease-in-out infinite alternate; }
.lp-legs.walk .lg-back { animation: legSwing .5s ease-in-out infinite alternate-reverse; }
@keyframes legSwing { from { transform: rotate(-15deg); } to { transform: rotate(15deg); } }
.lp-leash { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lp-leash path { fill: none; stroke: #E5484D; stroke-width: 3.5; stroke-linecap: round; transition: stroke .2s; }
.lp-leash.tight path { stroke: #C22F35; }
.lp-hand { position: absolute; width: 62%; left: 112%; top: 62%; transition: left .7s ease-in-out, top .7s ease-in-out; pointer-events: none; }
.lp-hand-in { transform: translate(-4.667%, -50%); }
.lp-hand svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 4px 6px rgba(30, 38, 64, .12)); }
.lp-hand .hv { display: none; }
.lp-hand[data-v="treat"] .hv-treat, .lp-hand[data-v="empty"] .hv-empty,
.lp-hand[data-v="fist"] .hv-fist, .lp-hand[data-v="palm"] .hv-palm { display: inline; }
.lp-hand.shake .lp-hand-in { animation: handShake .16s ease-in-out 4; }
@keyframes handShake { 50% { transform: translate(-3.6%, -46%) rotate(-5deg); } }
.lp-treat { position: absolute; width: 3.2%; transform: translate(-50%, -50%); display: none; pointer-events: none; }
.lp-treat svg { width: 100%; height: auto; display: block; }
.lp-say {
  position: absolute; left: 74%; top: 8%; z-index: 3; transform: translateX(-50%) scale(.5); opacity: 0;
  background: #fff; color: var(--ink); font: 700 clamp(13px, 4.4cqw, 26px)/1.1 var(--font-head);
  padding: .45em .8em; border-radius: 14px; box-shadow: 0 6px 16px rgba(30, 38, 64, .14); white-space: nowrap;
  transition: opacity .15s, transform .3s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none;
}
.lp-say::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom: 0; border-top-color: #fff;
}
.lp-say.show { opacity: 1; transform: translateX(-50%) scale(1); }
.lp-say.isso { background: var(--brand); color: #fff; }
.lp-say.isso::after { border-top-color: var(--brand); }
.lp-end {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(255, 248, 239, .5);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lp-end.show { opacity: 1; pointer-events: auto; }
.lp-replay {
  display: inline-flex; align-items: center; gap: 8px; font: 800 1rem var(--font); color: #fff; background: var(--ink);
  border: 0; border-radius: 99px; padding: 12px 22px; cursor: pointer; box-shadow: var(--shadow-lg);
}
.lp-replay:hover { background: #2A3459; }
.lp-stage.paused *, .lp-stage.paused *::before, .lp-stage.paused *::after { animation-play-state: paused !important; }
.lp-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.lp-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mc, var(--ink)); color: #fff;
  cursor: pointer; display: grid; place-items: center; transition: transform .12s;
}
.lp-btn:active { transform: scale(.94); }
.lp-cap { flex: 1; margin: 0; min-height: 2.8em; font-weight: 700; color: var(--ink) !important; line-height: 1.4; display: flex; align-items: center; gap: 8px; }
.lp-n { flex: none; font: 800 .74rem var(--font); color: #fff; background: var(--mc, var(--ink)); border-radius: 99px; padding: 3px 8px; }
.lp-n:empty { display: none; }
@media (max-width: 640px) { .lp-cap { min-height: 4.2em; font-size: .95rem; } }
.lp-dots { display: flex; gap: 6px; margin-top: 10px; }
.lp-dots i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); transition: background .3s; }
.lp-dots i.on { background: var(--mc, var(--brand)); }

/* ---------- Botão de som no topo ---------- */
.sound-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink);
}
.sound-btn[aria-pressed="false"] { color: var(--ink-3); }
@media (max-width: 420px) { .sound-btn, .menu-btn { width: 40px; height: 40px; } .topbar-inner { gap: 10px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .deco, .dog .tail, .dog .eye, .dog .hop { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
