/* ============================================================
   ZÉ APOSTAS · ARENA
   CSS filho da página Arena.
   Depende do app.css para identidade global, botões, nav e variáveis.
   Aqui ficam apenas layout, cards, seletor, fatores, resultado e modal.
   ============================================================ */

/* ------------------------------------------------------------
   1) BASE DA PÁGINA
   ------------------------------------------------------------ */
.za-arena-page{
  min-height:100vh;
  padding-bottom:calc(96px + env(safe-area-inset-bottom));
  overflow-x:hidden;
}

.za-arena-shell{
  width:100%;
  min-width:0;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:0;
  overflow-x:hidden;
}

.za-arena-grid{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:16px;
  min-width:0;
}

.za-arena-panel{
  position:relative;
  width:100%;
  min-width:0;
  max-width:100%;
  border-radius:28px;
  padding:18px;
  border:1px solid rgba(148,163,184,.16);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.07), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  box-shadow:0 16px 42px rgba(0,0,0,.22);
  overflow:hidden;
}

.za-arena-control-card{
  padding:18px;
}

.za-result-card{
  padding:18px;
}

.za-result-card[hidden]{
  display:none!important;
}

.za-arena-panel,
.za-select-duel,
.za-pick-card,
.za-team-preview,
.za-team-info{
  box-sizing:border-box;
}

/* ------------------------------------------------------------
   2) HELP NO CANTO DO CARD
   ------------------------------------------------------------ */
.za-arena-help-slot{
  position:absolute;
  top:14px;
  right:14px;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ------------------------------------------------------------
   3) FILTRO DE CAMPEONATO
   O JS pode renderizar select nativo ou botão custom.
   Este bloco cobre os dois para evitar visual quebrado.
   ------------------------------------------------------------ */
.za-filter-row{
  width:100%;
  min-width:0;
  display:flex!important;
  align-items:center;
  justify-content:center;
  padding:0 42px 14px 0;
  margin:0;
  overflow:visible;
}

.za-filter-row select{
  appearance:none;
  -webkit-appearance:none;
  width:min(100%,280px);
  min-height:42px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.30);
  background:
    radial-gradient(circle at top, rgba(56,189,248,.14), transparent 42%),
    linear-gradient(180deg, rgba(56,189,248,.12), rgba(255,255,255,.04));
  color:#d8f4ff;
  padding:0 16px;
  text-align:center;
  text-align-last:center;
  font-size:12px;
  font-weight:850;
  box-shadow:0 10px 24px rgba(56,189,248,.10);
  outline:none;
}

.za-league-select{
  position:relative;
  width:min(100%,280px);
  z-index:8;
}

.za-league-select-toggle{
  appearance:none;
  width:100%;
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(56,189,248,.30);
  background:
    radial-gradient(circle at top, rgba(56,189,248,.14), transparent 42%),
    linear-gradient(180deg, rgba(56,189,248,.12), rgba(255,255,255,.04));
  color:#d8f4ff;
  border-radius:999px;
  padding:10px 16px;
  font-size:12px;
  line-height:1.1;
  font-weight:850;
  text-align:center;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(56,189,248,.10);
}

