/* ==========================================================================
   InfinityCraft — Premium Polish Layer (r640)
   Overlay ADITIVO sobre o frontend publicado. Não substitui nenhum layout:
   só refina tipografia, profundidade, microinterações e acabamento.
   Reverter = remover o <link> deste arquivo (ou voltar o release anterior).
   ========================================================================== */

:root {
  --icp-gold: #ffc24a;
  --icp-gold-soft: #ffd98a;
  --icp-violet: #9b6bff;
  --icp-cyan: #46d6ff;
  --icp-ink: #05070f;
  --icp-glass: rgba(14, 19, 40, .72);
  --icp-line: rgba(160, 175, 230, .16);
  --icp-line-strong: rgba(190, 170, 255, .34);
  --icp-radius: 18px;
  --icp-ease: cubic-bezier(.22, .8, .24, 1);
  --icp-shadow: 0 18px 50px -18px rgba(3, 4, 14, .85), 0 2px 0 rgba(255, 255, 255, .03) inset;
}

/* ---------- Base: seleção, foco, rolagem ---------- */
::selection { background: rgba(255, 194, 74, .38); color: #fff; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--icp-gold);
  outline-offset: 3px;
  border-radius: 10px;
  box-shadow: 0 0 0 6px rgba(255, 194, 74, .16);
}
* { scrollbar-width: thin; scrollbar-color: #3a3f66 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(#3b3f6b, #2a2e52); border-radius: 10px; border: 2px solid #0a0d1c; }

/* ---------- Cabeçalho: vidro + brilho de marca ---------- */
.ic-header {
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  background: linear-gradient(180deg, rgba(14, 18, 38, .86), rgba(9, 12, 28, .78)) !important;
  border-color: var(--icp-line-strong) !important;
  box-shadow: 0 14px 44px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 1px 0 rgba(255, 194, 74, .12);
}
.ic-header a, .ic-header button { transition: transform .22s var(--icp-ease), background-color .22s, border-color .22s, box-shadow .22s, color .22s; }
.ic-header nav a:hover { transform: translateY(-1px); }
.ic-header nav a[aria-current="page"] {
  box-shadow: 0 0 0 1px rgba(255, 194, 74, .55) inset, 0 8px 24px -10px rgba(255, 194, 74, .55);
}

/* ---------- Botões: profundidade + brilho deslizante ---------- */
.button, a.button, button.button {
  position: relative;
  overflow: hidden;
  transition: transform .22s var(--icp-ease), box-shadow .22s var(--icp-ease), filter .22s, border-color .22s, background-color .22s;
  letter-spacing: .01em;
}
.button:not(.secondary):not(:disabled)::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .42) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--icp-ease);
  pointer-events: none;
}
.button:not(.secondary):not(:disabled):hover::after { transform: translateX(120%); }
.button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(255, 194, 74, .55); filter: saturate(1.08); }
.button.secondary:not(:disabled):hover { box-shadow: 0 12px 28px -14px rgba(155, 107, 255, .6); border-color: var(--icp-line-strong); }
.button:not(:disabled):active { transform: translateY(0) scale(.985); transition-duration: .08s; }
.button:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.25); }

