/* ── Trilha imersiva (prática e teoria) — visual compartilhado ──────── */
body { background: var(--bg); }

/* ── Cabeçalho gamificado (voltar/título/XP) — usado nas trilhas imersivas ── */
.game-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px; display: flex; align-items: center; padding: 0 20px; background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border, rgba(255,255,255,0.1)); gap: 16px; }
.game-header-back { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted, #8b93a7); text-decoration: none; padding: 6px 10px; border-radius: 8px; transition: all 0.15s; }
.game-header-back:hover { background: rgba(255,255,255,0.05); color: var(--text, #f0f0ff); }
.game-header-title { font-weight: 800; font-size: 0.95rem; color: var(--text, #f0f0ff); }
.game-header-xp { margin-left: auto; font-size: 0.82rem; font-weight: 700; color: var(--primary, #00d4c8); display: flex; align-items: center; gap: 6px; }
.game-header-xp .xp-badge { background: rgba(0,212,200,0.12); border: 1px solid rgba(0,212,200,0.25); padding: 3px 10px; border-radius: 99px; }
.pt-wrap { max-width: 540px; margin: 0 auto; padding: 116px 14px 80px; }
@media (min-width: 760px) { .pt-wrap { max-width: 720px; } }

.pt-stats {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 50;
  max-width: 540px; margin: 0 auto; border-radius: 0 0 16px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 10px; backdrop-filter: blur(10px);
}
@media (min-width: 760px) { .pt-stats { max-width: 720px; } }
@media (max-width: 480px) { .pt-stats { top: 50px; padding: 6px 8px; } }
.pt-stat { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; }
.pt-stat .ic { font-size: 17px; }
.pt-stat.streak { color: #f97316; } .pt-stat.xp { color: var(--primary); } .pt-stat.lvl { color: var(--purple, #8b5cf6); }

.pt-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.pt-badge { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; opacity: .35; transition: opacity .3s; }
.pt-badge.earned { opacity: 1; }
.pt-badge .b-ic { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 21px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.pt-badge.earned .b-ic { background: rgba(250,204,21,.12); border-color: rgba(250,204,21,.4); }
.pt-badge .b-lb { font-size: 9.5px; color: var(--muted); font-weight: 700; text-align: center; line-height: 1.2; }

#ptTrail { position: relative; border-radius: 20px; overflow: hidden; transition: background .4s; }
body[data-theme="lagoa"] #ptTrail { background: linear-gradient(180deg, #8fd24a 0%, #7cb83a 55%, #69a52f 100%); }
body[data-theme="fundo-do-mar"] #ptTrail { background: linear-gradient(180deg, #0a3a4d 0%, #072a3a 45%, #04161f 100%); }

.pt-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; cursor: pointer; z-index: 6; }
.pt-circ { position: relative; width: 72px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; transition: transform .12s; color: #06231f; }
.pt-node:hover .pt-circ { transform: translateY(-2px); }
.pt-node:active .pt-circ { transform: translateY(3px); }
.pt-label { font-size: 10px; font-weight: 800; max-width: 76px; text-align: center; line-height: 1.2; }
body[data-theme="lagoa"] .pt-label { color: #2c4a14; }
body[data-theme="fundo-do-mar"] .pt-label { color: #9fcfdc; }

body[data-theme="lagoa"] .pt-circ.done    { background: radial-gradient(ellipse at 50% 30%, #6fdb93, #2f9c5e 72%); box-shadow: 0 8px 0 #1d6b45, 0 11px 8px rgba(0,40,20,.35), inset 0 3px 3px rgba(255,255,255,.4); color: #0d3a22; }
body[data-theme="lagoa"] .pt-circ.avail   { background: radial-gradient(ellipse at 50% 30%, #d8ab73, #a5763f 72%); box-shadow: 0 8px 0 #6b4a26, inset 0 3px 3px rgba(255,255,255,.35); color: #3a2814; }
body[data-theme="lagoa"] .pt-circ.locked  { background: radial-gradient(ellipse at 50% 30%, #b3bcc4, #828d97 72%); box-shadow: 0 7px 0 #5d666f, inset 0 2px 2px rgba(255,255,255,.3); color: #4a525b; }
body[data-theme="lagoa"] .pt-circ.trophy  { background: radial-gradient(ellipse at 50% 30%, #c7cdd2, #9aa2ab 72%); box-shadow: 0 7px 0 #6d757d; color: rgba(90,66,0,.5); }
body[data-theme="lagoa"] .pt-circ.trophy.won { background: radial-gradient(ellipse at 50% 28%, #ffe06b, #e0a81f 72%); box-shadow: 0 8px 0 #9a7410, inset 0 3px 3px rgba(255,255,255,.55); color: #5a4200; }

body[data-theme="fundo-do-mar"] .pt-circ.done    { background: radial-gradient(ellipse at 50% 30%, #4ff0d8, #0f9e8c 72%); box-shadow: 0 8px 0 #066b62, 0 0 18px rgba(45,230,205,.4), inset 0 3px 3px rgba(255,255,255,.4); color: #043029; }
body[data-theme="fundo-do-mar"] .pt-circ.avail   { background: radial-gradient(ellipse at 50% 30%, #e08a6a, #b25636 72%); box-shadow: 0 8px 0 #7a3a22, 0 0 14px rgba(224,138,106,.3), inset 0 3px 3px rgba(255,255,255,.3); color: #3a160c; }
body[data-theme="fundo-do-mar"] .pt-circ.locked  { background: radial-gradient(ellipse at 50% 30%, #3a4654, #232d39 72%); box-shadow: 0 7px 0 #141b24, inset 0 2px 2px rgba(255,255,255,.1); color: #7a8694; }
body[data-theme="fundo-do-mar"] .pt-circ.trophy  { background: radial-gradient(ellipse at 50% 30%, #3a4654, #232d39 72%); box-shadow: 0 7px 0 #141b24; color: rgba(230,180,60,.45); }
body[data-theme="fundo-do-mar"] .pt-circ.trophy.won { background: radial-gradient(ellipse at 50% 28%, #ffd96b, #d99a1c 72%); box-shadow: 0 8px 0 #9a6e10, 0 0 22px rgba(255,210,80,.5), inset 0 3px 3px rgba(255,255,255,.5); color: #5a3f00; }

.pt-node.current .pt-circ::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid; animation: ptRing 1.7s ease-out infinite; }
body[data-theme="lagoa"] .pt-node.current .pt-circ::after { border-color: #fff; }
body[data-theme="fundo-do-mar"] .pt-node.current .pt-circ::after { border-color: #5ff0d8; }
@keyframes ptRing { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.4); opacity: 0; } }

.pt-modtitle { position: absolute; transform: translateY(-50%); z-index: 9; font-size: 12.5px; font-weight: 900; white-space: nowrap; padding: 6px 13px; border-radius: 999px; }
body[data-theme="lagoa"] .pt-modtitle { background: #8a5a2c; color: #fff3df; border: 2px solid #6e441f; }
body[data-theme="fundo-do-mar"] .pt-modtitle { background: rgba(8,40,52,.85); color: #bfe9f0; border: 1px solid #1c6b7a; }
.pt-modtitle small { opacity: .7; font-weight: 700; font-size: 11px; }

.pt-fishplayer { position: absolute; transform: translate(-50%, -50%); z-index: 8; pointer-events: none; transition: left 1.3s cubic-bezier(.45,0,.3,1), top 1.3s cubic-bezier(.45,0,.3,1); }
.pt-fishplayer .fishbob { animation: ptBob 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes ptBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }

.pt-scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#ptConfetti { position: fixed; inset: 0; pointer-events: none; z-index: 9000; }

.pt-modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9500; align-items: center; justify-content: center; padding: 20px; }
.pt-modal-bg.show { display: flex; }
.pt-modal { background: var(--panel, #161821); border: 1px solid var(--border-hover); border-radius: 22px; padding: 30px 26px; max-width: 380px; text-align: center; }
.pt-modal .m-trophy { font-size: 56px; margin-bottom: 6px; }
.pt-modal h2 { font-size: 22px; font-weight: 900; margin: 0 0 6px; }
.pt-modal p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.pt-modal-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pt-mbtn { padding: 11px 20px; border-radius: 13px; border: none; font-size: 14px; font-weight: 800; cursor: pointer; }
.pt-mbtn.wa { background: rgba(37,211,102,.14); border: 1px solid rgba(37,211,102,.4); color: #25d366; }
.pt-mbtn.ghost { background: var(--panel-2, rgba(255,255,255,.05)); border: 1px solid var(--border); color: var(--text); }

/* ── Header compacto no mobile (auditoria 375px) ───────────────────── */
@media (max-width: 480px) {
  .game-header { height: 50px; padding: 0 12px; gap: 8px; }
  .game-header-title { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
  .game-header-back { font-size: 0.74rem; padding: 6px 6px; gap: 4px; flex-shrink: 0; }
  .game-header-back svg { width: 12px; height: 12px; }
  .game-header-xp { font-size: 0.74rem; gap: 4px; flex-shrink: 0; }
  .game-header-xp .xp-badge { padding: 2px 7px; }
}

/* === Reforma Duolingo (Fase 1): menu fixo, unidades, lendario, delight === */

/* Pilulas da barra fixa */
.pt-stat small { font-size: 9px; font-weight: 700; opacity: .7; margin-left: -2px; }
.pt-stat.lvl { min-width: 0; }
.lvl-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lvl-txt #ptLvlName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.lvlbar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.lvlbar i { display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary,#00d4c8), var(--purple,#8b5cf6)); transition: width .8s ease; }
.pt-stat.streak.dim .ic { filter: grayscale(1); opacity: .5; }
@media (max-width: 480px) { .lvl-txt #ptLvlName { max-width: 70px; font-size: 12px; } .pt-stat { font-size: 13px; } }

/* Botao trofeu + ponto "nova conquista" */
.pt-trophybtn { position: relative; appearance: none; border: 1px solid rgba(250,204,21,.35);
  background: rgba(250,204,21,.12); border-radius: 12px; padding: 5px 9px; color: #fff; font-size: 17px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.05; transition: .15s; }
.pt-trophybtn:hover, .pt-trophybtn.active { background: rgba(250,204,21,.22); }
.pt-trophybtn small { font-size: 8.5px; opacity: .85; font-weight: 800; }
.pt-trophybtn.has-new::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
  border-radius: 50%; background: #fb3b5c; animation: ptDot 1.2s ease-in-out infinite; }
@keyframes ptDot { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.4); opacity: .6 } }

/* Painel de conquistas (accordion deslizante sob a barra) */
.pt-achmodal { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.62);
  align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.pt-achmodal.open { display: flex; }
.pt-achbox { position: relative; background: rgba(10,32,42,.98); border: 1px solid var(--border);
  border-radius: 20px; padding: 24px 20px; max-width: 420px; width: 100%; max-height: 82vh; overflow: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.pt-achclose { position: absolute; top: 12px; right: 12px; appearance: none; border: none;
  background: rgba(255,255,255,.08); color: #fff; width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; cursor: pointer; line-height: 1; }
.pt-achclose:hover { background: rgba(255,255,255,.16); }
.pt-achhead { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: #bfe9f0; text-align: center; margin-bottom: 14px; }

/* Cabecalho de UNIDADE colorido */
.pt-unitcard { position: absolute; transform: translate(-50%,-50%); z-index: 9;
  width: min(370px, calc(100% - 34px)); box-sizing: border-box; background: var(--uc);
  border-bottom: 4px solid rgba(0,0,0,.28); border-radius: 13px; padding: 7px 13px; color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.32); }
.pt-unitcard.done { box-shadow: 0 0 18px rgba(255,210,80,.5); border-bottom-color: #caa030; }
.pt-unitcard .uc-unit { font-size: 10px; font-weight: 900; letter-spacing: 2px; opacity: .85; }
.pt-unitcard .uc-name { font-size: 14px; font-weight: 900; margin-top: 1px; }
.pt-unitcard .uc-bar { height: 5px; background: rgba(0,0,0,.25); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.pt-unitcard .uc-bar i { display: block; height: 100%; background: rgba(255,255,255,.9); border-radius: 99px; transition: width .6s ease; }

/* No lendario (fases "Desafio") */
body[data-theme="fundo-do-mar"] .pt-circ.legendary.done {
  background: radial-gradient(ellipse at 50% 30%, #ffe27a, #d99a1c 72%);
  box-shadow: 0 8px 0 #9a6e10, 0 0 20px rgba(255,210,80,.6), inset 0 3px 3px rgba(255,255,255,.5); color: #5a3f00; }
body[data-theme="lagoa"] .pt-circ.legendary.done {
  background: radial-gradient(ellipse at 50% 28%, #ffe06b, #e0a81f 72%);
  box-shadow: 0 8px 0 #9a7410, inset 0 3px 3px rgba(255,255,255,.55); color: #5a4200; }
.ptl-ph.legendary.done { border-color: rgba(255,210,80,.5); color: #ffd75e; }
.ptl-ph.legendary.done i { background: rgba(255,210,80,.25); }

/* Reflexo molhado 3D em todo no + respiracao no disponivel */
.pt-circ::before { content: ""; position: absolute; top: 6px; left: 18px; width: 22px; height: 11px;
  border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.55), transparent 70%); pointer-events: none; }
.pt-circ.avail { animation: ptBreathe 2.2s ease-in-out infinite; }
@keyframes ptBreathe { 0%,100% { transform: scale(1) } 50% { transform: scale(1.045) } }

/* Balao COMECAR no no atual */
.pt-startbubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 7px;
  background: #2de6cd; color: #04201c; font-size: 11px; font-weight: 900; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 10px; white-space: nowrap; z-index: 12; box-shadow: 0 3px 0 #12a596;
  animation: ptStartBob 1.4s ease-in-out infinite; }
.pt-startbubble::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #2de6cd; }
@keyframes ptStartBob { 0%,100% { transform: translateX(-50%) translateY(0) } 50% { transform: translateX(-50%) translateY(-4px) } }

/* Peixe vivo + clicavel */
.pt-fishplayer .fishbob { pointer-events: auto; cursor: pointer; }
.fishflip.blink #ptEye { transform: scaleY(.12); transform-box: fill-box; transform-origin: center; }
.fishflip.wiggle { animation: ptWiggle .5s ease; }
@keyframes ptWiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-9deg) } 75% { transform: rotate(9deg) } }
.pt-fishnote { position: absolute; left: 60%; bottom: 78%; font-size: 18px; pointer-events: none; z-index: 13;
  animation: ptNote 1.1s ease-out forwards; }
@keyframes ptNote { 0% { opacity: 0; transform: translateY(0) scale(.6) } 20% { opacity: 1 }
  100% { opacity: 0; transform: translateY(-34px) scale(1.1) } }

/* Onda na chegada + rastro de bolhas do nado */
.pt-ripple { position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 2px solid rgba(120,230,235,.6); pointer-events: none; z-index: 5; animation: ptRipple .7s ease-out forwards; }
@keyframes ptRipple { 0% { transform: scale(.2); opacity: .8 } 100% { transform: scale(2.6); opacity: 0 } }
.swimbubble { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: rgba(190,240,255,.55); pointer-events: none; z-index: 7; animation: ptSwimB 1.3s ease-out forwards; }
@keyframes ptSwimB { 0% { opacity: 0; transform: translateY(6px) scale(.5) } 25% { opacity: .8 }
  100% { opacity: 0; transform: translateY(-26px) scale(1) } }

/* Padding extra no mobile (barra fixa) + acessibilidade de movimento */
@media (max-width: 480px) { .pt-wrap { padding-top: 104px; } }
@media (prefers-reduced-motion: reduce) {
  .pt-flow, .pt-circ.avail, .pt-startbubble, .pt-fishplayer .fishbob, .bub, .swy, .swy2, .drift { animation: none !important; }
}
