/* =====================================================================
   JARDIM DA FLORA — ESTILOS v4 (Soft Claymotion + Cores da Flora)
   ---------------------------------------------------------------------
   · Fundo creme-menta quente #F9FBF3, tinta marrom-cacau #3A2318 e volumes clay.
   · Uma cor por tela: cada atividade define --hue (app.js → setHue).
   · Cartões do Hub sem imagem da Flora: representações táteis de cada atividade.
   · Personagem Flora em claymotion nas interações (chegada, companheira, celebração, sono).
   ===================================================================== */

:root {
  --c-base: #F9FBF3;
  --c-surface: #FFFDF9;
  --c-ink: #3A2318;
  --c-ink-muted: #6E584B;
  --c-line: #E6EBD8;

  /* Pigmentos oficiais da personagem Flora */
  --flora-petal: #F5285A;
  --flora-face: #B0DF2D;
  --flora-leaf: #5EB525;
  --flora-skirt: #93BE1F;
  --flora-peach: #F7CBA8;
  --flora-cocoa: #3A2318;

  /* Cores das atividades */
  --violet: #6B3EEB;
  --blue: #3282E8;
  --green: #5EB525;
  --green-ink: #3B8210;
  --yellow: #F9C628;
  --orange: #FA6B43;
  --pink: #F5285A;
  --teal: #149B90;
  --lime: #96C81E;

  /* Cor da tela atual */
  --hue: var(--flora-petal);
  --hue-on: #FFFFFF;
  --hue-glyph: var(--flora-petal);
  --hue-shade: #990F32;
  --hue-08: color-mix(in srgb, var(--hue) 9%, #FFFDF9);
  --hue-14: color-mix(in srgb, var(--hue) 15%, #FFFDF9);
  --hue-24: color-mix(in srgb, var(--hue) 26%, #FFFDF9);
  --hue-shadow: color-mix(in srgb, var(--hue) 32%, transparent);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --radius-pill: 999px;

  /* Elevação e sulcos Soft Claymotion */
  --clay-sheet:
    0 18px 40px rgba(58, 35, 24, 0.08),
    0 4px 12px rgba(58, 35, 24, 0.04),
    inset 0 3px 6px rgba(255, 255, 255, 0.94),
    inset 0 -5px 12px rgba(147, 190, 31, 0.14);
  --clay-card:
    0 10px 22px rgba(58, 35, 24, 0.09),
    0 3px 6px rgba(58, 35, 24, 0.05),
    inset 0 3px 5px rgba(255, 255, 255, 0.95),
    inset 0 -5px 10px rgba(58, 35, 24, 0.08);
  --clay-float:
    0 16px 28px rgba(58, 35, 24, 0.13),
    0 5px 10px rgba(58, 35, 24, 0.06),
    inset 0 4px 7px rgba(255, 255, 255, 0.96),
    inset 0 -6px 12px rgba(58, 35, 24, 0.11);
  --clay-pressed:
    0 3px 8px rgba(58, 35, 24, 0.1),
    inset 0 3px 7px rgba(58, 35, 24, 0.12),
    inset 0 -2px 4px rgba(255, 255, 255, 0.72);
  --clay-recess:
    inset 0 4px 10px rgba(58, 35, 24, 0.11),
    inset 0 -3px 6px rgba(255, 255, 255, 0.85);

  --shadow-sheet: var(--clay-sheet);
  --shadow-card: var(--clay-card);
  --shadow-float: var(--clay-float);
  --shadow-hue:
    0 12px 24px var(--hue-shadow),
    0 4px 8px color-mix(in srgb, var(--hue) 18%, transparent),
    inset 0 4px 7px rgba(255, 255, 255, 0.42),
    inset 0 -6px 11px color-mix(in srgb, var(--hue-shade) 48%, transparent);

  --clay-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23g)' opacity='0.35'/%3E%3C/svg%3E");

  --press-scale-x: 0.96;
  --press-scale-y: 0.92;
  --ease-clay: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-tap: 170ms;

  --font-display: 'Fredoka', 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'Nunito', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --topbar-h: 64px;
  --gutter: 14px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--c-base);
  color: var(--c-ink);
  font-family: var(--font-body);
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Ícone Solar: herda a cor do texto (currentColor) */
.ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  overflow: visible;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--hue);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  background: var(--c-base);
}

.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('/images/Prado%20sereno%20em%20tons%20de%20s%C3%A1lvia.png') center bottom / cover no-repeat;
  opacity: 0.5;
}

/* ==================== PRELOADER ==================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--c-base);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.preloader-halo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: linear-gradient(165deg, #FFFFFF 0%, #FEEEF2 100%);
  box-shadow: var(--clay-float);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  animation: preloaderBreathe 2.6s ease-in-out infinite;
}

.preloader-flora {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(58, 35, 24, 0.16));
}

@keyframes preloaderBreathe {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.06) rotate(3deg); }
}

.preloader-seeds {
  display: flex;
  gap: 10px;
}

.preloader-seeds span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.65), 0 3px 6px rgba(58, 35, 24, 0.14);
  animation: seedGrow 1.2s ease-in-out infinite;
}

.preloader-seeds span:nth-child(1) { background: var(--flora-petal); }
.preloader-seeds span:nth-child(2) { background: var(--flora-face); animation-delay: 0.2s; }
.preloader-seeds span:nth-child(3) { background: var(--flora-leaf); animation-delay: 0.4s; }

@keyframes seedGrow {
  0%, 100% { transform: scale(0.6); opacity: 0.35; }
  50% { transform: scale(1); opacity: 1; }
}

/* ==================== DECORAÇÃO (só na chegada) ==================== */
.decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

body:not([data-mode="home"]) .decor {
  opacity: 0;
}

.decor-leaf {
  position: absolute;
  width: clamp(86px, 18vw, 138px);
  height: auto;
  opacity: 0.55;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(42, 37, 64, 0.06));
}

.decor-leaf--tl { top: 82px; left: -24px; transform: rotate(22deg); opacity: 0.4; }
.decor-leaf--tr { top: 72px; right: -22px; transform: rotate(-16deg); }
.decor-leaf--bl { bottom: -16px; left: -18px; transform: rotate(8deg); }
.decor-leaf--br { bottom: -14px; right: -20px; transform: rotate(-14deg); opacity: 0.48; }

.decor-confetti {
  position: absolute;
  inset: 0;
}

.confetti-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  opacity: 0.45;
}

.confetti-dot--flower {
  width: 11px;
  height: 11px;
  background: radial-gradient(circle at center, #FFD95A 0 28%, var(--dot) 30%);
  opacity: 0.6;
}

/* ==================== BOTÃO REDONDO COM ÍCONE ==================== */
.cbtn {
  position: relative;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  color: var(--c-ink);
  box-shadow: var(--clay-card);
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.cbtn:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
  box-shadow: var(--clay-pressed);
}

.cbtn .ico {
  width: 26px;
  height: 26px;
}

.cbtn--hue {
  background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 84%, #FFFFFF), var(--hue));
  color: var(--hue-on);
  box-shadow: var(--shadow-hue);
}

.cbtn--hue:active {
  box-shadow:
    0 4px 10px var(--hue-shadow),
    inset 0 4px 8px color-mix(in srgb, var(--hue-shade) 45%, transparent),
    inset 0 -2px 4px rgba(255, 255, 255, 0.3);
}

.cbtn--dark {
  background: linear-gradient(165deg, #543728 0%, var(--flora-cocoa) 100%);
  color: #FFFDF9;
  box-shadow:
    0 10px 20px rgba(58, 35, 24, 0.24),
    inset 0 3px 5px rgba(255, 255, 255, 0.22),
    inset 0 -5px 9px rgba(24, 12, 6, 0.45);
}

.cbtn--lg {
  width: 66px;
  height: 66px;
}

.cbtn--lg .ico {
  width: 30px;
  height: 30px;
}

.cbtn--xl {
  width: 88px;
  height: 88px;
}

.cbtn--xl .ico {
  width: 40px;
  height: 40px;
}

.icon-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.gentle-wiggle {
  animation: gentleShake 0.35s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

/* ==================== BARRA SUPERIOR ==================== */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--topbar-h) + var(--safe-top));
  padding: calc(8px + var(--safe-top)) calc(var(--gutter) + var(--safe-right)) 4px calc(var(--gutter) + var(--safe-left));
}

.topbar-spacer {
  flex: 1;
}

.topbar-utils {
  display: flex;
  gap: 10px;
}

