/* Squad Noir Editorial — Album Copa 2026 v3 */

:root {
  --bg: #0A0A0B;
  --surface-1: #111114;
  --surface-2: #16161A;
  --surface-3: #1C1C22;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.14);
  --text: #F5F5F7;
  --text-dim: #8B8B92;
  --text-mute: #5A5A62;
  --accent: #06B6D4;
  --accent-bright: #4CD7F6;
  --danger: #FF6B6B;
  --warn: #FFC857;
  --ok: #4CAF50;
  --gold: #D4A04C;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}

/* HEADER */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(10,10,11,0.95); backdrop-filter: blur(10px);
  z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-mark { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -0.5px; }
.brand-mark::first-letter { color: var(--accent); }
.brand-sub {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.top-right { display: flex; align-items: center; gap: 20px; }
.top-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.loading { color: var(--text-mute); }

/* HAMBURGER */
.hamburger {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; padding: 0; align-items: center;
  border-radius: 6px; transition: background 0.15s;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  width: 22px; height: 2px; background: var(--text);
  border-radius: 1px; transition: all 0.2s;
}

/* SIDE MENU */
.side-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 99; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.side-overlay.open { opacity: 1; pointer-events: auto; }
.side-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 90vw;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  z-index: 100;
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; gap: 24px;
}
.side-menu.open { transform: translateX(0); }
.side-menu.hidden { /* ainda transformado, mas inalcansável visualmente */ }
.side-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.side-menu-title {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 3px; color: var(--accent); font-weight: 500;
}
.side-menu-close {
  background: none; border: none; color: var(--text); font-size: 28px;
  cursor: pointer; padding: 0; line-height: 1; font-weight: 200;
}
.side-menu-section { display: flex; flex-direction: column; gap: 6px; }
.side-menu-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px;
}
.side-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; text-align: left;
  font-family: var(--font-body); font-size: 13px;
  cursor: pointer; border-radius: 6px; transition: all 0.15s;
}
.side-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.side-btn-ok { border-left: 2px solid var(--ok); }
.side-btn-warn { border-left: 2px solid var(--warn); }
.side-btn-danger { border-left: 2px solid var(--danger); }
.side-grupos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.side-grupos button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 4px; font-family: var(--font-mono); font-size: 11px;
  cursor: pointer; border-radius: 4px; transition: all 0.15s;
}
.side-grupos button:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.side-stats {
  background: var(--surface-2); padding: 14px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  display: flex; flex-direction: column; gap: 6px;
}
.side-stats .row { display: flex; justify-content: space-between; gap: 12px; }
.side-stats .row b { color: var(--text); font-weight: 500; }

/* HERO (v1 — 4 cards horizontais) */
.hero {
  padding: 64px 32px 48px;
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  max-width: 1400px; margin: 0 auto;
  border: 1px solid var(--border);
}
.stat {
  background: var(--bg); padding: 36px 28px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-primary { background: var(--surface-2); }
.stat-num {
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1; letter-spacing: -3px;
  color: var(--text);
}
.stat-num.accent { color: var(--accent); }
.stat-label {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim);
}
.stat-sub { font-size: 13px; color: var(--text-mute); margin-top: 2px; }
.progress {
  height: 3px; background: var(--surface-3); border-radius: 2px;
  overflow: hidden; margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* CHARTS */
.charts {
  display: grid; grid-template-columns: 280px 1fr; gap: 1px;
  background: var(--border); border-bottom: 1px solid var(--border);
}
.chart-card {
  background: var(--surface-1); padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.chart-card-wide { background: var(--surface-1); }
.chart-head { display: flex; flex-direction: column; gap: 4px; }
.chart-title {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 2px; color: var(--text-dim); font-weight: 500;
}
.chart-sub { font-size: 12px; color: var(--text-mute); }
.donut-wrap { display: flex; justify-content: center; align-items: center; flex: 1; }
.donut { display: block; }
.donut-fill { transition: stroke-dasharray 1.4s cubic-bezier(0.4,0,0.2,1); }

.bars-grupo {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  align-content: start;
}
.bar-grupo {
  display: grid; grid-template-columns: 24px 1fr 60px;
  gap: 10px; align-items: center;
}
.bar-grupo-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--accent); letter-spacing: 1px;
}
.bar-grupo-wrap {
  height: 18px; background: var(--surface-3); border-radius: 3px; overflow: hidden;
}
.bar-grupo-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
  border-radius: 3px;
}
.bar-grupo-fill.complete { background: var(--ok); }
.bar-grupo-fill.low { background: linear-gradient(90deg, var(--danger), var(--warn)); }
.bar-grupo-pct {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-dim); text-align: right;
}
.bar-grupo-pct b { color: var(--text); font-weight: 500; }

