@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --pink: #fbe7ef;
  --pink-strong: #f5bfd3;
  --blue: #dff3fb;
  --blue-strong: #92d5ec;
  --yellow: #fff4c9;
  --yellow-strong: #f8d976;
  --ink: #5f5060;
  --white: rgba(255,255,255,.84);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--pink);
  color: var(--ink);
  overflow: hidden;
}

button { font: inherit; }

#app { min-height: 100dvh; }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  min-height: 100dvh;
  padding: max(22px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.screen.active { display: flex; }

#homeScreen {
  align-items: center;
  justify-content: center;
  background:
    
    linear-gradient(180deg,#87CEFA 0%,#cfefff 65%,#9dd66d 65%,#9dd66d 100%);
}

.home-content {
  z-index: 2;
  width: min(100%, 430px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  margin: 18px 0 5px;
  font-size: clamp(29px, 8vw, 42px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -.8px;
}

.tagline {
  margin: 0 0 22px;
  font-size: 19px;
  font-weight: 700;
  opacity: .82;
}

.category-icons{display:none;}

.start-button {
  width: min(100%, 320px);
  min-height: 82px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--blue-strong), #b8e8f6);
  color: #355a67;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 13px 0 #73bfd9, 0 22px 34px rgba(65,141,166,.2);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.start-button:active {
  transform: translateY(8px) scale(.98);
  box-shadow: 0 5px 0 #73bfd9, 0 12px 24px rgba(65,141,166,.18);
}

.start-button .play { font-size: 30px; }
.start-button strong { display: block; font-size: 26px; line-height: 1; }
.start-button small { display: block; margin-top: 5px; font-size: 17px; font-weight: 800; }

.cloud {
  position: absolute;
  width: 120px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  filter: blur(.1px);
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before { width: 58px; height: 58px; left: 18px; top: -26px; }
.cloud::after { width: 48px; height: 48px; right: 14px; top: -20px; }
.cloud-one { top: 9%; left: -25px; transform: scale(.8); }
.cloud-two { top: 22%; right: -30px; transform: scale(.65); }

.version {
  position: absolute;
  bottom: max(8px, env(safe-area-inset-bottom));
  font-size: 12px;
  font-weight: 800;
  opacity: .5;
}

.puppy {
  position: relative;
  width: 136px;
  height: 118px;
}
.head {
  position: absolute;
  left: 18px;
  top: 15px;
  width: 100px;
  height: 98px;
  border-radius: 48% 48% 46% 46%;
  background: #e9b980;
  box-shadow: inset 0 -8px 0 rgba(149,91,42,.08), 0 10px 20px rgba(110,68,31,.12);
}
.ear {
  position: absolute;
  top: 12px;
  width: 42px;
  height: 72px;
  background: #b97847;
  border-radius: 55% 55% 65% 65%;
  z-index: 0;
}
.ear-left { left: 5px; transform: rotate(22deg); }
.ear-right { right: 5px; transform: rotate(-22deg); }
.eye {
  position: absolute;
  top: 34px;
  width: 10px;
  height: 14px;
  border-radius: 50%;
  background: #44312b;
}
.eye-left { left: 26px; }
.eye-right { right: 26px; }
.muzzle {
  position: absolute;
  left: 27px;
  bottom: 12px;
  width: 46px;
  height: 38px;
  border-radius: 48%;
  background: #f7dbb6;
}
.nose {
  position: absolute;
  left: 15px;
  top: 6px;
  width: 16px;
  height: 11px;
  border-radius: 50% 50% 55% 55%;
  background: #4b342e;
}
.smile {
  position: absolute;
  left: 13px;
  bottom: 7px;
  width: 20px;
  height: 10px;
  border-bottom: 3px solid #5a3d34;
  border-radius: 0 0 50% 50%;
}

.hello-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--pink), var(--yellow));
  text-align: center;
}
.hello-screen h2 {
  margin: 20px 0 0;
  font-size: clamp(42px, 12vw, 64px);
  color: #6a5261;
}
.puppy-wave { transform: scale(1.35); animation: helloPop .55s ease both; }
.paw {
  position: absolute;
  right: -8px;
  top: 28px;
  font-size: 34px;
  transform-origin: bottom left;
  animation: wave .55s ease-in-out infinite alternate;
}
.sparkle { position: absolute; color: #efc954; font-size: 34px; animation: sparkle 1s ease-in-out infinite alternate; }
.sparkle-a { left: 18%; top: 25%; }
.sparkle-b { right: 17%; top: 32%; animation-delay: .3s; }

.activity-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--blue), #f4fbfd);
}

