/* Capitão Pedro — Ilha da Fusão | Estilos principais (PC & Mobile Android PWA) */
:root {
  --ocean-dark: #0c4a6e;
  --ocean-mid: #0284c7;
  --ocean-light: #e0f2fe;
  --sky-top: #7dd3fc;
  --parchment: #fffbeb;
  --parchment-border: #fcd34d;
  --gold: #facc15;
  --gold-dark: #ca8a04;
  --coral: #ef4444;
  --coral-dark: #b91c1c;
  --emerald: #10b981;
  --emerald-dark: #047857;
  --purple: #8b5cf6;
  --ink: #1e293b;
  --muted: #475569;
  --card-bg: #ffffff;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow-soft: 0 10px 26px rgba(12, 74, 110, 0.16);
  --shadow-btn: 0 6px 0 rgba(0, 0, 0, 0.18);
  --font-main: 'Comic Sans MS', 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-main);
  color: var(--ink);
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 45%, #fef9c3 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  user-select: none;
}

.uppercase-pedagogic {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hidden {
  display: none !important;
}

/* Barra superior */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(12, 74, 110, 0.94);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.topbar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--gold);
  object-fit: cover;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.15;
}

.topbar-sub {
  font-size: 0.78rem;
  color: #bae6fd;
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 0.95rem;
}

.btn-small-nav {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--gold-dark);
}

.btn-small-nav.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-small-nav:active {
  transform: translateY(2px);
}

/* Container principal */
.main-container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}

/* Botões gigantes infantis */
.btn-big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  padding: 14px 24px;
  border-radius: 22px;
  border: 4px solid rgba(0, 0, 0, 0.14);
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: var(--shadow-btn);
  color: #fff;
  background: var(--ocean-mid);
  text-transform: uppercase;
}

.btn-big:hover {
  filter: brightness(1.05);
}

