/* ============================================================
   BOLÃO DAS COPAS — Responsive CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:ital,wght@0,300;0,400;0,600;0,700;1,300&display=swap');

:root {
  --gold:          #D4AF37;
  --gold-light:    #f0d060;
  --gold-dark:     #a08020;
  --black:         #0a0a0a;
  --dark:          #111318;
  --dark2:         #1a1d24;
  --dark3:         #22262f;
  --white:         #f5f5f0;
  --red:           #c0392b;
  --text:          #c8c4b0;
  --text-dim:      #7a7668;
  --border:        rgba(212,175,55,0.2);
  --border-strong: rgba(212,175,55,0.5);
  --c-gold:        #D4AF37;
  --c-black:       #000;
  --c-white:       #FFF;
  --c-red:         #E31A24;
  --c-blue:        #0D4B8F;
  --c-link:        #a08020;
  --c-link-hover:  #D4AF37;
  --c-secondary-color: #D4AF37;
  --font-main:     'Barlow', 'Helvetica Neue', sans-serif;
  --font-display:  'Bebas Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background-color: var(--black);
  text-align: left;
}

a { color: var(--gold-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }

h1, .h1 { font-family: var(--font-display); font-weight: 400; letter-spacing: 1px; font-size: 28px; }
h3 { border-bottom: 1px solid var(--border); padding-bottom: 6px; color: var(--white); }
ul { list-style: none; margin: 0; padding: 0; }

/* ==== SHELL ==== */
#container { min-height: 100vh; display: flex; flex-direction: column; }

/* HEADER */
#header {
  background: var(--dark);
  background-image: url("images/bg-bolao-2025.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: contain;
  height: 90px;
  border-bottom: 2px solid var(--gold-dark);
  position: relative;
  flex-shrink: 0;
}
#header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
#header h1 { margin: 0; padding: 12px 20px 0; font-family: var(--font-display); font-size: 28px; color: var(--gold); letter-spacing: 3px; }
#header h3  { margin: 0 0 0 1.2em; padding: 0; color: #ccc; font-size: 14px; font-style: italic; border: none; }

/* MENU */
#menu {
  background: var(--black);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.nav_menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
  min-height: 52px;
}
.nav_menu > li > a {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  padding: 16px 12px;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav_menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--gold);
  transition: all 0.2s;
}
.nav_menu > li > a:hover { color: var(--white); background: none; }
.nav_menu > li > a:hover::after { left: 8px; right: 8px; }

#nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--gold);
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  margin-left: auto;
}
#nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 6px 12px 14px;
}
#nav-mobile.open { display: flex; }
#nav-mobile a { display: block; padding: 10px 12px; color: var(--text-dim); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; }
#nav-mobile a:hover { color: var(--white); background: var(--dark2); }
#nav-mobile a.danger { color: var(--red); }

/* MIOLO */
#miolo { flex: 1; background: var(--dark); }

.conteudo {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
#miolo > .conteudo { min-height: 500px; }
#content { min-height: 400px; padding-top: 4px; }

/* TITLE PAGE BAR */
.titlePage {
  background: var(--dark2);
  border-bottom: 2px solid var(--gold);
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.titlePage::before { content: ''; width: 4px; background: var(--gold); flex-shrink: 0; }
.titlePage h2 {
  font-family: var(--font-display);
  font-size: clamp(16px, 3vw, 24px);
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--white);
  margin: 0;
  padding: 10px 16px;
  line-height: 1;
}

/* FOOTER */
#footer { text-align: center; background: var(--black); border-top: 1px solid var(--border); flex-shrink: 0; }
#footer .conteudo { color: var(--text-dim); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 16px 20px; }

/* ==== LOGIN LAYOUT ==== */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  padding-top: 24px;
}
section { min-height: unset; float: none; }
.imgPrincipal { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 6px; margin-bottom: 20px; }
.textoLateral { color: var(--text-dim); font-size: 12px; line-height: 1.6; margin-bottom: 12px; float: none; width: auto; }
.textoLateral time { display: block; font-style: italic; }
.texto { font-size: 14px; line-height: 1.8; font-weight: 300; color: var(--text); width: 100%; float: none; margin: 0; display: block; }
.texto p { margin: 0 0 12px; }
.meioLateral { width: 100%; float: none; }
.formParticipar { width: 100%; }

