/* ===========================================================================
   Ninjinha Sorteios — Design System
   Estilo: gaming/esports dark glassmorphism (ui-ux-pro-max)
   Paleta: roxo neon + teal (identidade Ninja Hub) + rosa (ação/perigo)
   Fontes: Russo One (títulos) / Chakra Petch (corpo)
   =========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&family=Russo+One&display=swap');

:root {
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --primary-soft: #a78bfa;
  --teal: #2dd4bf;
  --accent: #f43f5e;       /* rosa: CTA principal / perigo */
  --bg: #0b0b1a;
  --bg-2: #0f0f23;
  --fg: #e7e9f3;
  --fg-muted: #9aa0bd;
  --surface: rgba(20, 22, 44, 0.6);
  --surface-solid: #15162c;
  --border: rgba(124, 58, 237, 0.28);
  --twitch: #9146ff;
  --youtube: #ff0000;
  --kick: #53fc18;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  --glow: 0 0 24px rgba(139, 92, 246, 0.45);
  --glow-teal: 0 0 24px rgba(45, 212, 191, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(45, 212, 191, 0.16), transparent 55%),
    var(--bg);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Russo One', sans-serif; font-weight: 400; letter-spacing: 0.02em; }

a { color: var(--primary-soft); text-decoration: none; }

.container { width: min(1140px, 92vw); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 11, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-strong), var(--teal));
  box-shadow: var(--glow);
}
.brand .mark svg { width: 24px; height: 24px; }
.brand h1 { font-size: 1.25rem; }
.brand h1 span { color: var(--teal); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: 'Chakra Petch', sans-serif; font-weight: 600; font-size: 0.95rem;
  padding: 12px 20px; min-height: 46px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; color: #fff;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary { background: linear-gradient(135deg, var(--primary-strong), var(--primary)); box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 0 32px rgba(139, 92, 246, 0.7); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #fb7185); box-shadow: 0 0 24px rgba(244, 63, 94, 0.5); font-size: 1.1rem; padding: 16px 30px; min-height: 56px; }
.btn-accent:hover { box-shadow: 0 0 38px rgba(244, 63, 94, 0.75); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary-soft); }
.btn-twitch { background: var(--twitch); }
.btn-twitch:hover { box-shadow: 0 0 26px rgba(145, 70, 255, 0.6); }
.btn-youtube { background: var(--youtube); }
.btn-youtube:hover { box-shadow: 0 0 26px rgba(255, 0, 0, 0.55); }
.btn-danger { background: transparent; border-color: rgba(244, 63, 94, 0.5); color: #fda4af; }
.btn-danger:hover { background: rgba(244, 63, 94, 0.12); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(16px);
  box-shadow: var(--shadow); padding: 26px;
}

/* live badge */
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #fff; background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.4); padding: 6px 14px; border-radius: 999px;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(244,63,94,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,.6);} 70% { box-shadow: 0 0 0 10px rgba(244,63,94,0);} 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0);} }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 30px; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hero h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; }
.hero h2 .grad {
  background: linear-gradient(120deg, var(--primary-soft), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.1rem; color: var(--fg-muted); max-width: 48ch; }
.hint code { background: rgba(45,212,191,.12); color: var(--teal); padding: 2px 8px; border-radius: 6px; font-weight: 700; }

/* giveaway card (right) */
.giveaway-card { display: flex; flex-direction: column; gap: 18px; }
.giveaway-card .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prize { text-align: center; padding: 10px 0; }
.prize .label { color: var(--fg-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.prize .value { font-family: 'Russo One'; font-size: 1.9rem; color: var(--teal); text-shadow: var(--glow-teal); margin-top: 4px; }

.count-wrap { text-align: center; }
.count-wrap .count {
  font-family: 'Russo One'; font-size: 4rem; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, var(--primary-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: transform .12s ease; display: inline-block;
}
.count-wrap .count-label { color: var(--fg-muted); margin-top: 2px; }

/* auth area */
.auth-box { display: flex; flex-direction: column; gap: 12px; }
.auth-row { display: flex; gap: 10px; }
.auth-row .btn { flex: 1; }
.me-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface-solid); border: 1px solid var(--border);
}
.me-chip img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary); }
.me-chip .meta { display: flex; flex-direction: column; line-height: 1.2; }
.me-chip .meta .pf { font-size: 0.78rem; color: var(--fg-muted); text-transform: capitalize; }

/* ---------- Participants ---------- */
.section { padding: 28px 0 60px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.section-head h3 { font-size: 1.3rem; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.participant {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  animation: pop .35s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.participant img { width: 42px; height: 42px; border-radius: 50%; flex: none; object-fit: cover; }
.participant .info { min-width: 0; }
.participant .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-badge { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.pf-twitch { color: var(--twitch); }
.pf-youtube { color: var(--youtube); }
.pf-kick { color: var(--kick); }
.pf-chat { color: var(--fg-muted); }

.empty-state { text-align: center; color: var(--fg-muted); padding: 50px 20px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); margin: 0 auto 14px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Winner reveal (public) ---------- */
.winner-banner {
  display: none; align-items: center; gap: 18px;
  background: linear-gradient(120deg, rgba(124,58,237,.25), rgba(45,212,191,.18));
  border: 1px solid var(--primary); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--glow); margin-bottom: 22px;
}
.winner-banner.show { display: flex; animation: pop .4s ease; }
.winner-banner img { width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--teal); }
.winner-banner .wlabel { color: var(--teal); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.winner-banner .wname { font-family: 'Russo One'; font-size: 1.8rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-solid); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--accent); color: #fda4af; }
.toast.ok { border-color: var(--teal); color: var(--teal); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; color: var(--fg-muted); text-align: center; font-size: 0.9rem; }

.hidden { display: none !important; }

/* ===========================================================================
   Plataforma: navegação + seções (Sorteios/Drops, Ranking, Loja)
   =========================================================================== */

/* nav principal */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-muted); font-weight: 600; font-size: 0.95rem;
  padding: 9px 14px; border-radius: 10px; transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--fg); background: var(--surface); }