.za-league-select-label{
  min-width:0;
  max-width:100%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.za-league-select-caret{
  display:none!important;
}

.za-league-select-menu{
  position:absolute;
  z-index:60;
  top:calc(100% + 8px);
  left:0;
  right:0;
  max-height:min(46vh,320px);
  overflow:auto;
  padding:8px;
  border:1px solid rgba(56,189,248,.22);
  border-radius:18px;
  background:linear-gradient(180deg, rgba(18,31,50,.98), rgba(9,17,30,.98));
  box-shadow:0 18px 48px rgba(0,0,0,.42);
}

.za-league-select-menu[hidden]{
  display:none!important;
}

.za-league-select-option{
  appearance:none;
  width:100%;
  min-height:40px;
  border:0;
  border-radius:13px;
  background:transparent;
  color:var(--za-text-soft);
  padding:10px 11px;
  font-size:12px;
  font-weight:760;
  text-align:center;
  cursor:pointer;
}

.za-league-select-option.is-active{
  color:#fff;
  background:rgba(56,189,248,.14);
}

/* ------------------------------------------------------------
   4) DUELO MANDANTE x VISITANTE
   Corrige o card clicável, proporção, respiro e alinhamento.
   ------------------------------------------------------------ */
.za-select-duel{
  width:100%;
  min-width:0;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 38px minmax(0,1fr);
  gap:10px;
  align-items:stretch;
  margin:0 0 14px;
}

.za-select-vs{
  align-self:center;
  justify-self:center;
  display:grid;
  place-items:center;
  width:38px;
  min-width:38px;
  height:38px;
  border-radius:999px;
  color:#cfe8f8;
  font-size:13px;
  line-height:1;
  font-weight:1000;
  text-transform:uppercase;
  background:rgba(7,14,24,.28);
  border:1px solid rgba(148,163,184,.12);
  box-shadow:0 10px 20px rgba(0,0,0,.16);
}

.za-pick-card{
  --arena-role-color:rgba(56,189,248,.62);
  position:relative;
  min-width:0;
  min-height:236px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  padding:12px;
  border-radius:24px;
  border:1px solid var(--arena-role-color);
  background:
    radial-gradient(circle at top, rgba(255,255,255,.11), transparent 30%),
    linear-gradient(180deg, rgba(18,31,50,.94), rgba(10,19,33,.94));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.035), 0 14px 30px rgba(0,0,0,.18);
  overflow:hidden;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  transition:transform .10s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
}

.za-pick-card:active{
  transform:translateY(1px) scale(.99);
  filter:brightness(.96);
}

.za-pick-card:focus{
  outline:none;
}

.za-pick-card:focus-visible{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05), 0 0 0 4px rgba(56,189,248,.12), 0 14px 30px rgba(0,0,0,.18);
}

.za-pick-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.88;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.11), transparent 24%),
    linear-gradient(145deg, var(--team-color-1, rgba(56,189,248,.22)) 0%, transparent 58%),
    linear-gradient(320deg, var(--team-color-2, rgba(15,23,42,.88)) 0%, transparent 54%),
    radial-gradient(circle at 78% 20%, var(--team-color-3, rgba(56,189,248,.18)) 0%, transparent 25%);
}

.za-pick-home{
  --arena-role-color:rgba(56,189,248,.62);
}

.za-pick-away{
  --arena-role-color:rgba(255,111,97,.64);
}

.za-pick-home:not(.has-team)::before{
  background:radial-gradient(circle at 20% 0%, rgba(56,189,248,.18), transparent 46%), rgba(255,255,255,.015);
}

.za-pick-away:not(.has-team)::before{
  background:radial-gradient(circle at 80% 0%, rgba(255,111,97,.18), transparent 46%), rgba(255,255,255,.015);
}

.za-pick-head,
.za-team-choice,
.za-team-preview{
  position:relative;
  z-index:1;
}

.za-pick-head{
  display:grid;
  grid-template-columns:1fr 42px;
  align-items:center;
  gap:8px;
  min-height:36px;
  margin-bottom:8px;
}

.za-pick-label{
  min-width:0;
  color:#fff;
  font-size:12px;
  line-height:1.05;
  font-weight:900;
  text-align:center;
  text-shadow:0 2px 8px rgba(0,0,0,.38);
}

.za-team-choice{
  display:grid;
  place-items:center;
  min-height:40px;
  padding:0 10px;
  border-radius:15px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(7,14,24,.34);
  text-align:center;
}

.za-team-choice-label{
  display:block;
  width:100%;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#fff;
  font-size:14px;
  line-height:1.1;
  font-weight:950;
  text-shadow:-1px -1px 0 rgba(0,0,0,.70), 1px -1px 0 rgba(0,0,0,.70), -1px 1px 0 rgba(0,0,0,.70), 1px 1px 0 rgba(0,0,0,.70), 0 2px 6px rgba(0,0,0,.28);
}

