.ej-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:15px}
.ej-card{position:relative;text-align:center}
.ej-card img{width:100%;aspect-ratio:1/1;object-fit:cover}
.ej-crown{position:absolute;top:5px;left:5px;color:#BF0811;transform:rotate(-25deg)}
.ej-stars span{cursor:pointer}
.ej-grid {
    display: grid;
    gap: 15px;
}

.ej-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.ej-crown {
    position:absolute;
    top:5px;
    left:5px;
    color:#BF0811;
    transform:rotate(-30deg);
    font-size:28px;
}

.ej-vote-btn {
    padding: 6px 10px;
    margin: 3px;
    cursor: pointer;
    font-weight: bold;
}

.ej-open-vote {
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
}

.ej-vote-options {
    margin-top: 5px;
}

.ej-vote-btn {
    margin: 2px;
    padding: 5px 8px;
    cursor: pointer;
}

.ej-vote-box {
    margin-top: 10px;
    text-align: center;
}

.ej-slider-wrap {
    margin: 0px 0;
}

.ej-note-value {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.ej-slider {
    width: 100%;
    accent-color: #BF0811;
}

.ej-confirm-vote {
    background: #BF0811;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.ej-confirm-vote:hover {
    opacity: 0.9;
    background: #a0060e;
}

/* Cursor correto no slider */
.ej-slider {
    cursor: pointer;
}

/* Melhora a pegada do botão do slider */
.ej-slider::-webkit-slider-thumb {
    cursor: grab;
}

.ej-slider:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.ej-slider::-moz-range-thumb {
    cursor: grab;
}

/* DESKTOP (PADRÃO) */
.ej-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 891px;
    margin: 0 auto;
}

/* 📱 CELULAR */
@media (max-width: 480px) {
    .ej-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        padding: 0 10px;
    }
}

/* 📲 TABLET */
@media (min-width: 481px) and (max-width: 768px) {
    .ej-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 💻 NOTEBOOK PEQUENO */
@media (min-width: 769px) and (max-width: 1024px) {
    .ej-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ej-share-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ej-share-player img {
  object-fit: cover;
}

.ej-note {
  font-size: 20px;
  font-weight: bold;
}

.ej-share-watermark {
  margin-top: 15px;
  font-size: 12px;
  opacity: 0.4;
}


/* botão de download começa escondido */
#ej-download {
  display: none;
}

/* Molde da imagem (invisível, mas renderizado corretamente) */
#ej-share-image {
  position: fixed;
  top: 0;
  left: 0;

  width: 1080px;
  min-height: 1080px;

  background: #ffffff;
  padding: 40px;
  box-sizing: border-box;

  opacity: 0;           /* invisível para o usuário */
  pointer-events: none; /* não clicável */
  z-index: -1;
}

/* Botão Finalizar Votação */
.ej-finalizar-btn {
    display: block;
    margin: 25px auto 0;

    background: #bf0811;
    color: #fff;

    border: none;
    border-radius: 6px;

    padding: 12px 28px;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.ej-finalizar-btn:hover {
    background: #a0060e;
}

/* ===== MODAL ===== */
.ej-modal {
    position: fixed;
    inset: 0;
    z-index: 9;
}

/* overlay clicável */
.ej-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    cursor: pointer;
}


/* botão X */
.ej-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border-radius: 15px 15px;
    background: #bf0811;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color:white;
}

/* imagem */
.ej-modal-image canvas {
    max-width: 100%;
    height: auto;
}

.ej-avg {
    margin: 0px 0;
    font-weight: 600;
    text-align: center;
}


/* ======================
   RESUMO / IMAGEM (POPUP)
====================== */

/* deixa a imagem menos larga no PC */
.ej-resumo {
    max-width: 800px;   /* controla largura no desktop */
    margin: 0 auto;
}