.activity-screen.sea-theme {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.55) 0 5px, transparent 6px),
    radial-gradient(circle at 82% 32%, rgba(255,255,255,.45) 0 7px, transparent 8px),
    linear-gradient(180deg, #aee5ff 0%, #dff6ff 55%, #8ed8ee 100%);
}
.activity-screen.sea-theme .activity-card {
  background: rgba(255,255,255,.78);
  box-shadow: 0 25px 60px rgba(30,125,166,.18);
}

.back-button {
  position: absolute;
  left: 18px;
  top: max(18px, env(safe-area-inset-top));
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  color: var(--ink);
  font-size: 30px;
  box-shadow: 0 8px 18px rgba(71,107,119,.12);
}
.activity-card {
  width: min(92vw, 430px);
  min-height: 500px;
  border-radius: 42px;
  background: rgba(255,255,255,.72);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 25px 60px rgba(70,120,138,.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
}
.animal { font-size: clamp(130px, 42vw, 200px); line-height: 1; animation: gentleFloat 2.5s ease-in-out infinite; }
.flag { margin-top: 34px; font-size: clamp(62px, 18vw, 84px); transition: transform .25s ease; }
.flag.bump { transform: scale(1.18); }
#instruction { margin: 20px 0 0; font-size: 20px; font-weight: 800; opacity: .65; }

.celebration {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}
.celebration.show { display: block; }
.celebration span {
  position: absolute;
  top: 44%;
  left: 50%;
  color: var(--yellow-strong);
  font-size: 36px;
  animation: burst .9s ease-out forwards;
}
.celebration span:nth-child(1) { --x:-120px; --y:-120px; }
.celebration span:nth-child(2) { --x:100px; --y:-130px; }
.celebration span:nth-child(3) { --x:-135px; --y:35px; }
.celebration span:nth-child(4) { --x:125px; --y:40px; }
.celebration span:nth-child(5) { --x:0px; --y:-175px; }

@keyframes gentleFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes helloPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1.35); opacity: 1; } }
@keyframes wave { from { transform: rotate(-15deg); } to { transform: rotate(22deg); } }
@keyframes sparkle { from { transform: scale(.8) rotate(-8deg); opacity: .55; } to { transform: scale(1.2) rotate(8deg); opacity: 1; } }
@keyframes burst { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 35% { opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.2); opacity: 0; } }

@media (max-height: 700px) {
  .puppy { transform: scale(.82); margin-bottom: -8px; }
  h1 { margin-top: 7px; }
  .category-icons { margin-bottom: 22px; }
  .activity-card { min-height: 430px; }
}

.progress {
  position: absolute;
  top: 24px;
  right: 28px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  font-size: 15px;
  font-weight: 900;
  opacity: .72;
}

.finish-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--pink), var(--yellow));
}
.finish-stars { font-size: 42px; color: var(--yellow-strong); letter-spacing: 14px; animation: sparkle 1s ease-in-out infinite alternate; }
.finish-animal { margin-top: 22px; font-size: clamp(130px, 40vw, 190px); animation: gentleFloat 2s ease-in-out infinite; }
.finish-screen h2 { margin: 18px 0 8px; font-size: clamp(38px, 10vw, 56px); }
.finish-screen p { margin: 0 0 34px; font-size: 22px; font-weight: 800; opacity: .78; }
.finish-button, .finish-home {
  width: min(88vw, 330px);
  min-height: 64px;
  border: 0;
  border-radius: 24px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}
