:root {
  --tinta: #342846;
  --creme: #fffaf0;
  --verde: #6fbf8e;
  --amarelo: #ffd23f;
  --coral: #ff8466;
  --roxo: #9a5ce6;
  --azul: #4f95e8;
  --rosa: #ff8fa3;
  --sombra: 0 6px 0 rgba(40, 25, 60, .18), 0 10px 24px rgba(40, 25, 60, .18);
  --titulo: "Luckiest Guy", "Fredoka", system-ui, sans-serif;
  --texto: "Fredoka", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd8e2; color: var(--tinta);
  font-family: var(--texto); }
#ceu { position: fixed; inset: 0; background: linear-gradient(#a9cfe4, #e6eef5); }
#cena { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* topo */
#topo { position: fixed; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  pointer-events: none; }
.marca { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--titulo); font-size: 26px; color: #fff; letter-spacing: .5px;
  text-shadow: 0 3px 0 var(--tinta), 0 0 14px rgba(52, 40, 70, .35); }
.linguas { pointer-events: auto; display: flex; gap: 4px; }
.linguas button { font: 600 12px var(--texto); border: 0; border-radius: 10px; padding: 6px 8px;
  background: rgba(255, 255, 255, .7); color: var(--tinta); }
.linguas button.ativa { background: var(--tinta); color: #fff; }
.barra { position: relative; margin-top: 10px; height: 34px; border-radius: 20px; background: rgba(255, 255, 255, .85);
  box-shadow: var(--sombra); overflow: hidden; border: 4px solid #fff; }
.barra-cheia { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--verde); border-radius: 16px;
  transition: width 1.4s cubic-bezier(.2, .9, .2, 1); }
#barra-texto { position: relative; display: block; text-align: center; font: 22px/26px var(--titulo); }
#faltam { margin: 6px 0 0; text-align: center; font-weight: 600; font-size: 14px; color: #fff;
  text-shadow: 0 1px 3px rgba(52, 40, 70, .6); }

#dica { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(52, 40, 70, .72); color: #fff; font-weight: 600; font-size: 14px; padding: 8px 14px;
  border-radius: 20px; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
#dica.some { opacity: 0; }

/* botões */
#acoes { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 10px; }
.btn { display: block; width: 100%; font: 22px var(--titulo); letter-spacing: .4px; text-align: center;
  text-decoration: none; color: var(--tinta); background: #fff; border: 0; border-radius: 22px; padding: 14px 16px;
  box-shadow: var(--sombra); cursor: pointer; }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(40, 25, 60, .18); }
.btn.principal { background: var(--amarelo); }

/* rótulos que seguem as criaturas */
#rotulos { position: fixed; inset: 0; pointer-events: none; }
.rotulo { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); border: 0; color: var(--tinta); background: #fff; border-radius: 14px;
  padding: 4px 10px 5px; font: 600 13px var(--texto); white-space: nowrap; box-shadow: 0 3px 0 rgba(40, 25, 60, .15);
  pointer-events: auto; cursor: pointer; }
.rotulo::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent;
  border-bottom: 0; border-top-color: #fff; }
