/* Usa as variáveis e o cabeçalho do style.css */

.container.wide { width: min(1480px, 96%); }
.mosaico-page { padding: 28px 0 56px; }
.page-head { margin-bottom: 20px; }
.page-head .section-sub { margin-bottom: 0; max-width: 60ch; }

/* ---------- Escolha dos jogos ---------- */

.picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 16px 16px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.pick-teams { display: flex; align-items: center; gap: 12px; }

.badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid rgba(255, 255, 255, .25);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
}

.pick-x { color: var(--muted); font-family: var(--display); font-size: 22px; }

.pick-name { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; }

.pick-state {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #71819a;
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  transition: background .2s, color .2s, border-color .2s;
}

.pick:hover { border-color: #71819a; }
.pick:hover .pick-state { color: #fff; }

.pick:has(input:checked) { border-color: #fff; background: var(--panel-2); }
.pick:has(input:checked) .pick-state {
  background: #fff;
  border: 1px solid #fff;
  color: var(--black);
}
.pick:has(input:checked) .pick-state i::before { content: "\f00c"; }

.pick:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Barra de status ---------- */

.mosaico-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin: 14px 0 6px;
}
.mosaico-status { color: var(--muted); font-size: 15px; }

.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: #fff; }

/* ---------- Grade: todos do mesmo tamanho ---------- */

.mosaico-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.mosaico-grid.layout-1 { max-width: 1100px; margin-inline: auto; width: 100%; }

@media (min-width: 800px) {
  .mosaico-grid.layout-2,
  .mosaico-grid.layout-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
    grid-column: 1 / -1;
    width: calc(50% - 6px);
    justify-self: center;
  }
}
@media (min-width: 1200px) {
  .mosaico-grid.layout-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mosaico-grid.layout-3 .mosaico-player:nth-child(3) { grid-column: auto; width: auto; }
}

.mosaico-player {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mosaico-player::before { content: ""; height: 5px; background: var(--club); }

[data-club="fortaleza"] { --club: linear-gradient(90deg, var(--blue) 50%, var(--red) 50%); }
[data-club="ceara"]     { --club: repeating-linear-gradient(90deg, #fff 0 8px, #08090c 8px 16px); }
[data-club="neutral"]   { --club: linear-gradient(90deg, #5b6b82, #5b6b82); }

.tile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 12px;
}
.tile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
}
.tile-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tile-btn:hover { color: #fff; border-color: #71819a; }

.tile-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }

.mosaico-player:fullscreen { border-radius: 0; background: #000; }
.mosaico-player:fullscreen .tile-frame { aspect-ratio: auto; flex: 1; }

/* ---------- Players ---------- */

.player-content { position: absolute; inset: 0; overflow: hidden; }
.player-content iframe,
.player-content video,
.player-content .hls-player { display: block; width: 100%; height: 100%; border: 0; }

.player-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  text-align: center;
  color: var(--red);
  background: #080a0e;
}
.player-placeholder p { color: var(--muted); font-size: 14px; }

/* ---------- Estado vazio ---------- */

.empty-mosaico {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.empty-mosaico i { font-size: 32px; margin-bottom: 8px; }
.empty-mosaico h3 { color: var(--text); font-family: var(--display); font-size: 26px; }

/* ---------- Celular ---------- */

@media (max-width: 700px) {
  .picker { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pick {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 14px;
  }
  .badge { width: 44px; height: 44px; font-size: 16px; }
  .pick-name { order: 3; flex: 1 1 100%; text-align: left; font-size: 22px; }
  .pick-state { order: 4; width: auto; padding: 8px 14px; }
  .pick-teams { gap: 8px; }
}


/* ==========================================
   FUTLIVECE - MOSAICO RESPONSIVO DEFINITIVO
========================================== */

/* Grade principal */
.mosaico-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    align-items: start;
}

/* Um jogo */
.mosaico-grid.layout-1 {
    max-width: 1100px;
    margin-inline: auto;
}

/* Dois jogos no computador e tablet */
@media (min-width: 701px) {
    .mosaico-grid.layout-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Três jogos: composição 2 + 1 */
    .mosaico-grid.layout-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* O terceiro terá exatamente a largura dos superiores */
    .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
        grid-column: 1 / -1;
        width: calc((100% - 14px) / 2);
        justify-self: center;
    }
}

/* Todos os players respeitam sua coluna */
.mosaico-player {
    width: 100%;
    min-width: 0;
    align-self: start;
    overflow: hidden;
}

.tile-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-content {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-content video,
.player-content iframe,
.player-content .hls-player {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* ==========================================
   CELULAR EM PÉ
========================================== */

@media (max-width: 700px) and (orientation: portrait) {

    .mosaico-page {
        width: 96%;
        padding-top: 18px;
    }

    .mosaico-grid,
    .mosaico-grid.layout-1,
    .mosaico-grid.layout-2,
    .mosaico-grid.layout-3 {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        max-width: 100%;
    }

    .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
        grid-column: auto;
        width: 100%;
    }

    .tile-name {
        font-size: clamp(16px, 4vw, 21px);
    }

    .tile-btn {
        padding: 6px 9px;
        font-size: 14px;
    }

    .tile-frame {
        aspect-ratio: 16 / 9;
    }
}

/* ==========================================
   CELULAR DEITADO
========================================== */

@media (max-width: 900px) and
       (max-height: 600px) and
       (orientation: landscape) {

    .mosaico-page {
        width: 98%;
        padding-top: 8px;
    }

    .page-head {
        margin-bottom: 8px;
    }

    .page-head .section-title {
        font-size: 22px;
    }

    .page-head .section-sub {
        font-size: 12px;
    }

    /* Seleção compacta */
    .picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .pick {
        padding: 7px 5px;
        gap: 5px;
    }

    .pick-teams {
        gap: 5px;
    }

    .badge {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .pick-name {
        font-size: 14px;
        text-align: center;
    }

    .pick-state {
        padding: 5px;
        font-size: 12px;
    }

    .mosaico-bar {
        min-height: 25px;
        margin: 5px 0;
    }

    /* Dois jogos */
    .mosaico-grid.layout-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* Três jogos lado a lado */
    .mosaico-grid.layout-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
        grid-column: auto;
        width: 100%;
    }

    /* Cabeçalho dos players reduzido */
    .tile-bar {
        padding: 4px 5px;
        gap: 3px;
    }

    .tile-name {
        font-size: clamp(10px, 1.8vw, 15px);
    }

    .tile-actions {
        gap: 3px;
    }

    .tile-btn {
        padding: 4px 5px;
        font-size: 11px;
    }

    /* Vídeos proporcionais */
    .tile-frame {
        aspect-ratio: 16 / 9;
        max-height: 30vh;
    }

    .mosaico-player {
        border-radius: 5px;
    }
}

/* ==========================================
   TELAS GRANDES
========================================== */

@media (min-width: 1400px) {

    .mosaico-grid.layout-2,
    .mosaico-grid.layout-3 {
        gap: 18px;
    }

    .mosaico-grid.layout-3
    .mosaico-player:nth-child(3) {
        width: calc((100% - 18px) / 2);
    }
}

/* =========================================
   RESPONSIVIDADE DO MOSAICO - CELULAR
========================================= */

/* Celular em pé */
@media (max-width: 700px) {

    .mosaico-page {
        padding-top: 18px;
    }

    .page-head {
        margin-bottom: 18px;
    }

    /* Seletor de jogos */
    .picker {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 16px;
    }

    .pick {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 12px;
    }

    .pick-teams {
        grid-column: 1;
        grid-row: 1;
    }

    .pick-name {
        grid-column: 2;
        grid-row: 1;
        width: auto;
        font-size: 15px;
        text-align: left;
    }

    .pick-state {
        grid-column: 3;
        grid-row: 1;
        margin: 0;
        white-space: nowrap;
    }

    .badge {
        width: 38px;
        height: 38px;
        font-size: 11px;
    }

    /* Players um abaixo do outro */
    .mosaico-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mosaico-grid.layout-2,
    .mosaico-grid.layout-3 {
        grid-template-columns: 1fr;
    }

    .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
        grid-column: auto;
        width: 100%;
        margin: 0;
    }

    .tile-name {
        font-size: 13px;
    }

    .tile-frame {
        aspect-ratio: 16 / 9;
    }
}


/* =========================================
   CELULAR DEITADO - MOSAICO OTIMIZADO
========================================= */

@media (max-width: 900px) and (max-height: 600px)
       and (orientation: landscape) {

    /* Aproveita praticamente toda a tela */
    .header {
        display: none;
    }

    .mosaico-page {
        width: 98%;
        padding: 8px 0 16px;
    }

    /* Esconde o título para liberar espaço */
    .page-head {
        display: none;
    }

    /* Barra de status compacta */
    .mosaico-bar {
        margin: 4px 0 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mosaico-status {
        font-size: 11px;
        margin: 0;
    }

    .link-btn {
        font-size: 11px;
        padding: 5px 9px;
    }

    /* Dois players por linha */
    .mosaico-grid.layout-2,
    .mosaico-grid.layout-3 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    /* Terceiro player mantém a mesma largura */
    .mosaico-grid.layout-3 .mosaico-player:nth-child(3) {
        grid-column: 1 / -1;
        width: calc((100% - 8px) / 2);
        margin-inline: auto;
    }

    /* Players mais compactos */
    .mosaico-player {
        min-width: 0;
        border-radius: 7px;
    }

    .tile-bar {
        min-height: 29px;
        padding: 4px 6px;
        gap: 4px;
    }

    .tile-name {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tile-actions {
        gap: 3px;
    }

    .tile-btn {
        font-size: 10px;
        padding: 3px 5px;
    }

    .tile-frame {
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: none;
    }

    .player-content,
    .player-content video,
    .player-content iframe,
    .player-content .hls-player {
        width: 100%;
        height: 100%;
    }

    .player-content video {
        object-fit: contain;
    }

    /* Seletor compacto abaixo dos players */
    .picker {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 12px;
    }

    .pick {
        min-width: 0;
        padding: 7px 4px;
        gap: 4px;
        align-items: center;
    }

    .pick-teams {
        justify-content: center;
    }

    .badge {
        width: 27px;
        height: 27px;
        font-size: 9px;
    }

    .pick-name {
        width: 100%;
        font-size: 10px;
        text-align: center;
        line-height: 1.2;
    }

    .pick-state {
        font-size: 10px;
        margin-top: 3px;
    }
}