.finish-button {
  background: linear-gradient(135deg, var(--blue-strong), #b8e8f6);
  color: #355a67;
  box-shadow: 0 9px 0 #73bfd9;
}
.finish-home { margin-top: 18px; background: rgba(255,255,255,.68); color: var(--ink); }

/* v0.2.6 — transições e passeio Safari */
.activity-screen.farm-theme {
  background: linear-gradient(180deg, #cfefff 0%, #eefaff 62%, #b9df8f 62%, #9fd173 100%);
}

.activity-screen.safari-theme {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.35) 0 5px, transparent 6px),
    radial-gradient(circle at 82% 24%, rgba(255,255,255,.28) 0 7px, transparent 8px),
    linear-gradient(180deg, #ffd98a 0%, #ffe9b7 56%, #d6b46b 56%, #c79a4d 100%);
}

.activity-screen.safari-theme .activity-card {
  background: rgba(255,250,235,.82);
  box-shadow: 0 25px 60px rgba(125,83,31,.18);
}

.transition-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.transition-screen.sea-theme {
  background: linear-gradient(180deg, #9edfff 0%, #dff6ff 58%, #67c6df 100%);
}

.transition-screen.safari-theme {
  background: linear-gradient(180deg, #ffd98a 0%, #ffe9b7 58%, #cda257 100%);
}

.transition-emoji {
  font-size: clamp(110px, 32vw, 170px);
  animation: transitionPop .65s ease both, gentleFloat 2s ease-in-out .65s infinite;
}

.transition-screen h2 {
  margin: 8px 0 0;
  font-size: clamp(38px, 10vw, 58px);
  line-height: 1.05;
}

.transition-screen p {
  width: min(88vw, 420px);
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 900;
  line-height: 1.25;
  opacity: .86;
}

@keyframes transitionPop {
  from { transform: scale(.55); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


/* v0.2.8 — Passeio no Pomar e Medalha do Pomar */
.activity-screen.orchard-theme {
  background:
    radial-gradient(circle at 14% 17%, rgba(255,255,255,.42) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 25%, rgba(255,255,255,.34) 0 8px, transparent 9px),
    linear-gradient(180deg, #bde9ff 0%, #e9f9ff 52%, #b8df82 52%, #8fc45f 100%);
}

.activity-screen.orchard-theme .activity-card {
  background: rgba(255,255,245,.82);
  box-shadow: 0 25px 60px rgba(79,130,50,.18);
}

.transition-screen.orchard-theme {
  background: linear-gradient(180deg, #bde9ff 0%, #eaf9ff 55%, #9dce69 100%);
}

.finish-medal {
  margin-top: 20px;
  font-size: clamp(120px, 36vw, 175px);
  animation: transitionPop .65s ease both, gentleFloat 2s ease-in-out .65s infinite;
}

.finish-screen p strong {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 1.12em;
}

/* v0.3.0 — atividade de escrita entre os passeios */
.writing-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff2c9 0%, #ffe8f1 100%);
  text-align: center;
}

.writing-card {
  width: min(94vw, 440px);
  padding: 22px 18px 20px;
  border-radius: 36px;
  background: rgba(255,255,255,.78);
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 24px 55px rgba(117,83,93,.15);
  backdrop-filter: blur(14px);
}

.writing-title {
  margin: 0;
  font-size: clamp(25px, 7vw, 34px);
  font-weight: 900;
}

.name-progress {
  min-height: 48px;
  margin: 8px 0 12px;
  font-size: clamp(34px, 10vw, 48px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #7a5a6a;
}

.trace-wrap {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(255,255,255,.88);
  border: 3px dashed rgba(117,91,104,.22);
  touch-action: none;
}

.trace-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(190px, 56vw, 270px);
  line-height: 1;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 5px rgba(125,102,113,.23);
  text-stroke: 5px rgba(125,102,113,.23);
  pointer-events: none;
  user-select: none;
}

#drawCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.writing-help {
  margin: 12px 0 14px;
  font-size: 17px;
  font-weight: 800;
  opacity: .68;
}

.writing-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.clear-drawing, .done-drawing {
  min-height: 56px;
  border: 0;
  border-radius: 20px;
  padding: 0 22px;
  font-size: 18px;
  font-weight: 900;
}
.clear-drawing { background: rgba(125,102,113,.12); color: var(--ink); }
.done-drawing { background: #9edcf0; color: #355a67; box-shadow: 0 7px 0 #72bfd8; }
.done-drawing:disabled { opacity: .42; box-shadow: none; }

.writing-success {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff1c4, #ffe5ef);
  text-align: center;
  z-index: 5;
}
.writing-success.show { display: flex; }
.writing-success .success-star { font-size: 72px; animation: sparkle .8s ease-in-out infinite alternate; }
.writing-success h2 { margin: 12px 0 4px; font-size: clamp(34px, 10vw, 52px); }
.writing-success p { margin: 0; font-size: 22px; font-weight: 800; }