/* Lua com o anel do tempo de uso (sem números) */
.moon-ring {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.moon-ring-track,
.moon-ring-progress {
  fill: none;
  stroke-width: 4;
}

.moon-ring-track {
  stroke: transparent;
}

.moon-ring-progress {
  stroke: var(--flora-petal);
  stroke-linecap: round;
  stroke-dasharray: 182.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.moon-btn:not(.has-timer) .moon-ring {
  display: none;
}

.moon-btn.has-timer .moon-ring-track {
  stroke: var(--c-line);
}

.moon-btn.is-yawning {
  animation: yawn 1.2s ease-in-out 2;
}

@keyframes yawn {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.15) rotate(-8deg); }
  70% { transform: scale(1.05) rotate(6deg); }
}

/* ==================== PALCO E VIEWS ==================== */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px calc(var(--gutter) + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.activity-view {
  display: none;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.activity-view.active {
  display: flex;
}

/* Tela de atividade: grande folha claymotion sem bordas duras */
.sheet {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(175deg, rgba(255, 253, 249, 0.96) 0%, rgba(246, 250, 239, 0.95) 100%);
  backdrop-filter: blur(6px);
  box-shadow: var(--clay-sheet);
}

.sheet::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--clay-grain);
  background-size: 120px 120px;
  opacity: 0.035;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}

.sheet > :not(.sheet-botanical) {
  position: relative;
  z-index: 1;
}

.sheet-botanical {
  position: absolute;
  z-index: 0;
  width: clamp(74px, 14vw, 112px);
  height: auto;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
}

.sheet-botanical--br {
  right: -10px;
  bottom: -10px;
  transform: rotate(-12deg);
}

.sheet-botanical--bl {
  left: -10px;
  bottom: -10px;
  transform: rotate(10deg);
}

/* ==================== CHEGADA ==================== */
.view-home {
  gap: 14px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Saudação: medalhão da Flora + texto que alterna + Flora acenando */
.greet {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--c-ink);
}

.greet-icon {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #FFFFFF 0%, #FEEEF2 100%);
  box-shadow: var(--clay-card);
  transition: transform var(--dur-tap) var(--ease-clay);
}

.greet:active .greet-icon {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.greet-flora {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(58, 35, 24, 0.14));
}

.greet-speak {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(165deg, #FF557F 0%, var(--flora-petal) 100%);
  color: #FFFFFF;
  box-shadow:
    0 6px 12px rgba(245, 40, 90, 0.36),
    inset 0 2px 4px rgba(255, 255, 255, 0.45),
    inset 0 -3px 6px rgba(153, 15, 50, 0.4);
}

.greet-speak .ico {
  width: 16px;
  height: 16px;
}

.home-flora-wave {
  position: relative;
  flex-shrink: 0;
  width: clamp(64px, 17vw, 94px);
  height: clamp(68px, 18vw, 96px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.home-flora-wave img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(58, 35, 24, 0.18));
  animation: clayBreathe 3.4s ease-in-out infinite;
  transform-origin: 50% 95%;
}

.home-flora-wave:active img {
  transform: scale(0.95);
}

@keyframes clayBreathe {
  0%, 100% { transform: scale(1, 1) translateY(0); }
  50% { transform: scale(1.02, 0.98) translateY(-3px); }
}

.greet-text {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 2.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.38rem, 6.2vw, 2rem);
  line-height: 1.15;
}

.greet-line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.greet-line.is-off {
  opacity: 0;
  transform: translateY(10px);
}

.greet-line b {
  color: var(--flora-petal);
  font-weight: 700;
}

/* Cartões de atividade: Soft Claymotion, representação da atividade (sem imagem da Flora) */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 14px;
  padding-top: 18px;
  padding-bottom: 6px;
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  scrollbar-width: none;
}

.hub-grid::-webkit-scrollbar {
  display: none;
}

.hub-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.hub-card.hidden {
  display: none;
}

.hub-card.is-odd-last {
  grid-column: 1 / -1;
}

.hub-card {
  --card: var(--green);
  position: relative;
  height: clamp(134px, 18.5dvh, 182px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(162deg, color-mix(in srgb, var(--card) 9%, #FFFDF9) 0%, color-mix(in srgb, var(--card) 28%, #FFFDF9) 100%);
  box-shadow:
    0 12px 24px rgba(58, 35, 24, 0.09),
    0 3px 8px rgba(58, 35, 24, 0.05),
    inset 0 4px 8px rgba(255, 255, 255, 0.92),
    inset 0 -6px 12px color-mix(in srgb, var(--card) 22%, transparent);
  cursor: pointer;
  display: flex;
  justify-content: center;
  overflow: visible;
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.hub-card:active {
  transform: scale(var(--press-scale-x), 0.94);
  box-shadow: var(--clay-pressed);
}

.hub-water {
  position: absolute;
  left: 12px;
  top: 34%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.8rem;
  color: color-mix(in srgb, var(--card) 15%, transparent);
  pointer-events: none;
}

.hub-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 62%;
  margin-top: -18px;
}

.hub-glyph {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.6rem, 12.5dvh, 6.2rem);
  line-height: 1;
  color: var(--card-glyph);
  text-shadow:
    0 10px 18px color-mix(in srgb, var(--card) 28%, transparent),
    0 2px 0 rgba(255, 255, 255, 0.6);
}

.hub-numbers-art {
  gap: 10px;
}

.hub-glyph--num {
  font-size: clamp(4.2rem, 11.5dvh, 5.6rem);
}

.hub-dots {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px;
  align-items: center;
}

.hub-dots span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--card) 45%, #FFFFFF), var(--card));
  box-shadow:
    0 5px 10px color-mix(in srgb, var(--card) 30%, transparent),
    inset 0 2px 3px rgba(255, 255, 255, 0.75);
}

.hub-dots span:first-child {
  grid-column: 1 / -1;
  justify-self: center;
}

.hub-quiz-cards {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 76px;
}

.hub-quiz-mini {
  width: 48px;
  height: 58px;
  border-radius: 17px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F5F7ED 100%);
  box-shadow: var(--clay-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--card-glyph);
}

.hub-quiz-mini--back {
  transform: translate(-12px, -4px) rotate(-10deg);
}

.hub-quiz-mini--front {
  margin-left: -14px;
  transform: translate(6px, 6px) rotate(8deg);
  background: linear-gradient(165deg, #FF557F 0%, var(--flora-petal) 100%);
  color: #FFFFFF;
}

.hub-quiz-mini--front .ico {
  width: 26px;
  height: 26px;
}

.hub-basket-svg {
  width: clamp(84px, 12dvh, 108px);
  height: auto;
  filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--card) 26%, transparent));
}

.hub-feelings-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-emo-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(165deg, #FFFFFF 0%, #F5F7ED 100%);
  box-shadow: var(--clay-card);
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-emo-badge svg {
  width: 100%;
  height: 100%;
}

.hub-emo-badge--calm {
  transform: translate(8px, 4px) rotate(-8deg);
}

.hub-emo-badge--joy {
  transform: translate(-6px, -4px) rotate(8deg);
  z-index: 1;
}

.hub-piece {
  min-width: 50px;
  height: 58px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow:
    0 10px 18px color-mix(in srgb, var(--card) 24%, transparent),
    inset 0 3px 5px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(58, 35, 24, 0.08);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--card-glyph);
}

.hub-piece:nth-child(odd) { transform: rotate(-6deg); }
.hub-piece:nth-child(even) { transform: translateY(8px) rotate(5deg); }
.hub-piece--sm { min-width: 40px; height: 50px; font-size: 1.5rem; }

