/* ═══════════════════════════════════════════════════
   FC Player Downloader — downloader.css
   Dark theme · Orange accent #f97316
   ═══════════════════════════════════════════════════ */

#fc-dl-app {
    --clr-bg:        #111111;
    --clr-surface:   #1a1a1a;
    --clr-surface2:  #222222;
    --clr-border:    #2e2e2e;
    --clr-text:      #f1f1f1;
    --clr-muted:     #888888;
    --clr-orange:    #f97316;
    --clr-orange-dk: #ea6c0c;
    --clr-green:     #22c55e;
    --clr-green-dk:  #16a34a;
    --clr-red:       #ef4444;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 100px;
    color: var(--clr-text);
    /* Bloqueia scroll horizontal causado por cards largos */
    overflow-x: hidden;
}

/* ── Loading ───────────────────────────────────────── */
.fc-dl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    color: var(--clr-muted);
    gap: 16px;
}
.fc-dl-loading p { font-size: 0.9em; }

/* ── Spinner ───────────────────────────────────────── */
.fc-dl-spinner {
    width: 42px; height: 42px;
    border: 3px solid var(--clr-border);
    border-top-color: var(--clr-orange);
    border-radius: 50%;
    animation: fc-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }

/* ── Botões ────────────────────────────────────────── */
.fc-dl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 9px 18px;
    border: none; border-radius: 8px; cursor: pointer;
    font-size: 0.85em; font-weight: 600; line-height: 1;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}
.fc-dl-btn:active { transform: scale(0.96); }
.fc-dl-btn-primary  { background: var(--clr-orange); color: #fff; }
.fc-dl-btn-primary:hover { background: var(--clr-orange-dk); }
.fc-dl-btn-ghost { background: var(--clr-surface2); color: var(--clr-text); border: 1px solid var(--clr-border); }
.fc-dl-btn-ghost:hover { background: #2a2a2a; border-color: #444; }
.fc-dl-btn-success { background: var(--clr-green); color: #fff; }
.fc-dl-btn-success:hover { background: var(--clr-green-dk); }
.fc-dl-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ── Tabs ──────────────────────────────────────────── */
.fc-dl-tabs {
    display: flex; gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--clr-border);
}
.fc-dl-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 0.85em; font-weight: 600;
    color: var(--clr-muted);
    text-decoration: none;
    border: 1px solid transparent; border-bottom: none;
    margin-bottom: -1px;
    transition: color 0.15s, background 0.15s;
}
.fc-dl-tab svg { width: 15px; height: 15px; opacity: 0.6; }
.fc-dl-tab:hover { color: var(--clr-text); }
.fc-dl-tab.active {
    color: var(--clr-orange);
    background: var(--clr-surface);
    border-color: var(--clr-border);
    border-bottom-color: var(--clr-surface);
}
.fc-dl-tab.active svg { opacity: 1; }

/* ── Topbar ────────────────────────────────────────── */
.fc-dl-topbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.fc-dl-topbar h2 {
    margin: 0; font-size: 1.15em; font-weight: 700;
    flex: 1; color: var(--clr-text);
}
.fc-dl-topbar-right { margin-left: auto; display: flex; gap: 8px; }
.fc-dl-toggle-btn   { margin-left: auto; }

.fc-dl-count {
    display: inline-block;
    background: var(--clr-surface2); border: 1px solid var(--clr-border);
    color: var(--clr-muted);
    font-size: 0.65em; font-weight: 600;
    padding: 2px 7px; border-radius: 99px;
    vertical-align: middle; margin-left: 4px;
}

.fc-dl-back {
    color: var(--clr-orange); text-decoration: none;
    font-weight: 600; font-size: 0.88em; white-space: nowrap;
}
.fc-dl-back:hover { color: var(--clr-orange-dk); }

/* ── Barra de ações squads ─────────────────────────── */
.fc-dl-actions-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 18px; flex-wrap: wrap;
}