/* FORMS */
#formulario_login {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 20px;
  width: 100%;
  float: none;
  margin: 0;
}
#formulario_login p { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

input, textarea {
  background-color: var(--dark3);
  background-image: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: none;
  color: var(--white);
  display: block;
  font-family: var(--font-main);
  font-size: 15px;
  height: 40px;
  line-height: 1.4;
  padding: 8px 12px;
  transition: border-color 0.2s;
  vertical-align: middle;
  width: 100%;
}
textarea { height: auto; resize: vertical; }
input:hover, input:focus, textarea:hover, textarea:focus {
  background-color: var(--dark3);
  border-color: var(--gold);
  outline: none;
  color: var(--white);
}
.login_field { width: 100%; }

.button {
  width: 100%;
  cursor: pointer;
  background-color: var(--gold);
  color: var(--black);
  border: none;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  height: 46px;
  transition: all 0.2s;
}
.button:hover { background-color: var(--gold-light); }
.button-login { width: 100%; height: 42px; font-size: 17px; }
.button-flutu { height: 54px; font-size: 18px; }

/* ==== DASHBOARD ==== */
.whats_mural {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37,211,102,0.07);
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: 6px;
  padding: 10px 16px;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  margin-right: 0;
}
.whats_mural img { height: 32px; flex-shrink: 0; }

#calendario { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; margin-bottom: 24px; }
#jogos_do_dia { grid-column: 1; }
#proximos_jogos { grid-column: 1; }

#dados_pessoais {
  grid-row: 1 / span 2;
  grid-column: 2;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  float: none;
  width: 100%;
}
#dados_pessoais h2 { font-family: var(--font-display); font-size: 18px; color: var(--gold); letter-spacing: 1px; margin: 0 0 12px; border: none; }
#dados_pessoais p { margin: 0 0 8px; font-size: 14px; }
.image-inicio { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-dark); margin-bottom: 12px; }

#hall_da_fama { float: none; width: 100%; margin-top: 24px; background: var(--dark2); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
#hall_da_fama h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold); letter-spacing: 1px; margin: 0 0 14px; border: none; }
#hall_da_fama table { width: 100%; border-collapse: collapse; font-size: 13px; }
#hall_da_fama table tr { height: auto; border-bottom: 1px solid var(--border); }
#hall_da_fama table tr:last-child { border-bottom: none; }
#hall_da_fama table td { padding: 7px 6px; font-size: 13px; color: var(--text); }
.ano { font-family: var(--font-display); font-size: 17px; color: var(--gold); white-space: nowrap; }
.winners { color: var(--white); font-weight: 600; }
.comp { color: var(--text-dim); font-size: 11px; text-align: right; }