.hub-trace {
  width: clamp(82px, 11.5dvh, 102px);
  height: clamp(82px, 11.5dvh, 102px);
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-trace-road {
  stroke: #FFFDF9;
  stroke-width: 18;
  filter: drop-shadow(0 2px 3px rgba(58, 35, 24, 0.08));
}

.hub-trace-dots {
  stroke: var(--card-glyph);
  stroke-width: 6;
  stroke-dasharray: 0.1 11;
}

.hub-pill {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 0 13px;
  border-radius: 20px;
  background: linear-gradient(175deg, #FFFFFF 0%, #F7FAF1 100%);
  box-shadow:
    0 5px 12px rgba(58, 35, 24, 0.07),
    inset 0 2px 4px rgba(255, 255, 255, 0.95),
    inset 0 -3px 6px rgba(58, 35, 24, 0.05);
  color: var(--card-glyph);
}

.hub-pill > .ico {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}

.hub-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.98rem, 2.7vw, 1.16rem);
  color: var(--c-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-go {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(165deg, #543728 0%, var(--flora-cocoa) 100%);
  color: #FFFDF9;
  box-shadow:
    0 4px 10px rgba(58, 35, 24, 0.2),
    inset 0 2px 3px rgba(255, 255, 255, 0.22),
    inset 0 -3px 5px rgba(24, 12, 6, 0.4);
}

.hub-go .ico {
  width: 19px;
  height: 19px;
}

/* ==================== FAIXAS (letras e palavras) ====================
   Rolam na horizontal com respiro interno: a sombra dos chips não é cortada. */
.word-strip-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.word-search-btn {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.word-search-btn .ico {
  width: 24px;
  height: 24px;
}

.letter-strip,
.word-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  padding: 6px 12px 16px;
  margin: -6px -12px -10px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.word-strip-bar .word-strip {
  flex: 1;
  min-width: 0;
  margin-left: 0;
  padding-left: 4px;
}

.letter-strip::-webkit-scrollbar,
.word-strip::-webkit-scrollbar {
  display: none;
}

.letter-chip {
  flex: 0 0 auto;
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: center;
  box-shadow: var(--clay-card);
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.letter-chip.active {
  background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 84%, #FFFFFF), var(--hue));
  color: var(--hue-on);
  box-shadow: var(--shadow-hue);
}

.letter-chip:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
  box-shadow: var(--clay-pressed);
}

/* Já explorada / desenhada: bolinha 3D verde-lima / dourada */
.letter-chip.is-done::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E7F99C, var(--flora-face) 65%, var(--flora-skirt));
  box-shadow: 0 3px 6px rgba(58, 35, 24, 0.2), inset 0 -2px 3px rgba(93, 127, 9, 0.3);
  border: 2.5px solid #FFFDF9;
}

.word-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px 16px 6px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  scroll-snap-align: center;
  box-shadow: var(--clay-card);
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.word-chip.active {
  background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 84%, #FFFFFF), var(--hue));
  color: var(--hue-on);
  box-shadow: var(--shadow-hue);
}

.word-chip:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
  box-shadow: var(--clay-pressed);
}

.word-chip-emoji {
  font-size: 1.5rem;
}

.word-chip-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.word-chip-thumb--contain {
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 2px;
}

/* ==================== ARTE DAS PALAVRAS ==================== */
.word-art-box {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.word-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.word-flora-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 10px rgba(58, 35, 24, 0.16));
}

.word-emoji-badge {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
}

.word-emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 8px 8px rgba(58, 35, 24, 0.15));
}

/* ==================== LETRAS ==================== */
.letters-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tocar na letra fala o nome + Flora apontando */
.hero-letter-card {
  position: relative;
  flex: 1;
  min-height: 150px;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(162deg, var(--hue-08), var(--hue-24));
  box-shadow:
    0 12px 26px rgba(58, 35, 24, 0.08),
    inset 0 4px 8px rgba(255, 255, 255, 0.92),
    inset 0 -6px 12px color-mix(in srgb, var(--hue) 22%, transparent);
  cursor: pointer;
  overflow: visible;
  transition: transform var(--dur-tap) var(--ease-clay);
}

.hero-letter-card:active {
  transform: scale(0.97, 0.94);
}

.hero-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7rem, 25dvh, 12rem);
  line-height: 1;
  color: var(--hue-glyph);
  text-shadow:
    0 14px 24px var(--hue-shadow),
    0 3px 0 rgba(255, 255, 255, 0.65);
}

.companion-peek {
  position: absolute;
  right: 10px;
  bottom: 4px;
  height: clamp(82px, 14dvh, 132px);
  width: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(58, 35, 24, 0.2));
  animation: clayBreathe 3.4s ease-in-out infinite;
  transform-origin: 50% 95%;
}

.letters-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.syllable-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.syl-card {
  height: 58px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-ink);
  cursor: pointer;
  box-shadow: var(--clay-card);
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.syl-card b {
  color: var(--hue-glyph);
  font-weight: 700;
}

.syl-card:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
  box-shadow: var(--clay-pressed);
}

.word-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 22px 12px 14px;
  margin: -14px -12px -10px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.word-row::-webkit-scrollbar {
  display: none;
}

/* Cartão de palavra claymotion: figura grande saindo do topo + pill com a palavra */
.word-card {
  flex: 0 0 auto;
  position: relative;
  width: 134px;
  height: 152px;
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: linear-gradient(162deg, var(--hue-08), var(--hue-24));
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow:
    0 10px 22px rgba(58, 35, 24, 0.09),
    inset 0 3px 6px rgba(255, 255, 255, 0.92),
    inset 0 -5px 10px color-mix(in srgb, var(--hue) 20%, transparent);
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow var(--dur-tap) ease;
}

.word-card:active {
  transform: scale(var(--press-scale-x), 0.94);
  box-shadow: var(--clay-pressed);
}

.word-card .word-art-box {
  width: 96px;
  height: 96px;
  margin-top: -16px;
  border-radius: 22px;
}

.word-card .word-emoji {
  font-size: 4rem;
}

.word-pill {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 5px 0 11px;
  border-radius: 17px;
  background: linear-gradient(175deg, #FFFFFF 0%, #F7FAF1 100%);
  box-shadow: inset 0 2px 3px #FFFFFF, inset 0 -2px 5px rgba(58, 35, 24, 0.05);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--c-ink);
  overflow: hidden;
}

.word-pill-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.word-pill-text b {
  color: var(--hue-glyph);
  font-weight: 700;
}

.word-pill-go {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(165deg, #543728 0%, var(--flora-cocoa) 100%);
  color: #FFFDF9;
}

.word-pill-go .ico {
  width: 18px;
  height: 18px;
}

.word-row.is-wide .word-card {
  width: 148px;
}

/* ==================== DESENHAR ==================== */
.trace-layout {
  position: relative;
  --trace-size: max(220px, min(100%, calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 260px)));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.companion-trace {
  display: none;
  height: clamp(110px, 20dvh, 170px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(58, 35, 24, 0.18));
  animation: clayBreathe 3.4s ease-in-out infinite;
  pointer-events: none;
}

.trace-board {
  position: relative;
  width: var(--trace-size);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(to bottom, transparent 49.5%, var(--hue-14) 49.5%, var(--hue-14) 50.5%, transparent 50.5%),
    var(--hue-08);
  box-shadow: var(--clay-recess);
  touch-action: none;
  overflow: hidden;
}

.trace-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trace-road {
  fill: none;
  stroke: #FFFDF9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(58, 35, 24, 0.08));
}

.trace-guide {
  fill: none;
  stroke: color-mix(in srgb, var(--hue) 55%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 2 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trace-flower {
  position: absolute;
  width: 16%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(58, 35, 24, 0.24));
  transition: transform 0.15s var(--ease-clay);
  z-index: 2;
}

.trace-flower svg,
.trace-flora-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.trace-flower.is-held {
  transform: translate(-50%, -50%) scale(1.18);
}

/* ==================== PALAVRAS e SÍLABAS ==================== */
.puzzle-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Figura no pedestal clay + Flora apontando */
.puzzle-picture {
  position: relative;
  width: min(100%, 330px);
  height: clamp(130px, 22dvh, 190px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.puzzle-picture::before {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 4px;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--hue-24) 0 50%, var(--hue-08) 68%, transparent 72%);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.8), 0 6px 14px color-mix(in srgb, var(--hue) 14%, transparent);
}

.companion-pedestal {
  position: absolute;
  right: 2px;
  bottom: 2px;
  height: clamp(78px, 14dvh, 114px);
  width: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 8px 12px rgba(58, 35, 24, 0.18));
  animation: clayBreathe 3.4s ease-in-out infinite;
}

.puzzle-water {
  position: absolute;
  top: 6%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 4rem);
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--hue) 11%, transparent);
  white-space: nowrap;
  overflow: hidden;
}

.puzzle-artwork {
  position: relative;
  z-index: 1;
  margin-bottom: 9%;
}

.pedestal-botanical {
  position: absolute;
  bottom: 8px;
  width: 44px;
  height: auto;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.pedestal-botanical--left {
  left: 16%;
  transform: rotate(-8deg);
}

.pedestal-botanical--right {
  right: 16%;
  transform: rotate(10deg);
}

.puzzle-artwork .word-art-box {
  width: clamp(96px, 16dvh, 136px);
  height: clamp(96px, 16dvh, 136px);
  border-radius: 26px;
}

.puzzle-artwork .word-emoji {
  font-size: clamp(4rem, 11dvh, 6rem);
}

.puzzle-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--hue-08);
  box-shadow: var(--clay-recess);
}

.puzzle-slot,
.puzzle-tile {
  min-width: clamp(46px, 13vw, 68px);
  height: clamp(56px, 16vw, 78px);
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1;
}