/* ── Título de secção ──────────────────────────────── */
.fc-dl-section-title {
    font-size: 0.82em; font-weight: 700; color: var(--clr-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 12px;
}

/* ── Grid de squads ────────────────────────────────── */
.fc-dl-squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.fc-dl-squad-card {
    display: block; background: var(--clr-surface);
    border: 1px solid var(--clr-border); border-radius: 12px;
    overflow: hidden; text-decoration: none; color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}
.fc-dl-squad-card:hover { border-color: var(--clr-orange); transform: translateY(-3px); }
.fc-dl-squad-img  { height: 120px; background: #0a0a0a center / contain no-repeat; }
.fc-dl-squad-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.fc-dl-squad-name { font-weight: 700; font-size: 0.88em; color: var(--clr-text); line-height: 1.3; }
.fc-dl-squad-meta { font-size: 0.75em; color: var(--clr-muted); }

/* badges */
.fc-dl-badge {
    display: inline-block; padding: 3px 9px; border-radius: 99px;
    font-size: 0.72em; font-weight: 700; width: fit-content;
}
.fc-dl-badge-ok    { background: rgba(34,197,94,.12);  color: var(--clr-green);  border: 1px solid rgba(34,197,94,.28); }
.fc-dl-badge-empty { background: rgba(249,115,22,.1);  color: var(--clr-orange); border: 1px solid rgba(249,115,22,.25); }

/* ── Estado intermediário ──────────────────────────── */
.fc-dl-center-box {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; padding: 64px 24px;
    text-align: center; color: var(--clr-muted);
}
.fc-dl-center-box p { margin: 0; font-size: 0.9em; }
.fc-dl-hint         { color: var(--clr-muted); font-size: 0.82em; }

/* ══════════════════════════════════════════════════════
   GRID DE JOGADORES — fix crítico de overflow no mobile
   A causa do card cortado: grid items têm min-width:auto
   por padrão, o que permite que ultrapassem a coluna.
   ══════════════════════════════════════════════════════ */
.fc-dl-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

/* Fix de overflow para qualquer filho do grid */
.fc-dl-players-grid > *,
.fc-dl-reward-grid  > * {
    min-width: 0;
}

/* ── Card wrap (label do jogador) ──────────────────── */
.fc-dl-player-wrap {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; cursor: pointer;
    /* Fix essencial: impede que o item ultrapasse a célula do grid */
    min-width: 0; width: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Checkbox oculto visualmente mas acessível */
.fc-dl-player-wrap input[type="checkbox"] {
    position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}

/* Indicador de seleção — posicionado sobre o card */
.fc-dl-player-wrap::after {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: background 0.15s, border-color 0.15s;
    pointer-events: none;
    z-index: 10;
}

/* Selecionado: laranja + checkmark SVG */
.fc-dl-player-wrap:has(input:checked)::after {
    background: var(--clr-orange);
    border-color: var(--clr-orange);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 13px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Ring laranja no card quando selecionado */
.fc-dl-player-wrap:has(input:checked) .fc-dl-card-shell {
    outline: 2.5px solid var(--clr-orange);
    border-radius: 13px;
    box-shadow: 0 0 20px rgba(249,115,22,.22);
}

/* Hover sutil */
.fc-dl-player-wrap:not(:has(input:checked)):hover .fc-dl-card-shell {
    outline: 1.5px solid rgba(249,115,22,.35);
    border-radius: 13px;
}

/* ── Card shell — contém e limita o fc-player-card ── */
.fc-dl-card-shell {
    width: 100%;
    min-width: 0;  /* fix grid overflow */
    overflow: hidden;
}

/* Força o fc-player-card a respeitar a largura da coluna,
   sobrepondo o width:250px do inline style do PHP */
.fc-dl-card-shell .fc-player-card {
    width: 100% !important;
    max-width: 100% !important;
}

/* ── Label do jogador ──────────────────────────────── */
.fc-dl-player-label, .fc-dl-reward-label {
    font-size: 0.78em; font-weight: 600;
    text-align: center; color: var(--clr-muted);
    line-height: 1.3; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Badge de expiração ────────────────────────────── */
.fc-dl-expires-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72em; font-weight: 600;
    color: var(--clr-orange);
    background: rgba(249,115,22,0.1);
    border: 1px solid rgba(249,115,22,0.25);
    padding: 3px 9px; border-radius: 99px;
    white-space: nowrap; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis;
}
.fc-dl-expires-badge svg {
    width: 12px; height: 12px; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   RECOMPENSAS
   ══════════════════════════════════════════════════════ */
.fc-dl-reward-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.fc-dl-reward-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    min-width: 0;
}

.fc-dl-reward-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 12px;
    transition: border-color 0.2s;
}
.fc-dl-reward-card:hover { border-color: rgba(249,115,22,.4); }

.fc-dl-reward-card img {
    width: 100%; height: 100%;
    object-fit: contain;
}
.fc-dl-reward-placeholder { font-size: 2.5em; opacity: 0.5; }

/* ── Barra de seleção sticky ───────────────────────── */
.fc-dl-selbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    background: rgba(15,15,15,0.97);
    border-top: 1px solid var(--clr-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-wrap: wrap;
}
.fc-dl-selbar-info       { font-size: 0.88em; color: var(--clr-muted); }
.fc-dl-selbar-info strong{ color: var(--clr-orange); font-size: 1.2em; }
.fc-dl-selbar-actions    { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ── Progresso scrape ──────────────────────────────── */
.fc-dl-progress-counter { font-size: 1.8em; font-weight: 700; color: var(--clr-text); line-height: 1; }
.fc-dl-progress-track   { width: 100%; max-width: 300px; height: 6px; background: var(--clr-border); border-radius: 99px; overflow: hidden; }
.fc-dl-progress-bar     { height: 100%; background: var(--clr-orange); border-radius: 99px; transition: width 0.4s; min-width: 4px; }
.fc-dl-progress-player  { font-size: 0.85em; font-weight: 600; color: var(--clr-text); margin: 0; }

/* ── Erro ──────────────────────────────────────────── */
.fc-dl-err-msg {
    background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3);
    color: var(--clr-red); padding: 12px 16px; border-radius: 8px;
    font-size: 0.88em; margin: 8px 0;
}

/* ══════════════════════════════════════════════════════
   MOBILE — 2 colunas, selbar compacta
   ══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    #fc-dl-app { padding: 12px 12px 90px; }

    .fc-dl-tabs { gap: 2px; }
    .fc-dl-tab  { padding: 8px 11px; font-size: 0.78em; gap: 5px; }
    .fc-dl-tab svg { width: 13px; height: 13px; }

    .fc-dl-topbar h2 { font-size: 1em; }

    /* 2 colunas no mobile */
    .fc-dl-players-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .fc-dl-squad-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .fc-dl-reward-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .fc-dl-player-wrap::after {
        width: 20px; height: 20px;
        top: 5px; right: 5px;
        background-size: 11px;
    }

    .fc-dl-player-label,
    .fc-dl-reward-label { font-size: 0.7em; }

    .fc-dl-expires-badge { font-size: 0.68em; padding: 2px 7px; }

    .fc-dl-selbar { padding: 10px 14px; }
    .fc-dl-selbar-info { font-size: 0.8em; }
    .fc-dl-btn  { padding: 9px 13px; font-size: 0.8em; }
}

/* Tablets: 3 colunas jogadores */
@media (min-width: 601px) and (max-width: 900px) {
    .fc-dl-players-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .fc-dl-reward-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ══════════════════════════════════════════════════════
   DME CARD WRAPPER — header (nome) + card + footer (expiração)
   ══════════════════════════════════════════════════════ */
.fc-dl-dme-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 14px;
    overflow: hidden;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fc-dl-dme-card-header {
    padding: 10px 36px 10px 12px; /* padding-right reserva espaço para o indicador */
    text-align: center;
    font-size: 0.78em;
    font-weight: 700;
    color: var(--clr-text);
    background: var(--clr-surface2);
    border-bottom: 1px solid var(--clr-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.fc-dl-dme-card-footer {
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.7em;
    font-weight: 700;
    color: var(--clr-orange);
    background: rgba(249,115,22,0.07);
    border-top: 1px solid rgba(249,115,22,0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-dl-dme-card-footer svg {
    width: 11px; height: 11px; flex-shrink: 0;
}

/* Hover no card inteiro */
.fc-dl-player-wrap:hover .fc-dl-dme-card {
    border-color: rgba(249,115,22,.4);
}

/* Selecionado: ring laranja no card wrapper */
.fc-dl-player-wrap:has(input:checked) .fc-dl-dme-card {
    border-color: var(--clr-orange);
    box-shadow: 0 0 20px rgba(249,115,22,.24);
}

/* Remove o outline do card-shell interno (o ring está no wrapper) */
.fc-dl-player-wrap:has(input:checked) .fc-dl-dme-card .fc-dl-card-shell,
.fc-dl-player-wrap:not(:has(input:checked)):hover .fc-dl-dme-card .fc-dl-card-shell {
    outline: none;
    box-shadow: none;
    border-radius: 0;
}

/* Indicador (::after) posicionado no canto da header */
.fc-dl-player-wrap:has(.fc-dl-dme-card)::after {
    top: 7px;
    right: 7px;
}

/* Mobile: mantém o indicador no lugar certo */
@media (max-width: 600px) {
    .fc-dl-dme-card-header { padding: 9px 32px 9px 10px; font-size: 0.72em; }
    .fc-dl-dme-card-footer { font-size: 0.66em; padding: 6px 10px; }
    .fc-dl-player-wrap:has(.fc-dl-dme-card)::after { top: 5px; right: 5px; }
}

/* ══════════════════════════════════════════════════════
   CRIAÇÃO DE POST — canvas editor mobile-first
   ══════════════════════════════════════════════════════ */

#fc-dl-screen-post {
    padding: 0;          /* override do #fc-dl-app — canvas vai edge-to-edge */
    margin: 0 -16px;     /* cancela padding lateral do app */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────── */
.fc-post-topbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--clr-border);
    background: var(--clr-surface);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}
.fc-post-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.9em;
    color: var(--clr-text);
}

/* Toggle Stories / Feed */
.fc-post-mode-toggle {
    flex: 1;
    display: flex;
    justify-content: center;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
    max-width: 160px;
}
.fc-post-mode-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.75em;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.fc-post-mode-btn.active {
    background: var(--clr-orange);
    color: #fff;
}

/* ── Canvas ──────────────────────────────────────────── */
.fc-post-canvas-wrap {
    position: relative;
    width: 100%;
    background: #000;
    flex: 1;
    display: flex;
    align-items: flex-start;
}
.fc-post-canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;   /* CRÍTICO: impede scroll/zoom do browser durante drag */
    cursor: crosshair;
}
.fc-post-canvas-loading {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 5;
}
.fc-post-load-text {
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
}

/* ── Toolbar inferior ────────────────────────────────── */
.fc-post-toolbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 12px;
    background: rgba(13,13,13,0.97);
    border-top: 1px solid var(--clr-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
    gap: 6px;
}
.fc-post-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    color: var(--clr-text);
    font-size: 0.72em;
    font-weight: 600;
    padding: 8px 10px;
    cursor: pointer;
    gap: 3px;
    min-width: 56px;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
    white-space: nowrap;
}
.fc-post-tool-btn:active {
    background: var(--clr-orange);
    border-color: var(--clr-orange);
    color: #fff;
    transform: scale(0.93);
}
.fc-post-tool-btn.danger {
    border-color: rgba(239,68,68,.4);
    color: var(--clr-red);
}
.fc-post-tool-btn.danger:active {
    background: var(--clr-red);
    border-color: var(--clr-red);
}

/* ── Bottom sheet overlay ────────────────────────────── */
.fc-post-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 97;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.fc-post-sheet-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Bottom sheet ────────────────────────────────────── */
.fc-post-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--clr-surface);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--clr-border);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 98;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}
.fc-post-sheet.open { transform: translateY(0); }