/* ==== JOGOS TABLES ==== */
.tab_grupo { margin-bottom: 28px; margin-top: 16px; }
.tab_grupo h1 { padding: 0; color: var(--gold); font-weight: 400; font-size: 13px; text-align: left; font-family: var(--font-display); letter-spacing: 1px; }
.tab_grupo_h { color: var(--text-dim); font-weight: 700; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: 1px; }
.tab_grupo_h td { border-bottom: 1px solid var(--border); padding: 6px 4px; }
.tab_grupo_1, .tab_grupo_2 { width: 100%; text-align: left; border-collapse: collapse; }
.tab_grupo_1 td, .tab_grupo_2 td { border-bottom: 1px solid var(--border); padding: 8px 4px; }
table tr { height: auto; color: var(--text); font-size: 14px; }
table tr:hover { background: rgba(212,175,55,0.03); }
.tab_grupo_hoje { margin: 8px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab_grupo_hoje table { min-width: 480px; width: 100%; }
.group_flag { height: 34px; width: auto; border-radius: 3px; }
.jogo_data { font-size: 13px; font-weight: 700; color: var(--gold); }
.jogo_local { line-height: 1.5; font-size: 11px; color: var(--text-dim); }
.jogo_grupo { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.time_logo_nome { margin-top: 0; align-items: center; display: flex !important; gap: 6px; }
.direction-right { direction: rtl; }
.direction-left  { direction: ltr; }
.pright { padding-right: 6px; margin: 0; }
.pleft  { padding-left: 6px; margin: 0; }

/* Score inputs */
.text_gols {
  height: 36px; width: 36px; font-size: 22px;
  padding: 0; margin: 0 1px;
  display: inline-block; text-align: center;
  background: var(--dark3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--white); font-family: var(--font-display);
}
.text_gols:hover, .text_gols:focus { border-color: var(--gold); outline: none; display: inline-block; }
.botao { width: auto; cursor: pointer; background: var(--gold); color: var(--black); border: none; border-radius: 4px; font-family: var(--font-display); font-size: 15px; letter-spacing: 1px; padding: 6px 16px; height: auto; transition: all 0.2s; }
.botao:hover { background: var(--gold-light); }

/* Floating submit */
.enviar-flutuante { position: fixed; bottom: 0; left: 0; right: 0; background: var(--dark); border-top: 1px solid var(--border); padding: 8px 20px; z-index: 50; display: flex; flex-direction: column; align-items: center; }
#saida { color: #4CAF50; font-size: 13px; margin-bottom: 4px; }
#caixa_baixo { text-align: center; padding: 6px; }

/* Group tabs */
.grupos-list { display: flex; flex-wrap: wrap; gap: 6px; height: auto; margin: 0 0 16px; padding: 0; }
.grupos-list li { width: auto; margin: 0; float: none; padding: 0; border: 1px solid var(--border); text-align: center; cursor: pointer; background: var(--dark2); border-radius: 4px; transition: all 0.2s; }
.grupos-list li:hover { border-color: var(--gold-dark); }
.grupos-list li a { display: block; padding: 7px 16px; text-decoration: none; color: var(--text-dim); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.grupos-list li:hover a { color: var(--gold); }
.grupos-list li.euro { padding: 0; }
.grupos-list li.americaeuro { padding: 0; }
.grupos-list li img { height: 28px; width: auto; display: block; }

.esconder { display: none !important; }
.mostrar  { display: block; }
.margin-top { margin-top: 16px; }

/* ==== RANKING ==== */
#ranking { margin-top: 12px; width: 100%; }
#ranking table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
#ranking table tr { height: auto; }
#ranking table tr td { padding: 10px 10px; }
.ranking-item { color: var(--text); background: var(--dark2); border: 1px solid var(--border); border-radius: 4px; transition: border-color 0.2s; }
.ranking-item:hover { border-color: var(--border-strong); }
.image-ranking { display: inline-block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); vertical-align: middle; }
.name-ranking { display: inline-block; margin: 0 0 0 10px; font-size: 15px; font-weight: 600; color: var(--white); vertical-align: middle; }

/* ==== EDIT ==== */
.edit-table td { padding: 8px 6px; vertical-align: middle; font-size: 14px; }
.edit-table td:first-child { white-space: nowrap; color: var(--text-dim); font-weight: 600; width: 160px; }

/* ==== MURAL ==== */
#mensagens { margin-top: 16px; padding: 12px; background: var(--dark2); border: 1px solid var(--border); border-radius: 6px; min-height: 200px; }
#alerta-mural { display: none; position: fixed; bottom: 10px; right: 16px; background: var(--dark2); border: 1px solid var(--border); border-radius: 20px; color: var(--gold); padding: 8px 20px; font-size: 13px; cursor: pointer; z-index: 200; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

/* ==== MISC ==== */
#data { font-style: italic; color: var(--gold); text-align: right; }
acronym { cursor: help; border-bottom: 1px dotted var(--text-dim); }
.image-inicio { top: auto; left: auto; }
.relatorio_jogo_column { width: 33%; float: left; }
.relatorio_jogo_row:after { content: ""; display: table; clear: both; }
.relatorio_jogo_title { padding-top: 14px; min-height: 40px; text-align: center; font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; padding-bottom: 10px; margin-bottom: 14px; color: var(--gold); }

/* ==== RESPONSIVE ==== */
@media (max-width: 900px) {
  #calendario { grid-template-columns: 1fr; }
  #dados_pessoais { grid-row: auto; grid-column: auto; margin-bottom: 16px; }
  .comp { display: none; }
}

@media (max-width: 768px) {
  .nav_menu > li { display: none; }
  #nav-hamburger { display: block; }
  #header { height: 64px; background-size: cover; }
  .conteudo { padding: 0 12px 32px; }
  .login-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
  .relatorio_jogo_column { width: 100%; float: none; }
}

@media (max-width: 480px) {
  #header { height: 50px; }
  .titlePage h2 { font-size: 15px; }
  .conteudo { padding: 0 10px 24px; }
  #formulario_login { padding: 16px 12px; }
  .name-ranking { font-size: 13px; }
}

/* ============================================================
   MOBILE FIX — MATCH BETTING ROWS (grupo_ajax.php table)
   The 6-column table is rebuilt as a flex card on mobile
   ============================================================ */

/* Wrapper for horizontal scroll on mid-size screens */
.tab_grupo { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {

  /* Turn each match row into a flex card */
  .tab_grupo_1 tr,
  .tab_grupo_2 tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }

  /* Hide the empty first column */
  .tab_grupo_1 td:first-child,
  .tab_grupo_2 td:first-child {
    display: none;
  }

  /* Date / local — full width on top */
  .tab_grupo_1 td:nth-child(2),
  .tab_grupo_2 td:nth-child(2) {
    width: 100%;
    order: 0;
    text-align: center;
  }

  /* Home team — left half */
  .tab_grupo_1 td:nth-child(3),
  .tab_grupo_2 td:nth-child(3) {
    flex: 1;
    min-width: 0;
    order: 1;
    text-align: right;
  }

  /* Score inputs — fixed center */
  .tab_grupo_1 td:nth-child(4),
  .tab_grupo_2 td:nth-child(4) {
    flex: 0 0 auto;
    order: 2;
    text-align: center;
    padding: 0 4px;
  }

  /* Away team — right half */
  .tab_grupo_1 td:nth-child(5),
  .tab_grupo_2 td:nth-child(5) {
    flex: 1;
    min-width: 0;
    order: 3;
    text-align: left;
  }

  /* Result / points — below everything */
  .tab_grupo_1 td:nth-child(6),
  .tab_grupo_2 td:nth-child(6) {
    width: 100%;
    order: 4;
    text-align: center;
    font-size: 12px;
    color: var(--gold);
  }

  /* Header row — hide on mobile, too cramped */
  .tab_grupo_h { display: none; }

  /* Team name + flag side by side, proper direction */
  .time_logo_nome {
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
  }
  .direction-right {
    direction: ltr;
    justify-content: flex-end;
  }
  .direction-left {
    direction: ltr;
    justify-content: flex-start;
  }
  .direction-right p { text-align: right; }
  .direction-left p  { text-align: left; }

  /* Flag size */
  .group_flag { height: 26px; }

  /* Score inputs — bigger tap targets */
  .text_gols {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  /* Team name font size */
  .pright, .pleft {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
  }

  /* Float submit button full width */
  .enviar-flutuante .button {
    font-size: 16px;
    height: 50px;
  }
}