.puzzle-slot {
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hue) 5%, #FFFDF9);
  box-shadow: var(--clay-recess);
  color: color-mix(in srgb, var(--hue) 26%, transparent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-slot.filled {
  background: linear-gradient(165deg, #FFFFFF 0%, #F5F7ED 100%);
  box-shadow:
    0 8px 16px var(--hue-shadow),
    inset 0 3px 5px #FFFFFF,
    inset 0 -4px 8px color-mix(in srgb, var(--hue) 18%, transparent);
  color: var(--c-ink);
}

.puzzle-slot.is-next {
  box-shadow: inset 0 0 0 3px var(--hue), var(--clay-recess);
  background: var(--hue-08);
}

.puzzle-slot.hovered {
  background: var(--hue-24);
}

.puzzle-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 70px;
}

.puzzle-tile {
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  color: var(--c-ink);
  cursor: grab;
  touch-action: none;
  box-shadow: var(--clay-float);
  transition: transform var(--dur-tap) var(--ease-clay), opacity 0.2s ease;
}

.puzzle-tile:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
  box-shadow: var(--clay-pressed);
}

.puzzle-tile.used {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.puzzle-tile.dragging-ghost {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  transform: scale(1.12);
  box-shadow: 0 18px 32px rgba(58, 35, 24, 0.24);
}

.puzzle-done {
  display: flex;
  justify-content: center;
}

/* ==================== CADÊ? ==================== */
.quiz-sheet {
  align-items: center;
}

.quiz-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.quiz-flora-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  height: clamp(82px, 14dvh, 114px);
  display: flex;
  align-items: center;
}

.quiz-flora-btn img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(58, 35, 24, 0.18));
  animation: clayBreathe 3.4s ease-in-out infinite;
}

.quiz-cards-grid {
  width: 100%;
  max-width: 860px;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(100px, 1fr);
  gap: 14px;
}

.quiz-cards-grid[data-count="4"],
.quiz-cards-grid[data-count="5"],
.quiz-cards-grid[data-count="6"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
}

.quiz-cards-grid[data-count="4"] .quiz-card,
.quiz-cards-grid[data-count="5"] .quiz-card,
.quiz-cards-grid[data-count="6"] .quiz-card {
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
}

.quiz-cards-grid[data-count="4"] .quiz-card-letter,
.quiz-cards-grid[data-count="5"] .quiz-card-letter,
.quiz-cards-grid[data-count="6"] .quiz-card-letter {
  font-size: clamp(2.8rem, 9dvh, 4.6rem);
}

.quiz-cards-grid[data-count="4"] .quiz-card .word-art-box,
.quiz-cards-grid[data-count="5"] .quiz-card .word-art-box,
.quiz-cards-grid[data-count="6"] .quiz-card .word-art-box {
  width: clamp(58px, 10dvh, 92px);
  height: clamp(58px, 10dvh, 92px);
}

.quiz-cards-grid[data-count="4"] .quiz-card .word-emoji,
.quiz-cards-grid[data-count="5"] .quiz-card .word-emoji,
.quiz-cards-grid[data-count="6"] .quiz-card .word-emoji {
  font-size: clamp(2.4rem, 7dvh, 3.4rem);
}

.quiz-cards-grid[data-count="4"] .quiz-card-word,
.quiz-cards-grid[data-count="5"] .quiz-card-word,
.quiz-cards-grid[data-count="6"] .quiz-card-word {
  font-size: 1.05rem;
}

.quiz-card {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  cursor: pointer;
  box-shadow: var(--clay-card);
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow 0.2s ease, opacity 0.35s ease;
}

.quiz-card:active {
  transform: scale(0.97, 0.94);
  box-shadow: var(--clay-pressed);
}

.quiz-card-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.8rem, 12dvh, 6.2rem);
  line-height: 1;
  color: var(--hue-glyph);
}

.quiz-card-syllable {
  font-size: clamp(3rem, 10dvh, 5rem);
}

.quiz-card-num-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.quiz-card-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 120px;
}

.quiz-card-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--hue);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.quiz-card .word-art-box {
  width: clamp(76px, 12dvh, 120px);
  height: clamp(76px, 12dvh, 120px);
}

.quiz-card-word {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Escolha diferente apenas esmaece: zero erro punitivo */
.quiz-card.soft-dimmed {
  opacity: 0.3;
  transform: scale(0.96);
  pointer-events: none;
}

.quiz-card.found-winner {
  box-shadow:
    0 0 0 4px var(--hue),
    0 14px 28px var(--hue-shadow),
    inset 0 4px 6px rgba(255, 255, 255, 0.95);
}

.quiz-check {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 84%, #FFFFFF), var(--hue));
  color: var(--hue-on);
  box-shadow: 0 6px 12px var(--hue-shadow);
}

.quiz-check .ico {
  width: 24px;
  height: 24px;
}

/* ==================== NÚMEROS: contar um a um ==================== */
.numbers-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.numbers-hero-card {
  position: relative;
  min-height: 130px;
  flex: 0 0 auto;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(162deg, var(--hue-08), var(--hue-24));
  box-shadow:
    0 12px 26px rgba(58, 35, 24, 0.08),
    inset 0 4px 8px rgba(255, 255, 255, 0.92),
    inset 0 -6px 12px color-mix(in srgb, var(--hue) 22%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay);
}

.numbers-hero-card:active {
  transform: scale(0.97, 0.94);
}

.numbers-hero-glyph {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5.4rem, 18dvh, 9rem);
  line-height: 1;
  color: var(--hue-glyph);
  text-shadow:
    0 12px 22px var(--hue-shadow),
    0 3px 0 rgba(255, 255, 255, 0.65);
}

.companion-peek--numbers {
  height: clamp(78px, 14dvh, 118px);
}

.numbers-side {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.numbers-tray {
  flex: 1;
  min-height: 110px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: var(--hue-08);
  box-shadow: var(--clay-recess);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 12px;
}

.count-item {
  position: relative;
  width: clamp(66px, 17vw, 84px);
  height: clamp(66px, 17vw, 84px);
  border: 0;
  border-radius: 24px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow: var(--clay-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay), box-shadow 0.2s ease, background 0.2s ease;
}

.count-item:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.count-item-emoji {
  font-size: clamp(2.1rem, 8vw, 2.75rem);
  line-height: 1;
  filter: drop-shadow(0 6px 6px rgba(58, 35, 24, 0.14));
}

.count-item-num {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(165deg, #FFFDF9 0%, var(--flora-face) 100%);
  color: var(--flora-cocoa);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(58, 35, 24, 0.18), inset 0 2px 3px rgba(255, 255, 255, 0.7);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.28s var(--ease-clay);
}

.count-item.is-counted {
  background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 80%, #FFFFFF), var(--hue));
  box-shadow: var(--shadow-hue);
  transform: scale(1.04);
}

.count-item.is-counted .count-item-num {
  opacity: 1;
  transform: scale(1);
}

/* ==================== CESTINHA DA FLORA ==================== */
.basket-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.basket-prompt-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.basket-flora-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, #FFFFFF 0%, var(--hue-08) 100%);
  box-shadow: var(--clay-card);
  cursor: pointer;
}

.basket-flora-wrap:active {
  transform: scale(0.97, 0.95);
}

.basket-flora-img {
  height: clamp(74px, 13dvh, 108px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(58, 35, 24, 0.16));
  animation: clayBreathe 3.4s ease-in-out infinite;
}

.basket-request-bubble {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  background: #FFFDF9;
  box-shadow: var(--clay-recess);
}

.basket-target-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 7vw, 2.8rem);
  line-height: 1;
  color: var(--hue-glyph);
}

.basket-target-emoji {
  font-size: clamp(2rem, 6.5vw, 2.5rem);
  line-height: 1;
}

.basket-progress-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 108px;
}

.basket-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(58, 35, 24, 0.14);
  transition: transform 0.25s var(--ease-clay), background 0.25s ease;
}

.basket-dot.is-filled {
  background: var(--flora-petal);
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(245, 40, 90, 0.35);
}

.basket-vessel-area {
  width: 100%;
  display: flex;
  justify-content: center;
}