.fc-post-sheet-handle {
    width: 36px; height: 4px;
    background: var(--clr-border);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Toggle de fonte: DMEs ↔ Squads (topo do sheet) */
.fc-post-source-toggle {
    display: flex;
    margin: 14px 16px 0;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.fc-post-source-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.82em;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.fc-post-source-btn.active {
    background: var(--clr-orange);
    color: #fff;
}

/* Corpo dinâmico do sheet — precisa propagar o contexto flex
   para que .fc-post-sheet-list (flex:1; overflow-y:auto) role corretamente */
#pc-sheet-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Linha de squad na lista (fonte = Squads) */
.fc-post-squad-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--clr-border);
    cursor: pointer;
    gap: 10px;
    transition: background 0.12s;
}
.fc-post-squad-row:active { background: var(--clr-surface2); }
.fc-post-squad-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.fc-post-squad-row-name {
    font-weight: 700;
    font-size: 0.88em;
    color: var(--clr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fc-post-squad-row-count {
    font-size: 0.72em;
    color: var(--clr-muted);
}
.fc-post-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--clr-border);
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.88em;
}

/* Toggle com/sem wrapper */
.fc-post-wrap-toggle {
    display: flex;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
}
.fc-post-wrap-btn {
    padding: 5px 10px;
    font-size: 0.72em;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.fc-post-wrap-btn.active {
    background: var(--clr-orange);
    color: #fff;
}

/* Lista de cards na sheet */
.fc-post-sheet-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.fc-post-card-row {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid var(--clr-border);
    cursor: pointer;
    gap: 10px;
    transition: background 0.12s;
}
.fc-post-card-row:active { background: var(--clr-surface2); }
.fc-post-card-row.selected {
    background: rgba(249,115,22,.08);
    border-left: 3px solid var(--clr-orange);
    padding-left: 13px;
}

/* Checkbox de seleção múltipla (substitui o "+" estático em modo grade) */
.fc-post-card-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--clr-orange);
    /* Puramente visual — o toque é sempre capturado pela linha inteira
       (.fc-post-card-row), nunca pela checkbox em si. Evita a checkbox
       "engolir" o toque via seu próprio comportamento nativo antes do
       handler da linha rodar (causava contador travado/dessincronizado). */
    pointer-events: none;
}

