:root {
    --blue-flag: #3b82f6;
    --red-flag: #ef4444;

    --blue: #3b82f6;
    --red: #ef4444;

    --card-bg: rgba(6, 12, 32, 0.78);
    --stroke: rgba(148, 163, 184, 0.35);
    --panel: rgba(15, 23, 42, 0.9);
    --panel2: rgba(15, 23, 42, 0.7);
    --highlight: rgba(56, 189, 248, 0.25);
    --shine: rgba(248, 250, 252, 0.05);
    --ok: #22c55e;
    --warn: #f59e0b;

    --text: #e2e8f0;
    --muted: #94a3b8;
}

/* Página do simulador dentro do container do base.html */
.simulador-page {
    padding-top: 4px;
}

/* Container geral (o base.html já cuida da largura) */
.wrap {
    width: 100%;
    padding: 12px 0;
}

.layout {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

/* ================== CONTROLES (topo) ================== */

.card.me-ctrl {
    max-width: 1080px;
    width: 100%;
    margin-inline: auto;
    margin-top: 4px;
    background:
      radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.2), transparent 55%),
      radial-gradient(circle at 100% 100%, rgba(79, 70, 229, 0.18), transparent 55%),
      var(--card-bg);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.85);
}

/* Grid do topo: campos à esquerda, info/dica à direita */
.me-ctrl {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1.4fr);
    align-items: stretch;
    gap: 18px;
    padding: 16px 22px;
}

.me-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 18px;
}

/* Cada campo (Conta, Seu lado, Sua lane) */
.me-ctrl label.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

/* Selects */
.me-ctrl select {
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: var(--text);
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13px;
    min-width: 160px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.me-ctrl select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
    background: #020617;
}

/* Bloco da direita (texto + botão) */
.me-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.me-source {
    font-size: 12px;
    max-width: 260px;
    text-align: right;
}

.me-source-tag {
    display: inline-block;
    margin-left: 4px;
    font-weight: 600;
    color: #e5e7eb;
}

.me-source-type {
    font-weight: 400;
    color: var(--muted);
    font-size: 11px;
}

/* Dica + botão */
.me-hint {
    display: flex;
    align-items: center;
    gap: 10px;
}

.me-hint small {
    font-size: 11px;
}

/* Botões genéricos */
.btn-secondary {
    background: #020617;
    color: #e5e7eb;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 7px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background: #020617;
    border-color: #38bdf8;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ===== RESPONSIVO TOPO ===== */
@media (max-width: 900px) {
    .me-ctrl {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .me-side {
        align-items: flex-start;
        text-align: left;
    }

    .me-source {
        text-align: left;
        max-width: 100%;
    }

    .me-hint {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .me-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .me-ctrl select {
        width: 100%;
    }

    .me-hint {
        align-items: flex-start;
    }

    .btn-secondary {
        width: auto;
    }
}

/* ================== LADOS / LANES ================== */

.side_blue h3,
.side_red h3 {
    display: flex;
    margin: 0 0 10px;
    align-items: center;
}

/* BADGE LADO AZUL */
.side-badge {
    width: 110px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3aa0ff, #1776ff);
    border: 1px solid #7cc0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dff0ff;
    font-weight: 700;
    font-size: 12px;
    margin-left: 20px;
}

/* BADGE LADO VERMELHO */
.side-badge.red {
    background: linear-gradient(135deg, #ff6a6a, #e53939);
    border-color: #ff9b9b;
}

/* CARD GENÉRICO */
.card {
    width: 100%;
    max-width: 260px;
    margin: 10px auto;
    background: var(--card-bg);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 14px;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* HOVER CARD */
.card:hover {
    transform: translateY(-3px);
}

/* CORES DOS CARDS AZUL / VERMELHO */
.side_blue .card {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.55);
}

.side_red .card {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.55);
}

/* LANES */
.lane {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel2);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.lane:hover {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-1px);
}

.lane .left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 26px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #2a3a4a;
    background: #020617;
    color: #c9d6e1;
    border-radius: 999px;
    text-transform: uppercase;
}

.ava {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #020617 center/cover no-repeat;
    border: 1px solid #2a3a4a;
}

.cname {
    opacity: 0.9;
}

/* BANS */
.bans {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.ban {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #020617 center/cover no-repeat;
    border: 1px solid #2a3a4a;
    cursor: pointer;
}

/* ================== SUGESTÕES (CARD CENTRAL) ================== */

.layout-center {
    order: 2;
    flex: 0 0 560px;
}

.sugs.card {
    max-width: 620px;
}

.sugs {
    max-width: 620px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    padding: 16px 18px 18px;
    order: 2;
}

/* Cabeçalho de sugestões */
.sugs-head {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    margin-bottom: 10px;
}

.sugs-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #93c5fd;
    margin-bottom: 2px;
}

.title {
    margin: 0;
    text-align: left;
    color: #e5e7eb;
    font-weight: 700;
    font-size: 18px;
}

.sugs-sub {
    margin-top: 4px;
    font-size: 12px;
    max-width: 360px;
}

/* Corpo das sugestões */
.sugs-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sugs-group {
    padding: 4px 0 2px;
}

/* TÍTULOS DE LINHA DE SUGESTÃO */
.row-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 4px 2px 6px;
    color: #c7d1db;
}