.basket-vessel {
  position: relative;
  width: min(100%, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.basket-collected {
  width: 86%;
  min-height: 60px;
  padding: 8px 12px 2px;
  margin-bottom: -14px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
}

.basket-collected-item {
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1;
  filter: drop-shadow(0 6px 6px rgba(58, 35, 24, 0.2));
  animation: basketDropIn 0.35s var(--ease-clay) both;
}

@keyframes basketDropIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.5); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.basket-rim {
  width: 96%;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(175deg, #FCE0C8 0%, #EAB082 100%);
  box-shadow:
    0 6px 12px rgba(58, 35, 24, 0.14),
    inset 0 3px 5px rgba(255, 255, 255, 0.7),
    inset 0 -3px 6px rgba(154, 94, 48, 0.28);
  z-index: 3;
}

.basket-weave {
  position: relative;
  width: 84%;
  height: 70px;
  border-radius: 12px 12px 34px 34px;
  background:
    repeating-linear-gradient(90deg, rgba(168, 102, 54, 0.12) 0 12px, transparent 12px 24px),
    linear-gradient(175deg, var(--flora-peach) 0%, #E7AF80 100%);
  box-shadow:
    0 14px 26px rgba(58, 35, 24, 0.14),
    inset 0 4px 6px rgba(255, 255, 255, 0.45),
    inset 0 -8px 14px rgba(140, 78, 34, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.basket-count-pill {
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(165deg, #543728 0%, var(--flora-cocoa) 100%);
  color: #FFFDF9;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(58, 35, 24, 0.25);
}

.basket-garden {
  width: 100%;
  max-width: 560px;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: var(--hue-08);
  box-shadow: var(--clay-recess);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.basket-pick-item {
  width: clamp(64px, 16vw, 82px);
  height: clamp(64px, 16vw, 82px);
  border: 0;
  border-radius: 24px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow: var(--clay-card);
  font-size: clamp(2.1rem, 8vw, 2.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay), opacity 0.22s ease;
}

.basket-pick-item:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.basket-pick-item.is-picked {
  opacity: 0.2;
  transform: scale(0.8);
  pointer-events: none;
}

/* ==================== SENTIMENTOS (Florzinha sobre o cenário, sem card) ==================== */
.view-feelings {
  position: relative;
}

.feelings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.feelings-bg {
  position: absolute;
  inset: 0;
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 0.9s ease;
}

.feelings-bg-day {
  background-image: url('/images/Prado%20sereno%20em%20tons%20de%20s%C3%A1lvia.png');
  opacity: 1;
}

.feelings-bg-night {
  background-image: url('/images/Paisagem%20noturna%20em%20tons%20%C3%ADndigo.png');
  opacity: 0;
}

.view-feelings[data-sky="night"] .feelings-bg-day {
  opacity: 0;
}

.view-feelings[data-sky="night"] .feelings-bg-night {
  opacity: 1;
}

.feelings-night-fireflies {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.view-feelings[data-sky="night"] .feelings-night-fireflies {
  opacity: 1;
}

.feelings-night-fireflies span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFD95A;
  box-shadow: 0 0 12px 3px rgba(255, 217, 90, 0.6);
  animation: fireflyFloat 4.8s ease-in-out infinite;
}

.feelings-night-fireflies span:nth-child(1) { top: 22%; left: 16%; animation-delay: 0s; }
.feelings-night-fireflies span:nth-child(2) { top: 32%; right: 18%; animation-delay: 1s; }
.feelings-night-fireflies span:nth-child(3) { top: 52%; left: 26%; animation-delay: 2s; width: 5px; height: 5px; }
.feelings-night-fireflies span:nth-child(4) { top: 46%; right: 24%; animation-delay: 0.7s; }
.feelings-night-fireflies span:nth-child(5) { top: 18%; left: 52%; animation-delay: 1.7s; width: 5px; height: 5px; }

/* Arco celeste: Sol e Lua passando pelo céu na transição Dia <-> Noite */
.feelings-sky-orbit {
  position: absolute;
  top: 72px;
  left: 50%;
  width: min(480px, 92vw);
  height: 240px;
  transform: translateX(-50%);
  pointer-events: none;
}

.feelings-celestial {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: clamp(2.8rem, 7vw, 4rem);
  line-height: 1;
  transition: transform 1.15s cubic-bezier(0.34, 1.25, 0.64, 1), opacity 0.85s ease;
}

.feelings-sun {
  filter: drop-shadow(0 0 22px rgba(248, 196, 33, 0.65));
  transform: translate(-50%, -105px) scale(1);
  opacity: 1;
}

.feelings-moon {
  filter: drop-shadow(0 0 20px rgba(255, 217, 90, 0.55));
  transform: translate(150px, 75px) scale(0.55);
  opacity: 0;
}

.view-feelings[data-sky="night"] .feelings-sun {
  transform: translate(-180px, 75px) scale(0.55);
  opacity: 0;
}

.view-feelings[data-sky="night"] .feelings-moon {
  transform: translate(-50%, -105px) scale(1);
  opacity: 1;
}

.feelings-layout {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.feelings-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feelings-badge {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 249, 0.92);
  color: var(--c-ink);
  box-shadow: var(--clay-card);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  transition: background 0.6s ease, color 0.6s ease;
}

.view-feelings[data-sky="night"] .feelings-badge {
  background: rgba(31, 26, 66, 0.78);
  color: #FFF7D6;
}

.feelings-character {
  position: relative;
  width: clamp(190px, 44vw, 250px);
  height: clamp(210px, 34dvh, 280px);
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

.feelings-character:active {
  transform: scale(0.97);
}

.feelings-flora-img {
  position: relative;
  z-index: 2;
  height: clamp(160px, 28dvh, 224px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(58, 35, 24, 0.2));
  transform-origin: 50% 95%;
  transition: transform 0.35s ease;
}

.feelings-svg {
  position: relative;
  z-index: 2;
  width: clamp(132px, 28vw, 172px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 12px 18px rgba(58, 35, 24, 0.16));
  transform-origin: 50% 100%;
  transition: transform 0.35s ease;
}

.feelings-bush {
  position: absolute;
  bottom: -6px;
  pointer-events: none;
  user-select: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.45s ease;
}

.feelings-bush--back {
  z-index: 1;
  left: 6%;
  width: 78px;
  opacity: 0.88;
}

.feelings-bush--grass {
  z-index: 3;
  right: 8%;
  width: 82px;
  opacity: 0.92;
}

.feelings-bush--front {
  z-index: 4;
  width: 118px;
  opacity: 0;
  transform: translateY(20px) scale(0.85);
}

.view-feelings[data-feeling="escondendo"] .feelings-bush--front {
  opacity: 1;
  transform: translateY(2px) scale(1.12);
}

.view-feelings[data-sky="night"] .feelings-bush {
  filter: brightness(0.75) saturate(0.85);
}

.feelings-fx {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.feelings-fx-item {
  position: absolute;
  font-size: 1.55rem;
  animation: feelingsFxFloat 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.45s);
}

.feelings-fx-item:nth-child(1) { top: 8%; left: 10%; }
.feelings-fx-item:nth-child(2) { top: 6%; right: 12%; }
.feelings-fx-item:nth-child(3) { top: 28%; right: 2%; }

/* Animações por emoção */
.view-feelings[data-feeling="feliz"] .feelings-svg,
.view-feelings[data-feeling="feliz"] .feelings-flora-img {
  animation: feelingHappyBounce 2.2s ease-in-out infinite;
}

.view-feelings[data-feeling="triste"] .feelings-svg {
  animation: feelingSadDroop 3.4s ease-in-out infinite;
}

.view-feelings[data-feeling="chorando"] .feelings-svg {
  animation: feelingCrySob 0.9s ease-in-out infinite;
}

.view-feelings[data-feeling="chorando"] .feelings-tear {
  animation: feelingTearFall 1.1s ease-in infinite;
}

.view-feelings[data-feeling="chorando"] .feelings-tear--r {
  animation-delay: 0.45s;
}

.view-feelings[data-feeling="nervosa"] .feelings-svg {
  animation: feelingAngryShake 0.42s ease-in-out infinite;
}

.view-feelings[data-feeling="timida"] .feelings-svg {
  animation: feelingShyWiggle 2.8s ease-in-out infinite;
}

.view-feelings[data-feeling="escondendo"] .feelings-svg,
.view-feelings[data-feeling="escondendo"] .feelings-flora-img {
  animation: feelingPeek 2.6s ease-in-out infinite;
}

.view-feelings[data-feeling="acordando"] .feelings-svg,
.view-feelings[data-feeling="acordando"] .feelings-flora-img {
  animation: feelingWakeStretch 2.6s ease-in-out infinite;
}

@keyframes feelingsFxFloat {
  0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.75; }
  50% { transform: translateY(-10px) scale(1.12); opacity: 1; }
}

@keyframes feelingHappyBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes feelingSadDroop {
  0%, 100% { transform: rotate(-2deg) scaleY(0.98); }
  50% { transform: rotate(2deg) scaleY(0.96); }
}

@keyframes feelingCrySob {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(2px) scaleY(0.97); }
}

@keyframes feelingTearFall {
  0% { transform: translateY(0); opacity: 0.95; }
  100% { transform: translateY(16px); opacity: 0; }
}

@keyframes feelingAngryShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-3px) rotate(-1.5deg); }
  75% { transform: translateX(3px) rotate(1.5deg); }
}

@keyframes feelingShyWiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(3deg); }
}

@keyframes feelingPeek {
  0%, 100% { transform: translateY(6px); }
  50% { transform: translateY(-2px); }
}

@keyframes feelingWakeStretch {
  0%, 100% { transform: scaleY(0.98); }
  50% { transform: scaleY(1.04); }
}

/* Menus da atividade Sentimentos (embaixo no retrato, ao lado em paisagem/tablet) */
.feelings-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--clay-sheet);
  backdrop-filter: blur(8px);
  transition: background 0.6s ease;
}

