/* Caça Frasco, o app do participante: o frasco que se enche e a conversa com a IA.
   Carrega depois de app.css (fontes, tokens e botões). */

:root {
  --cristal-sombra: #6dbeeb;
  --cristal-claro: #c1e6fb;
  --folha: #dceffb; /* gelo-claro: o chão da conversa */
  --raio-folha: 24px;
}

body.caca {
  background: var(--azul-faixa);
  color: var(--apoio-azul);
}

body.caca ::selection {
  background: rgba(255, 255, 255, 0.85);
  color: var(--tinta);
}

body.caca :focus-visible {
  outline-color: var(--branco);
}

.caca .app {
  max-width: 520px;
  min-height: 100dvh;
  padding: 0;
}

.caca .cabeca {
  padding: env(safe-area-inset-top) 20px 0;
  min-height: 64px;
  color: var(--apoio-azul);
}

.cabeca__progresso {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--branco);
  font-variant-numeric: tabular-nums;
}

.cabeca__progresso .frasco {
  width: 24px;
}

/* ---------- o frasco ---------- */

.frasco {
  position: relative;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 97.6 / 144;
}

.frasco svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: filter 0.9s var(--saida);
}

.frasco__vidro {
  fill: rgba(255, 255, 255, 0.1);
}

.frasco__contorno {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.7;
}

.frasco__liquido {
  transition: transform 1.2s var(--saida);
}

.frasco__onda path {
  transition: fill 0.9s var(--saida);
}

.frasco__onda--frente path {
  fill: var(--gelo);
}

.frasco__onda--tras path {
  fill: var(--cristal-sombra);
  opacity: 0.75;
}

.frasco__onda--frente {
  animation: onda 2.8s linear infinite;
}

.frasco__onda--tras {
  animation: onda-tras 4.2s linear infinite;
}

@keyframes onda {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-85.6px, 0);
  }
}

@keyframes onda-tras {
  from {
    transform: translate(-85.6px, -1.6px);
  }
  to {
    transform: translate(0, -1.6px);
  }
}

.frasco__bolha {
  fill: rgba(255, 255, 255, 0.7);
  animation: bolha 3.6s ease-in infinite;
}

.frasco__bolha:nth-of-type(2) {
  animation-delay: 1.2s;
  animation-duration: 4.4s;
}

.frasco__bolha:nth-of-type(3) {
  animation-delay: 2.3s;
}

@keyframes bolha {
  0% {
    transform: translateY(26px);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-34px);
    opacity: 0;
  }
}

.frasco__reflexo {
  fill: rgba(255, 255, 255, 0.16);
}

/* cheio: o líquido clareia e o frasco brilha */
.frasco[data-cheio] .frasco__onda--frente path {
  fill: var(--gelo-aceso);
}

.frasco[data-cheio] .frasco__onda--tras path {
  fill: var(--cristal-claro);
}

.frasco[data-cheio] svg {
  filter: drop-shadow(0 0 10px rgba(124, 200, 242, 0.75)) drop-shadow(0 0 34px rgba(124, 200, 242, 0.55));
  animation: pulso 2.8s ease-in-out 1s infinite alternate;
}

@keyframes pulso {
  to {
    filter: drop-shadow(0 0 14px rgba(149, 212, 246, 0.9)) drop-shadow(0 0 48px rgba(124, 200, 242, 0.7));
  }
}

/* ---------- abertura ---------- */

.abertura {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px calc(156px + env(safe-area-inset-bottom));
}

.abertura__palco {
  flex: 1;
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: 12px 0 8px;
}

.abertura__palco .frasco {
  width: min(46vw, 200px);
}

@media (max-height: 740px) {
  .abertura__palco .frasco {
    width: min(36vw, 150px);
  }
}

.abertura__regua {
  position: relative;
}

.abertura__titulo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 10.6vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.032em;
  color: var(--branco);
  text-wrap: balance;
}

.abertura__lede {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--apoio-azul);
  text-wrap: pretty;
}

