/* ============================================================================================
   Mapucraft UI — capa de pulido para servidor.mapucraft.com
   Inspirada en el sistema de diseno "Vertix" (Dashboard v14): radios grandes, tarjetas suaves, coreografia de entrada,
   numeros tabulares, chips de estado y medallas en los rankings. Es solo CSS: se carga despues de app.css.
   ============================================================================================ */
:root {
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --surface: rgba(26, 22, 13, .86);
  --surface-2: rgba(36, 30, 18, .92);
  --line-2: rgba(255, 255, 255, .14);
  --oro: #f5c542; --plata: #cfd3da; --bronce: #d38b54;
  --glow: 0 18px 50px -22px rgba(222, 142, 22, .55);
}

/* ---- Movimiento: las tarjetas entran y su contenido "sube" (como en Vertix) ------------------------------------------------ */
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(59, 165, 93, .55); } 70% { box-shadow: 0 0 0 8px rgba(59, 165, 93, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 165, 93, 0); } }
@keyframes brillo { from { background-position: -120% 0; } to { background-position: 220% 0; } }

main h1, .hero2 h1 { animation: rise .7s var(--ease) both; }
main > .sub, .hero2 .lead { animation: rise .7s var(--ease) .08s both; }
.panel, .tile, .card, .stat { animation: cardIn .65s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 80ms); }
.grid > :nth-child(1), .tiles > :nth-child(1) { --i: 0; } .grid > :nth-child(2), .tiles > :nth-child(2) { --i: 1; }
.grid > :nth-child(3), .tiles > :nth-child(3) { --i: 2; } .grid > :nth-child(4), .tiles > :nth-child(4) { --i: 3; }
.grid > :nth-child(5), .tiles > :nth-child(5) { --i: 4; } .grid > :nth-child(6), .tiles > :nth-child(6) { --i: 5; }
.grid > :nth-child(n+7), .tiles > :nth-child(n+7) { --i: 6; }
/* donde el navegador lo permite, lo que esta mas abajo entra al hacer scroll */
@supports (animation-timeline: view()) {
  .seccion .panel, .seccion .tile, .seccion .card, main > .grid ~ .grid .panel {
    animation: cardIn both linear; animation-timeline: view(); animation-range: entry 0% entry 40%; animation-delay: 0s;
  }
}

/* ---- Tarjetas y paneles ----------------------------------------------------------------------------------------------- */
.panel {
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 40px -26px rgba(0, 0, 0, .8);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.panel:hover { border-color: var(--line-2); }
.panel h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.01em; }
.panel h2::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(var(--primary-h), var(--primary)); flex: none; }
a.card, a.panel, .card { border-radius: var(--r-lg); }
a.card:hover, a.panel:hover { transform: translateY(-4px); border-color: rgba(222, 142, 22, .65); box-shadow: var(--glow); }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(222, 142, 22, .12); border: 1px solid rgba(222, 142, 22, .3); letter-spacing: .1em; font-size: 11px; }
.sub { max-width: 70ch; font-size: 15px; }
.seccion > h2 { font-size: 19px; letter-spacing: -.01em; }

