/* ============================================================
   trophies.css — o jogo da Sala de Troféus (salas, vitrines, a imagem,
   o editor). Veio do tr.css do Zé Bolão; cores e letras são as variáveis
   --tr-* e --f-* do styles.css (identidade da Sala de Troféus).
   Tudo escopado em .tr-root (o tutorial abre fora dele, no <body>).
   ============================================================ */
.tr-root {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 0.9rem 2.5rem;
  color: var(--tr-ink);
  font-family: var(--f-body);
}
.tr-root * { box-sizing: border-box; }
.tr-loading { padding: 3rem; text-align: center; color: var(--tr-muted); font-weight: 600; }
.tr-loading::after { content: ' 🏆'; display: inline-block; animation: trSpin 1s linear infinite; }

/* sticker base reaproveitado do sistema */
/* placa de latão (no Zé Bolão era o "adesivo" com traço de tinta) */
.tr-sticker {
  background: var(--tr-card);
  border: 1.5px solid var(--tr-gold);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #fff, 0 8px 22px var(--tr-shadow);
}
.tr-head-font { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tr-num-font { font-family: var(--f-display); font-weight: 900; }

/* ---------- intro ---------- */
.tr-intro { text-align: center; margin-bottom: 1.1rem; animation: trFadeUp 0.4s both; }
.tr-intro h2 { font-family: var(--f-display); font-weight: 900; font-size: clamp(1.5rem, 5vw, 2.1rem); margin: 0 0 0.2rem; color: var(--tr-grass); }
.tr-intro h2::after { content: ''; display: block; width: 84px; height: 3px; margin: 0.45rem auto 0; background: linear-gradient(90deg, transparent, var(--tr-gold), transparent); }
.tr-intro p { margin: 0; color: var(--tr-ink); opacity: 0.8; font-size: 0.95rem; }
.tr-intro-actions { margin-top: 0.7rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ---------- grid de níveis ---------- */
.tr-levelgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tr-card {
  position: relative;
  min-height: 210px;
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid var(--tr-gold);
  box-shadow: 0 6px 16px var(--tr-shadow);
  cursor: pointer;
  text-align: left;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.9rem;
  gap: 0.4rem;
  background: var(--tr-grass-d);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: trPopIn 0.34s both;
  font-family: inherit;
}
.tr-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: var(--tr-bg); background-size: cover; background-position: center;
  filter: brightness(0.62) saturate(1.05); transition: transform 0.3s ease, filter 0.3s ease;
}
.tr-card::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.8)); }
.tr-card > * { position: relative; z-index: 2; }
.tr-card:not(.tr-locked):hover { transform: translate(-2px, -2px); box-shadow: 0 9px 24px var(--tr-shadow); }
.tr-card:not(.tr-locked):hover::before { transform: scale(1.05); filter: brightness(0.72) saturate(1.1); }
.tr-card.tr-locked { cursor: not-allowed; }
.tr-card.tr-locked::before { filter: brightness(0.22) grayscale(0.8); }
.tr-card.tr-locked::after { background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.88)); }
.tr-card.tr-locked .tr-card-idx { color: rgba(255,255,255,0.65); }
.tr-card.tr-locked h3 { color: rgba(255,255,255,0.78); }
.tr-card.tr-current { outline: 3px solid var(--tr-gold); outline-offset: -3px; }
.tr-card-idx { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.18em; color: var(--tr-yellow); }
.tr-card h3 { font-family: var(--f-display); font-weight: 900; margin: 0; font-size: 1.2rem; line-height: 1.1; }
.tr-card p { margin: 0; font-size: 0.85rem; opacity: 0.92; }
.tr-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.2rem; }
.tr-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  background: rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.35); color: #fff;
}
.tr-pill.tr-done { color: var(--tr-ink); background: var(--tr-yellow); border-color: var(--tr-ink); }
.tr-card-lock { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; text-align: center; padding: 1rem 1rem 3.2rem; pointer-events: none; }
.tr-card-lock svg { width: 52px; height: 52px; color: var(--tr-yellow); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.tr-card-lock span { font-size: 0.8rem; max-width: 180px; line-height: 1.4; color: rgba(255,255,255,0.75); }

/* ---------- seletor de categorias (jogador) ---------- */
.tr-catgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tr-catcard {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.4rem 1rem; cursor: pointer; text-align: center; color: var(--tr-ink);
  font-family: inherit; border-radius: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: trPopIn 0.34s both;
}
.tr-catcard:hover { transform: translate(-2px, -2px); box-shadow: 0 9px 24px var(--tr-shadow); }
.tr-catcard-ic { font-size: 3rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }
.tr-catcard h3 { font-family: var(--f-display); font-weight: 900; margin: 0; font-size: 1.15rem; line-height: 1.1; color: var(--tr-grass); }
.tr-catcard .tr-pill { background: var(--tr-paper); color: var(--tr-ink); border-color: var(--tr-ink); }
.tr-catcard .tr-pill.tr-done { background: var(--tr-yellow); }
.tr-backbtn { margin-bottom: 0.6rem; }

/* ---------- barra do jogo ---------- */
.tr-bar {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.45rem; margin-bottom: 0.8rem;
  border-radius: 10px; background: var(--tr-grass); border: 2.5px solid var(--tr-ink); box-shadow: 0 6px 16px var(--tr-shadow);
  animation: trFadeUp 0.35s both;
}
.tr-pillbtn {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 40px; padding: 0 0.8rem;
  border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink);
  font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 3px 8px var(--tr-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.tr-pillbtn:hover { transform: translate(-1px, -1px); box-shadow: 0 5px 12px var(--tr-shadow); }
.tr-pillbtn:active { transform: translate(1px, 1px); box-shadow: 0 2px 4px var(--tr-shadow); }
.tr-pillbtn small { display: block; font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 0.6rem; letter-spacing: 0.14em; color: var(--tr-muted); line-height: 1; }
.tr-pillbtn b { font-family: var(--f-display); font-weight: 900; font-size: 0.95rem; line-height: 1; }
.tr-bstat {
  display: flex; flex-direction: column; justify-content: center; gap: 0.18rem;
  height: 40px; padding: 0 0.7rem; border-radius: 8px; background: rgba(255,255,255,0.14); border: 1.5px solid rgba(255,255,255,0.3);
}
.tr-bstat small { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.14em; color: var(--tr-chalk); line-height: 1; }
.tr-bstat strong { font-family: var(--f-display); font-weight: 900; font-size: 1rem; line-height: 1; color: #fff; }
.tr-bstat strong .tr-accent { color: var(--tr-yellow); }
.tr-bar-spacer { flex: 1 1 auto; }
.tr-iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink);
  font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 8px var(--tr-shadow); transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.tr-iconbtn:hover { transform: translate(-1px, -1px); box-shadow: 0 5px 12px var(--tr-shadow); }
.tr-iconbtn:active { transform: translate(1px, 1px); box-shadow: 0 2px 4px var(--tr-shadow); }

/* ---------- palco / imagem ---------- */
.tr-stage {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 2.5px solid var(--tr-ink); box-shadow: 0 6px 16px var(--tr-shadow);
  background: #0b0c0f; line-height: 0;
}
/* a entrada (fade) vive no imgbox, NÃO no .tr-stage — senão as classes de flash
   (.tr-hit/.tr-wrong) sobrescrevem `animation` e, ao sair, o fade re-roda e a
   imagem "pisca". Mantendo aqui, o flash do palco não mexe na imagem. */
.tr-imgbox { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; animation: trFadeUp 0.4s 0.05s both; }
.tr-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.tr-markers { position: absolute; inset: 0; pointer-events: none; }
.tr-stage.tr-hit { animation: trHit 0.6s ease-out; }
.tr-stage.tr-wrong { animation: trShake 0.4s ease; }

.tr-marker {
  position: absolute; left: var(--mx); top: var(--my);
  width: 30px; height: 30px; transform: translate(-50%, -50%);
  border: 0; padding: 0; background: transparent; pointer-events: auto; cursor: help;
  animation: trMarkerIn 0.42s cubic-bezier(0.16, 1.25, 0.34, 1) both;
}
.tr-ball {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #fffef6 0 16%, transparent 17%),
    radial-gradient(circle at 50% 52%, #fff 0 38%, #e9e9e9 39% 60%, #c9c9c9 100%);
  border: 2px solid var(--tr-ink);
  box-shadow: 0 0 0 4px rgba(244,167,43,0.35), 0 2px 6px rgba(0,0,0,0.4);
  animation: trFloat 2.8s ease-in-out infinite;
  position: relative;
}
.tr-ball::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 36%; height: 36%;
  transform: translate(-50%, -50%);
  background: var(--tr-ink);
  clip-path: polygon(50% 0%, 95% 35%, 78% 100%, 22% 100%, 5% 35%);
}
/* marcador com emoji da categoria (ex.: ✨) no lugar da bola */
.tr-ball.tr-emoji { background: none; border: 0; box-shadow: none; display: grid; place-items: center; font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.65)); }
.tr-ball.tr-emoji::before { display: none; }
.tr-marker.tr-just .tr-ball { animation: trFound 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.tr-marker .tr-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) scale(0.96);
  opacity: 0; pointer-events: none; width: max-content; max-width: min(240px, 60vw);
  padding: 0.5rem 0.6rem; border-radius: 8px; background: var(--tr-ink); color: var(--tr-chalk);
  font-size: 0.78rem; font-weight: 700; line-height: 1.3; text-align: center; white-space: normal;
  transition: opacity 0.16s ease, transform 0.16s ease; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.tr-marker:hover .tr-tip, .tr-marker:focus-visible .tr-tip,