/* lista em grid */
.ej-resumo-lista {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colunas SEMPRE */
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* item do jogador */
.ej-resumo-item {
    display: flex;
    align-items: center;
    gap: 10px;

    background: #f4f4f4;
    padding: 10px;
    border-radius: 10px;
}

/* foto do jogador */
.ej-resumo-foto {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

/* info do jogador */
.ej-resumo-info {
    display: flex;
    flex-direction: column;
}

/* nome em destaque */
.ej-resumo-nome {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

/* nota */
.ej-resumo-nota {
    font-size: 25px;
    margin-top: 3px;
    font-weight: bold;
}

/* ===== MODAL AJUSTADO ===== */

.ej-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    /* ISSO É O MAIS IMPORTANTE */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* overlay cobre a tela toda */
.ej-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}

.ej-modal-wrapper {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    width: fit-content;
    max-width: 100%;
    max-height: none;
    overflow: visible;
}

@media (max-width: 768px) {
    .ej-modal-wrapper {
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 12px;
        top: 2%;
    }

    .ej-modal-image canvas,
    .ej-modal-image img {
        width: 100%;
        height: auto; /* 🔥 mantém proporção */
    }
}

/* conteúdo não força largura */
.ej-modal-content {
    width: auto;
    max-width: 100%;
}

/* imagem gerada */
.ej-modal-image canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ======================
   IMAGEM GERADA (DOWNLOAD)
   3 COLUNAS NO PC
====================== */

/* quando estiver sendo usada para imagem */
.ej-resumo.ej-resumo-image .ej-resumo-lista {
    grid-template-columns: repeat(3, 1fr);
}

/* garante boa leitura */
.ej-resumo.ej-resumo-image {
    max-width: 900px;
}

/* ======================
   BOTÕES DO POPUP (INLINE)
====================== */

.ej-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* botão principal */
.ej-download-btn,
.ej-download-story {
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 500;
    background: #bf0811;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;

    transition: transform .15s ease, box-shadow .15s ease;
}

.ej-download-btn:hover,
.ej-download-story:hover {
background: #a0060e;}

/* ======================
   RODAPÉ DA IMAGEM
====================== */

.ej-resumo-footer {
    margin-top: 0px;
    padding-top: 0px;
    border-top: 1px solid #ddd;
    font-size: 12px;
    text-align: right;
    color: #BF0811;
}

.ej-resumo-link {
    font-weight: 400;
    color: #000;
}

/* ======================
   LOGO CENTRAL (WATERMARK)
====================== */

/* watermark central real (story) */
.ej-resumo-story .ej-resumo-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ej-resumo-story .ej-resumo-watermark img {
    width: 60%;
    max-width: 500px;
    height: auto;
    opacity: 0.06;
}

.ej-resumo-watermark {
    display: none;
}

/* ======================
   LAYOUT DA IMAGEM GERADA
====================== */

/* quando for gerar imagem */
.ej-resumo.ej-resumo-image {
    width: 900px;        /* 🔑 largura fixa da imagem */
    max-width: none;
}

/* grid da imagem */
.ej-resumo.ej-resumo-image .ej-resumo-lista {
    grid-template-columns: repeat(3, 1fr); /* 3 colunas no download */
}

/* garante espaçamento melhor */
.ej-resumo.ej-resumo-image .ej-resumo-item {
    padding: 14px;
}

/* ======================
   CORES DAS NOTAS
====================== */

/* notas 0 a 4 */
.ej-resumo-nota.nota-baixa {
    color: #bf0811;
    font-weight: 700;
}

/* notas 5 a 10 */
.ej-resumo-nota.nota-alta {
    color: #0057b8; /* azul */
    font-weight: 700;
}

/* =========================
   LAYOUT STORY (1080x1920)
========================= */

.ej-resumo-story {
    width: 1080px;
    min-height: 1920px;

    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas */
    gap: 14px;

    padding: 120px 60px 160px;
    box-sizing: border-box;

    background: #ffffff;
}

/* título */
.ej-resumo-story .ej-resumo-title {
    grid-column: span 2;
    text-align: center;
    font-size: 36px;
    margin-bottom: 5px;
}

/* lista vira grid */
.ej-resumo-story .ej-resumo-lista {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 29px;
}

/* item */
.ej-resumo-story .ej-resumo-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border-radius: 16px;
    background: #f5f5f5;
}

/* foto */
.ej-resumo-story .ej-resumo-foto {
    width: 130px;
    height: 130px;
    border-radius: 12px;
    object-fit: cover;
}

/* nome */
.ej-resumo-story .ej-resumo-nome {
    font-size: 28px;
}

/* nota */
.ej-resumo-story .ej-resumo-nota {
    font-size: 45px;
    font-weight: bold;
}

/* logo central */
.ej-resumo-story .ej-resumo-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.06;
}

/* rodapé */
.ej-resumo-story .ej-resumo-footer {
    position: absolute;
    bottom: 40px;
    width: 100%;
    text-align: center;
    font-size: 18px;
}
