/* ============================================================
   EXTRAS.CSS — páginas novas (ranking, novidades, wiki, parceiros,
   perfil, coleção) + seções novas do painel do servidor.
   Prefixo x- pra não colidir com style.css / cartas.css.
   Usa só os tokens do design system (--bg, --surface, --red...).
   ============================================================ */

:root {
  --x-ok: #43c06a;
  --x-warn: #f5c518;
  --x-bad: #e53935;
}

.x-main { padding-top: 40px; padding-bottom: 96px; }
.x-stack { display: flex; flex-direction: column; gap: 22px; }
.x-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.x-muted { color: var(--text-muted); }
.x-mono { font-family: var(--font-mono); }

/* ---------------- ESTADOS ---------------- */
.x-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; color: var(--text-muted);
  padding: 56px 24px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 14px;
}
.x-state-erro { color: var(--red-light); border-color: rgba(255,59,59,0.35); }

/* ---------------- ABAS ---------------- */
.x-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.x-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-body); font-weight: 600; font-size: 0.88rem;
  padding: 10px 18px; border-radius: 100px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.x-tab svg { width: 16px; height: 16px; }
.x-tab:hover { color: var(--text); border-color: var(--text-muted); }
.x-tab[aria-selected="true"] { color: #fff; background: var(--red-dim); border-color: var(--red); }

/* ---------------- CARTÃO / LISTA ---------------- */
.x-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 30px -18px rgba(0,0,0,0.5);
}
.x-card h2, .x-card h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
.x-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.x-card-head h2, .x-card-head h3 { font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.x-card-head svg { width: 18px; height: 18px; color: var(--red); }
.x-sub { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); }

.x-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.x-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.x-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

.x-rank { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.x-rank-item {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 16px;
}
.x-rank-pos {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.x-rank-item[data-pos="1"] { border-color: rgba(245,197,24,0.55); }
.x-rank-item[data-pos="1"] .x-rank-pos { color: #1a1400; background: #f5c518; border-color: #f5c518; }
.x-rank-item[data-pos="2"] .x-rank-pos { color: #12141a; background: #c5cad6; border-color: #c5cad6; }
.x-rank-item[data-pos="3"] .x-rank-pos { color: #1c1008; background: #cd8a4b; border-color: #cd8a4b; }
.x-rank-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.x-rank-meta { font-size: 0.76rem; color: var(--text-muted); font-family: var(--font-mono); }
.x-rank-valor { text-align: right; font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; }
.x-rank-valor small { display: block; font-weight: 400; font-size: 0.68rem; color: var(--text-dim); }

/* ---------------- NOVIDADES ---------------- */
.x-timeline { display: flex; flex-direction: column; gap: 22px; max-width: 820px; }
.x-news { position: relative; padding-left: 26px; }
.x-news::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: -22px; width: 2px; background: var(--border); }
.x-news:last-child::before { display: none; }
.x-news::after { content: ''; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--red); }
.x-news-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.x-news h2 { font-size: 1.2rem; }
.x-news ul { list-style: disc; padding-left: 20px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.x-tag { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 10px; border-radius: 100px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.x-tag-novo { color: var(--red); border-color: rgba(255,59,59,0.4); background: var(--red-dim); }
.x-tag-melhoria { color: var(--x-warn); border-color: rgba(245,197,24,0.4); background: rgba(245,197,24,0.08); }
.x-tag-correcao { color: var(--x-ok); border-color: rgba(67,192,106,0.4); background: rgba(67,192,106,0.08); }

/* ---------------- BUSCA (wiki) ---------------- */
.x-search { position: relative; max-width: 640px; margin-bottom: 26px; }
.x-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-dim); pointer-events: none; }
.x-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--font-body); font-size: 1rem; padding: 14px 16px 14px 44px;
}
.x-search input:focus { outline: none; border-color: var(--red); }
.x-qa { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.x-qa details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 20px; }
.x-qa summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.x-qa summary::-webkit-details-marker { display: none; }
.x-qa summary::after { content: '+'; color: var(--red); font-family: var(--font-mono); font-size: 1.2rem; }
.x-qa details[open] summary::after { content: '–'; }
.x-qa .x-qa-resp { color: var(--text-muted); padding: 0 0 18px; white-space: pre-wrap; }
.x-qa .x-qa-alt { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); padding-bottom: 14px; }

/* ---------------- PARCEIROS / PERFIL ---------------- */
.x-partner { display: flex; flex-direction: column; gap: 14px; }
.x-partner-top { display: flex; align-items: center; gap: 14px; }
.x-avatar { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.x-avatar-fallback { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--red); flex-shrink: 0; }
.x-partner h3 { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; }
.x-partner p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }

.x-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.x-stat .n { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; }
.x-stat .l { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

/* ---------------- COLEÇÃO ---------------- */
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.x-chip { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; font-weight: 600; padding: 7px 14px; border-radius: 100px; cursor: pointer; }
.x-chip[aria-pressed="true"] { color: var(--text); border-color: var(--rc, var(--red)); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rc, var(--red)); }
.x-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.x-carta { background: var(--surface); border: 2px solid var(--rc, var(--border)); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.x-carta-img { aspect-ratio: 5 / 7; background: var(--surface-2); position: relative; }
.x-carta-img img { width: 100%; height: 100%; object-fit: cover; }
.x-carta-qtd { position: absolute; top: 8px; right: 8px; background: rgba(11,14,20,0.88); border: 1px solid var(--border); border-radius: 100px; padding: 2px 9px; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; }
.x-carta-holo { position: absolute; top: 8px; left: 8px; background: linear-gradient(135deg, #ff3df2, #3dc8ff, #f5ff3d); color: #111; border-radius: 100px; padding: 2px 9px; font-size: 0.68rem; font-weight: 700; }
.x-carta-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.x-carta-info strong { font-size: 0.9rem; line-height: 1.25; }
.x-carta-info span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--rc, var(--text-muted)); }
.x-carta-info small { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); }

.x-progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px; overflow: hidden; }
.x-progress > span { display: block; height: 100%; background: var(--red); border-radius: 100px; }

.x-optin { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.x-optin-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.x-check { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--text-muted); cursor: pointer; }
.x-check input { accent-color: var(--red); width: 16px; height: 16px; }
.x-linkbox { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.x-linkbox input { flex: 1; min-width: 220px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 10px 13px; font-family: var(--font-mono); font-size: 0.8rem; }

/* ---------------- PAINEL: GRÁFICOS ---------------- */
.x-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.x-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px; padding: 3px; }
.x-seg button { background: none; border: 0; color: var(--text-muted); font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; padding: 7px 16px; border-radius: 100px; cursor: pointer; }
.x-seg button[aria-pressed="true"] { background: var(--red-dim); color: #fff; box-shadow: inset 0 0 0 1px var(--red); }
.x-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.x-chart { position: relative; margin-bottom: 22px; }
.x-chart h4 { font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.x-chart h4 small { font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; color: var(--text-dim); }
.x-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.x-bar { fill: var(--red); transition: opacity .12s ease; }
.x-bar-hit { fill: transparent; cursor: default; }
.x-bar-peak { fill: var(--red-light); }
.x-grid-line { stroke: var(--border); stroke-width: 1; }
.x-axis-text { fill: var(--text-dim); font-family: var(--font-mono); font-size: 10px; }
.x-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 0.78rem; white-space: nowrap;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.7);
}
.x-tooltip b { font-family: var(--font-mono); }
.x-hbar { display: grid; grid-template-columns: minmax(80px, 160px) 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 0.86rem; }
.x-hbar-track { height: 10px; background: var(--surface-2); border-radius: 100px; overflow: hidden; }
.x-hbar-fill { height: 100%; background: var(--red); border-radius: 0 100px 100px 0; }
.x-hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-hbar b { font-family: var(--font-mono); }
.x-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 10px; }
.x-table th, .x-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.x-table th { color: var(--text-muted); font-weight: 500; }
.x-link-btn { background: none; border: 0; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-family: var(--font-body); font-size: 0.78rem; margin-top: 6px; }
.x-link-btn:hover { color: var(--text); }

