/* ============================================================
   Pelada — visual de tela de escalação: campo em perspectiva,
   painéis de vidro escuro, cartinhas com profundidade.
   ============================================================ */
:root {
  --fundo-1: #1a2130;
  --fundo-2: #0c0f16;
  --vidro: rgba(30, 38, 56, .78);
  --vidro-borda: rgba(150, 170, 210, .14);
  --texto: #f2f5fb;
  --texto-2: #9aa6c0;
  --linha-campo: rgba(185, 200, 230, .42);
  --verde: #4fe08a;
  --perigo: #ff6b6b;
  --fonte: system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --menu-aberto: 260px;
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--texto); font-family: var(--fonte); font-size: 14px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 70% 45% at 50% 105%, rgba(46, 140, 160, .28), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(90, 110, 160, .25), transparent 70%),
    linear-gradient(180deg, var(--fundo-1), var(--fundo-2)) fixed;
}
a { color: #8fb8ff; }
h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .4px; }
button, input { font-family: var(--fonte); }

/* ---------- Topo ---------- */
.topo {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 8px 24px; flex: none;
  border-bottom: 1px solid var(--vidro-borda);
}
.marca {
  font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: .5px; line-height: 1;
  padding-right: 14px; border-right: 1px solid var(--vidro-borda);
}
.marca b { color: var(--verde); font-weight: inherit; }
#titulo { text-transform: uppercase; color: var(--texto); }
.topo input[type="date"], button, .login input {
  padding: 5px 10px; border-radius: 4px; border: 1px solid var(--vidro-borda);
  background: rgba(15, 20, 30, .7); color: var(--texto); font-size: 13px;
}
.topo input[type="date"] { color-scheme: dark; }
button { cursor: pointer; }
button:hover { border-color: var(--verde); }
.topo-centro { grid-column: 2; display: flex; align-items: center; gap: 14px; }
.topo-dir { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; }
#status { color: var(--texto-2); font-size: 12px; }
#status.erro { color: var(--perigo); }

/* ---------- Menu lateral (resources/views/partials/menu.blade.php): escondido, abre pela marca ---------- */
.topo-esq { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 8px; }
.topo-esq .marca { border-right: 0; padding-right: 0; }
.menu-botao {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
}
.menu-botao:hover { background: rgba(255, 255, 255, .06); border: 0; }
.menu-botao svg { width: 20px; height: 20px; fill: none; stroke: var(--texto-2); stroke-width: 2; stroke-linecap: round; transition: stroke .15s; }
.menu-botao:hover svg { stroke: var(--verde); }

.menu {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 2000; width: var(--menu-aberto);
  display: flex; flex-direction: column; gap: 2px; padding: 12px 10px;
  background: #0d1119; border-right: 1px solid var(--vidro-borda);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s, box-shadow .2s ease;
}
.menu.aberto {
  transform: none; visibility: visible; box-shadow: 10px 0 40px rgba(0, 0, 0, .55);
  transition: transform .2s ease, visibility 0s, box-shadow .2s ease;
}
.menu-cab { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--vidro-borda); }
.menu-cab .marca { border: 0; padding: 0; font-size: 20px; }
.menu-fecha { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--texto-2); }
.menu-fecha:hover { background: rgba(255, 255, 255, .06); color: var(--texto); border: 0; }
.menu-fecha svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-item, .menu-titulo {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 40px; padding: 0 10px; flex: none;
  border: 0; border-radius: 6px; background: none; color: var(--texto-2);
  text-decoration: none; text-transform: uppercase; font-size: 12px; letter-spacing: .6px; white-space: nowrap;
}
.menu-item { cursor: pointer; }
.menu-item:hover { background: rgba(255, 255, 255, .06); color: var(--texto); border: 0; }
.menu-titulo { margin-top: 6px; cursor: default; }
.menu-item svg, .menu-titulo svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-item.atual, .menu-titulo.atual { color: var(--verde); }
.menu-item.atual { background: rgba(79, 224, 138, .08); }
.menu-historico {
  list-style: none; margin: 2px 0 8px 20px; padding: 0 0 0 14px; border-left: 1px solid var(--vidro-borda);
  flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(150, 170, 210, .3) transparent;
}
.menu-historico a {
  display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 4px;
  color: var(--texto-2); text-decoration: none; font-size: 12px; white-space: nowrap;
}
.menu-historico a:hover { color: var(--texto); background: rgba(255, 255, 255, .05); }
.menu-historico a.atual { color: var(--verde); background: rgba(79, 224, 138, .08); }
.menu-historico .qtd { opacity: .6; }
.vazio-menu { padding: 6px 8px; color: var(--texto-2); font-size: 12px; }
.menu-fim { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--vidro-borda); }
.menu-fundo { position: fixed; inset: 0; z-index: 1999; background: rgba(0, 0, 0, .4); }