.tr-marker.tr-show-tip .tr-tip { opacity: 1; transform: translateX(-50%) scale(1); }
.tr-marker.tr-show-tip { z-index: 6; }
.tr-marker .tr-tip span { display: block; margin-top: 0.2rem; color: var(--tr-yellow); font-weight: 600; font-size: 0.72rem; }

/* ---------- lupa (zoom no touch) ---------- */
.tr-loupe {
  position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none;
  border-radius: 50%; border: 3px solid var(--tr-chalk);
  box-shadow: 0 0 0 3px var(--tr-ink), 0 8px 22px rgba(0,0,0,0.5);
  background-color: #0b0c0f; opacity: 0; transform: scale(0.6);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tr-loupe.on { opacity: 1; transform: scale(1); }
.tr-zoomtip { display: inline-block; margin-left: 0.15rem; color: var(--tr-grass); font-weight: 700; }

/* ---------- dock de palpite ---------- */
.tr-dock { margin-top: 0.8rem; animation: trFadeUp 0.4s 0.1s both; }
.tr-form { display: flex; gap: 0.5rem; }
.tr-input {
  flex: 1; min-width: 0; height: 52px; padding: 0 1rem; border-radius: 10px;
  border: 2.5px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink);
  font: inherit; font-size: 1.05rem; outline: none; box-shadow: 0 5px 12px var(--tr-shadow);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.tr-input::placeholder { color: var(--tr-muted); }
.tr-input:focus { box-shadow: 3px 3px 0 var(--tr-gold); }
.tr-input:disabled { opacity: 0.55; }
.tr-okbtn {
  flex: 0 0 auto; width: 52px; height: 52px; padding: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--tr-ink); background: var(--tr-grass); color: var(--tr-ink);
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 5px 12px var(--tr-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.tr-okbtn:hover { transform: translate(-1px, -1px); box-shadow: 0 6px 16px var(--tr-shadow); }
.tr-okbtn:active { transform: translate(1px, 1px); box-shadow: 0 2px 4px var(--tr-shadow); }
.tr-iconbtn.tr-hinticon { background: var(--tr-yellow); }
.tr-hints { margin-top: 0.8rem; border-radius: 10px; overflow: hidden; animation: trFadeUp 0.3s both; }
.tr-hints-list { list-style: none; margin: 0; padding: 0.6rem; display: grid; gap: 0.4rem; background: var(--tr-paper); }
.tr-hints-list li { display: grid; grid-template-columns: 22px 1fr; gap: 0.5rem; align-items: start; padding: 0.45rem 0.55rem; border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); font-size: 0.85rem; }
.tr-hints-list .tr-hint-ic { line-height: 1.3; }
.tr-hint-got { color: var(--tr-grass); }
.tr-root.tr-fs .tr-hints { display: none; }
.tr-feedback { margin-top: 0.55rem; min-height: 1.2rem; font-size: 0.9rem; font-weight: 700; }
.tr-feedback.tr-fb-ok { color: var(--tr-grass); }
.tr-feedback.tr-fb-bad { color: var(--tr-red); }
.tr-feedback.tr-fb-dim { color: var(--tr-muted); font-weight: 500; }

/* ---------- lista de acertos ---------- */
.tr-found { margin-top: 1rem; border-radius: 10px; overflow: hidden; animation: trFadeUp 0.4s 0.15s both; }
.tr-found-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.8rem; font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.05em; background: var(--tr-paper); border-bottom: 2px solid var(--tr-ink); }
.tr-found-head span { font-family: var(--f-body); color: var(--tr-muted); font-size: 0.8rem; font-weight: 700; }
.tr-found-list { list-style: none; margin: 0; padding: 0.6rem; display: grid; gap: 0.5rem; grid-template-columns: 1fr 1fr; background: var(--tr-paper); }
.tr-found-list li { display: grid; grid-template-columns: 30px 1fr; gap: 0.55rem; align-items: center; padding: 0.5rem; border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); animation: trListIn 0.24s ease both; }
.tr-found-list .tr-num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-family: var(--f-display); font-weight: 900; font-size: 0.72rem; color: var(--tr-ink); background: var(--tr-yellow); border: 2px solid var(--tr-ink); }
.tr-found-list b { display: block; font-size: 0.85rem; }
.tr-found-list small { display: block; color: var(--tr-muted); font-size: 0.72rem; margin-top: 0.05rem; }
.tr-found-empty { grid-column: 1 / -1; color: var(--tr-muted); font-size: 0.85rem; padding: 0.4rem; }

