/* =========================================================
   Copa dos CLT — style.css (COMPLETO)
   - Tema escuro (glass)
   - UI: topbar, row, cards, botões, tabs, inputs, toast
   - Confrontos C10: responsivo (FIX iPhone)
   ========================================================= */

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue",
    "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: #e5e7eb;

  background: radial-gradient(1200px 700px at 10% 0%, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, rgba(34, 197, 94, 0.18), transparent 60%),
    radial-gradient(900px 700px at 50% 100%, rgba(148, 163, 184, 0.10), transparent 60%),
    linear-gradient(180deg, #020617, #030712 40%, #020617);

  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;

  overflow-x: hidden;
}

/* melhora scroll no iOS */
html { scroll-behavior: smooth; }
body { -webkit-overflow-scrolling: touch; }

/* ---------- Util ---------- */
.hidden { display: none !important; }

.muted {
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.35;
}

.small {
  font-size: 12px;
  opacity: 0.85;
}

a { color: inherit; }

img { max-width: 100%; }

/* ---------- Container ---------- */
.container {
  width: min(980px, calc(100% - 22px));
  margin: 18px auto 40px;
  padding-bottom: 30px;
  max-width: 100%;
}

/* ---------- Topbar / Header (usado no index) ---------- */
.topbar{
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom: 12px;
}

.brand{
  font-weight: 950;
  font-size: 18px;
  letter-spacing: .2px;
}

.sub{
  margin-top: 4px;
  opacity: .78;
}

/* row (usado no index e em botões) */
.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.title{
  font-weight: 950;
  font-size: 16px;
  margin-bottom: 6px;
}

/* ---------- Cards / Glass ---------- */
.card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}

.card-mini {
  padding: 14px;
  border-radius: 18px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ---------- Labels / Inputs ---------- */
.label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: rgba(226, 232, 240, 0.75);
}

.input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(2, 6, 23, 0.35);
  color: #fff;
  padding: 12px 14px;
  outline: none;
  font-size: 14px;
}

.input::placeholder {
  color: rgba(226, 232, 240, 0.55);
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

/* deixa selects bonitos no iOS */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.75) 50%),
    linear-gradient(135deg, rgba(226, 232, 240, 0.75) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px),
    calc(100% - 2.5em) 0.5em;
  background-size: 6px 6px, 6px 6px, 1px 1.5em;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(148, 163, 184, 0.10);
  color: #e5e7eb;

  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  user-select: none;

  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

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

.btn-full { width: 100%; }

.btn-ghost {
  background: rgba(2, 6, 23, 0.20);
  border-color: rgba(255, 255, 255, 0.10);
}

.btn-success {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.92));
  border-color: rgba(34, 197, 94, 0.35);
  color: #04110a;
  box-shadow: 0 18px 50px rgba(34, 197, 94, 0.18);
}

.btn-danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.92), rgba(220, 38, 38, 0.88));
  border-color: rgba(239, 68, 68, 0.35);
  color: #120505;
  box-shadow: 0 18px 50px rgba(239, 68, 68, 0.16);
}

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

.tab {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(2, 6, 23, 0.25);
  color: rgba(226, 232, 240, 0.92);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.tab.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.90));
  border-color: rgba(59, 130, 246, 0.35);
  color: #06111f;
  box-shadow: 0 18px 50px rgba(59, 130, 246, 0.16);
}

.tab-panel {
  margin-top: 14px;
  max-width: 100%;
}

/* ---------- Toast ---------- */
.toastArea{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font-weight: 900;
}
.toast.erro {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.30);
}

/* ---------- Ranking UI ---------- */
.rankingCard {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  padding: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  max-width: 100%;
}
.rankingTitle {
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 8px;
}
.rankingList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rankingRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

/* ---------- Bracket Title ---------- */
.fase-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  padding: 12px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* =========================================================
   CONFRONTOS – estilo Copa10 (C10)
   ========================================================= */

/* garante que nada estoure por padding */
.confrontoC10,
.confronto,
.c10Time,
.timeSlot,
.c10Centro,
.placarBox,
.c10Editar {
  box-sizing: border-box;
  max-width: 100%;
}

/* container do confronto */
.confrontoC10,
.confronto {
  width: 100%;
  overflow: hidden;
  gap: 12px;
  align-items: center;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  padding: 14px;
  border-radius: 22px;

  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin: 12px 0;

  backdrop-filter: blur(10px);
}

/* lados A e B */
.c10Time,
.timeSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* lado B alinhado */
.c10Time.c10B,
.timeSlot.right {
  justify-self: end;
}

/* escudos */
.c10Escudo,
.escudo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.35));
  border-radius: 14px;
}

/* nome do jogador */
.c10Nome,
.nomeJogador {
  font-weight: 900;
  text-align: center;
  font-size: 14px;
  line-height: 1.1;

  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  opacity: 0.95;
}

/* centro (placar/editar/confirmar) */
.c10Centro,
.placarBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  min-width: 0;
  max-width: 100%;
}

/* status OK (confirmado) */
.c10StatusOK,
.statusOK {
  font-weight: 900;
  opacity: 0.95;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.25);
  max-width: 100%;
}

/* linha do placar (A x B) */
.c10PlacarLinha {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* inputs do placar */
.c10Placar,
.placarInput {
  width: 62px;
  text-align: center;
  font-weight: 900;
  font-size: 18px;

  padding: 10px 10px;
  border-radius: 14px;

  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.35);
  color: #fff;

  outline: none;
}

.c10Placar:focus,
.placarInput:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.c10X {
  font-weight: 900;
  opacity: 0.85;
  font-size: 18px;
}

/* botão confirmar */
.c10BtnConfirmar {
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* área editar (compacta) */
.c10Editar {
  width: 100%;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* selects menores */
.c10Editar .input,
.c10Editar select,
.c10Editar input {
  width: clamp(92px, 18vw, 130px);
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

/* botão salvar menor */
.c10Editar .btn {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

/* =========================================================
   MOBILE (FIX DEFINITIVO iPhone)
   ========================================================= */
@media (max-width: 520px) {
  .confrontoC10,
  .confronto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    overflow: hidden;
  }

  .c10Time,
  .timeSlot {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 2px;
  }

  .c10Centro,
  .placarBox {
    flex: 0 0 auto;
    width: clamp(135px, 42vw, 175px);
    max-width: 175px;
    gap: 8px;
  }

  .c10Escudo,
  .escudo {
    width: 60px;
    height: 60px;
  }

  .c10Nome,
  .nomeJogador {
    max-width: 92px;
    font-size: 13px;
  }

  .c10Editar {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  .c10Editar .input,
  .c10Editar select,
  .c10Editar input {
    width: 100%;
    max-width: 160px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .c10Editar .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .c10Placar,
  .placarInput {
    width: 54px;
    padding: 9px 8px;
    font-size: 17px;
  }

  /* topbar mais estável no mobile */
  .topbar{
    align-items: flex-start;
  }
}