.abertura__lede b {
  color: var(--branco);
  font-weight: 600;
}

.faltam {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}

.faltam li {
  min-width: 44px;
  padding: 7px 12px;
  border-radius: var(--raio-pilula);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
  font-size: 15px;
  font-weight: 600;
  color: var(--branco);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.faltam li[data-feita] {
  background: var(--gelo);
  box-shadow: none;
  color: var(--tinta-gelo);
}

.rodape-fixo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--azul-faixa);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.rodape-fixo .btn {
  max-width: 480px;
  margin: 0 auto;
}

.rodape-fixo .link {
  display: block;
  margin: 4px auto 0;
  color: var(--apoio-azul);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

/* botão de contorno sobre o azul */
.btn--contorno-claro {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75);
  color: var(--branco);
}

.btn--contorno-claro:active {
  background: rgba(255, 255, 255, 0.08);
}

@media (hover: hover) {
  .btn--contorno-claro:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* o passe: um chão gelo dentro do azul (a luz acesa) */
.passe-gelo {
  margin-top: 24px;
  padding: 18px 20px 20px;
  border-radius: 20px;
  background: var(--gelo);
  color: var(--apoio-gelo);
}

.passe-gelo__rotulo {
  font-size: 14px;
  font-weight: 500;
  color: var(--rotulo-gelo);
}

.passe-gelo__codigo {
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(60px, 19vw, 84px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--tinta-gelo);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.passe-gelo__dono {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--tinta-gelo);
}

.passe-gelo__estado {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(21, 23, 26, 0.14);
  font-size: 15px;
  color: var(--apoio-gelo);
}

.passe-gelo__estado::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--apoio-gelo);
}

.passe-gelo__estado[data-ok] {
  color: var(--tinta-gelo);
  font-weight: 600;
}

.passe-gelo__estado[data-ok]::before {
  background: var(--branco);
  border-color: var(--branco);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.abertura__onde {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--branco);
}

.abertura__onde span {
  display: block;
  font-size: 14px;
  color: var(--apoio-azul);
}

.abertura--passe .abertura__palco {
  min-height: 240px;
}

.abertura--passe .abertura__palco .frasco {
  width: min(38vw, 160px);
}

/* ---------- a conversa ---------- */

.folha {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(64px + env(safe-area-inset-top));
  z-index: 4;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--folha);
  border-radius: var(--raio-folha) var(--raio-folha) 0 0;
  color: var(--tinta-balao);
  transform: translateY(0);
  transition: transform 0.55s var(--saida);
}

.folha[data-fora] {
  transform: translateY(105%);
}

.folha__cab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(21, 23, 26, 0.08);
}

.folha__avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--azul-faixa);
  display: grid;
  place-items: center;
}

.folha__avatar span {
  width: 13px;
  height: 19px;
  background: var(--branco);
  -webkit-mask: url('/img/simbolo-escuro.svg') center / contain no-repeat;
  mask: url('/img/simbolo-escuro.svg') center / contain no-repeat;
}

.folha__cab b {
  display: block;
  font-size: 16px;
  color: var(--tinta);
}

.folha__cab small {
  font-size: 13px;
  color: var(--rotulo-gelo);
}

.folha__fechar {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grafite);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.folha__fechar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.fio {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 86%;
  padding: 11px 14px 12px;
  border-radius: 16px 16px 16px var(--raio-bico);
  background: var(--branco);
  color: var(--tinta-balao);
  font-size: 16px;
  line-height: 1.48;
  box-shadow: inset 0 0 0 1px rgba(34, 38, 43, 0.06);
  text-wrap: pretty;
  animation: chega 0.38s var(--saida) both;
}

.msg + .msg:not(.msg--eu) {
  border-top-left-radius: var(--raio-bico);
}

.msg--eu {
  align-self: flex-end;
  border-radius: 16px 16px var(--raio-bico) 16px;
  background: var(--gelo);
  color: var(--tinta-gelo);
  box-shadow: none;
}