/* ---- Botones y chips -------------------------------------------------------------------------------------------------- */
.btn { border-radius: 999px; padding: 12px 22px; box-shadow: 0 10px 26px -14px rgba(222, 142, 22, .9); transition: transform .2s var(--spring), filter .15s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(222, 142, 22, 1); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-ghost { box-shadow: none; background: rgba(255, 255, 255, .06); }
.btn-ghost:hover { background: rgba(255, 255, 255, .11); box-shadow: none; }
.chip { padding: 3px 11px; letter-spacing: .01em; }
.punto.ok { animation: pulso 2.2s infinite; }
.estado-chip { border-radius: 999px; background: var(--surface); }
:focus-visible { outline: 2px solid var(--primary-h); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(222, 142, 22, .35); }

/* ---- Inicio: atajos (tiles) ------------------------------------------------------------------------------------------- */
.tile { border-radius: var(--r-md); padding: 18px 8px 16px; gap: 8px; background: var(--surface); position: relative; overflow: hidden; }
.tile .ic { width: 52px; height: 52px; display: grid; place-items: center; font-size: 26px; border-radius: 16px; background: rgba(222, 142, 22, .12); border: 1px solid rgba(222, 142, 22, .22); transition: transform .3s var(--spring), background .2s; }
.tile:hover .ic { transform: scale(1.1) rotate(-4deg); background: rgba(222, 142, 22, .22); }
.tile small { font-variant-numeric: tabular-nums; }
.stat b { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---- Tablas y rankings: podio, numeros tabulares, filas con hover ----------------------------------------------------- */
table { font-variant-numeric: tabular-nums; }
.panel table tr { transition: background .15s; }
.panel table tbody tr:hover { background: rgba(255, 255, 255, .045); }
.panel table td { padding: 10px 10px; }
.panel table td:first-child { border-radius: 12px 0 0 12px; }
.panel table td:last-child { border-radius: 0 12px 12px 0; }
.panel table td.muted:last-child { text-align: right; white-space: nowrap; }
.panel table td.muted { color: var(--muted); font-size: 13px; }
.pos { width: 52px; text-align: center; font-size: 13px; }
/* medallas 1-2-3 (solo CSS: el numero ya esta en la celda; se oculta y se dibuja en la medalla) */
.panel table tbody tr:nth-child(-n+3) td.pos { font-size: 0; }
.panel table tbody tr:nth-child(-n+3) td.pos::after {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; font-weight: 800; color: #1a1304;
}
.panel table tbody tr:nth-child(1) td.pos::after { content: "1"; background: radial-gradient(circle at 30% 25%, #fff3b0, var(--oro) 55%, #b8860b); box-shadow: 0 0 0 3px rgba(245, 197, 66, .18); }
.panel table tbody tr:nth-child(2) td.pos::after { content: "2"; background: radial-gradient(circle at 30% 25%, #fff, var(--plata) 55%, #8d939d); box-shadow: 0 0 0 3px rgba(207, 211, 218, .15); }
.panel table tbody tr:nth-child(3) td.pos::after { content: "3"; background: radial-gradient(circle at 30% 25%, #ffd2ac, var(--bronce) 55%, #8b4f22); box-shadow: 0 0 0 3px rgba(211, 139, 84, .15); }
.panel table tbody tr:nth-child(1):has(td.pos) { background: linear-gradient(90deg, rgba(245, 197, 66, .09), transparent 70%); }
.panel table tbody tr:nth-child(1):has(td.pos) td a { font-weight: 800; }
.cabeza { border-radius: 8px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); width: 30px; height: 30px; }
.tabla-scroll { border-radius: var(--r-md); }

/* ---- Formularios ------------------------------------------------------------------------------------------------------ */
input[type=text], input[type=search], select, textarea { border-radius: 14px; transition: border-color .2s, box-shadow .2s; }
input[type=text]:focus, input[type=search]:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(222, 142, 22, .18); }

/* ---- Cabecera y pie ---------------------------------------------------------------------------------------------------- */
@media (min-width: 900px) { .top { backdrop-filter: blur(14px) saturate(1.2); } }
.pie-grid a { transition: color .15s, transform .15s; }
.pie-grid a:hover { color: var(--primary-h); transform: translateX(2px); }

/* ---- Esqueleto de carga (para datos que llegan por JS) ------------------------------------------------------------------ */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .04) 75%); background-size: 200% 100%; animation: brillo 1.4s linear infinite; min-height: 1em; }

/* ---- Movil ------------------------------------------------------------------------------------------------------------ */
@media (max-width: 560px) {
  .panel { padding: 16px; border-radius: var(--r-md); }
  .panel table td { padding: 9px 6px; }
  .tile .ic { width: 46px; height: 46px; font-size: 23px; }
  h1 { letter-spacing: -.02em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Novedades: anuncios y actualizaciones publicados desde Discord ------------------------------------------------------- */
.tabs-nov { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.tabs-nov a { padding: 9px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text, #f3ead8); font-weight: 700; font-size: 14px; transition: background .2s, border-color .2s, transform .2s var(--spring); }
.tabs-nov a:hover { border-color: var(--line-2); transform: translateY(-2px); }
.tabs-nov a.on { background: linear-gradient(135deg, var(--primary-h), var(--primary)); color: #1a1304; border-color: transparent; box-shadow: 0 10px 26px -14px rgba(222, 142, 22, .9); }
.tabs-nov a.ext { margin-left: auto; background: transparent; color: var(--muted); font-weight: 600; }
.novedades { display: grid; gap: 16px; max-width: 860px; }
.novedad { position: relative; padding: 22px 24px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 14px 40px -26px rgba(0, 0, 0, .8); animation: cardIn .65s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); transition: border-color .25s, transform .25s var(--ease); }
.novedad:hover { border-color: var(--line-2); }
.novedad::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--primary-h), var(--primary)); opacity: .55; }
.novedad.nueva { border-color: rgba(222, 142, 22, .45); background: linear-gradient(135deg, rgba(222, 142, 22, .10), var(--surface) 55%); }
.novedad.nueva::before { opacity: 1; }
.novedad header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.novedad header time { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.novedad header h2 { flex-basis: 100%; margin: 2px 0 0; font-size: 21px; letter-spacing: -.01em; }
.nuevo-chip { background: rgba(222, 142, 22, .18); border: 1px solid rgba(222, 142, 22, .4); color: var(--primary-h); font-size: 11px; font-weight: 800; }
/* actualizaciones: linea de tiempo */
.novedades.linea { padding-left: 30px; position: relative; }
.novedades.linea::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--primary), rgba(222, 142, 22, 0)); }
.novedades.linea .novedad::after { content: ""; position: absolute; left: -29px; top: 26px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(222, 142, 22, .2); }
.novedades.linea .novedad::before { display: none; }
/* texto (markdown de Discord ya saneado) */
.cuerpo-md { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.cuerpo-md > :first-child { margin-top: 0; } .cuerpo-md > :last-child { margin-bottom: 0; }
.cuerpo-md p { margin: 0 0 12px; }
.cuerpo-md h3 { font-size: 18px; margin: 20px 0 8px; } .cuerpo-md h4 { font-size: 16px; margin: 16px 0 6px; color: var(--primary-h); }
.cuerpo-md ul { list-style: none; margin: 0 0 12px; padding: 0; }
.cuerpo-md li { position: relative; padding: 3px 0 3px 22px; }
.cuerpo-md li::before { content: ""; position: absolute; left: 4px; top: .85em; width: 7px; height: 7px; border-radius: 2px; background: var(--primary); transform: rotate(45deg); }
.cuerpo-md blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--primary); background: rgba(255, 255, 255, .04); border-radius: 0 12px 12px 0; }
.cuerpo-md code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .09); font-size: .92em; }
.cuerpo-md pre { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .35); overflow-x: auto; } .cuerpo-md pre code { background: none; padding: 0; }
.cuerpo-md a { color: var(--primary-h); text-decoration: underline; text-underline-offset: 3px; }
.cuerpo-md .chico { font-size: 12.5px; color: var(--muted); }
.cuerpo-md .spoiler { background: rgba(255, 255, 255, .18); color: transparent; border-radius: 4px; cursor: pointer; transition: color .2s, background .2s; }
.cuerpo-md .spoiler:hover, .cuerpo-md .spoiler:focus { color: inherit; background: rgba(255, 255, 255, .06); }
/* portada: ultimos anuncios */
.anuncios-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.anuncio-mini { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: inherit; transition: transform .25s var(--ease), border-color .25s, background .2s; }
.anuncio-mini:hover { transform: translateY(-3px); border-color: rgba(222, 142, 22, .55); background: rgba(222, 142, 22, .07); }
.anuncio-mini small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.anuncio-mini strong { font-size: 15px; line-height: 1.3; } .anuncio-mini span { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 560px) { .novedad { padding: 18px 16px; } .novedades.linea { padding-left: 24px; } .novedades.linea .novedad::after { left: -23px; } .tabs-nov a.ext { margin-left: 0; } }