/* INSIGHTS */
.insights {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border-bottom: 1px solid var(--border);
}
.insight-card {
  background: var(--surface-1); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.insight-label {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim);
}
.insight-label .mute { color: var(--text-mute); text-transform: none; letter-spacing: 0; font-size: 10px; }
.insight-num {
  font-family: var(--font-display); font-weight: 200;
  font-size: 48px; line-height: 1; letter-spacing: -1.5px;
}
.insight-ok .insight-num { color: var(--ok); }
.insight-warn .insight-num { color: var(--warn); }
.insight-info .insight-num { color: var(--accent); }
.insight-danger .insight-num { color: var(--danger); }
.insight-list {
  font-family: var(--font-mono); font-size: 11px; color: var(--text);
  line-height: 1.7;
}
.insight-list .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-radius: 3px; }
.insight-list .row.clickable { cursor: pointer; transition: background 0.15s; padding: 2px 6px; margin: 0 -6px; }
.insight-list .row.clickable:hover { background: var(--surface-3); }
.insight-list .row.clickable:hover b { color: var(--accent); }
.insight-list .row b { font-weight: 500; color: var(--text); }
.insight-list .row span:last-child { color: var(--text-dim); }

/* Highlight quando navega via click */
.team-page.highlight {
  animation: highlightPulse 1.8s ease-out;
  border-color: var(--accent) !important;
}
@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(6,182,212,0.6); background: var(--surface-2); }
  50% { box-shadow: 0 0 0 12px rgba(6,182,212,0); }
  100% { box-shadow: 0 0 0 0 rgba(6,182,212,0); background: var(--surface-1); }
}

/* TABS */
.tabs { display: flex; padding: 0 32px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  background: none; border: none; color: var(--text-dim);
  padding: 18px 24px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 2px; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* CONTROLS */
.controls {
  padding: 20px 32px; display: flex; flex-direction: column; gap: 14px;
  border-bottom: 1px solid var(--border);
}
#search {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 16px; font-family: var(--font-mono); font-size: 13px;
  border-radius: 6px; outline: none; transition: border-color 0.2s;
}
#search:focus { border-color: var(--accent); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 12px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 1px; border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 500; }

/* MAIN */
main { padding: 32px; min-height: 60vh; max-width: 1400px; margin: 0 auto; }
.empty { text-align: center; padding: 80px 20px; color: var(--text-mute); }
.empty-title { font-family: var(--font-display); font-size: 24px; font-weight: 300; }

/* ÁLBUM — livro aberto */
.album-list { display: flex; flex-direction: column; gap: 28px; }
.team-page {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; transition: border-color 0.2s;
}
.team-page:hover { border-color: var(--border-strong); }
.team-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.team-head-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.team-code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 3px; font-weight: 500; }
.team-name { font-family: var(--font-display); font-size: 26px; font-weight: 300; letter-spacing: -0.5px; }
.team-group {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 2px;
  background: var(--surface-3); padding: 4px 8px; border-radius: 4px;
}
.team-stats { display: flex; align-items: center; gap: 14px; }
.team-progress-bar { width: 120px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.team-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  width: 0%; transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.team-progress-fill.complete { background: var(--ok); }
.team-pct { font-family: var(--font-display); font-size: 22px; font-weight: 300; min-width: 50px; text-align: right; }
.team-pct.complete { color: var(--ok); }
.team-fraction { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.team-actions { display: flex; gap: 4px; margin-left: 8px; }
.team-actions button {
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim);
  padding: 4px 8px; font-family: var(--font-mono); font-size: 10px;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.5px;
}
.team-actions button:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.team-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; }
.team-photo {
  position: relative; background: #000; min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-in; overflow: hidden;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-photo-hint {
  position: absolute; bottom: 10px; right: 12px;
  font-family: var(--font-mono); font-size: 10px; color: rgba(245,245,247,0.7);
  background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 4px; letter-spacing: 1px;
}

.team-slots {
  padding: 20px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  align-content: start;
}
.slot {
  aspect-ratio: 3/4; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; position: relative;
  cursor: pointer; transition: all 0.15s;
}
.slot:hover { transform: scale(1.04); z-index: 2; }
.slot.tem { background: var(--surface-2); border: 1px solid rgba(76,175,80,0.4); color: var(--ok); }
.slot.tem::before { content: "✓"; font-size: 18px; }
.slot.falta { background: rgba(255,107,107,0.07); border: 1px solid var(--danger); color: var(--danger); }
.slot.falta::before { content: "—"; font-size: 18px; opacity: 0.5; }
.slot-num { font-size: 11px; font-weight: 500; margin-top: 2px; }
.slot.complete-team.tem { background: rgba(76,175,80,0.12); }
.slot.edit { box-shadow: inset 0 0 0 1px var(--accent); }
.slot.edit::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}