/* Barra fixa "Concluir" no rodapé do sheet — sobrevive à troca DME/Squads */
.fc-post-build-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--clr-border);
    background: var(--clr-surface);
    flex-shrink: 0;
}
.fc-post-build-bar span {
    font-size: 0.82em;
    font-weight: 700;
    color: var(--clr-text);
}
#pc-build-confirm-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.fc-post-card-row-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.fc-post-card-rating {
    font-weight: 800;
    font-size: 1em;
    color: var(--clr-orange);
    min-width: 30px;
    flex-shrink: 0;
}
.fc-post-card-pos {
    font-size: 0.68em;
    font-weight: 700;
    color: var(--clr-muted);
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.fc-post-card-name {
    font-weight: 600;
    font-size: 0.85em;
    color: var(--clr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fc-post-card-add-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--clr-orange);
    border: none;
    color: #fff;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    pointer-events: none; /* o clique é capturado pelo row */
}

/* Foto do jogador no card row do sheet */
.fc-post-card-face {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top; /* prioriza rosto */
    flex-shrink: 0;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
}
.fc-post-card-face-fallback {
    background: var(--clr-surface2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fc-post-card-face-fallback::after {
    content: '?';
    color: var(--clr-muted);
    font-size: 1.2em;
    font-weight: 700;
}

/* ── Painel de texto ─────────────────────────────────── */
.fc-post-text-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--clr-surface);
    border-top: 1px solid var(--clr-border);
    border-radius: 20px 20px 0 0;
    padding: 16px 16px 24px;
    z-index: 98;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.fc-post-text-panel.open { transform: translateY(0); }

.fc-post-text-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.fc-post-text-field {
    width: 100%;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--clr-text);
    font-size: 0.9em;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
    caret-color: var(--clr-orange);
}
.fc-post-text-field:focus {
    outline: none;
    border-color: var(--clr-orange);
}
.fc-post-text-options {
    display: flex;
    gap: 8px;
    align-items: center;
}
.fc-post-select {
    flex: 1;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--clr-text);
    font-size: 0.78em;
    cursor: pointer;
    -webkit-appearance: none;
}
.fc-post-color-pick {
    width: 44px; height: 40px;
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    background: var(--clr-surface2);
    cursor: pointer;
    padding: 3px;
    flex-shrink: 0;
}
.fc-post-text-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════
   PREÇOS DME — badge verde nos cards + toggles Console/PC
   ══════════════════════════════════════════════════════ */