.za-team-preview{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  padding-top:9px;
}

.za-team-name-wrap{
  display:none;
}

.za-team-info{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border-radius:18px;
  background:rgba(7,14,24,.34);
  border:1px solid rgba(255,255,255,.07);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.za-team-text{
  margin:0;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(248,250,252,.92);
  font-size:12px;
  line-height:1.32;
  font-weight:650;
  text-align:center;
}

/* ------------------------------------------------------------
   5) SELOS: CLASSE, ATAQUE E DEFESA
   Emoji como fundo; número perfeitamente centralizado.
   ------------------------------------------------------------ */
.za-level-seal,
.za-seal{
  position:relative;
  display:grid!important;
  place-items:center;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin:0!important;
  overflow:visible;
}

.za-level-seal{
  width:42px;
  height:36px;
  justify-self:end;
}

.za-seal-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
  margin:0;
}

.za-seal{
  min-width:0;
  width:100%;
  min-height:40px;
}

.za-seal-bg{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-size:28px;
  line-height:1;
  pointer-events:none;
  transform:none;
}

.za-level-seal .za-seal-bg{
  font-size:31px;
  transform:translateY(-2px);
}

.za-seal-number{
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  min-width:18px;
  min-height:18px;
  color:#fff;
  font-size:18px;
  line-height:1;
  font-weight:1000;
  text-align:center;
  transform:translateY(1px);
  text-shadow:-2px -2px 0 rgba(0,0,0,.88), 2px -2px 0 rgba(0,0,0,.88), -2px 2px 0 rgba(0,0,0,.88), 2px 2px 0 rgba(0,0,0,.88), 0 2px 8px rgba(0,0,0,.35);
}

.za-level-seal .za-seal-number{
  transform:translateY(-1px);
}

/* ------------------------------------------------------------
   6) FATORES DE CAMPO
   ------------------------------------------------------------ */
.za-field-factors{
  width:100%;
  min-width:0;
  display:grid!important;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
  margin:14px 0;
}

.za-factor-btn{
  appearance:none;
  width:100%;
  min-width:0;
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background:rgba(255,255,255,.045);
  color:var(--za-text-soft);
  font-size:12px;
  line-height:1.05;
  font-weight:760;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
  transition:transform .10s ease, background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.za-factor-btn:active{
  transform:translateY(1px) scale(.99);
}

.za-factor-btn.is-active{
  color:#fff;
  border-color:rgba(246,199,98,.34);
  background:linear-gradient(180deg, rgba(246,199,98,.22), rgba(246,199,98,.10));
  box-shadow:0 10px 20px rgba(246,199,98,.10);
}

/* ------------------------------------------------------------
   7) AÇÃO PRINCIPAL
   ------------------------------------------------------------ */
.za-actions{
  display:flex!important;
  justify-content:center;
  margin-top:6px;
}

.za-actions .za-btn{
  width:min(100%,360px);
}

.za-actions .za-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.za-empty{
  margin-top:12px;
  border-radius:16px;
  padding:12px;
  color:var(--za-text-soft);
  background:rgba(255,255,255,.025);
  border:1px dashed rgba(148,163,184,.16);
  font-size:13px;
  line-height:1.45;
}

/* ------------------------------------------------------------
   8) RESULTADO DA SIMULAÇÃO
   ------------------------------------------------------------ */
.za-estimate{
  display:flex;
  flex-direction:column;
  gap:12px;
  text-align:center;
}

.za-estimate-title{
  margin:0;
  color:var(--za-text);
  font-size:17px;
  line-height:1.1;
  font-weight:900;
  letter-spacing:-.02em;
}

.za-estimate-score{
  color:#fff;
  font-size:34px;
  line-height:1;
  font-weight:1000;
  letter-spacing:-.04em;
}

.za-estimate-sub{
  color:var(--za-text-soft);
  font-size:13px;
  line-height:1.35;
  font-weight:650;
}

.za-probability-strip{
  display:flex;
  overflow:hidden;
  width:100%;
  height:12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.045);
}