/* ---------- conclusão + leaderboard ---------- */
.tr-complete { padding: 1.4rem; text-align: center; animation: trPopIn 0.4s both; }
.tr-trophy { font-size: 3rem; line-height: 1; animation: trTrophy 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.tr-complete h2 { font-family: var(--f-display); font-weight: 900; margin: 0.5rem 0 0.2rem; font-size: 1.5rem; color: var(--tr-grass); }
.tr-complete .tr-sub { color: var(--tr-muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.tr-bigscore { font-family: var(--f-display); font-weight: 900; font-size: 2.6rem; color: var(--tr-grass); line-height: 1.05; }
.tr-bigscore small { display: block; font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.14em; color: var(--tr-muted); }
.tr-best { margin-top: 0.3rem; font-size: 0.85rem; color: var(--tr-muted); }
.tr-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.1rem; }

.tr-board { margin-top: 1.3rem; text-align: left; }
.tr-board h3 { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 1.15rem; letter-spacing: 0.05em; margin: 0 0 0.6rem; }
.tr-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.tr-board-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); }
.tr-board-row.tr-me { background: var(--tr-yellow); }
.tr-board-pos { font-family: var(--f-display); font-weight: 900; text-align: center; color: var(--tr-muted); }
.tr-board-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.tr-board-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-board-av { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; color: #fff; border: 2px solid var(--tr-ink); }
.tr-board-g { font-family: var(--f-display); font-weight: 900; font-size: 0.9rem; }
.tr-board-g small { font-family: var(--f-body); color: var(--tr-muted); font-weight: 600; }
.tr-board-empty { color: var(--tr-muted); font-size: 0.88rem; padding: 0.5rem 0; }

/* ---------- FULLSCREEN ---------- */
.tr-root.tr-fs {
  max-width: none; margin: 0; padding: 0; width: 100vw; height: 100vh;
  background: radial-gradient(circle at 50% 30%, #16241c, #0a0f0c 75%);
  display: flex; flex-direction: column; overflow: hidden;
}
.tr-root.tr-fs .tr-bar { margin: 0.6rem auto 0; width: min(900px, calc(100vw - 1.2rem)); }
.tr-root.tr-fs .tr-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; box-shadow: none; border-radius: 0; min-height: 0; margin: 0.4rem 0; }
.tr-root.tr-fs .tr-imgbox { width: auto; max-width: calc(100vw - 1rem); max-height: 100%; }
.tr-root.tr-fs .tr-img { width: auto; height: auto; max-width: calc(100vw - 1rem); max-height: calc(100vh - 180px); }
.tr-root.tr-fs .tr-dock { margin: 0 auto 0.7rem; width: min(900px, calc(100vw - 1.2rem)); }
.tr-root.tr-fs .tr-found { display: none; }
.tr-root.tr-fs .tr-complete { background: var(--tr-card); width: min(560px, calc(100vw - 2rem)); margin: auto; border-radius: 12px; box-shadow: 0 6px 16px var(--tr-shadow); border: 2.5px solid var(--tr-ink); overflow: auto; max-height: calc(100vh - 2rem); }

/* ---------- efeitos ---------- */
.tr-burst { position: fixed; width: 18px; height: 18px; border: 3px solid var(--tr-yellow); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 9999; animation: trBurst 0.7s ease-out forwards; }
.tr-spark { position: fixed; width: 7px; height: 7px; border-radius: 50%; background: var(--tr-gold); box-shadow: 0 0 12px var(--tr-yellow); pointer-events: none; z-index: 9999; animation: trSpark 0.78s ease-out forwards; }

@keyframes trMarkerIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes trFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes trFound { 0% { transform: scale(0.3) rotate(-20deg); filter: brightness(1.8); } 45% { transform: scale(1.55) rotate(10deg); } 100% { transform: scale(1) rotate(0); filter: brightness(1); } }
@keyframes trListIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trPopIn { 0% { opacity: 0; transform: scale(0.94); } 60% { transform: scale(1.02); } 100% { opacity: 1; transform: scale(1); } }
@keyframes trTrophy { 0% { transform: scale(0) rotate(-28deg); } 70% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes trHit { 0% { box-shadow: 0 6px 16px var(--tr-shadow); } 30% { box-shadow: 0 6px 16px var(--tr-shadow), 0 0 0 4px var(--tr-yellow); } 100% { box-shadow: 0 6px 16px var(--tr-shadow); } }
@keyframes trShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes trBurst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(5); } }
@keyframes trSpark { to { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); } }
@keyframes trSpin { to { transform: rotate(360deg); } }