.msg__tema {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--tinta);
}

.msg--pergunta {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.014em;
  color: var(--tinta);
}

.msg--certo {
  background: var(--branco);
  box-shadow: inset 0 0 0 1.5px var(--gelo-fundo);
}

.msg b {
  color: var(--tinta);
  font-weight: 600;
}

@keyframes chega {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.digitando {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 16px 16px 16px var(--raio-bico);
  background: var(--branco);
  align-self: flex-start;
}

.digitando i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rotulo-gelo);
  animation: ponto 1s ease-in-out infinite;
}

.digitando i:nth-child(2) {
  animation-delay: 0.15s;
}

.digitando i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ponto {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* cartão dentro da conversa: o passe e o resultado da sala */
.cartao {
  align-self: stretch;
  margin-top: 4px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  background: var(--azul-faixa);
  color: var(--apoio-azul);
  animation: chega 0.5s var(--saida) both;
}

.cartao__codigo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(56px, 18vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--branco);
  font-variant-numeric: tabular-nums;
}

.cartao--frasco {
  display: flex;
  align-items: center;
  gap: 18px;
}

.frasco--cartao {
  width: 64px;
  flex: none;
}

.cartao__nivel {
  font-size: 18px;
  color: var(--apoio-azul);
  font-variant-numeric: tabular-nums;
}

.cartao__nivel b {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--branco);
}

.cartao__rotulo--pe {
  margin-top: 6px;
}

.cartao__rotulo {
  font-size: 14px;
  color: var(--apoio-azul);
}

.cartao__nome {
  margin-top: 10px;
  font-size: 16px;
  color: var(--branco);
  font-weight: 600;
}

/* ---------- o que a pessoa responde ---------- */

.resposta {
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(21, 23, 26, 0.08);
  background: var(--folha);
}

.resposta:empty {
  display: none;
}

.opcoes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opcoes--linha {
  flex-direction: row;
  flex-wrap: wrap;
}

.opcao {
  appearance: none;
  display: flex;
  align-items: center;
  min-height: 52px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--branco);
  box-shadow: inset 0 0 0 1.5px rgba(34, 38, 43, 0.75);
  color: var(--tinta);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--saida), transform 0.2s var(--saida), opacity 0.2s var(--saida);
  animation: chega 0.38s var(--saida) both;
}

.opcoes--linha .opcao {
  width: auto;
  flex: 1 1 auto;
  justify-content: center;
  border-radius: var(--raio-pilula);
  font-weight: 600;
}

.opcao:active {
  transform: scale(0.98);
  background: var(--gelo-aceso);
}

@media (hover: hover) {
  .opcao:hover {
    background: var(--gelo-claro);
  }
}

.opcao--forte {
  background: var(--gelo);
  box-shadow: none;
  justify-content: center;
  font-weight: 600;
}

.opcao[disabled] {
  opacity: 0.4;
  cursor: default;
}

.compositor {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compositor input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--raio-pilula);
  background: var(--branco);
  box-shadow: inset 0 0 0 1.5px rgba(34, 38, 43, 0.2);
  font-size: 17px;
  color: var(--tinta);
  font-variant-numeric: tabular-nums;
}

.compositor input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gelo-fundo);
}

.compositor input::placeholder {
  color: var(--rotulo-gelo);
  opacity: 0.8;
}

.compositor button {
  width: 52px;
  height: 52px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--gelo);
  color: var(--tinta-gelo);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--saida), background 0.2s var(--saida);
}

.compositor button:active {
  transform: scale(0.94);
  background: var(--gelo-aceso);
}

.compositor button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resposta__aviso {
  margin: 0 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tinta);
}

.resposta__legal {
  margin: 8px 6px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--rotulo-gelo);
}

/* ---------- carregando ---------- */

.caca .carregando span {
  background: var(--branco);
}

@media (prefers-reduced-motion: reduce) {
  .frasco__onda--frente,
  .frasco__onda--tras,
  .frasco__bolha {
    animation: none !important;
  }
  .frasco__bolha {
    opacity: 0;
  }
}