.view-feelings[data-sky="night"] .feelings-dock {
  background: rgba(31, 26, 66, 0.78);
}

.feelings-sky-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feelings-sky-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  box-shadow: var(--clay-card);
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay), background 0.2s ease, color 0.2s ease;
}

.feelings-sky-btn:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.feelings-sky-btn.active {
  background: linear-gradient(165deg, #FFE178 0%, var(--yellow) 100%);
  color: var(--c-ink);
  box-shadow: 0 8px 16px rgba(249, 198, 40, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.55);
}

.feelings-sky-btn[data-sky="night"].active {
  background: linear-gradient(165deg, #6255C8 0%, #483D9F 100%);
  color: #FFF7D6;
  box-shadow: 0 8px 18px rgba(42, 34, 96, 0.45);
}

.feelings-emotions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.feeling-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 13px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--clay-card);
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay), background 0.2s ease;
}

.feeling-btn:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.feeling-btn.active {
  background: linear-gradient(165deg, #FFE178 0%, var(--yellow) 100%);
  color: var(--c-ink);
  box-shadow:
    0 8px 16px rgba(249, 198, 40, 0.38),
    inset 0 3px 5px rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(142, 104, 4, 0.25);
}

.feeling-btn-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

/* ==================== CELEBRAÇÃO E AVISO -1 MIN ==================== */
.petal-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.petal-piece {
  position: absolute;
  font-size: 1.9rem;
  opacity: 0;
}

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: calc(36px + var(--safe-bottom));
  pointer-events: none;
}

.celebrate-mascot {
  height: clamp(148px, 24dvh, 210px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(58, 35, 24, 0.24));
}

.celebrate-stars {
  position: absolute;
  bottom: calc(250px + var(--safe-bottom));
  display: flex;
  gap: 12px;
  font-size: 2.6rem;
}

.sleep-warning-toast {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(18px + var(--safe-bottom));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 10px;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, #FFFDF9 0%, color-mix(in srgb, var(--flora-peach) 42%, #FFFDF9) 100%);
  box-shadow: var(--clay-float);
  cursor: pointer;
  animation: toastSlideIn 0.45s var(--ease-clay) both;
}

.sleep-warning-toast img {
  height: 76px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(58, 35, 24, 0.16));
}

.sleep-warning-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(165deg, #FF557F 0%, var(--flora-petal) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(245, 40, 90, 0.3);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== FLORA DORMINDO ==================== */
.sleep-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(28px + var(--safe-top)) 24px calc(28px + var(--safe-bottom));
  background:
    url('/images/Paisagem%20noturna%20em%20tons%20%C3%ADndigo.png') center bottom / cover no-repeat,
    radial-gradient(circle at 50% 35%, #3A3270, #1C1838 80%);
  overflow: hidden;
}

.sleep-fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sleep-fireflies span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFD95A;
  box-shadow: 0 0 12px 3px rgba(255, 217, 90, 0.55);
  animation: fireflyFloat 5s ease-in-out infinite;
}

.sleep-fireflies span:nth-child(1) { top: 24%; left: 18%; animation-delay: 0s; }
.sleep-fireflies span:nth-child(2) { top: 34%; right: 20%; animation-delay: 1.1s; width: 6px; height: 6px; }
.sleep-fireflies span:nth-child(3) { bottom: 28%; left: 24%; animation-delay: 2.2s; }
.sleep-fireflies span:nth-child(4) { bottom: 32%; right: 26%; animation-delay: 0.7s; width: 6px; height: 6px; }
.sleep-fireflies span:nth-child(5) { top: 18%; left: 54%; animation-delay: 1.8s; width: 5px; height: 5px; }

@keyframes fireflyFloat {
  0%, 100% { transform: translate(0, 0) scale(0.75); opacity: 0.35; }
  50% { transform: translate(8px, -14px) scale(1.15); opacity: 0.95; }
}

.sleep-stars {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 26px;
  font-size: 1.8rem;
  animation: breathe 3.6s ease-in-out infinite;
}

.sleep-scene {
  position: relative;
  z-index: 1;
  width: 240px;
  height: 260px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.sleep-mascot {
  position: relative;
  z-index: 2;
  height: clamp(176px, 28dvh, 224px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(10, 6, 26, 0.45));
  transform-origin: 50% 100%;
  animation: sleepSway 4.2s ease-in-out infinite;
}

.sleep-botanical {
  position: absolute;
  bottom: -4px;
  z-index: 1;
  width: 68px;
  height: auto;
  opacity: 0.42;
  filter: brightness(0.72) saturate(0.8);
  pointer-events: none;
}

.sleep-botanical--left { left: 10px; transform: rotate(-10deg); }
.sleep-botanical--right { right: 10px; transform: rotate(8deg); }

.sleep-moon {
  position: absolute;
  top: -6px;
  right: 0;
  font-size: 3rem;
  animation: breathe 4s ease-in-out infinite;
}

.sleep-zzz {
  position: absolute;
  top: 12px;
  left: 10px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  color: #FFD95A;
}

.sleep-zzz span {
  opacity: 0;
  animation: sleepZzzFloat 3.2s ease-in-out infinite;
}

.sleep-zzz span:nth-child(1) { font-size: 1.1rem; animation-delay: 0s; }
.sleep-zzz span:nth-child(2) { font-size: 1.45rem; margin-left: 10px; animation-delay: 0.65s; }
.sleep-zzz span:nth-child(3) { font-size: 1.85rem; margin-left: 18px; animation-delay: 1.3s; }

@keyframes sleepZzzFloat {
  0% { transform: translate(0, 8px) scale(0.7); opacity: 0; }
  35% { opacity: 0.95; }
  100% { transform: translate(-10px, -22px) scale(1.05); opacity: 0; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes sleepSway {
  0%, 100% { transform: rotate(-3deg) scaleY(1); }
  50% { transform: rotate(3deg) scaleY(0.98); }
}

.sleep-wake-btn {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #E7E4F7;
  cursor: pointer;
}

/* ==================== MODAIS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(42, 37, 64, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 100%;
  background: var(--c-base);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  color: var(--c-ink);
}

.modal-gate {
  position: relative;
  overflow: hidden;
  max-width: 400px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.gate-botanical {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 82px;
  height: auto;
  opacity: 0.24;
  transform: rotate(-14deg);
  pointer-events: none;
  user-select: none;
}

.gate-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
}

.modal-gate h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.gate-question {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.gate-options {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.gate-opt-btn {
  min-width: 72px;
  height: 58px;
  border: 0;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== BUSCA ALFABÉTICA DE PALAVRAS ==================== */
.modal-word-picker {
  position: relative;
  max-width: 780px;
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-base);
}

.modal-word-picker > :not(.sheet-botanical) {
  position: relative;
  z-index: 1;
}

.word-picker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--c-surface);
  box-shadow: 0 1px 0 var(--c-line);
}

.word-picker-az {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.word-picker-az::-webkit-scrollbar {
  display: none;
}

.word-picker-az-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--hue-08);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-tap) ease, background var(--dur-tap) ease, color var(--dur-tap) ease;
}

.word-picker-az-btn:hover,
.word-picker-az-btn:active {
  background: var(--hue);
  color: var(--hue-on);
  transform: scale(0.95);
}

.word-picker-az-btn.is-empty {
  opacity: 0.3;
  background: var(--c-base);
  cursor: default;
  transform: none;
}

.word-picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.word-picker-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 8px;
}

.word-picker-letter {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 15px;
  background: var(--hue);
  color: var(--hue-on);
  box-shadow: var(--shadow-hue);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-tap) ease;
}

.word-picker-letter:active {
  transform: scale(0.94);
}

.word-picker-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

/* ==================== MODO PAIS (menu lateral) ==================== */
.modal-backdrop--parent {
  padding: 0;
  --hue: var(--flora-leaf);
  --hue-on: var(--flora-cocoa);
}

.modal-parent {
  position: relative;
  max-width: 1040px;
  height: 100dvh;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.parent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: var(--c-surface);
  box-shadow: 0 1px 0 var(--c-line);
  z-index: 4;
}

