:root {
  --texto: #2a2420;
  --suave: #74685d;
  --vidro: rgba(255, 252, 247, .72);
  --vidro-forte: rgba(255, 252, 247, .92);
  --borda: rgba(255, 255, 255, .9);
  --linha: rgba(42, 36, 32, .09);
  --sombra: 0 14px 44px rgba(60, 40, 20, .16);
  --acento: #2f7d5b;
  --acento-claro: rgba(47, 125, 91, .12);
}
html { font-size: clamp(11px, .8vw, 22px); }
* { box-sizing: border-box; }
html, body { height: 100%; }   /* o conteúdo é todo fixo: sem isso o gradiente do fundo some */
body {
  margin: 0; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 42%, #f6efe4, #ddd0bf);
  color: var(--texto);
  font-family: Inter, "SF Pro Text", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#cena { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
body.sobre { cursor: pointer; }

.vidro {
  position: fixed;
  background: var(--vidro);
  border: 1px solid var(--borda);
  box-shadow: var(--sombra);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-radius: 1.4rem;
}
h2 { margin: 0 0 .7rem; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); font-weight: 650; }

.marca { top: 1.6rem; left: 1.6rem; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.6rem 1rem 1.1rem; }
.selo {
  width: 3.4rem; height: 3.4rem; border-radius: 1rem; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f7d5b, #1f4e3d); color: #f3e9c8;
  font: 800 1.3rem/1 ui-monospace, "SF Mono", Menlo, monospace;
}
.marca-logo { height: 3.1rem; width: auto; display: block; }
.marca-texto { padding-left: 1rem; border-left: 1px solid var(--linha); }
.marca h1 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: .01em; }
.marca p { margin: .2rem 0 0; color: var(--suave); font-size: .95rem; font-weight: 550; }