/* teclado aberto: a conversa ocupa toda a área visível e esconde o próprio cabeçalho */
.folha[data-teclado] {
  border-radius: 0;
}

.folha[data-teclado] .folha__cab {
  display: none;
}

/* em tela larga, o pé fixo acompanha a coluna de 520px */
.rodape-fixo {
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- vitrine dos brindes ---------- */
.vitrine {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.vitrine li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.vitrine p b {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.018em;
  color: var(--branco);
}

.vitrine p span {
  font-size: 14px;
  color: var(--apoio-azul);
}

.vitrine li[data-ganhou]::after {
  content: 'Liberado';
  padding: 5px 10px;
  border-radius: var(--raio-pilula);
  background: var(--gelo);
  color: var(--tinta-gelo);
  font-size: 13px;
  font-weight: 600;
}

.adesivos {
  position: relative;
  display: block;
  width: 64px;
  height: 44px;
}

.adesivos__um {
  position: absolute;
  top: 4px;
  width: 34px;
  height: 34px;
}

.adesivos__um:nth-child(1) {
  left: 0;
  transform: rotate(-8deg);
}

.adesivos__um:nth-child(2) {
  left: 15px;
  top: 0;
  z-index: 1;
}

.adesivos__um:nth-child(3) {
  left: 30px;
  transform: rotate(7deg);
  z-index: 2;
}

.adesivos__um svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.vitrine__lata {
  display: grid;
  place-items: center;
  width: 64px;
}

.lata {
  width: 26px;
  height: auto;
}

.vitrine__plus {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-left: 6px;
  border-radius: 14px;
  background: var(--branco);
  color: var(--tinta);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.vitrine li[data-ganhou] .adesivos,
.vitrine li[data-ganhou] .vitrine__lata,
.vitrine li[data-ganhou] .vitrine__plus {
  filter: drop-shadow(0 0 8px rgba(124, 200, 242, 0.7));
}

/* o código, pequeno, no progresso */
.codigo-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--gelo);
  color: var(--rotulo-gelo);
  font-size: 14px;
  font-weight: 500;
}

.codigo-mini b {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--tinta-gelo);
  font-variant-numeric: tabular-nums;
}

/* ---------- abertura: os brindes flutuam em volta do frasco ---------- */
.abertura__palco--orbita {
  position: relative;
  min-height: 330px;
}

.orbita {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.orbita__item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  animation: flutua 5.5s ease-in-out infinite alternate;
}

.orbita__item > span:last-child {
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--apoio-azul);
}

.orbita__item b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--branco);
}

.orbita__item--adesivo {
  left: 0;
  top: 6%;
  animation-delay: -1.2s;
}

.orbita__item--adesivo .adesivos {
  transform: rotate(-6deg) scale(1.45);
  transform-origin: 30% 50%;
  margin: 10px 0 8px 14px;
}

.orbita__item--lata {
  right: 2%;
  top: 30%;
  animation-delay: -3s;
}

.orbita__item--lata .lata {
  width: 40px;
  transform: rotate(9deg);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.orbita__item--plus {
  left: 4%;
  bottom: 4%;
  animation-delay: -4.4s;
}

.orbita__item--plus .vitrine__plus {
  width: 60px;
  height: 60px;
  font-size: 17px;
  margin: 0;
  transform: rotate(-5deg);
}

@keyframes flutua {
  from {
    transform: translateY(-5px);
  }
  to {
    transform: translateY(6px);
  }
}

@media (max-width: 359px) {
  .orbita__item > span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbita__item {
    animation: none;
  }
}

/* imagens reais dos brindes */
.vitrine__plus {
  background: transparent;
  overflow: hidden;
}

.vitrine__plus .chatgpt {
  width: 84%;
  height: 84%;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.lata {
  height: auto;
}

.vitrine__lata .lata {
  width: 24px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.orbita__item--lata .lata {
  width: 44px;
}