.btn-big:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.btn-gold { background: linear-gradient(180deg, #fde047, #eab308); color: #1e293b; }
.btn-coral { background: linear-gradient(180deg, #f87171, #dc2626); color: #fff; }
.btn-emerald { background: linear-gradient(180deg, #34d399, #059669); color: #fff; }
.btn-purple { background: linear-gradient(180deg, #a78bfa, #7c3aed); color: #fff; }
.btn-ocean { background: linear-gradient(180deg, #38bdf8, #0284c7); color: #fff; }

/* Tela Inicial (Home) */
.hero-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 18px;
  background: var(--parchment);
  border: 4px solid var(--parchment-border);
  border-radius: var(--radius-xl);
  padding: 18px 22px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.hero-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--gold);
  object-fit: contain;
  cursor: pointer;
  animation: floatSlow 3.5s ease-in-out infinite;
}

.hero-speech {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--ocean-dark);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  min-height: 185px;
  padding: 20px 16px;
  border-radius: var(--radius-xl);
  border: 5px solid #fff;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.16), var(--shadow-soft);
  transition: transform 0.14s ease;
}

.mode-card:active {
  transform: translateY(5px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16);
}

.mode-card img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
}

.mode-card .mode-emoji {
  font-size: 3.1rem;
  line-height: 1;
}

.mode-card-title {
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
}

.mode-card-desc {
  font-size: 0.96rem;
  font-weight: 700;
  opacity: 0.95;
}

.mode-tutor { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.mode-fusao { background: linear-gradient(145deg, #f97316, #ea580c); }
.mode-espada { background: linear-gradient(145deg, #10b981, #047857); }
.mode-bau { background: linear-gradient(145deg, #eab308, #ca8a04); color: #1e293b; }
.mode-album { background: linear-gradient(145deg, #8b5cf6, #6d28d9); grid-column: span 2; min-height: 120px; flex-direction: row; justify-content: space-around; }

/* Cabeçalho da atividade */
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-back {
  min-height: 54px;
  padding: 10px 18px;
  border-radius: 18px;
  border: 3px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
}

.btn-back:active {
  transform: translateY(3px);
}

.stage-card {
  background: var(--card-bg);
  border: 4px solid #bae6fd;
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  box-shadow: var(--shadow-soft);
}

/* Avatar / Balão do Agente Tutor */
.tutor-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--parchment);
  border: 4px solid var(--parchment-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.tutor-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--gold);
  object-fit: contain;
  flex-shrink: 0;
}

.tutor-avatar.speaking {
  animation: talkBounce 0.45s ease-in-out infinite alternate;
  box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.35);
}

.tutor-bubble {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ocean-dark);
  line-height: 1.35;
}

/* Cartões de Sílabas e Letras */
.syllable-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.syllable-tile {
  min-width: 108px;
  min-height: 96px;
  padding: 12px 20px;
  border-radius: 22px;
  border: 4px solid #0284c7;
  background: #f0f9ff;
  color: var(--ocean-dark);
  font-family: var(--font-main);
  font-size: 2.6rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 #7dd3fc;
  transition: transform 0.14s ease, background 0.18s ease, box-shadow 0.14s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.syllable-tile:active {
  transform: translateY(4px);
}

.syllable-tile.consonant {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 6px 0 #fca5a5;
}

.syllable-tile.vowel {
  background: #fef9c3;
  border-color: #eab308;
  color: #854d0e;
  box-shadow: 0 6px 0 #fde047;
}

.syllable-tile.fused {
  background: linear-gradient(135deg, #fde047, #fb923c);
  border-color: #ea580c;
  color: #fff;
  font-size: 3.3rem;
  min-width: 150px;
  min-height: 118px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 0 #c2410c;
  animation: popBurst 0.45s cubic-bezier(0.22, 1.35, 0.36, 1);
}

.syllable-tile.highlight {
  transform: scale(1.1);
  background: #fde047;
  border-color: #ca8a04;
  box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.45);
}

.syllable-tile.slot-empty {
  background: #f8fafc;
  border: 4px dashed #94a3b8;
  color: #94a3b8;
  box-shadow: none;
  cursor: default;
}

.syllable-tile.slot-filled {
  background: #d1fae5;
  border: 4px solid #10b981;
  color: #065f46;
  box-shadow: 0 6px 0 #6ee7b7;
  animation: popBurst 0.35s ease;
}

.syllable-tile.used {
  opacity: 0.3;
  pointer-events: none;
}

.syllable-tile.hint-pulse {
  animation: pulseHint 1s ease-in-out infinite;
  border-color: #10b981;
}

.picture-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}

.picture-big {
  width: 190px;
  height: 190px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 28px;
  border: 4px solid #e2e8f0;
  padding: 12px;
  cursor: pointer;
}

.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.picture-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 4px solid #cbd5e1;
  border-radius: 24px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 6px 0 #cbd5e1;
  transition: transform 0.12s ease;
}

.picture-choice:active {
  transform: translateY(4px);
}

.picture-choice img {
  width: 115px;
  height: 115px;
  object-fit: contain;
}

.picture-choice span {
  font-size: 1.45rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* Botão gigante de microfone */
.mic-btn {
  min-height: 82px;
  padding: 16px 28px;
  border-radius: 999px;
  border: 5px solid #fff;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  color: #fff;
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 0 #9f1239, 0 12px 24px rgba(225, 29, 72, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
}

.mic-btn.listening {
  background: linear-gradient(180deg, #34d399, #059669);
  box-shadow: 0 8px 0 #065f46, 0 0 0 12px rgba(16, 185, 129, 0.32);
  animation: pulseMic 1s ease-in-out infinite;
}

/* Fusão Arena */
.fusion-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #eff6ff, #fefce8);
  border: 4px dashed #93c5fd;
  border-radius: 24px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.plus-sign {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ocean-dark);
}

.family-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}

.family-tab {
  min-width: 72px;
  min-height: 54px;
  padding: 8px 18px;
  border-radius: 16px;
  border: 3px solid #94a3b8;
  background: #fff;
  font-family: var(--font-main);
  font-size: 1.45rem;
  font-weight: 900;
  cursor: pointer;
  color: var(--ink);
}

.family-tab.active {
  background: var(--ocean-mid);
  color: #fff;
  border-color: var(--ocean-dark);
  box-shadow: 0 4px 0 var(--ocean-dark);
}

/* Espada das Sílabas */
.sword-arena {
  text-align: center;
  padding: 16px;
}

.sword-btn {
  min-height: 92px;
  padding: 16px 34px;
  font-size: 1.5rem;
  border-radius: 26px;
}

.slash-flash {
  animation: slashShake 0.25s ease;
}

/* Álbum de Monstrinhos */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}

.monster-card {
  background: #fff;
  border: 4px solid var(--gold);
  border-radius: 24px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.monster-card.locked {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.monster-card.locked img {
  filter: brightness(0) opacity(0.22);
}

.monster-card img {
  width: 124px;
  height: 124px;
  object-fit: contain;
}

.monster-name {
  font-size: 1.25rem;
  font-weight: 900;
  margin-top: 6px;
}

.monster-word-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ocean-light);
  color: var(--ocean-dark);
  font-weight: 900;
  font-size: 1rem;
  text-transform: uppercase;
}

/* Área dos Pais */
.parents-panel {
  display: grid;
  gap: 16px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.stats-table th, .stats-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.progress-bar-bg {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 999px;
}

/* Celebração & Confete leve */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  animation: confettiDrop 1.8s ease-out forwards;
}

/* Banner de feedback */
.feedback-banner {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

.feedback-banner.ok {
  background: #d1fae5;
  color: #065f46;
  border: 3px solid #10b981;
}

.feedback-banner.retry {
  background: #fef3c7;
  color: #92400e;
  border: 3px solid #f59e0b;
}

.feedback-banner.info {
  background: #e0f2fe;
  color: #075985;
  border: 3px solid #38bdf8;
}

/* Animações */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes talkBounce {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes popBurst {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes pulseHint {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes slashShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px) rotate(-2deg); }
  75% { transform: translateX(10px) rotate(2deg); }
  100% { transform: translateX(0); }
}

@keyframes confettiDrop {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(95vh) rotate(520deg); opacity: 0; }
}

@media (max-width: 680px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .mode-album {
    grid-column: span 1;
    flex-direction: column;
  }
  .tutor-box {
    flex-direction: column;
    text-align: center;
  }
  .syllable-tile {
    min-width: 88px;
    min-height: 82px;
    font-size: 2.15rem;
  }
  .picture-big {
    width: 155px;
    height: 155px;
  }
}