.sugs-label {
    font-weight: 600;
    font-size: 13px;
}

.sugs-status {
    font-size: 11px;
}

/* Barrinha de divisão entre Pool e Gerais */
.sugs-divider {
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(148, 163, 184, 0.8),
      transparent
    );
    margin: 4px 0;
}

/* SLOTS DE SUGESTÕES */
.slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 10px;
    justify-items: center;
}

@media (max-width: 900px) {
    .slots {
        grid-template-columns: repeat(7, 56px);
    }
}

.slot {
    width: 56px;
    height: 56px;
    border: 1px solid var(--stroke);
    border-radius: 14px;

    /* fundo base; o JS coloca o background-image do campeão por cima */
    background-color: #020617;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    position: relative;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.slot:hover {
    border-color: #a5b4fc;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.7);
}

.slot.selected {
    outline: 2px solid var(--warn);
    border-color: var(--warn);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
}

.slot.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* BOTÃO CONFIRMAR */
.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #052e16;
    border: none;
    border-radius: 999px;
    padding: 9px 22px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-confirm:hover:not([disabled]) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
}

.btn-confirm[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* ================== SUMMARY ================== */

.summary {
    border: 1px solid #38bdf8;
    border-radius: 14px;
    background: #020617;
    padding: 12px;
    margin-top: 14px;
    position: relative;
}

.summary .lane-chip {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 11px;
    border: 1px solid #334155;
    background: #020617;
    border-radius: 999px;
    padding: 2px 8px;
}

.summary h4 {
    margin: 0 0 8px;
}

.chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 4px 8px;
    border: 2px solid #1e293b;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.explain {
    margin-top: 8px;
    background: #020617;
    border: 1px dashed #1e293b;
    border-radius: 10px;
    padding: 8px;
    display: none;
}

.explain.show {
    display: block;
}

/* ================== INSIGHTS ================== */

canvas#radar {
    max-width: 100%;
}

.insights {
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--panel);
    padding: 12px;
    margin-top: 12px;
}

.ins-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    max-width: 100%;
    overflow: visible;
}

@media (max-width: 900px) {
    .ins-grid {
        flex-direction: column;
    }
}

.pill-big {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 8px;
}

.pill-big.blue {
    background: #1f3b6b;
    color: #d9e7ff;
    border: 2px solid var(--blue);
}

.pill-big.red {
    background: #6b1f1f;
    color: #ffe1e1;
    border: 2px solid var(--red);
}

.chip-sm {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: #020617;
    font-size: 11px;
    margin: 4px 6px 0 0;
}

.col-chips {
    display: flex;
    flex-direction: column;
}

.legend {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #aab6c4;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.dot.blue {
    background: var(--blue);
}

.dot.red {
    background: var(--red);
}

/* ================== MODAIS ================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal {
    width: min(700px, 96vw);
    max-height: 90vh;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    padding: 12px;
}

.modal[hidden],
.modal-backdrop[hidden] {
    display: none;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-x {
    border: none;
    background: #020617;
    color: #e6edf3;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
}

.modal-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}

.modal-tools input {
    flex: 1;
    background: #020617;
    color: #e6edf3;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 8px;
}

/* GRID DE CAMPEÕES NO MODAL */
.champ-grid {
    display: grid;
    grid-template-columns: repeat(10, 56px);
    gap: 10px;
}

@media (max-width: 700px) {
    .champ-grid {
        grid-template-columns: repeat(7, 56px);
    }
}

.champ {
    width: 56px;
    height: 56px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: #020617 center/cover no-repeat;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.champ:hover {
    transform: scale(1.1);
    border-color: #e28a05;
    box-shadow: 0 0 15px rgba(226, 138, 5, 0.6);
}

.champ.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* MODAL INFO */
.info-wrap {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
}

.info-ava {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    background: #020617 center/cover no-repeat;
    border: 1px solid var(--stroke);
}

.info-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ================== ORDEM LAYOUT ================== */

.side_blue {
    order: 1;
    flex: 0 0 280px;
}

.side_red {
    order: 3;
    flex: 0 0 280px;
}

/* ===== TELAS MENORES ===== */
@media (max-width: 1000px) {
    .layout {
        flex-wrap: wrap;
        justify-content: center;
    }

    .side_blue,
    .side_red {
        flex: 0 0 48%;
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .side_blue h3,
    .side_red h3 {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 14px;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 8px;
    }

    .layout-center {
        order: 2;
        flex: 0 0 100%;
        margin-top: 20px;
    }

    .sugs {
        width: 100%;
    }
}

@media (max-width: 580px) {
    .layout {
        flex-wrap: wrap;
        flex-direction: row;
        flex-shrink: 1;
        gap: 8px;
    }

    .side_blue,
    .side_red {
        flex: 1 1 40%;
        max-width: 50%;
    }

    .layout-center {
        flex: 1 1 100%;
    }
}