.main-nav a.active { color: var(--fg); background: rgba(124,58,237,.16); }
.main-nav a svg { width: 18px; height: 18px; }
.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--border); color: var(--fg); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

/* TC pill no header */
.tc-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--tc, #fbbf24); background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); padding: 7px 13px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tc-pill svg { width: 16px; height: 16px; }
:root { --tc: #fbbf24; }

/* cabeçalho de seção com ícone */
.sec { padding: 46px 0; }
.sec-title { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sec-title .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(124,58,237,.16); border: 1px solid var(--border); }
.sec-title .ico svg { width: 22px; height: 22px; color: var(--primary-soft); }
.sec-title h3 { font-size: 1.6rem; }
.sec-sub { color: var(--fg-muted); margin-bottom: 24px; }

/* baús (chests) */
.chest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.chest {
  position: relative; text-align: center; padding: 26px 20px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; transition: transform .18s, box-shadow .2s;
}
.chest:hover { transform: translateY(-4px); }
.chest .glow { position: absolute; inset: -40% 0 auto 0; height: 120px; filter: blur(40px); opacity: .55; }
.chest-icon { width: 84px; height: 84px; margin: 0 auto 12px; position: relative; }
.chest h4 { font-family: 'Russo One'; font-size: 1.25rem; }
.chest .tier { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-top: 2px; }
.chest .reward { margin-top: 10px; color: var(--tc); font-weight: 700; font-variant-numeric: tabular-nums; }
.chest .reward small { color: var(--fg-muted); font-weight: 500; }
/* tiers */
.t-comum   { --c: #9aa0bd; }
.t-raro    { --c: #378add; }
.t-epico   { --c: #a78bfa; }
.t-lendario{ --c: #fbbf24; }
.chest.t-comum, .chest.t-raro, .chest.t-epico, .chest.t-lendario { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.chest .glow { background: var(--c); }
.chest .tier { color: var(--c); }

/* feed de drops/vencedores */
.drops-list { display: flex; flex-direction: column; gap: 10px; }
.drop-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--primary));
}
.drop-row img { width: 44px; height: 44px; border-radius: 50%; }
.drop-row .who { min-width: 0; }
.drop-row .who .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-row .who .pz { color: var(--fg-muted); font-size: .85rem; }
.drop-tier { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.drop-chance { text-align: right; font-variant-numeric: tabular-nums; }
.drop-chance b { color: var(--teal); }
.drop-chance small { display: block; color: var(--fg-muted); font-size: .72rem; }

/* ranking */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: grid; grid-template-columns: 46px auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
}
.rank-row .pos { font-family: 'Russo One'; font-size: 1.3rem; text-align: center; color: var(--fg-muted); }
.rank-row.top1 { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.06); }
.rank-row.top1 .pos { color: #fbbf24; }
.rank-row.top2 .pos { color: #cbd5e1; }
.rank-row.top3 .pos { color: #f0997b; }
.rank-row img { width: 46px; height: 46px; border-radius: 50%; }
.rank-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .lvl { color: var(--fg-muted); font-size: .82rem; }
.rank-row .tc { color: var(--tc); font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.rank-row .tc svg { width: 16px; height: 16px; }
.rank-row .xp { text-align: right; color: var(--fg-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* loja */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.shop-card { text-align: center; padding: 24px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); position: relative; transition: transform .18s; }
.shop-card:hover { transform: translateY(-4px); border-color: var(--primary-soft); }
.shop-card.featured { border: 2px solid var(--tc); }
.shop-card .badge-top { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--tc); color: #3a2a04; font-weight: 700; font-size: .72rem; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.shop-card .amount { font-family: 'Russo One'; font-size: 2rem; color: var(--tc); display: flex; align-items: center; justify-content: center; gap: 8px; }
.shop-card .amount svg { width: 26px; height: 26px; }
.shop-card .price { font-size: 1.3rem; font-weight: 700; margin: 8px 0 4px; }
.shop-card .price s { color: var(--fg-muted); font-weight: 400; font-size: .9rem; }
.coupon { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding: 16px; border-radius: var(--radius); background: rgba(45,212,191,.08); border: 1px dashed rgba(45,212,191,.4); }
.coupon .code { font-family: 'Russo One'; font-size: 1.4rem; color: var(--teal); letter-spacing: .1em; }
.partner-note { margin-top: 14px; color: var(--fg-muted); font-size: .85rem; text-align: center; }
.placeholder-img { background: var(--surface-solid); border: 1px dashed var(--border); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--fg-muted); font-size: .8rem; min-height: 90px; text-align: center; padding: 10px; }

.muted { color: var(--fg-muted); }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .main-nav.open { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px; }
  .nav-toggle { display: grid; place-items: center; }
}
@media (max-width: 600px) {
  .drop-row { grid-template-columns: auto 1fr auto; }
  .drop-row .drop-tier { display: none; }
  .rank-row { grid-template-columns: 36px auto 1fr auto; }
  .rank-row .xp { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 20px; }
  .brand h1 { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