/* Badge de preço no card DME (acima da expiração) */
.fc-dl-dme-card-price {
    padding: 6px 12px;
    text-align: center;
    font-size: 0.74em;
    font-weight: 800;
    color: #22c55e;
    background: rgba(34,197,94,0.07);
    border-top: 1px solid rgba(34,197,94,0.14);
    letter-spacing: 0.01em;
    min-height: 0;
    line-height: 1.3;
}
.fc-dl-dme-card-price:empty { display: none; }

/* Controles da secção DME (toggle de plataforma) */
.fc-dme-section-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 0 10px;
}
.fc-dme-plat-toggle {
    display: flex;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
}
.fc-dme-plat-btn {
    padding: 5px 14px;
    font-size: 0.72em;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.fc-dme-plat-btn.active { background: #22c55e; color: #fff; }

/* Toggle Console/PC no sheet do post creator */
.fc-post-sheet-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.fc-post-sheet-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.fc-post-sheet-title { font-weight: 700; font-size: 0.88em; }
.fc-post-plat-toggle {
    display: flex;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
}
.fc-post-plat-btn {
    padding: 5px 10px;
    font-size: 0.72em;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.fc-post-plat-btn.active { background: #22c55e; color: #fff; }

/* Preço na linha do card no sheet do post creator */
.fc-post-card-price {
    font-size: 0.72em;
    font-weight: 800;
    color: #22c55e;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 4px;
}
.fc-post-card-price:empty { display: none; }

/* ══════════════════════════════════════════════════════
   BARRA DE PESQUISA — squads / squad detail / DME
   ══════════════════════════════════════════════════════ */
.fc-dl-search-wrap {
    position: relative;
    margin: 0 0 14px;
}
.fc-dl-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-muted);
    pointer-events: none;
}
.fc-dl-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 38px 10px 36px;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    color: var(--clr-text);
    font-size: 0.88em;
    font-family: inherit;
}
.fc-dl-search-input:focus {
    outline: none;
    border-color: var(--clr-orange);
}
.fc-dl-search-input::placeholder { color: var(--clr-muted); }
.fc-dl-search-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-muted);
    font-size: 0.95em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.fc-dl-search-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--clr-muted);
    font-size: 0.85em;
}