.za-probability-strip span{
  display:block;
  height:100%;
  min-width:4px;
  transition:width .18s ease;
}

.za-prob-home{ background:rgba(56,189,248,.92); }
.za-prob-draw{ background:rgba(148,163,184,.72); }
.za-prob-away{ background:rgba(255,111,97,.92); }

.za-probability-row{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:8px;
}

.za-probability-row div{
  min-width:0;
  padding:9px 7px;
  border-radius:15px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(148,163,184,.10);
  text-align:center;
}

.za-probability-row span{
  display:block;
  color:#fff;
  font-size:18px;
  line-height:1;
  font-weight:1000;
}

.za-probability-row small{
  display:block;
  margin-top:5px;
  color:var(--za-text-soft);
  font-size:10px;
  line-height:1.1;
  text-transform:uppercase;
  font-weight:850;
}

.za-reading-block{
  text-align:left;
  border-radius:18px;
  padding:12px;
  background:rgba(7,14,24,.24);
  border:1px solid rgba(148,163,184,.10);
}

.za-reading-title{
  margin:0 0 7px;
  color:var(--za-blue);
  font-size:11px;
  line-height:1.1;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:1000;
}

.za-reading-text{
  margin:0;
  color:rgba(248,250,252,.84);
  font-size:13px;
  line-height:1.5;
}

.za-error{
  margin-top:10px;
  border-radius:14px;
  padding:10px 12px;
  color:#ffd7df;
  background:rgba(251,113,133,.12);
  border:1px solid rgba(251,113,133,.18);
  font-size:12px;
  line-height:1.5;
}

/* ------------------------------------------------------------
   9) MODAL SELETOR DE TIMES
   ------------------------------------------------------------ */
.za-team-selector-modal[hidden]{
  display:none!important;
}

.za-team-selector-modal{
  position:fixed;
  inset:0;
  z-index:9998;
  display:grid;
  align-items:end;
  padding:14px;
}

.za-team-selector-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.60);
  backdrop-filter:blur(8px);
}

.za-team-selector-sheet{
  position:relative;
  z-index:1;
  width:min(560px,100%);
  max-height:min(76vh,680px);
  margin:0 auto;
  overflow:hidden;
  border:1px solid rgba(56,189,248,.20);
  border-radius:24px;
  background:linear-gradient(180deg, rgba(18,31,50,.98), rgba(9,17,30,.98));
  box-shadow:0 26px 70px rgba(0,0,0,.42);
  padding:16px;
  display:grid;
  grid-template-rows:auto auto auto 1fr;
  gap:8px;
}

.za-team-selector-close{
  position:absolute;
  top:12px;
  right:12px;
  width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
}

.za-team-selector-close:active{
  transform:scale(.96);
}

.za-team-selector-kicker{
  color:var(--za-blue);
  font-size:11px;
  line-height:1;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.za-team-selector-sheet h2{
  margin:0 40px 0 0;
  color:#fff;
  font-size:19px;
  line-height:1.1;
  font-weight:1000;
}

.za-team-selector-sheet p{
  margin:0;
  color:var(--za-text-soft);
  font-size:12.5px;
  line-height:1.45;
}

.za-team-selector-grid{
  min-height:0;
  overflow:auto;
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
  padding:4px 2px 2px;
  scrollbar-width:thin;
}

.za-team-option{
  appearance:none;
  position:relative;
  overflow:hidden;
  min-height:46px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);
  color:#fff;
  padding:12px 13px;
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  transition:transform .10s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
}

.za-team-option:active{
  transform:translateY(1px) scale(.99);
  filter:brightness(.96);
}

.za-team-option.is-selected{
  border-color:rgba(56,189,248,.60);
  box-shadow:0 0 0 1px rgba(56,189,248,.14);
}

.za-team-option.is-opponent:not(.is-selected){
  opacity:.62;
}