/* ---------------- PAINEL: NOTA DE SEGURANÇA ---------------- */
.x-score { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: center; margin-bottom: 24px; }
.x-ring { position: relative; width: 160px; height: 160px; }
.x-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.x-ring-track { stroke: var(--surface-2); }
.x-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.x-ring-center b { font-family: var(--font-mono); font-size: 2.3rem; line-height: 1; }
.x-ring-center span { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.x-score-txt h3 { font-size: 1.25rem; margin-bottom: 6px; }
.x-score-txt p { color: var(--text-muted); }
.x-reco { display: flex; flex-direction: column; gap: 10px; }
.x-reco-item { display: flex; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--x-warn); border-radius: 10px; padding: 12px 14px; }
.x-reco-item.critico { border-left-color: var(--x-bad); }
.x-reco-item svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--x-warn); }
.x-reco-item.critico svg { color: var(--x-bad); }
.x-reco-item strong { display: block; font-size: 0.9rem; }
.x-reco-item p { color: var(--text-muted); font-size: 0.84rem; margin-top: 2px; }
.x-reco-item code { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text); background: var(--bg); padding: 1px 6px; border-radius: 5px; }
.x-scen { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.x-scen-item { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84rem; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.x-scen-item svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.x-scen-item.ok svg { color: var(--x-ok); }
.x-scen-item.falha svg { color: var(--x-bad); }
.x-scen-item small { display: block; color: var(--text-dim); font-size: 0.74rem; }
.x-section-title { font-family: var(--font-display); font-size: 0.98rem; margin: 26px 0 12px; }

/* selo */
.x-selo-preview { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.x-selo-bg { padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.x-selo-bg.escuro { background: #1b1b20; }
.x-selo-bg.claro { background: #f1f1f4; }
.x-selo-bg img { display: block; }
.x-code { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 12px 14px; font-family: var(--font-mono); font-size: 0.78rem; resize: vertical; min-height: 70px; }

/* ---------------- PAINEL: BACKUP / EMBED ---------------- */
.x-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.x-warnbox { border: 1px solid rgba(245,197,24,0.4); background: rgba(245,197,24,0.07); border-radius: 10px; padding: 12px 14px; font-size: 0.86rem; color: var(--text-muted); margin: 12px 0; }
.x-warnbox b { color: var(--text); }
.x-msg { font-family: var(--font-mono); font-size: 0.8rem; margin-top: 12px; min-height: 1.2em; }
.x-msg.ok { color: var(--x-ok); }
.x-msg.erro { color: var(--red-light); }
.x-list-avisos { margin: 8px 0 0 18px; font-size: 0.8rem; color: var(--text-muted); }

.x-embed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.x-embed .form-field { margin-bottom: 14px; }
.x-embed .form-field input[type="text"], .x-embed .form-field textarea, .x-embed .form-field select,
.x-embed .form-field input[type="url"] {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 13px; color: var(--text); font-family: var(--font-body); font-size: 0.88rem;
}
.x-embed .form-field textarea { min-height: 96px; resize: vertical; }
.x-embed .form-field input:focus, .x-embed .form-field textarea:focus, .x-embed .form-field select:focus { outline: none; border-color: var(--red); }
.x-embed .form-field label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.x-embed .form-field.erro input, .x-embed .form-field.erro textarea, .x-embed .form-field.erro select { border-color: var(--x-bad); }
.x-field-err { color: var(--red-light); font-size: 0.76rem; margin-top: 4px; }
.x-embed-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.x-embed-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.x-embed-field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.x-embed-field-row input, .x-embed-field-row textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; color: var(--text); font-family: var(--font-body); font-size: 0.82rem; }
.x-embed-field-row textarea { min-height: 38px; resize: vertical; }
.x-embed-field-row label { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-muted); grid-column: 1 / -1; }
.x-embed-field-row .x-del { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 7px; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; }
.x-embed-field-row .x-del:hover { color: var(--red); border-color: var(--red); }

/* prévia no estilo do Discord */
.x-discord { background: #313338; border-radius: 10px; padding: 16px; color: #dbdee1; font-family: 'gg sans', Inter, sans-serif; position: sticky; top: 90px; }
.x-discord-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; font-size: 0.9rem; }
.x-discord-head b { color: #f2f3f5; }
.x-discord-head i { font-style: normal; font-size: 0.62rem; background: #5865f2; color: #fff; padding: 1px 5px; border-radius: 3px; font-weight: 700; margin-left: 4px; }
.x-discord-head small { color: #949ba4; font-size: 0.72rem; }
.x-demb { border-left: 4px solid #ff0000; background: #2b2d31; border-radius: 4px; padding: 10px 14px 12px; max-width: 480px; display: grid; gap: 8px; }
.x-demb-top { display: flex; justify-content: space-between; gap: 12px; }
.x-demb-body { min-width: 0; display: grid; gap: 6px; }
.x-demb-autor { font-size: 0.8rem; font-weight: 600; color: #f2f3f5; }
.x-demb-titulo { font-size: 1rem; font-weight: 700; color: #f2f3f5; overflow-wrap: anywhere; }
.x-demb-desc { font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.x-demb-thumb { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.x-demb-campos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.x-demb-campo { grid-column: 1 / -1; min-width: 0; }
.x-demb-campo.inline { grid-column: auto; }
.x-demb-campo b { display: block; font-size: 0.8rem; color: #f2f3f5; overflow-wrap: anywhere; }
.x-demb-campo span { font-size: 0.84rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.x-demb-img { max-width: 100%; border-radius: 6px; }
.x-demb-foot { font-size: 0.72rem; color: #b5bac1; }
.x-demb-vazio { color: #949ba4; font-size: 0.84rem; font-style: italic; }

@media (max-width: 900px) {
  .x-grid-2, .x-grid-3, .x-embed, .x-score { grid-template-columns: 1fr; }
  .x-kpis { grid-template-columns: repeat(2, 1fr); }
  .x-embed-cols { grid-template-columns: 1fr; }
  .x-discord { position: static; }
  .x-embed-field-row { grid-template-columns: 1fr auto; }
}