/* TEAM FLAG (logo seleção) */
.team-flag, .rank-flag, .troca-grupo .team-flag {
  width: 32px; height: 24px; object-fit: cover; border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.team-flag-placeholder, .rank-flag-placeholder {
  width: 32px; height: 24px; background: var(--surface-3); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-family: var(--font-mono); font-size: 14px;
}

/* TROCA — agrupado por seleção */
.troca-list { display: flex; flex-direction: column; gap: 24px; }
.troca-grupo {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.troca-grupo-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.troca-grupo-team { display: flex; align-items: center; gap: 14px; }
.troca-grupo .team-flag { width: 48px; height: 36px; border-radius: 4px; }
.troca-grupo-code {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 2px; font-weight: 500;
}
.troca-grupo-name { font-family: var(--font-display); font-size: 18px; font-weight: 300; }
.troca-grupo-stat { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.troca-grupo-stat-num {
  font-family: var(--font-display); font-size: 28px; font-weight: 300;
  color: var(--warn); line-height: 1;
}
.troca-grupo-stat-label { margin-top: 4px; }
.troca-grupo-stat-label b { color: var(--text); font-weight: 500; }
.troca-grupo .fig-grid { padding: 14px 20px 18px; }

/* RANKING */
.ranking { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: grid; grid-template-columns: 36px 50px 1fr 80px;
  gap: 12px; align-items: center; padding: 8px 12px;
  background: var(--surface-1); border-radius: 6px; cursor: pointer;
  transition: background 0.15s;
}
.rank-item:hover { background: var(--surface-2); }
.rank-code { font-family: var(--font-mono); font-weight: 500; color: var(--accent); font-size: 13px; }
.rank-bar-wrap {
  height: 24px; background: var(--surface-3); border-radius: 4px; overflow: hidden;
  position: relative;
}
.rank-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 4px; width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.rank-bar.complete { background: var(--ok); }
.rank-bar.danger { background: linear-gradient(90deg, var(--danger), var(--warn)); }
.rank-name {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-body); font-size: 12px; color: var(--text); z-index: 2;
  text-shadow: 0 0 4px rgba(0,0,0,0.7);
}
.rank-data { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.rank-data b { color: var(--text); font-weight: 500; }

/* TROCAS */
.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.fig {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px 10px; text-align: center;
  position: relative; cursor: pointer; transition: all 0.15s;
}
.fig:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.fig-code { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.fig-num { font-family: var(--font-display); font-size: 28px; font-weight: 300; line-height: 1; margin: 8px 0 4px; }
.fig-type { font-family: var(--font-mono); font-size: 9px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.fig.falta { border-left: 2px solid var(--danger); }
.fig.falta .fig-num { color: var(--danger); }
.fig.troca { border-left: 2px solid var(--warn); }
.fig.troca .fig-num { color: var(--warn); }
.fig-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--warn); color: var(--bg);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 8px; min-width: 18px;
}

/* MODAL */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 1; transition: opacity 0.2s;
}
.modal.hidden { display: none; }
.modal-inner { position: relative; max-width: 95vw; max-height: 95vh; }
.modal-inner img { max-width: 95vw; max-height: 95vh; display: block; border-radius: 8px; }
.modal-close {
  position: absolute; top: -40px; right: 0; background: none; border: none;
  color: white; font-size: 30px; cursor: pointer; font-weight: 200;
}

/* FOOT */
.foot {
  padding: 20px 32px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; color: var(--text-mute); font-size: 11px;
}
.foot-mono { font-family: var(--font-mono); }

/* MOBILE */
@media (max-width: 1000px) {
  .charts { grid-template-columns: 1fr; }
  .bars-grupo { grid-template-columns: 1fr; }
  .insights { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 48px; }
  .top { padding: 14px 16px; }
  .hero { padding: 32px 16px; }
  .charts { grid-template-columns: 1fr; }
  .team-body { grid-template-columns: 1fr; }
  .team-photo { min-height: 200px; }
}
@media (max-width: 600px) {
  .insights { grid-template-columns: 1fr; }
  .tabs { padding: 0 16px; }
  .controls { padding: 16px; }
  main { padding: 20px 16px; }
  .team-head { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
  .team-slots { grid-template-columns: repeat(4, 1fr); padding: 14px; }
  .side-menu { width: 100%; }
}
