/* JVFoot — visual de jogo de PC dos anos 2000 (janelas cinza, barra azul, tabelas), adaptado pro celular. */
:root {
  --win: #d4d0c8;
  --win-l: #ffffff;
  --win-m: #dfdfdf;
  --win-d: #808080;
  --win-dd: #404040;
  --title1: #0a246a;
  --title2: #3a6ea5;
  --title3: #a6caf0;
  --sel: #0a246a;
  --sel-t: #ffffff;
  --verde: #2e7d32;
  --verde-c: #dff0d8;
  --vermelho: #c62828;
  --vermelho-c: #f8d7d7;
  --azul-c: #dbe7fb;
  --amarelo-c: #fff4c2;
  --font: Verdana, Tahoma, "Segoe UI", Geneva, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #008080;
  font: 13px/1.3 var(--font);
  color: #000;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
input, select, textarea { -webkit-user-select: text; user-select: text; }
button { font-family: var(--font); color: #000; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  background: var(--win);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 600px) {
  #app { border-left: 2px solid var(--win-dd); border-right: 2px solid var(--win-dd); }
}

.scr { display: flex; flex-direction: column; flex: 1; min-height: 100vh; }

/* ---------- janela ---------- */
.titlebar {
  background: linear-gradient(90deg, var(--title1), var(--title2) 70%, var(--title3));
  color: #fff;
  font-weight: bold;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.titlebar .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.titlebar .ico { width: 16px; height: 16px; flex: none; }
.app-top { position: sticky; top: 0; z-index: 20; padding-top: var(--safe-t); background: var(--title1); }

.bevel, .panel {
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  box-shadow: inset -1px -1px var(--win-d), inset 1px 1px var(--win-m);
  background: var(--win);
}
.sunken {
  border: 2px solid;
  border-color: var(--win-d) var(--win-l) var(--win-l) var(--win-d);
  box-shadow: inset 1px 1px var(--win-dd);
  background: #fff;
}
.panel { margin: 6px; padding: 8px; }
.panel > h3, .grp > h3 {
  margin: -2px 0 6px;
  font-size: 12px;
  color: var(--title1);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.grp {
  border: 1px solid var(--win-d);
  box-shadow: 1px 1px 0 var(--win-l), inset 1px 1px 0 var(--win-l);
  margin: 10px 6px 6px;
  padding: 10px 8px 8px;
  position: relative;
}
.grp > .lg {
  position: absolute;
  top: -8px;
  left: 8px;
  background: var(--win);
  padding: 0 4px;
  font-weight: bold;
  color: var(--title1);
  font-size: 12px;
}

/* ---------- botões ---------- */
.btn {
  background: var(--win);
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  box-shadow: inset -1px -1px var(--win-d), inset 1px 1px var(--win-m);
  padding: 8px 12px;
  font: bold 13px var(--font);
  min-height: 38px;
  cursor: pointer;
  border-radius: 0;
  touch-action: manipulation;
}
.btn:active, .btn.on {
  border-color: var(--win-dd) var(--win-l) var(--win-l) var(--win-dd);
  box-shadow: inset 1px 1px var(--win-d);
  padding: 9px 11px 7px 13px;
}
.btn.on { background: #e8e6e0; }
.btn:disabled { color: var(--win-d); text-shadow: 1px 1px #fff; }
.btn.sm { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.btn.sm:active, .btn.sm.on { padding: 5px 7px 3px 9px; }
.btn.go { background: #3c8c3c; color: #fff; border-color: #8fd18f #134d13 #134d13 #8fd18f; box-shadow: inset -1px -1px #1f6a1f, inset 1px 1px #64b464; text-shadow: 1px 1px #134d13; }
.btn.go:active { border-color: #134d13 #8fd18f #8fd18f #134d13; }
.btn.go:disabled { background: var(--win); color: var(--win-d); text-shadow: 1px 1px #fff; border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l); box-shadow: inset -1px -1px var(--win-d), inset 1px 1px var(--win-m); }
.btn.danger { color: var(--vermelho); }
.btn.wide { width: 100%; }
.btn.big { min-height: 48px; font-size: 15px; }
.row { display: flex; gap: 6px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; }
.btns .btn { flex: 1 1 auto; }

/* ---------- abas ---------- */
.tabs {
  display: flex;
  gap: 0;
  padding: 6px 6px 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--win-l);
  position: relative;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: var(--win);
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) transparent var(--win-l);
  border-bottom: 0;
  margin-right: -2px;
  padding: 6px 10px 5px;
  font: 12px var(--font);
  white-space: nowrap;
  position: relative;
  top: 2px;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
}
.tabs button.on {
  font-weight: bold;
  top: 0;
  padding-bottom: 9px;
  z-index: 2;
  background: var(--win);
}

/* ---------- tabelas ---------- */
.tbl-wrap { margin: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; width: 100%; background: #fff; font-size: 12.5px; }
table.grid th {
  background: var(--win);
  border: 1px solid;
  border-color: var(--win-l) var(--win-d) var(--win-d) var(--win-l);
  font-weight: normal;
  text-align: left;
  padding: 3px 4px;
  white-space: nowrap;
  font-size: 11.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.grid td { border-bottom: 1px solid #e6e4dc; padding: 6px 4px; white-space: nowrap; }
table.grid tr:nth-child(even) td { background: #f7f6f2; }
table.grid tr.sel td { background: var(--sel); color: var(--sel-t); }
table.grid tr.eu td { background: var(--amarelo-c); font-weight: bold; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:active td { background: #c8d6f0; }
table.grid td.n, table.grid th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.c, table.grid th.c { text-align: center; }
table.grid td.nome { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
table.grid tr.z-lib td:first-child { box-shadow: inset 4px 0 #1565c0; }
table.grid tr.z-sul td:first-child { box-shadow: inset 4px 0 #2e9e46; }
table.grid tr.z-sobe td:first-child { box-shadow: inset 4px 0 #2e9e46; }
table.grid tr.z-po td:first-child { box-shadow: inset 4px 0 #9ccc65; }
table.grid tr.z-cai td:first-child { box-shadow: inset 4px 0 #d32f2f; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; padding: 2px 8px 6px; color: #333; }
.legenda i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }

/* ---------- peças ---------- */
.pos {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: bold;
  font-size: 11px;
  padding: 1px 3px;
  color: #fff;
  border: 1px solid rgba(0,0,0,.35);
}
.pos.G { background: #e09b00; }
.pos.L { background: #1e7fd8; }
.pos.Z { background: #0b4f94; }
.pos.M { background: #2e8b57; }
.pos.A { background: #c0392b; }
.chip {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid;
  font-weight: bold;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.45;
}
.chip.lg { font-size: 14px; padding: 3px 8px; }
.chip.xl { font-size: 16px; padding: 5px 10px; }
.stars { color: #b8860b; letter-spacing: -1px; font-size: 12px; }
.stars .off { color: #c9c4b8; }
.f { font-weight: bold; }
.f.f90 { color: #6a1b9a; }
.f.f80 { color: #1b5e20; }
.f.f70 { color: #2e7d32; }
.f.f60 { color: #8d6e00; }
.f.f00 { color: #8a3b12; }
.bar { display: inline-block; width: 46px; height: 9px; border: 1px solid var(--win-d); background: #fff; vertical-align: middle; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; }
.tag { display: inline-block; font-size: 10.5px; padding: 0 3px; border: 1px solid; margin-left: 3px; vertical-align: 1px; font-weight: bold; }
.tag.inj { color: #c62828; border-color: #c62828; background: #fff0f0; }
.tag.susp { color: #fff; background: #c62828; border-color: #8e0000; }
.tag.venda { color: #0b5d1e; border-color: #0b5d1e; background: #eaf7ea; }
.tag.star { color: #8a6d00; border-color: #c9a400; background: #fff7cc; }
.tag.ca { background: #f4d03f; border-color: #b7950b; color: #000; }
.st {
  display: inline-block;
  width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 11px;
  padding: 4px 0;
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  cursor: pointer;
}
.st.T { background: #3c8c3c; color: #fff; }
.st.R { background: #f1c40f; color: #000; }
.st.X { background: var(--win); color: var(--win-d); }
.muted { color: #555; }
.small { font-size: 11px; }
.big-num { font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; }
.pos-num { color: #fff; background: var(--title1); padding: 0 5px; font-weight: bold; }
.pad { padding: 8px; }
.center { text-align: center; }
.right { text-align: right; }
.hr { height: 0; border-top: 1px solid var(--win-d); border-bottom: 1px solid var(--win-l); margin: 8px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.kv > b { font-weight: normal; color: #444; }
.kv > span { font-weight: bold; }
.ok { color: var(--verde); font-weight: bold; }
.ruim { color: var(--vermelho); font-weight: bold; }

/* ---------- barra de informações e navegação ---------- */
.infobar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--win-d);
  background: var(--win);
  font-size: 12px;
}
.infobar .chip { max-width: 40%; }
.infobar .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; padding-bottom: calc(66px + var(--safe-b)); }
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 4px 4px calc(4px + var(--safe-b));
  background: var(--win);
  border-top: 2px solid var(--win-l);
  box-shadow: 0 -1px 0 var(--win-d);
  z-index: 30;
}
.nav button {
  background: var(--win);
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  box-shadow: inset -1px -1px var(--win-d), inset 1px 1px var(--win-m);
  font: 11px var(--font);
  padding: 4px 0 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 48px;
  cursor: pointer;
}
.nav button .i { font-size: 18px; line-height: 20px; }
.nav button.on { border-color: var(--win-dd) var(--win-l) var(--win-l) var(--win-dd); box-shadow: inset 1px 1px var(--win-d); background: #e8e6e0; font-weight: bold; }
.badge { background: var(--vermelho); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; margin-left: 2px; font-weight: bold; }

/* ---------- caixa de mensagem / diálogo ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 var(--safe-b);
}
@media (min-height: 700px) { .modal-bg { align-items: center; padding: 16px; } }
.dlg {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--win);
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  box-shadow: inset -1px -1px var(--win-d), inset 1px 1px var(--win-m), 4px 4px 0 rgba(0,0,0,.35);
}
.dlg .titlebar .x {
  width: 26px;
  height: 22px;
  min-height: 0;
  padding: 0;
  font: bold 13px var(--font);
  background: var(--win);
  border: 2px solid;
  border-color: var(--win-l) var(--win-dd) var(--win-dd) var(--win-l);
  color: #000;
  line-height: 16px;
}
.dlg .body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; }
.dlg .foot { display: flex; gap: 6px; padding: 6px 8px 8px; }
.dlg .foot .btn { flex: 1; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-b));
  transform: translateX(-50%);
  max-width: 92%;
  background: #ffffe1;
  border: 1px solid #000;
  padding: 8px 12px;
  z-index: 200;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
  font-size: 12.5px;
}

/* ---------- formulários ---------- */
.inp, select.inp {
  font: 14px var(--font);
  padding: 6px;
  border: 2px solid;
  border-color: var(--win-d) var(--win-l) var(--win-l) var(--win-d);
  box-shadow: inset 1px 1px var(--win-dd);
  background: #fff;
  border-radius: 0;
  min-height: 36px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
select.inp { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23000'/%3E%3C/svg%3E") no-repeat right 8px center; padding-right: 24px; }
label.lbl { display: block; font-size: 11.5px; margin: 6px 0 3px; color: #222; }
.stepper { display: flex; gap: 4px; align-items: stretch; }
.stepper .inp { text-align: center; font-weight: bold; }
.stepper .btn { min-width: 44px; padding: 0; }

/* ---------- tela de título ---------- */
.titulo {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #008080;
}
.titulo .janela { margin: auto 12px; }
.logo {
  font-family: "Arial Black", Impact, var(--font);
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
  color: #ffde00;
  text-shadow: 3px 3px 0 #0a246a, -1px -1px 0 #0a246a, 1px -1px 0 #0a246a, -1px 1px 0 #0a246a, 5px 5px 0 rgba(0,0,0,.3);
  line-height: 1;
  font-style: italic;
}
.logo small { font-size: 24px; color: #fff; }
.logo-wrap {
  background: linear-gradient(180deg, #2f8f2f, #1f6f1f);
  padding: 22px 10px 16px;
  border-bottom: 2px solid var(--win-dd);
  position: relative;
  overflow: hidden;
}
.logo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 28px, transparent 28px 56px);
}
.logo-wrap .sub { color: #fff; text-align: center; font-size: 12px; margin-top: 8px; position: relative; text-shadow: 1px 1px #0a3a0a; }
.credito { text-align: center; color: #fff; font-size: 12px; padding: 14px 10px calc(14px + var(--safe-b)); text-shadow: 1px 1px #004040; }
.credito b { color: #ffde00; }

/* ---------- partida ---------- */
.placar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #101010;
  color: #fff;
  border-bottom: 2px solid #000;
}
.placar .time { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.placar .time.r { align-items: flex-end; }
.placar .gols { font: bold 30px/1 "Courier New", monospace; color: #ffde00; text-align: center; min-width: 96px; letter-spacing: 2px; }
.placar .min { font: bold 12px var(--font); color: #7CFC00; text-align: center; }
.placar .agg { font-size: 10.5px; color: #bbb; text-align: center; }
.placar .scor { font-size: 10.5px; color: #ccc; white-space: normal; line-height: 1.25; }
.campo { display: block; width: 100%; background: #2f7f2f; touch-action: none; }
.ticker { background: #ffffe1; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 5px 8px; font-size: 12.5px; min-height: 30px; }
.ticker.gol { background: #ffde00; font-weight: bold; }
.lances { max-height: 32vh; overflow-y: auto; background: #fff; margin: 6px; }
.lance { padding: 5px 6px; border-bottom: 1px solid #eee; font-size: 12.5px; display: flex; gap: 6px; }
.lance .t { color: #555; min-width: 38px; font-variant-numeric: tabular-nums; }
.lance.gol { background: #fff7b3; font-weight: bold; }
.lance.vermelho { background: #fde0e0; }
.lance.info, .lance.inicio, .lance.intervalo, .lance.fim, .lance.reinicio { background: #e9eef8; color: #0a246a; font-weight: bold; }
.ctrl { position: sticky; bottom: 0; display: flex; gap: 4px; padding: 5px 5px calc(5px + var(--safe-b)); background: var(--win); border-top: 2px solid var(--win-l); z-index: 5; }
.ctrl .btn { flex: 1; padding: 4px 2px; font-size: 12px; min-height: 44px; }
.outro { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px; align-items: center; padding: 4px 6px; border-bottom: 1px solid #eee; background: #fff; font-size: 12px; }
.outro .r { text-align: right; }
.outro .pl { font: bold 13px "Courier New", monospace; min-width: 44px; text-align: center; background: #111; color: #ffde00; padding: 1px 4px; }
.outro.flash .pl { background: #ffde00; color: #000; }
.estat { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 8px; padding: 8px; background: #fff; margin: 6px; font-size: 12.5px; }
.estat .r { text-align: right; }
.estat .c { text-align: center; color: #555; }

/* ---------- tática ---------- */
.mini-campo { position: relative; background: repeating-linear-gradient(180deg, #3b8f3b 0 10%, #348434 10% 20%); border: 2px solid #fff; outline: 2px solid #1f5f1f; aspect-ratio: 68 / 80; margin: 6px; max-height: 52vh; }
.mini-campo .jog { position: absolute; transform: translate(-50%, -50%); text-align: center; width: 68px; }
.mini-campo .jog .bola { width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 2px; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font: bold 10px var(--font); color: #fff; box-shadow: 1px 1px 2px rgba(0,0,0,.5); }
.mini-campo .jog .nm { font-size: 10px; color: #fff; text-shadow: 1px 1px 1px #000, -1px -1px 1px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-campo .linha-meio { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255,255,255,.7); }
.mini-campo .area { position: absolute; left: 25%; right: 25%; bottom: 0; height: 15%; border: 2px solid rgba(255,255,255,.7); border-bottom: 0; }

/* ---------- prêmios ---------- */
.trofeu { text-align: center; padding: 10px; background: linear-gradient(180deg, #fff8d6, #f3dc7a); border: 2px solid #b8860b; margin: 6px; }
.trofeu .nome { font-size: 18px; font-weight: bold; }
.trofeu .ic { font-size: 36px; }
.premio { display: flex; gap: 8px; align-items: center; padding: 6px; background: #fff; border-bottom: 1px solid #eee; }
.premio .ic { font-size: 22px; width: 30px; text-align: center; }
.msg { padding: 7px 8px; border-bottom: 1px solid #e6e4dc; background: #fff; cursor: pointer; display: flex; gap: 6px; align-items: flex-start; }
.msg.nao { font-weight: bold; background: #fffdf0; }
.msg .de { font-size: 11px; color: #555; font-weight: normal; }
.msg .ic { font-size: 16px; width: 22px; text-align: center; }
.lista { background: #fff; margin: 6px; }
.empty { padding: 16px; text-align: center; color: #555; }
.next { padding: 10px; background: #fff; }
.next .vs { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.scroll-x { overflow-x: auto; }
.hide { display: none !important; }