/* ============================================================
   EDITOR (admin)
   ============================================================ */
.tr-editor { animation: trFadeUp 0.35s both; }
.tr-ed-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.tr-ed-top h2 { font-family: var(--f-display); font-weight: 900; font-size: 1.25rem; margin: 0; color: var(--tr-grass); }
.tr-ed-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .tr-ed-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.tr-ed-canvas { position: relative; }
.tr-ed-stage { position: relative; border-radius: 10px; overflow: hidden; border: 2.5px solid var(--tr-ink); box-shadow: 0 6px 16px var(--tr-shadow); background: #0b0c0f; line-height: 0; }
.tr-ed-imgbox { position: relative; width: 100%; line-height: 0; cursor: crosshair; }
.tr-ed-img { display: block; width: 100%; height: auto; }
.tr-ed-markers { position: absolute; inset: 0; }
.tr-ed-marker {
  position: absolute; left: var(--mx); top: var(--my); width: 28px; height: 28px;
  transform: translate(-50%, -50%); border-radius: 50%; cursor: grab; touch-action: none;
  background: var(--tr-yellow); border: 2.5px solid var(--tr-ink); box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 0.72rem; color: var(--tr-ink);
}
.tr-ed-marker.tr-sel { background: var(--tr-red); color: #fff; box-shadow: 0 0 0 4px rgba(193,39,45,0.35), 0 2px 6px rgba(0,0,0,0.5); z-index: 3; }
.tr-ed-marker.tr-drag { cursor: grabbing; }
.tr-ed-dropzone { display: grid; place-items: center; min-height: 240px; text-align: center; color: var(--tr-muted); padding: 1.5rem; gap: 0.5rem; }
.tr-ed-dropzone .tr-dz-emoji { font-size: 2.4rem; }
.tr-ed-hint { font-size: 0.78rem; color: var(--tr-muted); margin-top: 0.5rem; text-align: center; }

.tr-ed-side { display: grid; gap: 0.9rem; }
.tr-ed-panel { padding: 0.85rem; }
.tr-ed-panel h3 { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.05em; margin: 0 0 0.6rem; }
.tr-field { margin-bottom: 0.6rem; }
.tr-field label { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tr-muted); margin-bottom: 0.2rem; }
.tr-field input, .tr-field textarea {
  width: 100%; padding: 0.5rem 0.6rem; border-radius: 7px; border: 2px solid var(--tr-ink);
  background: #fff; color: var(--tr-ink); font: inherit; font-size: 0.9rem; outline: none;
}
.tr-field input:focus, .tr-field textarea:focus { box-shadow: 0 0 0 2px var(--tr-gold); }
.tr-field textarea { resize: vertical; min-height: 48px; }
.tr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tr-ed-empty { color: var(--tr-muted); font-size: 0.85rem; padding: 0.4rem 0; }

.tr-ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; max-height: 260px; overflow: auto; }
.tr-ed-li { display: grid; grid-template-columns: 16px 26px 1fr auto; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: 7px; border: 2px solid var(--tr-ink); background: var(--tr-card); cursor: pointer; }
.tr-handle { cursor: grab; color: var(--tr-muted); user-select: none; font-size: 0.95rem; line-height: 1; flex: 0 0 auto; }
.tr-handle:active { cursor: grabbing; }
.tr-dragging { opacity: 0.4; }
.tr-drop-before { box-shadow: inset 0 3px 0 0 var(--tr-gold); }
.tr-drop-after { box-shadow: inset 0 -3px 0 0 var(--tr-gold); }
.tr-ed-li.tr-sel { background: var(--tr-yellow); }
.tr-ed-li .tr-ed-li-n { font-family: var(--f-display); font-weight: 900; font-size: 0.7rem; text-align: center; }
.tr-ed-li b { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-ed-li small { color: var(--tr-muted); font-size: 0.72rem; }
.tr-ed-del { border: 0; background: transparent; cursor: pointer; font-size: 0.95rem; color: var(--tr-red); padding: 0.1rem 0.3rem; }

.tr-ed-levellist { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.tr-ed-levelrow { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; }
.tr-ed-levelrow .tr-thumb { width: 52px; height: 36px; border-radius: 6px; border: 2px solid var(--tr-ink); object-fit: cover; flex: 0 0 auto; background: #0b0c0f; }
.tr-ed-levelrow .tr-lv-meta { flex: 1 1 auto; min-width: 0; }
.tr-ed-levelrow .tr-lv-meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-ed-levelrow .tr-lv-meta small { color: var(--tr-muted); font-size: 0.75rem; }
.tr-badge { font-size: 0.66rem; font-weight: 800; padding: 0.12rem 0.4rem; border-radius: 999px; border: 1.5px solid var(--tr-ink); text-transform: uppercase; }
.tr-badge.tr-pub { background: var(--tr-grass); color: #fff; }
.tr-badge.tr-draft { background: var(--tr-paper); color: var(--tr-muted); }
.tr-row-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; align-items: center; }

/* ---------- gerenciador de categorias (admin) ---------- */
.tr-cat-mgr { padding: 0.8rem; margin-bottom: 1rem; }
.tr-cat-mgr h3 { margin: 0 0 0.6rem; font-family: var(--f-display); font-weight: 900; font-size: 1rem; color: var(--tr-grass); }
.tr-cat-list { display: grid; gap: 0.45rem; margin-bottom: 0.7rem; }
.tr-cat-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tr-cat-sound { flex: 0 0 auto; width: auto; min-width: 128px; padding: 0.35rem 0.4rem; }
.tr-cat-icon { width: 48px; flex: 0 0 auto; text-align: center; font-size: 1.1rem; padding: 0.4rem 0.2rem; border-radius: 7px; border: 2px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink); }
.tr-cat-title { flex: 1 1 auto; min-width: 0; padding: 0.4rem 0.5rem; border-radius: 7px; border: 2px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink); font: inherit; }
.tr-cat-count { flex: 0 0 auto; font-size: 0.72rem; color: var(--tr-muted); white-space: nowrap; }
.tr-cat-new { display: flex; align-items: center; gap: 0.4rem; padding-top: 0.6rem; border-top: 1.5px dashed var(--tr-ink); }
.tr-cat-mgr .tr-iconbtn { width: 32px; height: 32px; font-size: 0.85rem; }
.tr-cat-mgr .btn { padding: 0.35rem 0.6rem; }

/* ---------- níveis agrupados por categoria (admin) ---------- */
.tr-ed-group { display: grid; gap: 0.5rem; margin-bottom: 1.1rem; }
.tr-ed-grouphead { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 0.95rem; color: var(--tr-ink); padding-bottom: 0.3rem; border-bottom: 2px solid var(--tr-ink); }
.tr-ed-grouphead small { color: var(--tr-muted); font-family: inherit; font-weight: 600; }
.tr-ed-emptygrp { color: var(--tr-muted); font-size: 0.8rem; padding: 0.3rem 0.2rem; }
.tr-ed-levelrow .tr-iconbtn { width: 30px; height: 30px; font-size: 0.8rem; }

/* select de categoria no formulário do nível */
.tr-select { width: 100%; padding: 0.45rem 0.5rem; border-radius: 7px; border: 2px solid var(--tr-ink); background: var(--tr-card); color: var(--tr-ink); font: inherit; }

/* música de fundo no formulário do nível */
.tr-music-field { margin-top: 0.6rem; }
.tr-music-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tr-music-prev { height: 34px; max-width: 220px; }
.tr-music-none { color: var(--tr-muted); font-size: 0.82rem; }

/* ---------- mini tutorial ---------- */
.tr-tut-backdrop {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10, 8, 4, 0.62);
  display: grid; place-items: center; padding: 1rem;
  animation: trFade 0.2s both; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  font-family: var(--f-body); color: var(--tr-ink);
}
@keyframes trFade { from { opacity: 0; } to { opacity: 1; } }
.tr-tut { position: relative; width: min(480px, 100%); max-height: 90vh; overflow: auto; padding: 1.4rem 1.4rem 1.2rem; text-align: center; animation: trPopIn 0.3s both; }
.tr-tut-x { position: absolute; top: 0.5rem; right: 0.5rem; width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--tr-ink); background: var(--tr-card); cursor: pointer; font-weight: 800; box-shadow: 0 3px 8px var(--tr-shadow); }
.tr-tut-emoji { font-size: 2.4rem; line-height: 1; animation: trTrophy 0.6s both; }
.tr-tut h2 { font-family: var(--f-display); font-weight: 900; font-size: 1.25rem; color: var(--tr-grass); margin: 0.4rem 0 0.5rem; }
.tr-tut-lead { color: var(--tr-ink); opacity: 0.85; font-size: 0.92rem; margin: 0 0 1rem; line-height: 1.4; }
.tr-tut-steps { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.6rem; text-align: left; }
.tr-tut-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 0.6rem; align-items: start; padding: 0.6rem 0.7rem; border-radius: 9px; border: 2px solid var(--tr-ink); background: var(--tr-paper); font-size: 0.9rem; line-height: 1.35; }
.tr-tut-steps li span { font-size: 1.25rem; line-height: 1.2; }
.tr-tut-steps li i { font-style: normal; background: var(--tr-yellow); border: 1.5px solid var(--tr-ink); border-radius: 4px; padding: 0 0.25rem; font-size: 0.82rem; }
.tr-tut-go { width: 100%; }
/* ---------- pré-visualização do editor em tela cheia ---------- */
.tr-prev { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 28%, #16241c, #07100b 80%); animation: trFadeUp 0.18s both; }
.tr-prev-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0.8rem; background: var(--tr-grass); border-bottom: 2.5px solid var(--tr-ink); color: #fff; flex: 0 0 auto; }
.tr-prev-title { font-family: var(--f-display); font-weight: 900; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tr-prev-hint { flex: 1 1 auto; font-size: 0.82rem; color: var(--tr-chalk); opacity: 0.92; }
.tr-prev-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 1rem; min-height: 0; }
.tr-prev-imgbox { max-width: calc(100vw - 2rem); max-height: 100%; }
.tr-prev-imgbox .tr-img { width: auto; height: auto; max-width: calc(100vw - 2rem); max-height: calc(100vh - 90px); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
/* marcadores arrastáveis na tela cheia do editor */
.tr-prev .tr-markers { pointer-events: none; }
.tr-prev-marker { cursor: grab; touch-action: none; pointer-events: auto; }
.tr-prev-marker.tr-drag { cursor: grabbing; z-index: 7; }
.tr-prev-marker.tr-drag .tr-tip { opacity: 0; }
.tr-prev-marker .tr-ball { animation: none; } /* sem flutuar — arraste preciso */
.tr-prev-marker .tr-ball::before { display: none; } /* esconde o losango; mostra o número */
.tr-prev-marker .tr-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; color: var(--tr-ink); pointer-events: none; }

.tr-msg { padding: 2rem; text-align: center; color: var(--tr-muted); }
.tr-checkline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.tr-checkline input { width: 18px; height: 18px; }

@media (max-width: 560px) {
  .tr-found-list { grid-template-columns: 1fr; }
}