/* ---------- Dois lados ---------- */
.times { display: flex; flex: 1; min-height: 0; padding: 14px 24px 0; }
.time { flex: 1; min-width: 0; padding: 0 18px; display: flex; flex-direction: column; }
.time:first-child { padding-left: 0; }
.time:last-child { padding-right: 0; }
.time + .time { border-left: 1px solid var(--vidro-borda); }

.cab-time {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 8px 16px; margin-bottom: 8px; border-radius: 6px; flex: none;
  background: var(--vidro); border: 1px solid var(--vidro-borda);
  backdrop-filter: blur(6px);
}
.nome-time { font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.em-campo { color: var(--texto-2); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.em-campo b { color: var(--texto); font-size: 15px; margin-right: 3px; }

/* ---------- Campo em perspectiva (desenho em resources/views/partials/gramado.blade.php) ---------- */
.campo { position: relative; flex: 1; min-height: 240px; }
.gramado {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45));
}
.gramado .faixa.clara { fill: #2b3650; }
.gramado .faixa.escura { fill: #26304a; }
.gramado .linha { fill: none; stroke: var(--linha-campo); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.campo.alvo .gramado .linha { stroke: var(--verde); }

/* ---------- Painéis (reservas e banco) ---------- */
.painel {
  margin-top: 10px; padding: 8px 14px 10px; border-radius: 6px; flex: none;
  background: var(--vidro); border: 1px solid var(--vidro-borda); backdrop-filter: blur(6px);
}
.cab-painel {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
}
.cab-painel .conta { color: var(--texto-2); font-size: 12px; font-weight: 400; }
.cab-painel .conta b { color: var(--texto); font-size: 13px; }
.cab-painel .dica { text-transform: uppercase; font-size: 10px; letter-spacing: .6px; }
.painel .zona {
  display: flex; flex-wrap: nowrap; gap: 10px; min-height: 92px; padding: 10px 6px 6px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(150, 170, 210, .3) transparent;
  border: 1px dashed transparent; border-radius: 6px;
}
.painel .zona.alvo { border-color: var(--verde); background: rgba(79, 224, 138, .05); }
.banco { margin: 10px 24px 14px; }

/* ---------- Cartinha do jogador ---------- */
.jogador {
  position: relative; flex: none; width: 64px; padding: 6px 3px 5px; text-align: center;
  border-radius: 5px; border: 1px solid rgba(170, 190, 230, .28);
  background: linear-gradient(180deg, rgba(78, 92, 124, .97), rgba(40, 50, 72, .97));
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: grab; user-select: none; touch-action: none;
  transition: box-shadow .15s, border-color .15s;
}
.jogador:hover { border-color: rgba(79, 224, 138, .7); box-shadow: 0 8px 20px rgba(0, 0, 0, .5), 0 0 0 1px rgba(79, 224, 138, .35); }
.avatar {
  width: 34px; height: 34px; margin: 0 auto 5px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .4px;
  background: radial-gradient(circle at 35% 30%, #7d8fb8, #46557a);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35);
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* Cartinha com foto: a foto ocupa a parte de cima inteira (rosto e ombros), como nas telas de escalação */
.jogador.com-foto { padding-top: 4px; }
.jogador.com-foto .avatar {
  width: auto; height: 58px; margin: 0 1px 5px; border-radius: 3px;
  background: linear-gradient(180deg, #56688f, #2d3954); box-shadow: none;
}
.jogador.com-foto .avatar img { object-position: 50% 22%; }
.barra { height: 2px; margin: 0 9px 4px; border-radius: 2px; background: var(--verde); box-shadow: 0 0 6px rgba(79, 224, 138, .6); }
.nome {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

/* No campo: posição em %, escala menor quanto mais "longe" (alto do campo), definida no app.js */
.campo .jogador { position: absolute; transform: translate(-50%, -50%) scale(var(--escala, 1)); }

/* "+" para cadastrar */
.novo {
  flex: none; width: 64px; min-height: 76px; border-radius: 5px; cursor: pointer;
  border: 1px dashed rgba(170, 190, 230, .35); color: var(--texto-2);
  display: grid; place-items: center; transition: border-color .15s, color .15s;
}
.novo:hover { border-color: var(--verde); color: var(--verde); }
.novo .mais { font-size: 26px; font-weight: 300; }
.novo input {
  display: none; padding: 5px; font-size: 13px;
  border: 1px solid var(--vidro-borda); border-radius: 4px; background: rgba(15, 20, 30, .8); color: var(--texto);
}
.novo.editando { width: 116px; cursor: default; }
.novo.editando .mais { display: none; }
.novo.editando input { display: block; width: 100px; }

/* Editar / remover: aparecem ao passar o mouse na cartinha (só para o adm) */
.acao {
  display: none; position: absolute; top: -8px; width: 20px; height: 20px; padding: 0; z-index: 2;
  border-radius: 50%; border: 1px solid var(--vidro-borda); background: #141a26; color: var(--texto);
  font-size: 11px; line-height: 18px; cursor: pointer;
}
.acao.editar { left: -8px; }
.acao.remover { right: -8px; }
.acao.editar:hover { border-color: var(--verde); color: var(--verde); }
.acao.remover:hover { border-color: var(--perigo); color: var(--perigo); }
.jogador:hover .acao { display: block; }
.leitura .acao, .fantasma .acao, .arrastando .acao { display: none !important; }
.editando-nome {
  width: 58px; padding: 1px; font: inherit; font-size: 10px; text-align: center;
  border: 1px solid var(--verde); border-radius: 3px; background: #141a26; color: var(--texto);
}

/* Arrastar */
.jogador.arrastando { opacity: .25; }
.fantasma { position: fixed; pointer-events: none; z-index: 1000; opacity: .95; transform: rotate(-2deg) scale(1.05); }

/* Somente leitura (histórico ou visitante) */
.leitura .banco, .leitura #data { display: none; }
.leitura .jogador { cursor: default; }
.leitura .jogador:hover { border-color: rgba(170, 190, 230, .28); box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* ---------- Login ---------- */
.login {
  max-width: 340px; margin: 12vh auto; padding: 28px; border-radius: 8px;
  background: var(--vidro); border: 1px solid var(--vidro-borda); backdrop-filter: blur(6px);
}
.login h1 { font-size: 20px; font-weight: 800; font-style: italic; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login input, .login button { width: 100%; padding: 9px 12px; }
.login .erro { color: var(--perigo); min-height: 1em; margin: 0; }
.login .marca { display: block; border: 0; padding: 0; margin-bottom: 14px; font-size: 26px; }

/* ---------- Cadastro de jogadores (resources/views/jogadores.blade.php) ---------- */
.cadastro { flex: 1; min-height: 0; padding: 14px 24px 18px; display: flex; justify-content: center; }
.cadastro > .painel { width: 100%; max-width: 900px; margin: 0; padding: 14px 16px; display: flex; flex-direction: column; min-height: 0; }
.barra-ferramentas { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.busca, .novo-jogador input {
  padding: 8px 12px; border-radius: 4px; border: 1px solid var(--vidro-borda);
  background: rgba(15, 20, 30, .7); color: var(--texto); font-size: 13px;
}
.busca { width: 260px; }
.busca:focus, .novo-jogador input:focus { outline: none; border-color: var(--verde); }
.novo-jogador { display: flex; gap: 8px; }
.novo-jogador input { width: 230px; }
.novo-jogador button { padding: 8px 16px; background: var(--verde); color: #0d1119; border-color: var(--verde); font-weight: 600; }
.novo-jogador button:hover { filter: brightness(1.1); }
.abas { display: flex; align-items: flex-end; gap: 4px; margin: 14px 0 0; border-bottom: 1px solid var(--vidro-borda); }
.aba { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--texto-2); padding: 8px 12px; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.aba:hover { color: var(--texto); border-color: transparent; }
.aba.ativa { color: var(--verde); border-bottom-color: var(--verde); }
.aba span { margin-left: 4px; opacity: .7; }
.aviso-cadastro { margin: 0 0 8px auto; color: var(--texto-2); font-size: 11px; }
.aviso-cadastro b { color: var(--texto); font-weight: 600; }

.tabela-rolagem { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(150, 170, 210, .3) transparent; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th {
  position: sticky; top: 0; z-index: 1; background: #1b2232;
  padding: 10px 12px; text-align: left; color: var(--texto-2);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--vidro-borda);
}
.tabela td { padding: 8px 12px; border-bottom: 1px solid rgba(150, 170, 210, .07); vertical-align: middle; }
.tabela tbody tr:hover { background: rgba(255, 255, 255, .03); }
.tabela .col-foto { width: 64px; }
.tabela .col-num { width: 90px; text-align: center; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.tabela .col-acoes { width: 170px; text-align: right; }
.tabela .avatar { width: 38px; height: 38px; margin: 0; font-size: 12px; }
.nome-jogador { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.tabela tr.removido .nome-jogador, .tabela tr.removido .avatar { opacity: .5; }
.acoes { display: inline-flex; gap: 4px; }
.btn-icone {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--texto-2);
}
.btn-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone:hover { background: rgba(255, 255, 255, .06); border-color: var(--vidro-borda); color: var(--verde); }
.btn-icone.perigo:hover { color: var(--perigo); border-color: rgba(255, 107, 107, .4); }
.campo-nome { width: 100%; max-width: 260px; padding: 5px 8px; border-radius: 4px; border: 1px solid var(--verde); background: rgba(15, 20, 30, .8); color: var(--texto); font-size: 13px; }
.detalhe { color: var(--texto-2); font-size: 11px; margin-top: 3px; }
.vazio-lista { color: var(--texto-2); padding: 18px 12px; margin: 0; }
.leitura .so-admin { display: none !important; }

/* Sem o banco (visitante ou histórico), as reservas não encostam no fim da página */
.leitura .times { padding-bottom: 16px; }

/* ---------- Janela de enquadramento da foto ---------- */
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(0, 0, 0, .6); }
.modal-caixa {
  padding: 20px; border-radius: 8px;
  transform: translateY(-8vh); /* um pouco acima do meio */
  background: #151b28; border: 1px solid var(--vidro-borda); box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.modal-caixa h2 { margin: 0; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.modal-caixa .detalhe { margin: 6px 0 12px; line-height: 1.4; }
.corte-tela { display: block; width: 280px; height: 280px; margin: 0 auto; border-radius: 6px; background: #0d1119; cursor: crosshair; touch-action: none; }
.corte-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 10px 4px; color: var(--texto-2); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.corte-zoom input { flex: 1; accent-color: var(--verde); }
.modal-botoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-botoes button { padding: 8px 14px; }
.modal-botoes .primario { background: var(--verde); color: #0d1119; border-color: var(--verde); font-weight: 600; }
.modal-botoes .primario.perigo { background: var(--perigo); border-color: var(--perigo); color: #fff; }
.modal-botoes .primario:hover { filter: brightness(1.1); }
.confirma-mensagem { margin: 8px 0 4px; font-size: 13px; }
