/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #e5e7eb;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(800px 500px at 10% 0%, rgba(59,130,246,.18), transparent 55%),
    linear-gradient(180deg, #071023, #050814 70%);
}

/* IMPORTANTÍSSIMO: garante que nada fique invisível */
.app, header, section, .card { display: block !important; opacity: 1 !important; visibility: visible !important; }

.app{
  width: min(980px, 92vw);
  margin: 18px auto 60px auto;
}

/* ===== Topo ===== */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
}

.top-title{
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
}

.top-subtitle{
  margin-top: 4px;
  opacity: .8;
  font-size: 13px;
}

.top-actions{ display:flex; gap: 10px; }

/* ===== Cards / Layout ===== */
.card{
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}

.card-mini{ padding: 14px; }

.grid{
  display:grid;
  grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) );
  gap: 12px;
}

/* ===== Tipografia ===== */
.h2{ margin: 0 0 10px 0; font-size: 22px; font-weight: 900; }
.muted{ opacity: .76; margin-top: 8px; }
.small{ font-size: 12px; opacity: .82; }

/* ===== Inputs ===== */
.label{
  display:block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: .8;
  font-weight: 800;
}

.input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.65);
  color: #e5e7eb;
  outline: none;
}

.input:focus{
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 3px rgba(34,197,94,.14);
}

/* ===== Botões ===== */
.btn{
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(255,255,255,.06);
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor:pointer;
}

.btn:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.btn-full{ width: 100%; }

.btn-success{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.38);
}

.btn-success:hover{
  background: rgba(34,197,94,.26);
}

.btn-danger{
  background: rgba(239,68,68,.16);
  border-color: rgba(239,68,68,.38);
}

.btn-ghost{
  background: rgba(2,6,23,.35);
  border-color: rgba(148,163,184,.22);
}

/* ===== Tabs ===== */
.tabs{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.35);
  color:#e5e7eb;
  font-weight: 900;
  cursor: pointer;
}

.tab.active{
  background: rgba(59,130,246,.16);
  border-color: rgba(59,130,246,.38);
}

/* ===== Hidden ===== */
.hidden{ display:none !important; }

/* ===== Modal ===== */
.modal.hidden{ display:none !important; }

.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}

.modal-content{
  position: relative;
  width: min(520px, 92vw);
  margin: 12vh auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(2,6,23,.92);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

/* ===== Toast ===== */
.toastArea{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 14px;
  display:flex;
  flex-direction:column;
  gap: 8px;
  z-index: 99999;
  pointer-events:none;
}

.toast{
  background: rgba(34,197,94,.18);
  border: 1px solid rgba(34,197,94,.38);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.toast.erro{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.38);
}

/* ===== Bracket / Confrontos ===== */
.fase-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(2,6,23,.45);
  border: 1px solid rgba(148,163,184,.18);
  margin-bottom: 10px;
}

.confronto{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(2,6,23,.45);
  border