/* ================================================================ figurinhas e foto de capa
   Seletor de figurinhas do chat, criador, figurinha grande na conversa, cartão "salvar", prévias na loja,
   campo da foto de capa nas configurações e a vitrine da Coleção Ascensão. */

/* ---------------------------------------------------------------- desenho */
.fig-art { display: grid; place-items: center; width: 100%; height: 100%; }
.fig-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fig-art.img img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)); user-select: none; }

/* ---------------------------------------------------------------- botão no compositor */
.composer #btn-sticker { color: var(--text-2); }
.composer #btn-sticker:hover { color: #fff; }

/* ---------------------------------------------------------------- seletor */
.fig-picker {
  position: fixed;
  z-index: 70;
  width: min(392px, calc(100vw - 16px));
  height: min(470px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(14, 16, 24, 0.98);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(var(--hot-rgb), 0.08);
  overflow: hidden;
}
.fig-picker::before { content: ""; height: 3px; flex-shrink: 0; background: var(--grad); }
.fig-tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.fig-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  border-radius: 9px;
  font: 700 12px/1 var(--font-display);
  letter-spacing: 0.04em;
  color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}
.fig-tab small { font: 600 10px/1 var(--font-display); color: var(--text-3); }
.fig-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.fig-tab.active { color: #fff; background: rgba(var(--hot-rgb), 0.16); box-shadow: inset 0 0 0 1px rgba(var(--hot-rgb), 0.4); }
.fig-tab.active small { color: rgba(255, 255, 255, 0.7); }
.fig-tools { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.fig-search { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line-2); }
.fig-search .icon { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.fig-search input { flex: 1; min-width: 0; height: 32px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 13px; }
.fig-search input:focus { outline: none; box-shadow: none; }
.fig-create { height: 34px; padding: 0 12px; gap: 5px; }
.fig-create .icon { width: 15px; height: 15px; }
.fig-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.fig-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fig-cell { position: relative; }
.fig-pick {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 12px;
  transition: background 0.12s, transform 0.12s;
}
.fig-pick:hover { background: rgba(var(--hot-rgb), 0.12); transform: scale(1.06); }
.fig-pick:active { transform: scale(0.96); }
.fig-rar { position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--rar); box-shadow: 0 0 6px var(--rar); }
.fig-cell-tools { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.fig-cell:hover .fig-cell-tools, .fig-cell:focus-within .fig-cell-tools { opacity: 1; }
.fig-tool { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: rgba(8, 10, 16, 0.85); border: 1px solid var(--line-2); }
.fig-tool .icon { width: 12px; height: 12px; }
.fig-tool:hover { background: rgba(var(--hot-rgb), 0.9); }
.fig-tool.danger:hover { background: var(--red); }
.fig-pack + .fig-pack { margin-top: 10px; }
.fig-pack h4 { display: flex; align-items: baseline; gap: 8px; margin: 2px 4px 6px; font: 700 11px/1 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-2); }
.fig-pack h4 small { font-size: 10px; letter-spacing: 0.04em; color: var(--text-3); }
.fig-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px; padding: 9px; border-radius: 10px; font: 700 12px/1 var(--font-display); color: var(--text-2); border: 1px dashed var(--line-2); }
.fig-more:hover { color: #fff; border-color: rgba(var(--hot-rgb), 0.5); }
.fig-more .icon { width: 15px; height: 15px; }
.fig-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; min-height: 200px; padding: 18px; text-align: center; }
.fig-empty strong { font: 700 14px/1.3 var(--font-display); }
.fig-empty p { margin: 0; font-size: 13px; color: var(--text-2); }
.fig-foot { padding: 7px 12px 9px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- no chat */
.fig-msg {
  display: block;
  width: 160px;
  height: 160px;
  margin: 4px 0 2px;
  padding: 0;
  border-radius: 14px;
  cursor: pointer;
  transform-origin: 30% 80%;
  transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.fig-msg:hover { transform: rotate(-3deg) scale(1.04); }
.fig-msg:focus-visible { outline: 2px solid rgba(var(--hot-rgb), 0.7); outline-offset: 2px; }
.fig-msg.pop { animation: fig-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes fig-pop {
  0% { transform: scale(0.3) rotate(-14deg); opacity: 0; }
  55% { transform: scale(1.1) rotate(4deg); opacity: 1; }
  78% { transform: scale(0.96) rotate(-1.5deg); }
  100% { transform: scale(1) rotate(0); }
}
.msg.pending .fig-msg { opacity: 0.6; }

/* cartão ao clicar */
.fig-card { width: 300px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border-radius: 18px; text-align: center; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.fig-card-art { width: 196px; height: 196px; margin-bottom: 4px; background: radial-gradient(circle at 50% 45%, rgba(var(--hot-rgb), 0.14), transparent 65%); border-radius: 16px; }
.fig-card strong { font: 700 15px/1.3 var(--font-display); overflow-wrap: anywhere; }
.fig-card small { font-size: 12px; color: var(--text-3); }
.fig-card-actions { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fig-card-actions .btn { width: 100%; }
.fig-card-actions .btn .coins { margin-left: 4px; }
.fig-card-actions .ok-chip { justify-content: center; }

/* ---------------------------------------------------------------- criador */
.fig-editor { width: min(640px, calc(100vw - 24px)); }
.fig-editor-grid { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; }
.fig-editor-preview {
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 16px;
  background: repeating-conic-gradient(#151826 0 25%, #10121c 0 50%) 0 0 / 20px 20px;
  border: 1px solid var(--line-2);
}
.fig-canvas { display: block; width: 240px; height: 240px; }
.fig-editor-fields { display: flex; flex-direction: column; gap: 14px; }
.fig-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fig-editor-fields .hint { font-size: 12.5px; }
@media (max-width: 640px) { .fig-editor-grid { grid-template-columns: minmax(0, 1fr); } }

/* recorte largo (foto de capa) */
.crop-dialog.wide { width: min(600px, calc(100vw - 24px)); }
.crop-dialog.wide .crop-stage { max-width: 100%; }

/* ---------------------------------------------------------------- loja */
.pv-fig { padding: 6px; background: radial-gradient(circle at 50% 45%, #232741, #0b0d14 75%); }
.pv-fig .fig-art { width: 84px; height: 84px; }
.detail-big .pv-fig .fig-art { width: 168px; height: 168px; }
.chest-reveal .pv-fig .fig-art { width: 150px; height: 150px; }
.equip-slot .pv-fig .fig-art { width: 62px; height: 62px; }
.chest-desc { margin: -4px 0 0; text-align: center; font-size: 12.5px; color: var(--text-2); }

/* vitrine da Coleção Ascensão */
.asc-hero {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 220px;
  padding: 24px 28px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(122, 246, 255, 0.28);
  background: #07040f;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 40px rgba(122, 246, 255, 0.06);
}
.asc-hero-bg { position: absolute; inset: 0; z-index: 0; }
.asc-hero > :not(.asc-hero-bg) { position: relative; z-index: 1; }
.asc-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5, 3, 12, 0.92) 0%, rgba(5, 3, 12, 0.7) 38%, rgba(5, 3, 12, 0.1) 70%); }
.asc-hero-text { flex: 1; min-width: 0; max-width: 430px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.asc-hero-text small { font: 700 11px/1 var(--font-display); letter-spacing: 0.26em; white-space: nowrap; text-transform: uppercase; color: #9ff7ff; }
.asc-hero-text h2 { margin: 0; font: 700 40px/1 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; background: linear-gradient(90deg, #fff4c2, #ff9de2 45%, #7af6ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255, 157, 226, 0.35)); }
.asc-hero-text p { margin: 0 0 4px; font-size: 13.5px; color: rgba(255, 255, 255, 0.78); }
.asc-hero-bar { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.asc-hero-bar i { position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.asc-hero-bar i::after { content: ""; position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p)); background: linear-gradient(90deg, #fff4c2, #ff9de2, #7af6ff); }
.asc-hero .btn { white-space: nowrap; }
.asc-hero .btn .coins { margin-left: 4px; }
.asc-hero-show { display: flex; align-items: center; gap: 40px; padding-right: 18px; }
.asc-hero-show .asc-hero-av:nth-child(3) { display: none; }
@media (min-width: 1500px) { .asc-hero-show .asc-hero-av:nth-child(3) { display: flex; } }
.asc-hero-av { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.asc-hero-av > span:last-child { font: 700 10.5px/1 var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
@media (max-width: 1050px) { .asc-hero-show { display: none; } }

/* ---------------------------------------------------------------- foto de capa nas configurações */
.cover-field { gap: 8px; }
.cover-preview { position: relative; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-1); }
.cover-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 12px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(6, 7, 11, 0.62);
  backdrop-filter: grayscale(1);
}
.cover-lock .icon { width: 16px; height: 16px; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cover-actions .btn .icon { width: 16px; height: 16px; }
.cover-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.cover-choice { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; cursor: pointer; font-size: 12.5px; color: var(--text-2); background: var(--bg-1); border: 1px solid var(--line-2); }
.cover-choice input { accent-color: var(--hot); margin: 0; }
.cover-choice.active { color: #fff; border-color: rgba(var(--hot-rgb), 0.55); background: rgba(var(--hot-rgb), 0.1); }
.cover-field .hint.small { font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .fig-msg.pop { animation: none; }
  .fig-pick:hover, .fig-msg:hover { transform: none; }
}