.rotulo small { display: block; font-weight: 500; font-size: 11px; opacity: .65; margin-top: -1px; }
.rotulo.juiz { background: var(--tinta); color: #fff; }
.rotulo.juiz::after { border-top-color: var(--tinta); }

/* carregando */
#carregando { position: fixed; inset: 0; display: grid; place-content: center; text-align: center;
  background: linear-gradient(#a9cfe4, #e6eef5); transition: opacity .5s; font-weight: 600; }
#carregando.some { opacity: 0; pointer-events: none; }
.spinner { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 7px solid #fff;
  border-top-color: var(--verde); animation: gira .9s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* janelas */
.fundo-modal { position: fixed; inset: 0; background: rgba(40, 30, 60, .45); display: grid; place-items: center;
  padding: 16px; z-index: 10; animation: aparece .2s ease-out; }
.fundo-modal[hidden] { display: none; }
@keyframes aparece { from { opacity: 0; } }
.modal { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  animation: sobe .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes sobe { from { transform: translateY(40px) scale(.94); opacity: 0; } }
.painel { background: var(--creme); border-radius: 30px; padding: 22px 18px 18px; box-shadow: var(--sombra); }
.painel h2 { font: 30px var(--titulo); margin: 0 30px 6px 0; }
.fechar { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: #fff; font: 700 26px/1 var(--texto); color: var(--tinta); box-shadow: var(--sombra); }
.acoes-carta { display: grid; gap: 10px; margin-top: 12px; }

/* carta (mesmo desenho das cartas dos vídeos) */
.carta { --c1: #bfe9cf; --c2: #6fbf8e; --c3: #2f6b48; position: relative; border-radius: 30px; padding: 14px;
  background: linear-gradient(var(--c1), var(--c2)); box-shadow: var(--sombra); }
.carta.rara { --c1: #b9dcff; --c2: #4f95e8; --c3: #1d4d8f; }
.carta.epica { --c1: #e2c4ff; --c2: #9a5ce6; --c3: #4e2387; }
.carta.lendaria { --c1: #fff0a8; --c2: #e8a920; --c3: #7a4d00; }
.carta.juiz { --c1: #d9d2e6; --c2: #6b5a85; --c3: #342846; }
.carta.mascote { --c1: #d6f5c9; --c2: #7cc47f; --c3: #2f6b48; }
.miolo { background: var(--creme); border-radius: 22px; padding: 14px 14px 12px; }
.cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cab h3 { font: 34px/1 var(--titulo); margin: 4px 0 0; }
.cab .num { font: 24px var(--titulo); color: var(--c2); }
.janela { position: relative; margin-top: 10px; border-radius: 18px; border: 4px solid var(--c2); aspect-ratio: 1 / .9;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .7), transparent 60%),
              linear-gradient(var(--h1, #d4f5ff), var(--h2, #c9f0b0)); overflow: hidden; }
.janela img { position: absolute; left: 50%; bottom: 8%; width: 76%; transform: translateX(-50%);
  filter: drop-shadow(0 10px 8px rgba(40, 60, 40, .25)); animation: respira 3s ease-in-out infinite; }
@keyframes respira { 50% { transform: translateX(-50%) translateY(-6px) scale(1.02); } }
.selo { position: absolute; top: 10px; left: 10px; font: 18px var(--titulo); color: var(--c3); background: var(--c1);
  border: 3px solid var(--c2); border-radius: 16px; padding: 4px 10px 2px; }
.selo-exemplo { position: absolute; top: 10px; right: 10px; font: 15px var(--titulo); background: var(--amarelo);
  border-radius: 10px; padding: 4px 8px 2px; }
.chip { display: table; margin: -16px auto 0; position: relative; background: #fff; border: 3px solid var(--c2);
  border-radius: 16px; padding: 3px 14px; font-weight: 600; font-size: 14px; }
.linha { margin: 8px 2px 0; font-size: 15px; line-height: 1.3; }
.linha b { font: 16px var(--titulo); color: var(--c2); margin-right: 4px; }
.notas { margin-top: 8px; display: grid; gap: 6px; }
.nota { display: grid; grid-template-columns: 16px 1fr 1.2fr 34px; align-items: center; gap: 8px; font-size: 14px;
  font-weight: 500; }
.nota i { width: 16px; height: 16px; border-radius: 50%; }
.nota .trilho { height: 12px; border-radius: 6px; background: #efe6d6; overflow: hidden; }
.nota .trilho span { display: block; height: 100%; background: var(--c2); border-radius: 6px; }
.nota b { font: 17px var(--titulo); text-align: right; }
.desc { margin: 8px 2px 0; font-size: 15px; line-height: 1.35; }
.rodape { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 600; }
.rodape span:last-child { font: 14px var(--titulo); color: var(--c2); }

/* criar */
.regra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.ficha { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 26px; padding: 6px 10px 6px 6px;
  font: 16px var(--titulo); border: 3px solid var(--cor); box-shadow: 0 3px 0 rgba(40, 25, 60, .12); }
.ficha .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cor) center / 60% no-repeat; }
.f-rosa { --cor: var(--rosa); } .f-azul { --cor: var(--azul); } .f-coral { --cor: var(--coral); }
.f-amarelo { --cor: var(--amarelo); }
.ic-nome { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 12l4-6h13v12H7z'/%3E%3C/svg%3E"); }
.ic-olho { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='12' rx='10' ry='6' fill='white'/%3E%3Ccircle cx='12' cy='12' r='4' fill='%23342846'/%3E%3C/svg%3E"); }
.ic-come { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='9' cy='14' r='6'/%3E%3Ccircle cx='15' cy='14' r='6'/%3E%3Cellipse cx='16' cy='5' rx='3' ry='2'/%3E%3C/svg%3E"); }
.ic-sabe { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2l3 7h7l-5.5 4.5 2 7.5-6.5-4.5L5.5 21l2-7.5L2 9h7z'/%3E%3C/svg%3E"); }
.comentario { position: relative; display: flex; gap: 10px; background: #fff; border-radius: 20px; padding: 26px 12px 12px;
  box-shadow: 0 3px 0 rgba(40, 25, 60, .12); font-size: 14px; }
.comentario .selo-exemplo { top: -8px; left: 12px; right: auto; }
.comentario p { margin: 2px 0 0; line-height: 1.3; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--roxo); color: #fff;
  display: grid; place-items: center; font: 20px var(--titulo); }
.regras-mini { margin: 12px 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }

/* busca */
#form-buscar { display: grid; gap: 10px; margin-top: 10px; }
#campo-arroba { font: 600 20px var(--texto); padding: 12px 16px; border-radius: 18px; border: 3px solid #e5dccb;
  background: #fff; color: var(--tinta); outline: none; }
#campo-arroba:focus { border-color: var(--azul); }
#resultado { margin-top: 12px; display: grid; gap: 8px; }
.mini { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 8px 12px;
  box-shadow: 0 3px 0 rgba(40, 25, 60, .1); cursor: pointer; border: 0; width: 100%; text-align: left;
  font: inherit; color: inherit; }
.mini img { width: 54px; height: 54px; object-fit: contain; }
.mini b { font: 18px var(--titulo); display: block; }
.vazio { font-size: 15px; line-height: 1.4; }

#aviso { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 20; background: var(--tinta);
  color: #fff; font-weight: 600; padding: 12px 18px; border-radius: 18px; box-shadow: var(--sombra); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* coleção */
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dupla .btn { font-size: 19px; padding: 13px 8px; }
.modal.largo { width: min(560px, 100%); }
.contagem { margin: 0 0 10px; font-weight: 600; }
.painel h3 { font: 22px var(--titulo); margin: 16px 0 8px; }
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 4px 8px;
  border-radius: 18px; border: 4px solid var(--rc, #6b5a85); background: #fff; font: inherit; color: inherit;
  box-shadow: 0 3px 0 rgba(40, 25, 60, .12); cursor: pointer; min-width: 0; }
.slot img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.slot b { font: 14px var(--titulo); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { font-size: 11px; font-weight: 600; opacity: .6; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.slot-num { position: absolute; top: 4px; left: 8px; font: 13px var(--titulo); color: var(--rc, #6b5a85); }
.slot.vazio { border-style: dashed; border-color: #cfc5b3; background: #f6f0e4; }
.slot.vazio .slot-num { color: #b3a68f; }
.interrogacao { width: 100%; aspect-ratio: 1; display: grid; place-items: center; font: normal 54px var(--titulo);
  color: #cfc5b3; }

/* rótulos compactos */
.rotulo { padding: 2px 7px 3px; font-size: 11px; border-radius: 10px; opacity: .92; }
.rotulo::after { bottom: -4px; margin-left: -4px; border-width: 4px; border-bottom: 0; }
.rotulo.ponto { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 2px solid #fff;
  background: var(--amarelo); box-shadow: 0 1px 4px rgba(40, 25, 60, .35); }
.rotulo.ponto .nome { display: none; }
.rotulo.ponto::after { display: none; }
.rotulo.juiz.ponto { background: var(--roxo); }
