:root {
    --bg-geral: #0b0c10;
    --bg-paineis: #111217;
    --bg-slots: #1c1d24;
    --borda-suave: #1f2026;
    --borda-destaque: #2d303a;
    --rosa-neon: #ff00ff;
    --azul-time: #007bff;
    --vermelho-time: #ff3333;
 
    /* Tamanhos do tabuleiro (bans, picks e mapa) — aumentados a pedido.
       Se precisar reajustar para caber na sua tela, mexa só aqui. */
    --ban-slot-size: 48px;
    --pick-slot-size: 82px;
    --map-w: 260px;
    --map-h: 390px;
}
 
* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
 
body { 
    background-color: var(--bg-geral); 
    color: #ffffff; 
    height: 100vh; /* Ajustado para preencher exatamente a tela */
    display: flex; 
    flex-direction: column; 
    overflow: hidden; /* Remove barra de rolagem geral da pgina */
}
 
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--borda-destaque); border-radius: 10px; }
 
/*  NAVBAR & CONTROLS  */
.navbar { display: flex; background-color: #000000; padding: 15px 30px; border-bottom: 1px solid var(--borda-suave); gap: 30px; }
.navbar a { color: #ffffff; text-decoration: none; font-weight: bold; font-size: 13px; text-transform: uppercase; }
 
.top-controls { display: flex; align-items: center; justify-content: center; background-color: var(--bg-paineis); border: 1px solid var(--borda-suave); border-radius: 14px; padding: 18px 28px; margin: 20px 20px 16px 20px; min-height: 42px; }
.tc-state { width: 100%; display: flex; align-items: center; justify-content: center; }
 
.btn-iniciar { background: linear-gradient(135deg, var(--rosa-neon), #8800ff); color: #fff; border: none; padding: 14px 40px; font-size: 15px; font-weight: 900; letter-spacing: 1px; border-radius: 10px; cursor: pointer; text-transform: uppercase; box-shadow: 0 0 20px rgba(255,0,255,0.35); transition: transform .15s ease; }
.btn-iniciar:hover { transform: translateY(-2px); }
 
/*  BARRA DE TEMPO (substitui a linha de seleo de modo/mapa/lado)  */
#tc-timer { gap: 24px; }
.timer-segments { flex: 1; display: flex; gap: 5px; max-width: 760px; }
.timer-segment { flex: 1; height: 13px; border-radius: 6px; background: #26272f; overflow: hidden; position: relative; }
.timer-segment .fill { position: absolute; top: 0; left: 0; height: 100%; width: 100%; background: var(--azul-time); transition: width 1s linear; }
.timer-segment.done .fill { width: 100% !important; background: #3a3d4a !important; transition: none; }
.timer-segment.team-red .fill { background: var(--vermelho-time); }
.timer-readout { display: flex; align-items: center; gap: 14px; white-space: nowrap; font-weight: 900; }
#timer-fase-label { font-size: 15px; letter-spacing: 1px; color: #b7b9c4; text-transform: uppercase; }
#timer-numero { font-size: 32px; min-width: 48px; text-align: center; color: #fff; }
#timer-numero.urgente { color: var(--vermelho-time); animation: piscaTempo .6s infinite; }
@keyframes piscaTempo { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.timer-clock-icon { width: 36px; height: 36px; object-fit: contain; }
 
/*  MAIN CONTAINER  */
.main-container { 
    display: flex; 
    flex: 1; 
    padding: 0 20px 20px 20px; 
    gap: 20px; 
    align-items: stretch; 
    overflow: hidden; /* Mantm tudo restrito  tela atual */
}
 
/*  DRAFT AREA (CONTAINER DO TABLEIRO)  */
.draft-area {
    flex: 3;
    background-color: var(--bg-paineis);
    border-radius: 16px;
    border: 1px solid var(--borda-suave);
    padding: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden; /* Ajuste para o retngulo do draft */
    overflow-y: auto; /* Permite rolar para ver a análise final inteira */
}
 
/*  TELA DE SETUP (MODO / MAPA / LADO)  */
.setup-overlay { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.setup-step { width: 100%; text-align: center; animation: fadeInSetup .25s ease; }
@keyframes fadeInSetup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.setup-title { font-size: 23px; letter-spacing: 2px; color: var(--rosa-neon); margin-bottom: 28px; font-weight: 900; }
 
.setup-grid { display: grid; gap: 22px; max-width: 900px; margin: 0 auto; max-height: 72vh; overflow-y: auto; padding: 10px; }
.modos-grid { grid-template-columns: repeat(3, 1fr); }
.mapas-grid { grid-template-columns: repeat(3, 1fr); }
 
.modo-card, .mapa-card { background: var(--bg-slots); border: 2px solid var(--borda-destaque); border-radius: 14px; padding: 20px; cursor: pointer; transition: transform .15s ease, border-color .15s ease; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.modo-card:hover, .mapa-card:hover { transform: translateY(-3px); border-color: var(--rosa-neon); }
.modo-card img { width: 104px; height: 104px; object-fit: contain; }
.modo-card span { font-weight: 800; font-size: 15px; letter-spacing: .5px; }
/* aspect-ratio real dos prints de mapa (131x200) + object-fit:contain garante
   que o mapa inteiro apareça, sem cortar topo/base como acontecia com 16/10 + cover */
.mapa-card img { width: 100%; aspect-ratio: 131/200; object-fit: contain; border-radius: 8px; background: #000; }
.mapa-card span { font-weight: 800; font-size: 15px; }
 
.coin-toss-wrap { display: flex; align-items: center; justify-content: center; gap: 60px; margin-top: 10px; }
.coin-toss-img { width: 140px; height: 140px; object-fit: contain; cursor: pointer; transition: transform .18s ease, filter .18s ease; filter: drop-shadow(0 0 12px rgba(255,255,255,0.15)); }
.coin-toss-img:hover { transform: scale(1.08); filter: drop-shadow(0 0 22px rgba(255,255,255,0.4)); }
 
/* Alinha o topo de todos os blocos internos (Picks, Bans e Mapa) */
.vertical-layout { width: 100%; height: 100%; display: flex; align-items: flex-start; justify-content: center; padding-top: 0; }
.draft-board-capture { background: var(--bg-paineis); border-radius: 16px; padding: 8px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.board-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start !important;
    gap: 12px;
}

/* Cada equipe permanece em seu próprio lado do mapa. */
.team-col { display: flex; flex-direction: row; align-items: flex-start !important; gap: 7px; }
.ban-col, .pick-col { display: flex; flex-direction: column; gap: 6px; justify-content: flex-start !important; }

/* O ícone do modo fica acima do mapa. */
.map-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex: 0 0 auto;
}
.map-modo-top {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain;
    display: none;
}

/* A moeda fica dentro do mapa, logo abaixo da área superior. */
.coin-topo {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8;
}
.coin-topo img { width: 32px; height: 32px; object-fit: contain; }
 
/*  SLOTS DE PICKS E BANS  */
.slot { background-color: var(--bg-slots); border: 2px solid var(--borda-destaque); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative !important; cursor: pointer; }
.active-blue { border-color: var(--azul-time) !important;     box-shadow: 0 0 15px rgba(0,123,255,0.5); }
.active-red  { border-color: var(--vermelho-time) !important; box-shadow: 0 0 15px rgba(255,51,51,0.5); }
 
.ban-slot  { width: var(--ban-slot-size) !important;  height: var(--ban-slot-size) !important;  border-radius: 8px;  }
.pick-slot { width: var(--pick-slot-size) !important; height: var(--pick-slot-size) !important; border-radius: 10px; }
 
.ban-slot .slot-assets img { filter: grayscale(100%) !important; opacity: 0.5; }
.red-team-imgs img { transform: scaleX(-1); }
 
/* Timer dentro da moldura do slot ativo (ainda no pickado) */
.slot-mini-timer { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,0.75); color: #fff; font-size: 12px; font-weight: 900; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; z-index: 20; border: 1px solid rgba(255,255,255,0.4); }
.pick-slot .slot-mini-timer { width: 33px; height: 33px; font-size: 15px; top: 6px; right: 6px; }
.slot-mini-timer.urgente { background: rgba(255,51,51,0.85); animation: piscaTempo .6s infinite; }
 
/*  MAPA CENTRAL COMPACTO  */
.map-col {
    width: var(--map-w) !important;
    height: var(--map-h) !important;
    background-color: var(--bg-paineis);
    border: 2px solid var(--borda-destaque);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
.map-col img#map-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    z-index: 2;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}
#map-placeholder { position: absolute; z-index: 1; color: #555; text-align: center; font-size: 18px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
#map-modo-icon { background: transparent; border-radius: 0; padding: 0; }
#map-nome-label { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; z-index: 3; font-weight: 900; font-size: 17px; text-shadow: 0 2px 6px rgba(0,0,0,0.9); display: none; letter-spacing: .5px; }
 
/*  ASSETS E FALLBACKS  */
.slot-assets { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.slot-fallback-text { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; text-align: center; font-weight: 800; font-size: 11px; padding: 4px; background: linear-gradient(135deg, #1f2026, #111217); color: #ffffff; text-transform: uppercase; word-break: break-all; }
.ban-slot .slot-fallback-text { font-size: 9px; line-height: 1.2; }
 
/*  PAINIS LATERAIS  */
.info-panels { 
    flex: 1.1; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    height: 100%; 
    overflow: hidden; /* Ajuste para respeitar tamanho total */
}
 
.side-panel { 
    background-color: var(--bg-paineis); 
    border: 1px solid var(--borda-suave); 
    border-radius: 12px; 
    padding: 15px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-height: 0; 
    position: relative; 
    overflow-y: auto; /* Permite scroll interno se necessrio nos counters/meta */
}
 
.panel-title { color: var(--rosa-neon); font-weight: bold; font-size: 13px; text-transform: uppercase; text-align: center; margin-bottom: 12px; }
.panel-filter-btn { position: absolute; top: 10px; right: 12px; background: transparent; border: 1px solid var(--borda-destaque); color: #b7b9c4; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.panel-filter-btn:hover { border-color: var(--rosa-neon); color: var(--rosa-neon); }
.panel-filter-box { display: none; position: absolute; top: 40px; right: 12px; background: #05060a; border: 1px solid var(--borda-destaque); border-radius: 8px; padding: 12px; z-index: 30; min-width: 170px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.panel-filter-box.aberto { display: block; }
.panel-filter-box label { font-size: 10px; color: #888a93; font-weight: 800; display: block; margin: 8px 0 4px; }
.panel-filter-box select { width: 100%; background: #000; color: #fff; border: 1px solid var(--borda-destaque); border-radius: 6px; padding: 6px; font-size: 11px; }
 
#counters-list, #podetomar-list, #meta-list { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; padding: 10px !important; overflow-y: auto; align-items: flex-start; align-content: flex-start; }
 
/*  MINI BRAWLERS  */
.mini-brawler { position: relative !important; width: 45px !important; height: 45px !important; background-color: var(--bg-slots); border-radius: 8px !important; overflow: hidden !important; display: block !important; border: 1px solid var(--borda-destaque); }
.highlight-good   { border: 2px solid #00ff00 !important; box-shadow: 0 0 10px rgba(0,255,0,0.4); }
.highlight-bad    { border: 2px solid #ff3333 !important; box-shadow: 0 0 10px rgba(255,51,51,0.4); }
 
/*  BADGES DE MULTIPLICADORES  */
.badge-multi, .badge-multi-danger { position: absolute !important; bottom: 2px !important; right: 2px !important; font-size: 9px !important; font-weight: 900 !important; padding: 1px 4px !important; border-radius: 4px !important; z-index: 10 !important; }
.badge-multi        { background: #00ff00 !important; color: #000000 !important; }
.badge-multi-danger { background: #ff3333 !important; color: #000000 !important; }
 
/*  ROSTER (DIREITA)  */
.roster-area { 
    flex: 1.3; 
    background-color: var(--bg-paineis); 
    border: 1px solid var(--borda-suave); 
    border-radius: 12px; 
    padding: 15px; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    overflow: hidden; /* Mantm o container preso  altura para que apenas o grid role */
}
 
.search-bar { width: 100%; padding: 10px 12px; background-color: #000000; border: 1px solid var(--borda-destaque); color: #ffffff; border-radius: 6px; margin-bottom: 15px; outline: none; font-size: 13px; }
.roster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; overflow-y: auto; flex: 1; padding-right: 4px; }
.brawler-icon { display: flex; flex-direction: column; background-color: var(--bg-slots); border: 2px solid var(--borda-destaque); border-radius: 8px; padding: 6px; align-items: center; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease; }
.brawler-icon:hover { transform: translateY(-2px); border-color: var(--rosa-neon); }
.brawler-icon.disabled { filter: grayscale(100%) opacity(0.15); pointer-events: none; }
.brawler-img-container { width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; position: relative; background-color: #000000; display: flex; align-items: center; justify-content: center; }
.brawler-name { font-size: 11px; font-weight: 700; color: #e2e4e9; margin-top: 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
 
.brawler-icon img, .slot img, .mini-brawler img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block; }
 
/* Regra específica para mover a imagem do Nori mais para a esquerda */
/* Isso assume que o ícone do Nori tem a classe específica '.nori' aplicada ao container geral '.brawler-icon' */
.brawler-icon.nori img {
    object-position: left center !important;
}

.fallback-initials { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; background: linear-gradient(135deg, #2d303a, #1c1d24); color: var(--rosa-neon); font-weight: bold; font-size: 13px; border-radius: 4px; }
 
/*  ANIMAES DE PR-SELEO  */
.pre-selecting { animation: pulse-draft 1.2s infinite ease-in-out; }
@keyframes pulse-draft { 0% { opacity: 0.5; } 50% { opacity: 0.85; } 100% { opacity: 0.5; } }
.pre-select-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: rgba(0,123,255,0.95); color: #ffffff; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; box-shadow: 0 0 8px rgba(0,123,255,0.8); z-index: 15; }
.pick-slot .pre-select-badge { width: 46px; height: 46px; font-size: 23px; }
 
/*  ANLISE FINAL PS-DRAFT  */
.analise-final { width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 10px; }
.analise-final { width: 100%; max-width: 900px; margin: auto; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 10px 10px 30px; }
.analise-card { background: var(--bg-slots); border: 1px solid var(--borda-destaque); border-radius: 14px; padding: 20px; }
.analise-card h3 { color: var(--rosa-neon); font-size: 15px; margin-bottom: 12px; letter-spacing: .5px; }
.winrate-bar-wrap { background: #05060a; border-radius: 20px; height: 30px; overflow: hidden; position: relative; border: 1px solid var(--borda-destaque); }
.winrate-bar-fill { height: 100%; background: linear-gradient(90deg, var(--azul-time), #22c55e); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-weight: 900; font-size: 13px; color: #fff; transition: width .6s ease; }
.analise-lista { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.analise-lista li { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.troca-sugestao { display: flex; align-items: center; gap: 10px; }
.troca-sugestao img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.troca-x { color: var(--vermelho-time); font-weight: 900; font-size: 15px; }
.btn-baixar-print { background: linear-gradient(135deg, var(--rosa-neon), #8800ff); color: #fff; border: none; padding: 12px 26px; font-weight: 900; border-radius: 10px; cursor: pointer; font-size: 13px; letter-spacing: .5px; margin: 6px auto 0; display: block; }
.btn-novo-draft { background: transparent; border: 2px solid var(--borda-destaque); color: #b7b9c4; padding: 10px 22px; font-weight: 900; border-radius: 10px; cursor: pointer; font-size: 12px; margin: 0 auto; display: block; }

/* =========================================================
   DRAFT BOARD SEM ROLAGEM
   Bans, picks e mapa devem aparecer juntos na área do Draft.
   A escala é reduzida conforme a plataforma para caber na tela,
   sem criar barras de rolagem dentro do tabuleiro.
   ========================================================= */
.draft-area {
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

.vertical-layout {
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
}

.draft-board-capture {
    flex: 0 0 auto;
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transform: scale(.86);
}

/* PC: mantém o mapa grande, mas garante que o tabuleiro inteiro caiba. */
html[data-platform="pc"] .draft-board-capture {
    transform: scale(.86);
}

/* Tablet: redução moderada para evitar qualquer corte vertical. */
html[data-platform="tablet"] .draft-board-capture {
    transform: scale(.80);
}

/* Celular em paisagem: todo o Draft fica visível de uma vez. */
html[data-platform="mobile"] .draft-board-capture {
    transform: scale(.68);
}

/* Telas com pouca altura: reduz somente o tabuleiro, nunca cria scroll. */
@media (max-height: 800px) {
    .draft-board-capture { transform: scale(.74); }
}

@media (max-height: 700px) {
    .draft-board-capture { transform: scale(.68); }
}

@media (max-height: 600px) {
    .draft-board-capture { transform: scale(.60); }
}

@media (max-height: 800px) and (min-width: 900px) {
    html[data-platform="pc"] .draft-board-capture { transform: scale(.74); }
    html[data-platform="tablet"] .draft-board-capture { transform: scale(.68); }
}

/* Paisagem no celular: prioriza a visualização completa do tabuleiro. */
@media (orientation: landscape) and (max-width: 1100px) {
    html[data-platform="mobile"] .draft-area {
        padding: 8px;
    }

    html[data-platform="mobile"] .draft-board-capture {
        transform: scale(.66);
    }
}

/* Nunca permitir uma barra de rolagem no bloco visual do Draft. */
.draft-area::-webkit-scrollbar,
.vertical-layout::-webkit-scrollbar,
.draft-board-capture::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.draft-area,
.vertical-layout,
.draft-board-capture {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* =========================================================
   AJUSTE DE POSIÇÃO DO DRAFT
   Mantém bans, picks, mapa e pesquisador mais próximos do topo.
   ========================================================= */
.top-controls {
    margin: 8px 20px 8px 20px !important;
    padding: 10px 20px !important;
    min-height: 38px !important;
}

.timer-segments {
    max-width: 650px !important;
    gap: 4px !important;
}

.timer-segment {
    height: 9px !important;
}

.timer-readout {
    gap: 9px !important;
}

#timer-fase-label {
    font-size: 12px !important;
}

#timer-numero {
    font-size: 25px !important;
    min-width: 38px !important;
}

.timer-clock-icon {
    width: 29px !important;
    height: 29px !important;
}

.main-container {
    padding-top: 0 !important;
    padding-bottom: 10px !important;
}

.draft-area {
    align-items: flex-start !important;
    padding-top: 4px !important;
}

.vertical-layout {
    align-items: flex-start !important;
    padding-top: 0 !important;
}

.draft-board-capture {
    margin-top: 0 !important;
}

/* Em telas com pouca altura, subir ainda mais o tabuleiro. */
@media (max-height: 800px) {
    .top-controls { margin-top: 5px !important; margin-bottom: 5px !important; }
    .main-container { padding-bottom: 6px !important; }
}


/* =========================================================
   DRAFT — MOBILE COM A MESMA LEITURA DO TABLET
   Bans e picks continuam nas laterais do mapa e o mapa inteiro
   permanece visível.
   ========================================================= */
@media (orientation: landscape) and (max-width: 1100px) {
    html[data-platform="mobile"] .main-container {
        padding: 0 10px 8px !important;
        gap: 10px !important;
    }

    html[data-platform="mobile"] .draft-area {
        padding: 8px !important;
    }

    html[data-platform="mobile"] .draft-board-capture {
        transform: scale(.80) !important;
    }

    html[data-platform="mobile"] .info-panels {
        min-width: 0 !important;
    }

    html[data-platform="mobile"] .roster-area {
        padding: 8px !important;
    }
}

@media (orientation: portrait) and (max-width: 700px) {
    html[data-platform="mobile"] .top-controls {
        margin: 4px 6px !important;
        padding: 7px 8px !important;
    }

    html[data-platform="mobile"] .main-container {
        padding: 0 6px 6px !important;
        gap: 6px !important;
    }

    html[data-platform="mobile"] .draft-area {
        padding: 4px !important;
    }

    /* Mantém os três blocos na mesma linha e reduz somente a escala. */
    html[data-platform="mobile"] .draft-board-capture {
        transform: scale(.50) !important;
    }

    html[data-platform="mobile"] .roster-area {
        padding: 6px !important;
    }

    html[data-platform="mobile"] .search-bar {
        padding: 7px 8px !important;
        margin-bottom: 8px !important;
        font-size: 10px !important;
    }

    html[data-platform="mobile"] .brawler-name { font-size: 8px !important; }
}