/* ---- Portada: novedades (3 anuncios + 3 actualizaciones) y jerarquia ---------------------------------------------------- */
.novedades-home { margin-top: 22px; }
.novedades-home h2 { justify-content: flex-start; }
.ver-todo { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--primary-h); white-space: nowrap; }
.lista-nov { display: grid; gap: 10px; }
.item-nov { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: inherit;
  transition: transform .25s var(--ease), border-color .25s, background .2s; }
.item-nov:hover { transform: translateX(4px); border-color: rgba(222, 142, 22, .55); background: rgba(222, 142, 22, .07); }
.item-nov.primero { background: linear-gradient(135deg, rgba(222, 142, 22, .14), rgba(255, 255, 255, .03) 70%); border-color: rgba(222, 142, 22, .4); }
.item-nov small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.item-nov strong { font-size: 15px; line-height: 1.3; }
.item-nov span { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tiles { margin-top: 22px; }
.tile small { color: var(--muted); }
/* encabezados de pagina consistentes en todo el sitio */
main > h1 { font-size: clamp(28px, 4vw, 40px); margin: 8px 0 6px; letter-spacing: -.02em; }
main > .sub { margin: 0 0 22px; }
.seccion { margin-top: 22px; }
.vacio { text-align: center; }
.nav-grupo .sub-menu a, .top nav a { transition: background .15s, color .15s; }
@media (max-width: 700px) { .item-nov:hover { transform: none; } }

/* ---- Tipografia autoalojada (sin Google Fonts) --------------------------------------------------------------------------- */
@font-face { font-family: "Sora"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-400.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-600.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-700.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-800.ttf") format("truetype"); }

/* ---- Accesibilidad: foco, objetivos tactiles y tamanos minimos ----------------------------------------------------------- */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary-h); outline-offset: 3px; }
@media (pointer: coarse) {
  .btn, .btn-sm, .nav a, .nav summary, .dd-menu a, .tabs-nov a, input, select { min-height: 44px; }
  .dd-menu a { display: flex; align-items: center; }
}
.muted, small, .tile small, .item-nov small, .novedad header time { font-size: max(12px, .8em); }
@media (prefers-reduced-transparency: reduce) { .top { backdrop-filter: none; background: #0f0c05; } }

/* ---- Mercado: tendencia, FAQ, buscador global, semaforo de staff y barra inferior en movil -------------------------------- */
.spark { vertical-align: middle; } .spark.sube polyline { stroke: #3ba55d; } .spark.baja polyline { stroke: #ed4245; }
@media (max-width: 560px) { .col-tendencia { display: none; } }
details.faq { border-top: 1px solid var(--line); padding: 10px 0; } details.faq:first-of-type { border-top: 0; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 4px 0; } details.faq p { margin: 6px 0 2px; color: var(--muted); }
.resultados { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.resultados li { padding: 8px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .04); }
.busca-global { display: flex; gap: 10px; margin-top: 12px; } .busca-global input { flex: 1; }
.semaforo { display: flex; flex-wrap: wrap; gap: 8px; }
.sem-ok { background: rgba(59, 165, 93, .16); border-color: rgba(59, 165, 93, .5); }
.sem-aviso { background: rgba(245, 197, 66, .16); border-color: rgba(245, 197, 66, .5); }
.sem-mal { background: rgba(237, 66, 69, .18); border-color: rgba(237, 66, 69, .55); }
.barra-movil { display: none; }
@media (max-width: 720px) {
  .barra-movil { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 50; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(15, 12, 5, .96); border-top: 1px solid var(--line-2); }
  .barra-movil a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 48px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-decoration: none; }
  .barra-movil a[aria-current="page"] { color: #000; background: var(--primary); }
  .barra-movil span { font-size: 18px; line-height: 1; }
  body { padding-bottom: 72px; }
}

/* ---- Perfil comparado, comparador de rangos, suscripciones ------------------------------------------------------------------ */
.comparas { display: grid; gap: 18px; }
.compara-cab { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.compara-cab span { color: var(--muted); font-size: 14px; } .compara-cab b { color: var(--primary-h); }
.compara-fila { display: grid; grid-template-columns: 76px 1fr 72px; gap: 10px; align-items: center; margin: 5px 0; font-size: 14px; }
.compara-fila > i { font-style: normal; color: var(--muted); } .compara-fila > b { text-align: right; font-variant-numeric: tabular-nums; }
.compara-fila.prom .barra > i { background: rgba(255, 255, 255, .35); }
.comparador { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 14px; }
.comparador label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); } .comparador select { min-width: 170px; }
.comparar-tabla th[scope=row] { text-align: left; color: var(--muted); white-space: nowrap; font-weight: 600; }
.comparar-tabla tr.dif td { background: rgba(222, 142, 22, .09); }
.suscribir { background: linear-gradient(135deg, rgba(222, 142, 22, .10), var(--surface) 70%); }