/* ---------- Campos de formulário ---------- */
:where(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
:where(input:not([type=checkbox]):not([type=radio]), select, textarea):hover { border-color: var(--icp-line-strong); }
:where(input:not([type=checkbox]):not([type=radio]), select, textarea):focus {
  border-color: var(--icp-gold) !important;
  box-shadow: 0 0 0 4px rgba(255, 194, 74, .15), 0 8px 24px -14px rgba(255, 194, 74, .5);
  background-color: rgba(8, 11, 26, .96);
}

/* ---------- HOME: hero cinematográfico ---------- */
.premium-hero { isolation: isolate; }
.premium-hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 520px at 12% 8%, rgba(155, 107, 255, .22), transparent 60%),
    radial-gradient(900px 480px at 92% 70%, rgba(70, 214, 255, .10), transparent 60%),
    linear-gradient(90deg, rgba(5, 7, 15, .72) 0%, rgba(5, 7, 15, .34) 46%, transparent 78%);
}
.public-main .premium-home .premium-hero h1 {
  font-size: clamp(2.8rem, 6.6vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.025em;
  text-shadow: 0 6px 40px rgba(155, 107, 255, .5), 0 2px 0 rgba(0, 0, 0, .35);
}
.public-main .premium-home .premium-hero h1 span { text-shadow: 0 4px 44px rgba(255, 194, 74, .6); }
.public-main .premium-home .hero-tagline { font-size: clamp(1.4rem, 2.4vw, 2.1rem); font-weight: 600; letter-spacing: .005em; text-shadow: 0 2px 22px rgba(0, 0, 0, .7); }
.public-main .premium-home .premium-hero-copy > p { max-width: 54ch; line-height: 1.65; color: #d6def5; text-shadow: 0 1px 14px rgba(0, 0, 0, .65); }
.campaign-label {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 194, 74, .38);
  background: rgba(255, 194, 74, .08);
  backdrop-filter: blur(6px);
  letter-spacing: .14em;
}
.campaign-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--icp-gold); box-shadow: 0 0 12px var(--icp-gold); animation: icpPulse 2.4s ease-in-out infinite; }
.home-live-stats {
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  background: linear-gradient(160deg, rgba(18, 24, 50, .78), rgba(8, 11, 26, .72)) !important;
  border-color: var(--icp-line-strong) !important;
  box-shadow: var(--icp-shadow);
}
.network-status.online strong, .network-status.online > div > strong { text-shadow: 0 0 22px rgba(52, 215, 122, .55); }

/* ---------- Seções e cartões: profundidade consistente ---------- */
.premium-section, .server-network-overview, .server-catalog-hero, .home-discord-banner {
  border-color: var(--icp-line) !important;
  box-shadow: var(--icp-shadow);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%);
}
.section-head h2, .section-head h3 { letter-spacing: .02em; position: relative; padding-bottom: 12px; }
.section-head h2::after, .section-head h3::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--icp-gold), var(--icp-violet));
}

/* ---------- Mundos da rede: identidade própria por mundo ---------- */
.world-tile, .catalog-world-card {
  --world-glow: var(--world-color, var(--icp-violet));
  position: relative;
  transition: transform .35s var(--icp-ease), box-shadow .35s var(--icp-ease), border-color .35s;
  will-change: transform;
}
.world-tile.gold { --world-glow: #ffb347; }
.world-tile.blue { --world-glow: #4aa8ff; }
.world-tile.technology { --world-glow: #b07dff; }
.world-tile.purple { --world-glow: #b07dff; }
.world-tile.green { --world-glow: #3be39a; }
.world-tile::before, .catalog-world-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px 220px at 50% 0%, color-mix(in srgb, var(--world-glow) 34%, transparent), transparent 70%);
  transition: opacity .35s var(--icp-ease);
}
.world-tile:hover, .catalog-world-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--world-glow) 70%, #fff 0%) !important;
  box-shadow: 0 26px 54px -22px color-mix(in srgb, var(--world-glow) 65%, transparent), 0 0 0 1px color-mix(in srgb, var(--world-glow) 35%, transparent);
}
.world-tile:hover::before, .catalog-world-card:hover::before { opacity: 1; }
.world-tile img, .catalog-world-card img, .world-thumbnail img { transition: transform .8s var(--icp-ease), filter .5s; }
.world-tile:hover img, .catalog-world-card:hover img { transform: scale(1.06); filter: saturate(1.15) contrast(1.04); }
.world-art-link, .world-thumbnail { overflow: hidden; }
.server-live-dot { box-shadow: 0 0 0 0 currentColor; animation: icpPing 2.2s ease-out infinite; }

/* ---------- Notícias / destaques ---------- */
.premium-news-list > *, .home-highlights > a {
  transition: transform .28s var(--icp-ease), border-color .28s, background-color .28s, box-shadow .28s;
}
.premium-news-list > *:hover, .home-highlights > a:hover {
  transform: translateY(-3px);
  border-color: var(--icp-line-strong) !important;
  box-shadow: 0 18px 40px -22px rgba(155, 107, 255, .55);
}
.money-board > * { transition: background-color .2s; }
.money-board > *:hover { background: rgba(255, 194, 74, .05); }

/* ---------- Estados de carregamento: skeleton cinematográfico ---------- */
.section-loading-card, .team-skeleton, .skeleton {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(25, 30, 58, .8), rgba(14, 18, 38, .8)) !important;
  border: 1px solid var(--icp-line);
}
.section-loading-card::after, .team-skeleton::after, .skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(190, 170, 255, .14) 50%, transparent 80%);
  transform: translateX(-100%); animation: icpShimmer 1.6s ease-in-out infinite;
}
.public-feedback, .ic-commerce-empty, .premium-empty, .empty {
  border: 1px dashed var(--icp-line-strong);
  border-radius: var(--icp-radius);
  background: radial-gradient(600px 200px at 50% 0%, rgba(155, 107, 255, .10), transparent 70%), rgba(10, 14, 30, .55);
}