.parent-heading {
  flex: 1;
  min-width: 0;
}

.parent-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.parent-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--green-ink);
}

.btn-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow: var(--clay-card);
  color: var(--c-ink);
  cursor: pointer;
}

.parent-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Celular em pé: o menu é uma gaveta */
.parent-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: min(280px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 12px calc(14px + var(--safe-bottom));
  background: var(--c-surface);
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.25s ease;
}

.parent-nav-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(58, 35, 24, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-parent.is-nav-open .parent-nav {
  transform: translateX(0);
  box-shadow: 10px 0 30px rgba(58, 35, 24, 0.14);
}

.modal-parent.is-nav-open .parent-nav-scrim {
  opacity: 1;
  pointer-events: auto;
}

.parent-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 0.98rem;
  font-weight: 800;
  text-align: left;
  color: var(--c-ink);
  cursor: pointer;
}

.parent-nav-item:hover {
  background: var(--c-base);
}

.parent-nav-item.active {
  background: color-mix(in srgb, var(--flora-face) 24%, #FFFDF9);
  color: #25530A;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.85), inset 0 -2px 5px rgba(94, 181, 37, 0.14);
}

.parent-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 18px 16px calc(28px + var(--safe-bottom));
}

.parent-panel {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.parent-panel.active {
  display: flex;
}

.parent-section h3,
.settings-box h3,
.wifi-info-box h3,
.add-word-card h3,
.words-manage-header h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.box-title,
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-title {
  margin-bottom: 4px;
}

.hint-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--c-ink-muted);
}

.credits {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-ink-muted);
}

.settings-box,
.add-word-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--clay-card);
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.settings-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--green-ink);
}

.settings-row input[type="range"] {
  width: 100%;
  accent-color: var(--green-ink);
}

.range-label {
  justify-content: space-between;
  flex-wrap: wrap;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-btn,
.voice-subtab {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow: var(--clay-card);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-clay);
}

.segmented-btn:active,
.voice-subtab:active {
  transform: scale(var(--press-scale-x), var(--press-scale-y));
}

.segmented-btn.active,
.voice-subtab.active {
  background: linear-gradient(165deg, color-mix(in srgb, var(--flora-face) 28%, #FFFDF9), color-mix(in srgb, var(--flora-leaf) 26%, #FFFDF9));
  box-shadow: inset 0 0 0 2px var(--green-ink), 0 6px 12px rgba(94, 181, 37, 0.16);
  color: #25530A;
}

.timer-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--c-base);
  box-shadow: var(--clay-recess);
  font-weight: 800;
}

.timer-status .ico {
  color: var(--flora-petal);
}

/* Wi-Fi */
.wifi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.wifi-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--clay-card);
  text-align: center;
}

.qr-svg-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.qr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.qr-svg-wrap svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.wifi-info-box,
.wifi-urls-list,
.studio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wifi-url-row,
.studio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--clay-card);
}

.wifi-url-code {
  font-weight: 800;
  color: #25530A;
  word-break: break-all;
}

.info-callout,
.voice-notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--flora-face) 16%, #FFFDF9);
  font-size: 0.92rem;
  line-height: 1.45;
}

.info-callout.info-soft {
  background: color-mix(in srgb, var(--flora-peach) 22%, #FFFDF9);
  box-shadow: var(--clay-card);
}

/* Visibilidade das atividades no Modo Pais */
.activity-toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.activity-toggle-card {
  --act-color: var(--green-ink);
  --act-tint: color-mix(in srgb, var(--green) 14%, #FFFDF9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F4F7EC 100%);
  box-shadow: var(--clay-card);
  color: var(--c-ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  opacity: 0.72;
  transition: transform var(--dur-tap) var(--ease-clay), background var(--dur-tap) ease, opacity var(--dur-tap) ease, box-shadow var(--dur-tap) ease;
}

.activity-toggle-card:active {
  transform: scale(0.97, 0.94);
}

.activity-toggle-card.active {
  opacity: 1;
  background: var(--act-tint);
  box-shadow: inset 0 0 0 2px var(--act-color), var(--clay-card);
}

.activity-toggle-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.activity-toggle-main .ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--act-color);
}

.activity-toggle-state {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(58, 35, 24, 0.08);
  color: var(--c-ink-muted);
  flex-shrink: 0;
}

.activity-toggle-card.active .activity-toggle-state {
  background: #FFFDF9;
  color: var(--act-color);
}

/* Trilhas e letras */
.trails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.trail-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
}

.trail-card.active {
  background: color-mix(in srgb, var(--green) 12%, #FFFFFF);
  box-shadow: inset 0 0 0 2px var(--green-ink);
}

.trail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.trail-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #1F6B2C;
}

.trail-state .ico {
  width: 20px;
  height: 20px;
}

.parent-letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.parent-letter-toggle {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-ink-muted);
  cursor: pointer;
}

.parent-letter-toggle.active {
  background: var(--green);
  color: var(--c-ink);
}

/* Estúdio de voz */
.voice-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-info {
  flex: 1;
  min-width: 200px;
}

.studio-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.badge-family,
.badge-tts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 800;
}

.badge-family .ico,
.badge-tts .ico {
  width: 16px;
  height: 16px;
}

.badge-family {
  background: color-mix(in srgb, var(--green) 18%, #FFFFFF);
  color: #1F6B2C;
}

.badge-tts {
  background: var(--c-base);
  color: var(--c-ink-muted);
}

.studio-tip {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--c-ink-muted);
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Fotos e palavras */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.form-field {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field-sm {
  flex: 0 0 110px;
  min-width: 110px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--c-ink-muted);
}

.form-field input,
.form-field select,
.search-input {
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--c-base);
  box-shadow: inset 0 0 0 1.5px var(--c-line);
  font-size: 1rem;
  color: var(--c-ink);
}

.search-input {
  width: 100%;
}

.form-row-actions {
  align-items: center;
  justify-content: space-between;
}

.words-manage-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.words-manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.manage-word-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}

.manage-word-card .word-art-box {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--c-base);
}

.manage-word-card .word-emoji {
  font-size: 2.2rem;
}

.manage-word-meta {
  flex: 1;
  min-width: 0;
}

.manage-word-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.manage-word-meta small {
  color: var(--c-ink-muted);
}

.manage-word-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Progresso */
.progress-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-row {
  display: grid;
  grid-template-columns: 30px 42px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--c-base);
  font-weight: 700;
}

.progress-row .ico {
  color: var(--green-ink);
}

.progress-row strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #1F6B2C;
}

/* Botões do Modo Pais */
.btn-small,
.file-btn,
.btn-secondary,
.btn-outline-danger,
.btn-primary-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-small .ico,
.file-btn .ico,
.btn-secondary .ico,
.btn-outline-danger .ico {
  width: 20px;
  height: 20px;
}

.btn-small,
.file-btn {
  background: var(--c-base);
  box-shadow: inset 0 0 0 1.5px var(--c-line);
}

.btn-small.btn-rec {
  background: color-mix(in srgb, var(--orange) 12%, #FFFFFF);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--orange) 45%, transparent);
}

.btn-small.recording {
  background: var(--orange);
  box-shadow: none;
  color: var(--c-ink);
  animation: breathe 0.9s infinite;
}

.btn-primary-solid {
  background: var(--green);
  color: var(--c-ink);
}

.btn-secondary {
  align-self: flex-start;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}

.btn-outline-danger {
  align-self: flex-start;
  background: transparent;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pink) 60%, transparent);
  color: #B5163C;
}

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 360px) {
  :root {
    --gutter: 10px;
  }

  .letter-chip {
    width: 48px;
    height: 48px;
    font-size: 1.45rem;
  }

  .syl-card {
    font-size: 1.25rem;
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  .hub-grid {
    gap: 24px 12px;
    padding-top: 12px;
  }

  .hub-card {
    height: clamp(118px, 18dvh, 150px);
  }

  .hub-pill {
    height: 42px;
  }

  .hub-go {
    width: 32px;
    height: 32px;
  }

  .hero-letter-card {
    min-height: 120px;
  }

  .word-card {
    width: 116px;
    height: 132px;
  }

  .word-card .word-art-box {
    width: 80px;
    height: 80px;
  }

  .word-card .word-emoji {
    font-size: 3.2rem;
  }

  .trace-layout {
    --trace-size: max(200px, min(100%, calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 240px)));
  }

  .cbtn--lg {
    width: 58px;
    height: 58px;
  }
}