/* ════════════════════════════════════════════════════════
   Popup inicial — Modo Livre vs Grade fixa (Criar Post)
   ════════════════════════════════════════════════════════ */
.fc-post-layout-chip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    background: rgba(13,13,13,0.85);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    font-size: 0.75em;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.fc-post-layout-chip:active { background: var(--clr-orange); border-color: var(--clr-orange); }

.fc-post-layout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fc-post-layout-modal {
    width: 100%;
    max-width: 380px;
    max-height: 84vh;
    overflow-y: auto;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 18px;
    padding: 20px 16px;
}
.fc-post-layout-title {
    font-weight: 700;
    font-size: 1em;
    color: var(--clr-text);
    text-align: center;
    margin-bottom: 16px;
}
.fc-post-layout-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.fc-post-layout-option:active { border-color: var(--clr-orange); background: rgba(249,115,22,.08); }
.fc-post-layout-option-label { font-weight: 700; font-size: 0.88em; color: var(--clr-text); }
.fc-post-layout-option-sub   { font-size: 0.72em; color: var(--clr-muted); margin-top: 2px; }

.fc-post-layout-grid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

/* Mini-prévia da grade (popup) */
.fc-post-mini-grid {
    display: grid;
    width: 44px;
    height: 44px;
    gap: 3px;
    flex-shrink: 0;
}
.fc-post-mini-cell {
    background: var(--clr-orange);
    border-radius: 2px;
}
.fc-post-mini-cell.empty { background: var(--clr-border); }

/* Mini-prévia do Modo Livre (cards soltos rotacionados) */
.fc-post-layout-free-preview {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.fc-post-layout-free-rect {
    position: absolute;
    background: var(--clr-orange);
    border-radius: 2px;
}