/* ---------- CONTA: login e cadastro ---------- */
.account-auth, .account-auth-story { border-radius: 22px !important; }
.account-auth { box-shadow: var(--icp-shadow); }
.account-auth-story { position: relative; overflow: hidden; }
.account-auth-story::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 40%, rgba(5, 7, 15, .6)); }

/* ---------- CONTA > Compras e Cash ---------- */
.player-account-hero {
  border-color: var(--icp-line-strong) !important;
  background: radial-gradient(700px 240px at 0% 0%, rgba(155, 107, 255, .20), transparent 65%), linear-gradient(160deg, rgba(20, 26, 54, .9), rgba(9, 12, 28, .86)) !important;
  box-shadow: var(--icp-shadow);
}
.player-account-avatar { box-shadow: 0 0 0 2px rgba(255, 194, 74, .5), 0 0 34px -4px rgba(255, 194, 74, .5); }
.ic-account-navigation a { transition: background-color .2s, transform .2s var(--icp-ease), box-shadow .2s; }
.ic-account-navigation a:hover { transform: translateX(3px); }
.ic-account-navigation a[aria-current="page"] { box-shadow: 0 0 0 1px rgba(255, 194, 74, .55) inset, 0 10px 26px -14px rgba(255, 194, 74, .55); }

/* CORREÇÃO ESTRUTURAL (bug do release r637): carrinho/criar-pedido e histórico estão aninhados
   dentro do grid de 4 colunas das estatísticas e ficavam espremidos (~260px). Cada um passa a
   ocupar a linha inteira, preservando o grid interno 1.65fr/1fr já definido. */
.ic-commerce-stats > .ic-commerce-shop,
.ic-commerce-stats > .ic-commerce-history { grid-column: 1 / -1; min-width: 0; width: 100%; }
.ic-commerce-stats > .ic-commerce-shop { margin-top: 6px; }
.ic-commerce-history { padding: 26px !important; }
.ic-commerce-history-head h2, .ic-commerce-history-head h3 { letter-spacing: .01em; }
.ic-commerce-filters button, .ic-commerce-filters .button { transition: transform .2s var(--icp-ease), background-color .2s, border-color .2s, box-shadow .2s; }
.ic-commerce-filters [aria-pressed="true"], .ic-commerce-filters .is-active { box-shadow: 0 0 0 1px rgba(255, 194, 74, .6) inset, 0 8px 22px -12px rgba(255, 194, 74, .6); }
.ic-commerce-filters input { min-width: min(280px, 100%); }