/* Modo Pais: a partir de 720px o menu fica fixo ao lado */
@media (min-width: 720px) {
  .modal-backdrop--parent {
    padding: 14px;
  }

  .modal-parent {
    height: min(92dvh, 900px);
    border-radius: var(--radius-xl);
  }

  .btn-menu {
    display: none;
  }

  .parent-nav {
    position: static;
    transform: none;
    width: 250px;
    flex-shrink: 0;
    box-shadow: 1px 0 0 var(--c-line);
  }

  .parent-nav-scrim {
    display: none;
  }

  .parent-body {
    padding: 22px 26px 30px;
  }

  .wifi-grid {
    grid-template-columns: minmax(260px, auto) 1fr;
  }
}

/* ---------------------------------------------------------------------
   DUAS COLUNAS: tablet/desktop (≥ 821px) e celular deitado
   --------------------------------------------------------------------- */
@media (min-width: 821px), (orientation: landscape) and (max-height: 520px) {
  .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-grid[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .hub-grid[data-count="2"],
  .hub-grid[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-grid[data-count="7"],
  .hub-grid[data-count="8"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hub-card:last-child,
  .hub-card.is-odd-last {
    grid-column: auto;
  }

  .letters-layout,
  .numbers-layout {
    flex-direction: row;
    gap: 20px;
  }

  .hero-letter-card,
  .numbers-hero-card {
    flex: 0 0 min(42%, 380px);
    max-height: none;
  }

  .letters-side,
  .numbers-side {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .companion-trace {
    display: block;
  }

  .trace-layout {
    --trace-size: min(100%, calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 160px));
    flex-direction: row;
    justify-content: center;
    gap: 30px;
  }

  .trace-controls {
    flex-direction: column;
  }

  .quiz-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    grid-auto-rows: minmax(0, 1fr);
  }

  .quiz-cards-grid[data-count="4"],
  .quiz-cards-grid[data-count="5"],
  .quiz-cards-grid[data-count="6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quiz-card {
    flex-direction: column;
    gap: 8px;
  }

  .feelings-layout {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .feelings-dock {
    flex: 0 0 min(360px, 44%);
    align-self: center;
  }

  .feelings-emotions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feeling-btn:last-child {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (min-width: 821px) {
  .stage {
    padding-bottom: 26px;
  }

  .hub-card {
    height: 196px;
  }

  .home-flora-wave {
    width: 108px;
    height: 108px;
  }

  .greet-text {
    font-size: 2.2rem;
  }
}

/* Celular deitado: tudo dimensionado pela altura */
@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --topbar-h: 54px;
  }

  .topbar {
    padding-top: calc(4px + var(--safe-top));
    padding-bottom: 2px;
  }

  .cbtn {
    width: 46px;
    height: 46px;
  }

  .cbtn .ico {
    width: 22px;
    height: 22px;
  }

  .view-home {
    gap: 6px;
  }

  .greet {
    padding: 0;
  }

  .greet-icon {
    width: 52px;
    height: 52px;
    padding: 4px;
    border-radius: 18px;
  }

  .home-flora-wave {
    width: 56px;
    height: 56px;
  }

  .greet-text {
    font-size: 1.4rem;
  }

  /* Deitado: até 5 cartões numa linha; 6–8 cartões em 2 linhas proporcionais */
  .hub-grid,
  .hub-grid[data-count] {
    grid-template-columns: repeat(var(--hub-count, 5), minmax(0, 1fr));
    gap: 10px 8px;
    padding-top: 14px;
  }

  .hub-grid[data-count="6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-grid[data-count="7"],
  .hub-grid[data-count="8"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hub-card.is-odd-last {
    grid-column: auto;
  }

  .hub-card {
    height: calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 120px);
    min-height: 124px;
  }

  .hub-grid[data-count="6"] .hub-card,
  .hub-grid[data-count="7"] .hub-card,
  .hub-grid[data-count="8"] .hub-card {
    height: calc((100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 134px) / 2);
    min-height: 88px;
  }

  .hub-pill {
    height: 36px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    gap: 4px;
    padding: 0 4px 0 8px;
    border-radius: 12px;
  }

  .hub-title {
    font-size: 0.76rem;
  }

  .hub-go {
    width: 26px;
    height: 26px;
  }

  .feelings-character {
    height: calc(100dvh - var(--topbar-h) - 70px);
  }

  .feelings-svg,
  .feelings-flora-img {
    height: clamp(110px, 32dvh, 160px);
    width: auto;
  }

  .feelings-dock {
    padding: 10px;
    gap: 8px;
  }

  .feeling-btn {
    min-height: 38px;
    padding: 4px 8px;
    font-size: 0.8rem;
  }

  /* Deitado o cartão é baixo: a arte fica dentro dele, acima do pill */
  .hub-art {
    height: calc(100% - 50px);
    margin-top: -10px;
  }

  .hub-glyph {
    font-size: clamp(2.8rem, 19dvh, 5rem);
  }

  .hub-piece {
    min-width: 40px;
    height: 46px;
    font-size: 1.3rem;
    border-radius: 13px;
  }

  .hub-piece--sm {
    min-width: 34px;
    height: 40px;
    font-size: 1.15rem;
  }

  .hub-trace {
    width: clamp(56px, 20dvh, 90px);
    height: clamp(56px, 20dvh, 90px);
  }

  .hub-basket-svg {
    width: clamp(58px, 19dvh, 88px);
  }

  .hub-emo-badge {
    width: 40px;
    height: 40px;
  }

  .hub-quiz-mini {
    width: 36px;
    height: 42px;
    font-size: 1.35rem;
  }

  .hub-water {
    display: none;
  }

  .sheet {
    padding: 12px;
    gap: 10px;
  }

  .letter-chip {
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
  }

  .word-search-btn {
    width: 44px;
    height: 44px;
  }

  .word-search-btn .ico {
    width: 22px;
    height: 22px;
  }

  .hero-letter,
  .numbers-hero-glyph {
    font-size: clamp(4.2rem, 28dvh, 7.6rem);
  }

  .companion-peek {
    height: clamp(54px, 16dvh, 92px);
  }

  .companion-pedestal {
    height: clamp(54px, 16dvh, 82px);
  }

  .companion-trace {
    display: none;
  }

  .syl-card {
    height: 50px;
  }

  .word-card {
    width: 104px;
    height: 112px;
  }

  .word-card .word-art-box {
    width: 66px;
    height: 66px;
    margin-top: -12px;
  }

  .word-card .word-emoji {
    font-size: 2.7rem;
  }

  .word-pill {
    height: 36px;
    font-size: 0.85rem;
  }

  .word-pill-go {
    width: 28px;
    height: 28px;
  }

  .cbtn--lg {
    width: 52px;
    height: 52px;
  }

  .trace-layout {
    --trace-size: calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 124px);
  }

  .puzzle-stage {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "pic slots"
      "pic tray"
      "pic done";
    align-items: center;
    justify-items: center;
    gap: 8px 20px;
  }

  .puzzle-picture { grid-area: pic; width: 220px; height: calc(100dvh - var(--topbar-h) - 160px); min-height: 120px; }
  .puzzle-slots { grid-area: slots; }
  .puzzle-tray { grid-area: tray; min-height: 0; }
  .puzzle-done { grid-area: done; }

  .puzzle-slot,
  .puzzle-tile {
    min-width: 46px;
    height: 54px;
    font-size: 1.75rem;
  }

  .numbers-tray {
    padding: 10px;
    gap: 8px;
  }

  .count-item {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .count-item-emoji {
    font-size: 1.8rem;
  }

  .basket-stage {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "prompt garden"
      "vessel garden"
      "vessel done";
    align-items: center;
    gap: 8px 16px;
  }

  .basket-prompt-bar { grid-area: prompt; }
  .basket-vessel-area { grid-area: vessel; }
  .basket-garden { grid-area: garden; padding: 10px; gap: 8px; }
  #basket-done { grid-area: done; }

  .basket-flora-img { height: 64px; }
  .basket-collected { min-height: 44px; }
  .basket-weave { height: 50px; }
  .basket-pick-item { width: 52px; height: 52px; border-radius: 16px; font-size: 1.8rem; }

  .quiz-sheet {
    flex-direction: row;
  }

  .quiz-prompt-row {
    flex-direction: column;
  }

  .cbtn--xl {
    width: 70px;
    height: 70px;
  }

  .quiz-card .word-art-box {
    width: clamp(56px, 20dvh, 100px);
    height: clamp(56px, 20dvh, 100px);
  }

  .celebrate {
    padding-bottom: 8px;
  }

  .celebrate-mascot {
    height: clamp(104px, 32dvh, 148px);
  }

  .celebrate-stars {
    bottom: calc(180px + var(--safe-bottom));
  }

  .sleep-scene {
    height: 170px;
  }

  .sleep-mascot {
    height: 146px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