.lista { top: 8.6rem; left: 1.6rem; bottom: 1.6rem; width: 19rem; padding: 1.1rem 1rem; display: flex; flex-direction: column; }
.lista ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.lista li {
  display: flex; align-items: center; gap: .65rem;
  padding: .42rem .5rem; border-radius: .8rem; cursor: pointer;
  font-size: .9rem; font-weight: 600;
  transition: background .2s;
}
.lista li:hover, .lista li.ativo { background: var(--acento-claro); }
.lista li small { display: block; font-size: .7rem; font-weight: 500; color: var(--suave); }
.mini { width: 1.9rem; height: 1.9rem; border-radius: .65rem; flex: none; display: grid; place-items: center; color: #fff; font-size: .78rem; font-weight: 800; background: var(--c); }
.ponto { width: .5rem; height: .5rem; border-radius: 50%; background: #c4b8aa; display: inline-block; margin-left: auto; flex: none; }
.ponto.on { background: #2fae6f; box-shadow: 0 0 0 3px rgba(47, 174, 111, .18); }
.legenda { margin: .7rem 0 0; font-size: .72rem; color: var(--suave); display: flex; align-items: center; gap: .4rem; }
.legenda .ponto { margin-left: .6rem; }
.legenda .ponto:first-child { margin-left: 0; }

.dica {
  left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  padding: .65rem 1.3rem; border-radius: 99px; font-size: .9rem; font-weight: 600; color: var(--suave);
  transition: opacity .5s;
}
.dica.off { opacity: 0; }

/* rótulos */
#rotulos { position: fixed; inset: 0; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0;
  padding: .22rem .6rem; border-radius: 99px;
  background: var(--vidro-forte); border: 1px solid var(--borda);
  box-shadow: 0 4px 14px rgba(60, 40, 20, .14);
  font-size: .74rem; font-weight: 700; white-space: nowrap;
  display: flex; align-items: center; gap: .35rem;
  transition: opacity .3s, background .3s, color .3s;
  will-change: transform;
}
.tag i { width: .45rem; height: .45rem; border-radius: 50%; background: #c4b8aa; }
.tag.on i { background: #2fae6f; }
.tag.foco { background: var(--acento); color: #fff; border-color: transparent; }
.tag.foco i { background: #fff; }
.tag.apagado { opacity: .35; }
.balao {
  position: absolute; left: 0; top: 0;
  padding: .35rem .7rem; border-radius: 1rem 1rem 1rem .2rem;
  background: #fff; box-shadow: 0 6px 18px rgba(60, 40, 20, .18);
  font-size: 1rem; font-weight: 800; letter-spacing: .15em; color: var(--acento);
  opacity: 0; transition: opacity .3s;
}
.balao.on { opacity: 1; }
.emoji {
  position: absolute; left: 0; top: 0;
  padding: .25rem .5rem; border-radius: 1rem 1rem 1rem .2rem;
  background: #fff; box-shadow: 0 6px 18px rgba(60, 40, 20, .18);
  font-size: 1.15rem; line-height: 1;
  opacity: 0; transition: opacity .3s;
}
.emoji.on { opacity: 1; }

/* chat */
.chat {
  top: 1.6rem; right: 1.6rem; bottom: 1.6rem; width: 30rem;
  display: flex; flex-direction: column;
  background: var(--vidro-forte);
  transform: translateX(calc(100% + 2rem));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.chat.on { transform: none; }
.chat-topo { display: flex; align-items: center; gap: .9rem; padding: 1.2rem 1.3rem .8rem; }
.chat-ava { width: 3.2rem; height: 3.2rem; border-radius: 1.05rem; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.15rem; background: var(--c); }
.chat-id { flex: 1; min-width: 0; }
.chat-nome { margin: 0; font-size: 1.2rem; }
.chat-papel { margin: .15rem 0 0; font-size: .82rem; color: var(--suave); }
.chat-papel a { color: var(--acento); font-weight: 650; text-decoration: none; }
.chat-fechar { border: 0; background: var(--linha); width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--suave); }
.chat-aviso {
  margin: 0 1.3rem; padding: .55rem .8rem; border-radius: .8rem;
  background: #fff4dc; color: #7a5a14; font-size: .76rem; font-weight: 600;
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 86%; padding: .65rem .9rem; border-radius: 1.1rem; font-size: .95rem; line-height: 1.45; white-space: pre-wrap; animation: entra .35s ease-out; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--linha); border-bottom-left-radius: .3rem; }
.msg.user { align-self: flex-end; background: var(--acento); color: #fff; border-bottom-right-radius: .3rem; }
.msg.info { align-self: stretch; max-width: none; background: var(--linha); color: var(--suave); font-size: .85rem; }
.msg.erro { background: #fdeceb; color: #9c2f28; border-color: transparent; }
.msg.digitando::after { content: "▍"; animation: pisca 1s infinite; margin-left: .1rem; color: var(--acento); }
.chat-sugestoes { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.3rem .7rem; }
.chat-sugestoes button {
  border: 1px solid var(--linha); background: #fff; border-radius: 99px;
  padding: .35rem .75rem; font-weight: 600; font-size: .78rem; line-height: 1.2; font-family: inherit; color: var(--texto); cursor: pointer;
}
.chat-sugestoes button:hover { border-color: var(--acento); color: var(--acento); }
.chat-form { display: flex; gap: .5rem; padding: 0 1.3rem; }
.chat-form input {
  flex: 1; border: 1px solid var(--linha); background: #fff; border-radius: 99px;
  padding: .75rem 1.1rem; font-weight: 500; font-size: .95rem; font-family: inherit; color: var(--texto); outline: none;
}
.chat-form input:focus { border-color: var(--acento); }
.chat-form input:disabled { background: var(--linha); }
.chat-form button { width: 2.9rem; border: 0; border-radius: 50%; background: var(--acento); color: #fff; font-size: 1rem; cursor: pointer; }
.chat-form button:disabled { opacity: .4; cursor: default; }
.chat-rodape { padding: .6rem 1.3rem 1rem; font-size: .7rem; color: var(--suave); text-align: center; }

/* modo aluno */
.tag.voce { background: #5b4bd6; color: #fff; border-color: transparent; }
.tag.voce i { background: #fff; }
.ed-grupo { margin-bottom: .8rem; }
.ed-grupo > span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); margin-bottom: .4rem; }
.chips, .cores { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips button { border: 1px solid var(--linha); background: #fff; border-radius: 99px; padding: .3rem .7rem; font-weight: 600; font-size: .78rem; line-height: 1.2; font-family: inherit; color: var(--texto); cursor: pointer; }
.chips button.sel { background: #5b4bd6; border-color: #5b4bd6; color: #fff; }
.chips button:disabled { opacity: .4; }
.cores button { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--linha); cursor: pointer; }
.cores button.sel { box-shadow: 0 0 0 3px #5b4bd6; }
.dica-botao { margin-left: .8rem; border: 0; border-radius: 99px; padding: .3rem .8rem; background: var(--linha); font-weight: 650; font-size: .8rem; font-family: inherit; color: var(--texto); cursor: pointer; }
.modo-aluno .dica { pointer-events: auto; }
.perto {
  left: 50%; bottom: 5.2rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  border: 0; border-radius: 99px; padding: .8rem 1.4rem; font-weight: 600; font-size: 1rem; font-family: inherit; color: var(--texto); cursor: pointer;
  transition: opacity .3s, transform .3s;
}
.perto.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.perto kbd { margin-left: .5rem; padding: .1rem .45rem; border-radius: .4rem; background: var(--linha); font-weight: 700; font-size: .72rem; font-family: inherit; }

/* ---------- tela inicial ---------- */
.inicio { position: fixed; inset: 0; display: none; place-items: center; background: radial-gradient(ellipse at center, rgba(40, 28, 16, .15), rgba(40, 28, 16, .45)); z-index: 5; }
body.tela-inicio .inicio { display: grid; }
body.tela-inicio #cena { filter: blur(4px) saturate(1.05); transform: scale(1.03); }
body.tela-inicio .lista, body.tela-inicio .dica, body.tela-inicio #rotulos, body.tela-inicio .marca, body.tela-inicio .perto,
body.tela-criacao .lista, body.tela-criacao .dica, body.tela-criacao #rotulos, body.tela-criacao .marca, body.tela-criacao .perto, body.tela-criacao .chat { display: none; }
.inicio-card {
  width: min(34rem, calc(100vw - 2rem)); padding: 2.6rem 2.4rem 2rem; text-align: center;
  background: var(--vidro-forte); border: 1px solid var(--borda); border-radius: 2rem; box-shadow: 0 30px 80px rgba(40, 25, 10, .35);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: surge .7s cubic-bezier(.2, .8, .2, 1);
}
.selo.grande { width: 4.6rem; height: 4.6rem; border-radius: 1.4rem; font-size: 1.8rem; margin: 0 auto 1.1rem; }
.inicio-logo { display: block; height: 4.4rem; width: auto; margin: 0 auto 1.4rem; }
.inicio-card h1 { margin: 0; font-size: 2.3rem; font-weight: 850; letter-spacing: -.01em; }
.inicio-sub { margin: .3rem 0 1rem; color: var(--suave); font-weight: 600; }
.inicio-texto { margin: 0 auto 1.6rem; max-width: 26rem; line-height: 1.5; font-size: 1.02rem; }
.inicio-botoes { display: grid; gap: .6rem; }
.inicio-card small { display: block; margin-top: 1.3rem; color: var(--suave); font-size: .74rem; }
.btn-primario, .btn-sec, .btn-ad {
  border: 0; border-radius: 99px; padding: .9rem 1.4rem; cursor: pointer;
  font-weight: 700; font-size: 1rem; font-family: inherit; transition: transform .15s, box-shadow .15s;
}
.btn-primario { background: #5b4bd6; color: #fff; box-shadow: 0 8px 22px rgba(91, 75, 214, .35); }
.btn-primario:hover, .btn-sec:hover { transform: translateY(-1px); }
.btn-sec { background: #fff; color: var(--texto); border: 1px solid var(--linha); }
.btn-ad { background: transparent; color: var(--suave); border: 1.5px dashed rgba(42, 36, 32, .25); cursor: default; }
.btn-ad span { margin-left: .4rem; padding: .1rem .5rem; border-radius: 99px; background: var(--linha); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- criação de personagem ---------- */
.criacao { position: fixed; inset: 0; display: none; pointer-events: none; color: #f1ecff; z-index: 5; }
body.tela-criacao { background: radial-gradient(ellipse 70% 80% at 50% 58%, #3d3170 0%, #1c1633 55%, #0d0a18 100%); }
body.tela-criacao .criacao { display: block; }
.criacao > * { pointer-events: auto; }
.cr-logo { position: absolute; top: 1.7rem; left: 1.8rem; height: 2.6rem; width: auto; opacity: .92; pointer-events: none; }
.cr-topo { position: absolute; top: 1.6rem; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
.cr-topo span { font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: #f3c96b; font-weight: 700; }
.cr-topo h1 { margin: .4rem 0 0; font-size: 1.9rem; font-weight: 800; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.cr-painel {
  position: absolute; top: 7.5rem; bottom: 6.5rem; width: 24rem; padding: 1.3rem; overflow-y: auto;
  background: rgba(18, 14, 36, .62); border: 1px solid rgba(243, 201, 107, .22); border-radius: 1.4rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.cr-esq { left: 1.6rem; }
.cr-dir { right: 1.6rem; }
.criacao h2 { color: #f3c96b; }
.criacao .ed-grupo > span { color: #b9aee0; }
.criacao .ed-grupo small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.criacao .chips button { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #efe9ff; }
.criacao .chips button.sel { background: linear-gradient(135deg, #f3c96b, #e0a13a); border-color: transparent; color: #2a1d05; }
.criacao .cores button { border-color: #1c1633; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.criacao .cores button.sel { box-shadow: 0 0 0 3px #f3c96b, 0 0 14px rgba(243, 201, 107, .6); }
.cr-abas { display: flex; gap: .3rem; margin-bottom: 1rem; padding: .25rem; border-radius: 99px; background: rgba(255, 255, 255, .06); }
.cr-abas button { flex: 1; border: 0; border-radius: 99px; padding: .5rem; background: transparent; color: #b9aee0; font-weight: 700; font-size: .82rem; font-family: inherit; cursor: pointer; }
.cr-abas button.sel { background: rgba(243, 201, 107, .18); color: #f3c96b; }
.cr-dado { width: 100%; margin-top: .6rem; border: 1px solid rgba(243, 201, 107, .4); border-radius: 99px; padding: .7rem; background: transparent; color: #f3c96b; font-weight: 700; font-size: .9rem; font-family: inherit; cursor: pointer; }
.so-celular { display: none; }
.cr-ficha h2 { margin-top: 0; }
.cr-dado:hover { background: rgba(243, 201, 107, .1); }
.cr-campo { display: block; margin-bottom: .9rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #b9aee0; }
.cr-campo b { color: #f3c96b; margin-left: .3rem; }
.cr-campo input:not([type=range]), .cr-campo select {
  display: block; width: 100%; margin-top: .4rem; padding: .65rem .85rem; border-radius: .8rem;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); color: #fff;
  font-weight: 500; font-size: .95rem; font-family: inherit; letter-spacing: 0; text-transform: none; outline: none;
}
.cr-campo select option { color: #1c1633; }
.cr-campo input:focus, .cr-campo select:focus { border-color: #f3c96b; }
.cr-campo input[type=range] { display: block; width: 100%; margin-top: .6rem; accent-color: #f3c96b; }
.cr-cartao {
  margin-top: 1.1rem; padding: 1.1rem 1.2rem; border-radius: 1.1rem;
  background: linear-gradient(160deg, rgba(243, 201, 107, .16), rgba(91, 75, 214, .18)); border: 1px solid rgba(243, 201, 107, .35);
}
.cr-cartao-nome { font-size: 1.35rem; font-weight: 800; }
.cr-cartao-classe { font-size: .82rem; color: #d9cffb; margin: .15rem 0 .8rem; }
.cr-cartao-nivel { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: #b9aee0; }
.cr-cartao-nivel b { font-size: 1.3rem; color: #f3c96b; letter-spacing: 0; }
.cr-cartao-nivel i { height: .45rem; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cr-cartao-nivel em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f3c96b, #ff9f5a); transition: width .4s; }
.cr-cartao-attr { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .85rem; }
.cr-cartao-attr span { font-size: .78rem; font-weight: 650; padding: .2rem .55rem; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.cr-cartao-attr .vazio { background: none; color: #8f86b3; padding: 0; }
.cr-rodape { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); display: flex; align-items: center; gap: 1.4rem; }
.cr-girar { font-size: .8rem; color: #b9aee0; pointer-events: none; }
.btn-sec.escuro { background: rgba(255, 255, 255, .08); color: #efe9ff; border-color: rgba(255, 255, 255, .18); }
.btn-primario.dourado { background: linear-gradient(135deg, #f3c96b, #e0a13a); color: #2a1d05; box-shadow: 0 8px 28px rgba(243, 201, 107, .35); }

@keyframes surge { from { opacity: 0; transform: translateY(1rem) scale(.97); } }
@media (max-width: 1100px) {
  .cr-painel { width: 19rem; }
}
@media (max-width: 800px) {
  .cr-painel { top: auto; bottom: 5.4rem; width: auto; left: .8rem; right: .8rem; max-height: 42vh; padding: 1rem; }
  .cr-dir { display: none; }
  .so-celular { display: block; }
  .cr-aba[data-aba="ficha"] h2 { display: none; }
  .cr-logo { height: 1.8rem; top: 1rem; left: 1rem; }
  .cr-topo { top: 3.4rem; width: calc(100vw - 2rem); }
  .cr-topo span { font-size: .65rem; }
  .cr-topo h1 { font-size: 1.25rem; }
  .cr-rodape { bottom: 1rem; gap: .6rem; width: calc(100vw - 1.6rem); justify-content: space-between; }
  .cr-girar { display: none; }
  .cr-rodape .btn-primario, .cr-rodape .btn-sec { padding: .75rem 1.1rem; font-size: .9rem; }
}

@keyframes entra { from { opacity: 0; transform: translateY(.4rem); } }
@keyframes pisca { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .lista { display: none; }
  .chat { left: 1rem; right: 1rem; width: auto; top: 30vh; }
}