/* Cartões de pedido: trilho lateral colorido pelo estado do pagamento/entrega */
.ic-commerce-order {
  position: relative;
  border-radius: 16px !important;
  background: linear-gradient(160deg, rgba(14, 33, 64, .9), rgba(8, 20, 42, .9)) !important;
  box-shadow: 0 14px 36px -24px rgba(0, 0, 0, .9);
  transition: transform .28s var(--icp-ease), border-color .28s, box-shadow .28s !important;
}
.ic-commerce-order::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #8b93b8, #4b5276);
}
.ic-commerce-order:has(.ic-commerce-order-badges .ic-commerce-badge.success)::before { background: linear-gradient(180deg, #43f5a2, #14a36a); }
.ic-commerce-order:has(.ic-commerce-order-badges .ic-commerce-badge.pending)::before { background: linear-gradient(180deg, #ffd16c, #d9962c); }
.ic-commerce-order:has(.ic-commerce-order-badges .ic-commerce-badge.warning)::before { background: linear-gradient(180deg, #ffdc86, #d9962c); }
.ic-commerce-order:has(.ic-commerce-order-badges .ic-commerce-badge.danger)::before { background: linear-gradient(180deg, #ff8fa7, #c93d63); }
/* Pagamento aprovado + entrega ainda pendente NÃO pode parecer concluído: âmbar prevalece */
.ic-commerce-order:has(.ic-commerce-badge.success):has(.ic-commerce-order-badges .ic-commerce-badge.pending)::before,
.ic-commerce-order:has(.ic-commerce-badge.success):has(.ic-commerce-order-badges .ic-commerce-badge.warning)::before { background: linear-gradient(180deg, #ffd16c, #d9962c); }
.ic-commerce-order:hover { transform: translateY(-2px); box-shadow: 0 22px 46px -24px rgba(70, 120, 255, .45) !important; }
.ic-commerce-order-row { padding-left: 24px !important; }
.ic-commerce-order-art { box-shadow: 0 8px 22px -10px rgba(155, 107, 255, .6), 0 0 0 1px rgba(255, 255, 255, .06) inset; }
.ic-commerce-order-price { font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(255, 194, 74, .35); }

/* Selos de status com indicador: dois eixos distintos (pagamento × entrega) */
.ic-commerce-badge {
  gap: 7px; border-radius: 999px !important; padding: 6px 12px 6px 10px !important;
  backdrop-filter: blur(4px);
}
.ic-commerce-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }
.ic-commerce-badge.pending::before, .ic-commerce-badge.warning::before { animation: icpPulse 1.8s ease-in-out infinite; }
.ic-commerce-order-badges .ic-commerce-badge[title="Status da Entrega"] { border-style: dashed !important; }
/* Detalhes do pedido: linha do tempo */
.ic-commerce-order-detail { border-top: 1px solid var(--icp-line); background: linear-gradient(180deg, rgba(5, 10, 24, .5), transparent); }
.ic-commerce-timeline { position: relative; }
.ic-commerce-step-dot { transition: transform .25s var(--icp-ease), box-shadow .25s; }
.ic-commerce-step.is-done .ic-commerce-step-dot { box-shadow: 0 0 0 4px rgba(67, 245, 162, .14), 0 0 18px rgba(67, 245, 162, .5); }
.ic-commerce-meta-grid > * { border-radius: 12px; }

/* Carteira / Cash */
.ic-commerce-wallet {
  border-radius: 14px; border: 1px solid var(--icp-line);
  background: linear-gradient(150deg, rgba(255, 194, 74, .08), rgba(20, 26, 54, .6));
  transition: transform .25s var(--icp-ease), border-color .25s;
}
.ic-commerce-wallet:hover { transform: translateY(-2px); border-color: rgba(255, 194, 74, .45); }
.ic-commerce-wallet > strong { font-size: 1.35rem; color: var(--icp-gold-soft); text-shadow: 0 0 24px rgba(255, 194, 74, .35); font-variant-numeric: tabular-nums; }
.ic-commerce-stats > * {
  border-radius: 16px; border: 1px solid var(--icp-line);
  background: linear-gradient(160deg, rgba(22, 28, 58, .85), rgba(10, 14, 32, .85));
  transition: transform .25s var(--icp-ease), border-color .25s;
}
.ic-commerce-stats > *:hover { transform: translateY(-3px); border-color: var(--icp-line-strong); }
.ic-commerce-stats strong { font-variant-numeric: tabular-nums; }

/* ---------- Tabelas (ranking, status) ---------- */
.table-wrap { border-radius: var(--icp-radius); border: 1px solid var(--icp-line); overflow: auto; }
table tbody tr { transition: background-color .18s; }
table tbody tr:hover { background: rgba(155, 107, 255, .07); }

/* ---------- Rodapé ---------- */
.ic-footer { background-image: radial-gradient(900px 260px at 50% 0, rgba(155, 107, 255, .10), transparent 70%); }
.footer-social a, .footer-socials a { transition: transform .25s var(--icp-ease), box-shadow .25s; }
.footer-social a:hover, .footer-socials a:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(155, 107, 255, .65); }

/* ---------- Entrada suave (CSS puro) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .premium-section, .home-discord-banner, .server-catalog-hero, .server-network-overview, .player-account-hero {
    animation: icpRise .7s var(--icp-ease) both;
  }
  .world-strip > *, .server-catalog-grid > *, .home-highlights > * { animation: icpRise .7s var(--icp-ease) both; }
  .world-strip > *:nth-child(2), .server-catalog-grid > *:nth-child(2), .home-highlights > *:nth-child(2) { animation-delay: .07s; }
  .world-strip > *:nth-child(3), .server-catalog-grid > *:nth-child(3), .home-highlights > *:nth-child(3) { animation-delay: .14s; }
  .world-strip > *:nth-child(4), .server-catalog-grid > *:nth-child(4), .home-highlights > *:nth-child(4) { animation-delay: .21s; }
  .world-strip > *:nth-child(5), .server-catalog-grid > *:nth-child(5) { animation-delay: .28s; }
  .ic-commerce-order { animation: icpRise .5s var(--icp-ease) both; }
}
@keyframes icpRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes icpShimmer { to { transform: translateX(100%); } }
@keyframes icpPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }
@keyframes icpPing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
  .premium-hero h1 { font-size: clamp(2.4rem, 13vw, 3.6rem); }
  .button, a.button, button.button { min-height: 46px; }
  .world-tile:hover, .catalog-world-card:hover { transform: none; }
  .ic-commerce-order-row { padding: 16px 16px 16px 20px !important; }
  .ic-commerce-order-badges .ic-commerce-badge { font-size: .68rem; }
  .ic-commerce-order-row .button { width: 100%; justify-content: center; grid-column: 1 / -1; }
  .section-head h2::after, .section-head h3::after { width: 34px; }
}
@media (hover: none) {
  .button:hover, .world-tile:hover, .catalog-world-card:hover, .ic-commerce-order:hover { transform: none; }
}

/* ==========================================================================
   Minha Conta > Compras (r640) - aditivo, sem alterar logica nem dados
   ========================================================================== */
/* Mobile: elimina rolagem horizontal da area do jogador */
html, body { overflow-x: clip; }
.player-account, .player-account-layout, .player-account-sidebar, .player-account-content, .ic-account-panel, .ic-commerce { min-width: 0; max-width: 100%; }
.player-account-layout > * { min-width: 0; }
.ic-account-navigation { max-width: 100%; }
@media (max-width: 720px) {
  .ic-account-navigation { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .ic-account-navigation a { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
  .ic-commerce-order-row { flex-wrap: wrap; row-gap: 10px; }
  .ic-commerce-order-row > .button { width: 100%; }
}

/* Prioridade da tela: historico de pedidos vem ANTES do formulario de compra */
.ic-commerce-stats > .ic-commerce-history { order: 5; }
.ic-commerce-stats > .ic-commerce-shop { order: 6; }

/* Pagamento aprovado != entrega concluida: cada selo ganha legenda propria */
.ic-commerce-order-badges { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.ic-commerce-order-badges .ic-commerce-badge { position: relative; margin-top: 16px; }
.ic-commerce-order-badges .ic-commerce-badge::after {
  position: absolute; left: 4px; top: -15px; font-size: 9px; line-height: 1; font-weight: 800;
  letter-spacing: .18em; color: #8f9bc7; text-shadow: none; white-space: nowrap; pointer-events: none;
}
.ic-commerce-order-badges .ic-commerce-badge[title="Status do Pagamento"]::after { content: "PAGAMENTO"; }
.ic-commerce-order-badges .ic-commerce-badge[title="Status da Entrega"]::after { content: "ENTREGA"; }
.ic-commerce-order-badges .ic-commerce-badge[title="Status da Entrega"]::before { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .ic-commerce-badge::before { animation: none !important; } }