.za-team-option-name{
  position:relative;
  z-index:1;
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:13px;
  line-height:1.15;
  font-weight:900;
}

.za-team-selector-empty{
  grid-column:1/-1;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px;
  color:var(--za-text-soft);
  text-align:center;
  font-size:12px;
}

/* ------------------------------------------------------------
   10) RESPONSIVO
   ------------------------------------------------------------ */
@media (max-width:520px){
  .za-arena-shell{
    padding:0;
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  .za-arena-panel{
    width:100%;
    max-width:100%;
    border-radius:22px;
    padding:14px;
    box-sizing:border-box;
  }

  .za-filter-row{
    width:100%;
    padding-right:0;
    padding-bottom:14px;
    gap:10px;
  }

  .za-filter-row select,
  .za-league-select {
    width: auto; 
    min-width: 60%; 
    max-width: 100%;
    margin: 0 auto; 
  }
  
  .za-select-duel {
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center; 
    gap: 6px; 
    width: 100%;
  }

  .za-select-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; 
    min-width: 30px;
    height: 30px;
    font-size: 11px;
    font-weight: bold;
    order: 2;
  }

  .za-select-duel .za-pick-card:first-child{
    order:1;
  }

  .za-select-duel .za-pick-card:last-child{
    order:3;
  }

  .za-pick-card{
    width:100%;
    min-height:auto;
    padding:12px;
    border-radius:20px;
    box-sizing:border-box;
  }

  .za-pick-head{
    grid-template-columns:1fr 36px;
    min-height:34px;
    margin-bottom:8px;
  }

  .za-pick-label{
    font-size:12px;
  }

  .za-level-seal{
    width:36px;
    height:34px;
  }

  .za-level-seal .za-seal-bg{
    font-size:28px;
  }

  .za-team-choice{
    width:100%;
    min-height:40px;
    padding:0 10px;
  }

  .za-team-choice-label{
    font-size:13px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .za-team-info{
    padding:10px;
    gap:8px;
  }

  .za-team-text{
    min-height:auto;
    font-size:11.5px;
    line-height:1.35;
  }

  .za-seal-row{
    gap:7px;
  }

  .za-seal{
    min-height:40px;
  }

  .za-seal-bg{
    font-size:24px;
  }

  .za-seal-number{
    font-size:16px;
  }

  /* --- AQUI ESTÁ A MÁGICA DOS 4 BOTÕES --- */
  .za-field-factors {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .za-factor-btn {
    flex: 1 !important;
    min-height: 40px;
    padding: 0 2px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis;
    overflow: hidden;
    text-align: center;
    border-radius: 14px;
  }

  .za-estimate-score{
    font-size:30px;
  }

  .za-reading-text{
    font-size:12.5px;
    line-height:1.45;
  }

  .za-team-selector-modal{
    padding:10px;
  }

  .za-team-selector-sheet{
    width:100%;
    max-width:100%;
    max-height:78vh;
    border-radius:22px;
    padding:14px;
    box-sizing:border-box;
  }
}

@media (max-width:380px){
  .za-arena-panel{
    padding:12px;
    border-radius:20px;
  }

  .za-select-duel{
    gap:8px;
  }

  .za-select-vs{
    width:34px;
    min-width:34px;
    height:34px;
    font-size:11px;
  }

  .za-pick-card{
    padding:10px;
    border-radius:18px;
  }

  .za-pick-head{
    grid-template-columns:1fr 34px;
  }

  .za-team-text{
    font-size:10.8px;
  }

  .za-factor-btn{
    padding:0 8px;
    font-size:10.8px;
  }

  .za-estimate-score{
    font-size:28px;
  }
}

@media (prefers-reduced-motion:reduce){
  .za-pick-card,
  .za-factor-btn,
  .za-team-option,
  .za-team-selector-close,
  .za-probability-strip span{
    transition:none!important;
  }

  .za-pick-card:active,
  .za-factor-btn:active,
  .za-team-option:active,
  .za-team-selector-close:active{
    transform:none!important;
    filter:none!important;
  }
}