/* ==========================================================================
   CORRIDA DO CONHECIMENTO - CONFIGURAÇÃO CSS
   Estilo visual premium com glassmorphism, tons escuros e acentos neon.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-color: #0b0c10;
    --card-bg: #14161f;
    --sidebar-bg: #0f111a;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent-neon: #00ffcc;
    --accent-purple: #7000ff;
    --accent-blue: #0077ff;
    --accent-gold: #ffc107;
    --danger: #ff4757;
    --success: #2ed573;
    --border-color: #1f222f;
    --border-hover: #31354b;
    --gradient-primary: linear-gradient(135deg, #00ffcc 0%, #7000ff 100%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
}

html { overflow-x: hidden; }
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo-rs {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -2px;
    display: flex;
    gap: -2px;
}

.logo-rs span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-rs span.mirrored {
    transform: scaleX(-1);
    display: inline-block;
}

.brand-text {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    background: rgba(0, 255, 204, 0.1);
    color: var(--accent-neon);
    border-left: 3px solid var(--accent-neon);
    border-radius: 0 8px 8px 0;
}

/* --- MAIN CONTENT & CONTAINERS --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
    position: relative;
}

.top-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background-color: rgba(11, 12, 16, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}

.btn-back {
    color: var(--text-muted);
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:hover {
    color: var(--text-main);
    transform: translateX(-2px);
}

.plan-badge {
    border: 1.5px solid rgba(255, 215, 0, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    background: #090c15;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 1px;
}

.config-container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.config-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.4s ease-out;
    display: none;
}

.config-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-neon);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"], input[type="number"], textarea, select.custom-select {
    width: 100%;
    background: #0b0c10;
    border: 1px solid #31354b;
    padding: 14px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: 0.2s;
    outline: none;
}

select.custom-select {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select.custom-select:focus {
    border-color: var(--accent-purple);
}

/* --- PLAN TESTER (SIMULATOR) --- */
.plan-tester {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #31354b;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
}

.plan-tester span {
    color: var(--text-muted);
}

.btn-test {
    background: transparent;
    border: 1px solid #4b5563;
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-test:hover {
    background: #31354b;
}

.btn-test.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    font-weight: bold;
    color: #fff;
}

/* --- TABS & GRIDS --- */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .grid-2-cols {
        grid-template-columns: 1fr;
    }
}

/* --- ABA 1: EQUIPES --- */
.team-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    justify-content: flex-start;
}

.team-config-card {
    flex: 1 1 280px;
    min-width: 250px;
    max-width: 450px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #1f222f;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.3s ease;
}

.team-config-card.card-eq-1 { border-top: 3px solid #4c9aff; }
.team-config-card.card-eq-2 { border-top: 3px solid #ff4d4d; }
.team-config-card.card-eq-3 { border-top: 3px solid #33cc33; }
.team-config-card.card-eq-4 { border-top: 3px solid #ffb84d; }
.team-config-card.card-eq-5 { border-top: 3px solid #9b59b6; }
.team-config-card.card-eq-6 { border-top: 3px solid #e84393; }

/* Carrossel de Veículos */
.carousel-selector-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    display: flex;
    gap: 12px;
    padding: 10px 4px 15px 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) var(--card-bg);
}

.carousel-selector-wrapper::-webkit-scrollbar {
    height: 6px;
}

.carousel-selector-wrapper::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.carousel-selector-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--accent-purple);
    border-radius: 4px;
}

.option-card {
    flex: 0 0 110px;
    border: 2px solid #31354b;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    background: #0f111a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.option-card img.vehicle-thumb {
    width: 70px;
    height: 45px;
    object-fit: contain;
    margin-bottom: 6px;
    transition: filter 0.3s ease;
    image-rendering: auto;
}

.cor-azul    { filter: hue-rotate(0deg) saturate(1.2); }
.cor-vermelho{ filter: hue-rotate(130deg) saturate(1.5); }
.cor-verde   { filter: hue-rotate(250deg) saturate(1.2); }
.cor-roxo    { filter: hue-rotate(45deg) saturate(1.2); }
.cor-rosa    { filter: hue-rotate(80deg) saturate(1.5); }
.cor-ciano   { filter: hue-rotate(-45deg) saturate(1.2); }


.option-card .vehicle-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.option-card:hover:not(.locked) {
    border-color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}

.option-card:hover:not(.locked) .vehicle-name {
    color: var(--text-main);
}

.option-card.selected {
    border-color: var(--accent-neon) !important;
    background: rgba(0, 255, 204, 0.05) !important;
}

.option-card.selected .vehicle-name {
    color: var(--accent-neon);
}

/* Grid de Cores */
.colors-grid {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.color-dot:hover:not(.locked) {
    transform: scale(1.1);
}

.color-dot.selected {
    border-color: var(--text-main);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.color-dot.disabled-mutex {
    opacity: 0.15;
    cursor: not-allowed;
    transform: scale(0.9);
    pointer-events: none;
}

/* Toggles */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toggle-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-neon);
}

/* --- ABA 2: BANCO DE PERGUNTAS --- */
.clues-list-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clue-editor-card {
    background-color: #1a1d29;
    border: 1px solid #31354b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: border-color 0.3s;
}

.card-intruso {
    border-color: #9b59b6 !important;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.2);
}

.fumaca {
    position: relative;
}

.fumaca::after {
    content: '';
    position: absolute;
    bottom: 80%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(200,200,200,0.8) 0%, rgba(200,200,200,0) 70%);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: subirFumaca 1s linear infinite;
    pointer-events: none;
    z-index: 20;
}

@keyframes subirFumaca {
    0% { transform: translate(-50%, 0) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -40px) scale(3); opacity: 0; }
}

.clue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #1f222f;
    padding-bottom: 10px;
}

.clue-number {
    font-weight: 800;
    color: var(--accent-purple);
    font-size: 1.1rem;
}

.btn-remove {
    background: transparent;
    color: var(--danger);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-remove:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-remove:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.question-alternatives-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .question-alternatives-grid {
        grid-template-columns: 1fr;
    }
}

.alternative-input-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    background: #14161f;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #31354b;
    transition: all 0.25s ease;
    cursor: pointer;
}

.alternative-input-wrapper:hover {
    border-color: rgba(0, 255, 204, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.alternative-letter {
    font-weight: 800;
    color: var(--accent-neon);
    font-size: 1.1rem;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    margin: 0;
}

.alternative-input-wrapper input[type="text"] {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    width: 100%;
    flex: 1;
    outline: none;
    padding: 4px 0;
    margin: 0;
}

.alternative-input-wrapper.correct-selection {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.1);
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.2);
}

/* Radio button de seleção customizado */
.correct-selector-radio {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #4b5563;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    margin: 0;
}

.correct-selector-radio:hover {
    border-color: var(--success);
    transform: scale(1.1);
}

.correct-selector-radio:checked {
    border-color: var(--success);
    background: var(--success);
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.6);
}

.correct-selector-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
}

.alternative-vf-text {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
}

.add-clue-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.btn-add-clue {
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border: 2px dashed #31354b;
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-add-clue:hover:not(:disabled) {
    background: rgba(0, 255, 204, 0.05);
    border-color: var(--accent-neon);
    color: var(--accent-neon);
}

.btn-add-clue:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.clue-limit-text {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.clue-limit-text span {
    color: var(--accent-neon);
}

/* Disciplinas e Temas */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.theme-card {
    background: #0b0c10;
    border: 1px solid #31354b;
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    text-align: center;
}

.theme-card:hover:not(.locked) {
    border-color: var(--accent-blue);
}

.theme-card.selected {
    border-color: var(--accent-neon) !important;
    background: rgba(0, 255, 204, 0.05) !important;
}

.theme-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

/* --- LOCK SYSTEM (PLANOS) --- */
.option-card.locked, .theme-card.locked, .color-dot.locked {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 0.4;
}

.badge-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 800;
    z-index: 2;
}

.pro-badge-opt {
    background: var(--accent-blue);
    color: #fff;
}

.vip-badge-opt {
    background: rgba(0,0,0,0.85);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

/* --- ACTION BAR (FIXADA EM BAIXO) --- */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    background: rgba(20, 22, 31, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #1f222f;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.action-bar-info strong {
    font-size: 1.05rem;
    color: var(--text-main);
}

.action-bar-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2px;
}

.action-btns {
    display: flex;
    gap: 16px;
}

.btn-save {
    background: rgba(46, 213, 115, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: var(--success);
    color: var(--bg-color);
}

.btn-play {
    background: var(--gradient-primary);
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    text-transform: uppercase;
}

.btn-play:hover {
    transform: translateY(-2px);
}

/* --- OVERLAYS & MODALS --- */
.custom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--card-bg);
    border: 1px solid #1f222f;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-icon.gold {
    color: var(--accent-gold);
}

.modal-icon.green {
    color: var(--accent-neon);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-close {
    background: #1f222f;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text-main);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-close:hover {
    background: #31354b;
}

.btn-modal-action {
    background: var(--gradient-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-modal-action:hover {
    transform: translateY(-2px);
}

/* --- IMAGES/TEMAS DE CENÁRIO (ABA 4) --- */
.option-card img.template-img {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #1f222f;
    background: #14161f;
}

.option-card.scenario-card {
    flex: 0 0 160px;
    font-size: initial;
    flex-direction: column;
    padding: 8px;
    min-height: 110px;
}

.option-card .opt-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-main);
}

/* --- RESPONSO --- */
@media (max-width: 480px) {
    .btn-control { width: 36px; height: 36px; font-size: 1rem; }
    .grupo-numero { width: 30px; height: 30px; font-size: 1rem; }
}

/* Fallback visual para pista de asfalto no painel de configurações */
.preview-asfalto {
    width: 100%;
    height: 100%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-asfalto::after {
    content: "";
    width: 100%;
    height: 4px;
    background-image: linear-gradient(to right, #fff 50%, transparent 50%);
    background-size: 20px 100%;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .brand-text, .brand-box {
        display: none;
    }
    .nav-item span {
        display: none;
    }
    .main-content {
        margin-left: 70px;
    }
    .action-bar {
        left: 70px;
        padding: 15px 20px;
    }
    .action-bar-info {
        display: none;
    }
}

/* --- LOCK CLASSES FOR INICIANTE PLAN --- */
.locked-opt-iniciante {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}
.locked-label-iniciante {
    opacity: 0.7;
}
.locked-card-iniciante {
    border-color: rgba(255, 193, 7, 0.3) !important;
}

/* ==========================================
   BANCO DE CONTEÚDOS PRONTOS & ITENS PADRONIZADOS
   ========================================== */
.banco-pronto-card {
    background: #141622;
    border: 1px solid #31354b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.banco-pronto-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.banco-pronto-header i {
    font-size: 1.5rem;
    color: var(--accent-neon);
    flex-shrink: 0;
}

.banco-pronto-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main);
}

.banco-pronto-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-load-questions {
    background: rgba(0, 255, 204, 0.1);
    color: var(--accent-neon);
    border: 1px solid var(--accent-neon);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-load-questions:hover:not(:disabled) {
    background: var(--accent-neon);
    color: #0b0c10;
    box-shadow: 0 0 16px rgba(0, 255, 204, 0.4);
    transform: translateY(-2px);
}

.btn-load-questions:active:not(:disabled) {
    transform: translateY(0);
}

.btn-load-questions:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #4b5563;
    color: #9ca3af;
}

.acervo-legenda {
    font-size: 0.83rem;
    color: var(--accent-neon);
    margin-top: 10px;
    padding: 8px 14px;
    background: rgba(0, 255, 204, 0.06);
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.btn-swap-card {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid #31354b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-swap-card:hover {
    background: rgba(0, 255, 204, 0.12);
    color: var(--accent-neon);
    border-color: var(--accent-neon);
}

.dist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .dist-grid {
        grid-template-columns: 1fr;
    }
}

.dist-col label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.lock-tag-mini {
    background: var(--accent-blue, #0077ff);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    margin-left: 6px;
    display: inline-block;
}

.nav-item-bottom {
    margin-top: auto;
    margin-bottom: 20px;
    border-top: 1px solid var(--border-color, #31354b);
    padding-top: 16px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-item-bottom:hover {
    color: var(--accent-neon);
    background: rgba(0, 255, 204, 0.05);
}

.upgrade-box {
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.15) !important;
}

/* =========================================================
   NAVEGAÇÃO LATERAL MOBILE - PADRÃO GAVETA RETRÁTIL (OFF-CANVAS)
   ========================================================= */
.btn-mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    /* 1. Trava geral contra zoom-out e vazamento horizontal */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
        display: block !important;
    }

    /* 2. Conteúdo principal em largura total */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-bottom: 110px !important;
        box-sizing: border-box !important;
    }

    /* 3. Top Header estruturado em 2 níveis */
    .top-header {
        height: auto !important;
        min-height: 64px !important;
        padding: 12px 16px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .page-title {
        font-size: 0.95rem !important;
        order: 1;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    #header-plan-badge {
        order: 2;
        font-size: 0.72rem !important;
        padding: 4px 8px !important;
    }

    /* Botão de abrir etapas ocupando linha própria */
    .btn-mobile-menu {
        display: flex !important;
        order: 3;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid #31354b !important;
        color: var(--text-main) !important;
        padding: 10px 14px !important;
        border-radius: 8px !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
    }

    .btn-mobile-menu:active {
        border-color: var(--accent-neon) !important;
        color: var(--accent-neon) !important;
    }

    /* 4. Container de Configurações */
    .config-container {
        padding: 16px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .config-section {
        padding: 20px 14px !important;
        margin-bottom: 20px !important;
        border-radius: 12px !important;
    }

    /* 5. Simulação de Planos flexível */
    .plan-tester {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .plan-tester span {
        width: 100% !important;
        margin-bottom: 4px !important;
    }

    .btn-test {
        flex: 1 1 auto !important;
        text-align: center !important;
        padding: 7px 10px !important;
    }

    /* 6. Grids internos convertidos para coluna única */
    .grid-2-cols,
    .powerups-group {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 7. Carrossel de seleção adaptado para deslize suave */
    .carousel-selector-wrapper {
        padding-bottom: 12px !important;
    }

    .option-card {
        flex: 0 0 115px !important;
        padding: 12px 6px !important;
    }

    /* Permite que as opções de cores quebrem de linha sem estourar a tela */
    .color-picker-row,
    .color-options,
    .cores-grid,
    .cores-frota,
    .colors-grid,
    .color-swatches-grid,
    .color-picker-wrapper,
    [class*="color-picker"],
    [class*="color-options"],
    [class*="cores-"] {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        max-width: 100% !important;
        overflow-x: visible !important;
        white-space: normal !important;
    }

    .color-dot,
    .color-option,
    .color-swatch {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    /* Empilha as equipes verticalmente em coluna única de 100% */
    .teams-container,
    .teams-grid,
    .equipes-wrapper,
    .grid-equipes,
    .duas-equipes-grid,
    .team-cards-container {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }

    .team-card,
    .equipe-box,
    .card-equipe,
    .team-config-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Distribui os cards de cenários em 2 colunas equilibradas preenchendo 100% da tela */
    #scenario-group,
    .scenarios-grid,
    .cenarios-grid,
    .templates-grid,
    .scenarios-scroll-grid,
    .carousel-selector-wrapper.grid-layout {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .scenario-card,
    .cenario-card,
    .option-card.scenario-card,
    #scenario-group .option-card,
    .scenarios-grid .option-card,
    .cenarios-grid .option-card,
    .templates-grid .option-card,
    .carousel-selector-wrapper.grid-layout .option-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        box-sizing: border-box !important;
    }



    /* 8. Gaveta Lateral Retrátil (Sidebar Off-Canvas) */
    
    /* Respiro generoso na base para o conteúdo de veículos rolar livremente sem sumir atrás da barra */
    .main-content,
    main {
        padding-bottom: 130px !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    /* Seleção de Veículos: quebra em grade suave */
    .vehicles-selector,
    .veiculos-grid,
    .car-selector-group,
    [id^="veiculo-group-"] {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    [id^="veiculo-group-"] .option-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        box-sizing: border-box !important;
    }

.sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(14, 17, 27, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-right: 1px solid var(--border-subtle, #1f222f) !important;
        z-index: 2500 !important;
        transform: translateX(-105%) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 15px 0 40px rgba(0, 0, 0, 0.8) !important;
    }

    .sidebar.drawer-aberto {
        transform: translateX(0) !important;
    }

    /* Força a exibição da logo completa com o texto "Educação" no Drawer Mobile */
    .sidebar .brand-box,
    aside.sidebar .brand-box {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 20px 24px !important;
        height: 75px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidebar .brand-box .brand-text,
    aside.sidebar .brand-box .brand-text {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        letter-spacing: 2px !important;
        text-transform: uppercase !important;
        color: var(--text-main, #f3f4f6) !important;
    }

    .sidebar .logo-rs,
    aside.sidebar .logo-rs {
        display: flex !important;
        visibility: visible !important;
    }


    /* Força a exibição dos textos das abas dentro da gaveta lateral mobile */
    .sidebar .nav-item span,
    .config-sidebar .nav-item span,
    .nav-menu .nav-item span {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 0.95rem !important;
        color: var(--text-main, #f3f4f6) !important;
    }

    .sidebar .nav-item,
    .config-sidebar .nav-item {
        justify-content: flex-start !important;
        padding: 14px 18px !important;
        gap: 14px !important;
        width: 100% !important;
    }


    .drawer-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 2400;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .drawer-overlay.ativo {
        opacity: 1;
        visibility: visible;
    }

    /* 9. Barra Inferior de Ação: Fixa na base de ponta a ponta */
    .action-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        padding: 10px 14px !important;
        background: rgba(11, 12, 16, 0.96) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border-top: 1px solid #1f222f !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        z-index: 2000 !important;
        box-sizing: border-box !important;
    }

    /* Barra de Acoes - Preserva o Nome da Partida visivel */
    .action-bar-info,
    .bar-info,
    .action-bar-left {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        max-width: 45% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    /* Forca exibicao do titulo truncando caso seja muito longo */
    .action-bar-info strong,
    .action-bar-info #bar-title,
    .bar-info strong,
    .bar-info #bar-title,
    #bar-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: #ffffff !important;
    }

    /* Oculta apenas o resumo secundario para economizar espaco horizontal */
    #bar-summary,
    .bar-summary,
    .action-bar-desc,
    .bar-desc,
    .action-bar-info p {
        display: none !important;
    }

    /* Botoes de Acao alinhados a direita */
    .action-bar-actions,
    .bar-actions,
    .action-bar-right,
    .action-btns {
        margin-left: auto !important;
        display: flex !important;
        gap: 8px !important;
    }

    .btn-save {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
    }

    .btn-play {
        padding: 10px 18px !important;
        font-size: 0.88rem !important;
        white-space: nowrap !important;
    }
}

/* =========================================================
   ESTILOS VISUAIS: SALA ONLINE, MODAL PIN E LINK COPIAR
   ========================================================= */
.btn-action-pin {
    background: rgba(0, 229, 255, 0.12) !important;
    color: #00e5ff !important;
    border: 1px solid #00e5ff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-action-pin:hover {
    background: #00e5ff !important;
    color: #0b0c10 !important;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.tactical-modal-card {
    background: #0b0f19;
    border: 1.5px solid #1e293b;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 40px rgba(0, 229, 255, 0.08);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 92%;
    max-width: 620px;
    text-align: left;
    margin: 0 auto;
}

.tactical-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00e5ff, transparent);
}

.tactical-pin-modal {
    max-width: 440px !important;
    padding: 22px 24px !important;
    text-align: center;
}

.icon-header-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.tactical-pin-modal .icon-header-badge {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.5rem !important;
    margin: 0 auto 10px !important;
}

.modal-main-title {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #f8fafc;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.tactical-pin-modal .modal-main-title {
    font-size: 1.2rem !important;
    margin-bottom: 6px !important;
}

.modal-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 24px;
    line-height: 1.4;
}

.mode-selection-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.mode-card-option {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid #1e293b;
    padding: 16px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.mode-card-option:hover {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.1);
}

.mode-card-option.modo-1v1:hover {
    border-color: #ff5252;
    background: rgba(255, 82, 82, 0.04);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.1);
}

.mode-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 12px;
}

.mode-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.mode-title-cyan { color: #00e5ff; }
.mode-title-red { color: #ff5252; }

.mode-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.badge-cyan {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.badge-red {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.mode-card-desc {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.45;
    text-align: left;
}

.modal-actions-right {
    display: flex;
    justify-content: flex-end;
}

.modal-badge-wrapper {
    margin-bottom: 16px !important;
    text-align: center;
}

.pin-container-box {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 18px !important;
    text-align: center;
}

.pin-label-text {
    font-size: 0.74rem !important;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.pin-number-badge {
    display: inline-block;
    background: rgba(0, 229, 255, 0.06);
    border: 2px solid #00e5ff;
    padding: 8px 24px;
    border-radius: 12px;
    font-size: 2.2rem;
    font-weight: 900;
    color: #00e5ff;
    letter-spacing: 7px;
    font-family: monospace, var(--font);
    text-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.1);
}

.copy-url-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-align: left;
    margin-bottom: 6px;
}

.copy-url-wrapper {
    display: flex;
    gap: 8px;
    background: #080b11;
    border: 1.5px solid #1e293b;
    padding: 4px 6px 4px 12px;
    border-radius: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.copy-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    outline: none;
}

.btn-copy-action {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid #00e5ff;
    color: #00e5ff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-action:hover {
    background: #00e5ff;
    color: #000;
}

.btn-copy-action.copied {
    background: #2ed573 !important;
    border-color: #2ed573 !important;
    color: #0b0c10 !important;
}

.copy-url-subtext {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 4px;
    margin-bottom: 18px;
    line-height: 1.35;
    text-align: center;
}

.btn-action-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #31354b;
    color: var(--text-main, #f3f4f6);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4b5563;
}

.btn-full {
    width: 100%;
}

/* =========================================================
   RESPONSIVIDADE MOBILE DA BARRA DE AÇÕES E MODAL PIN
   ========================================================= */
@media (max-width: 680px) {
    /* Esconde o resumo textual da esquerda para dar 100% de espaço aos botões */
    .action-bar-info {
        display: none !important;
    }
    
    .action-bar {
        padding: 8px 10px !important;
        justify-content: center !important;
    }

    .action-btns {
        width: 100% !important;
        display: flex !important;
        gap: 6px !important;
        justify-content: space-between !important;
    }

    .action-btns button {
        flex: 1 !important;
        justify-content: center !important;
        padding: 9px 4px !important;
        font-size: 0.76rem !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        letter-spacing: 0 !important;
    }

    .action-btns button i {
        font-size: 1rem !important;
        margin-right: 2px !important;
    }

    /* Modal de Escolha do PIN no celular */
    .tactical-modal-card {
        padding: 16px 14px !important;
        width: 95vw !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    .mode-card-header {
        flex-wrap: wrap !important;
        gap: 4px !important;
        align-items: center !important;
    }

    .mode-card-title {
        white-space: normal !important;
        font-size: 0.88rem !important;
    }

    .mode-badge {
        font-size: 0.62rem !important;
        padding: 2px 7px !important;
    }
}
/* ==========================================================================
   BADGES DE PLANO E VISIBILIDADE DINÂMICA
   ========================================================================== */
.badge-tier-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.badge-tier-tag.pro {
    background: rgba(0, 119, 255, 0.15);
    color: #00d2ff;
    border: 1px solid #00d2ff;
}
.badge-tier-tag.premium {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid #ffc107;
}

/* Ocultação automática pelo plano ativo no body */
body[data-plano="pro"] .badge-tier-tag.pro {
    display: none !important;
}
body[data-plano="premium"] .badge-tier-tag.pro,
body[data-plano="premium"] .badge-tier-tag.premium {
    display: none !important;
}

/* ==========================================================================
   ESTILOS DO MODAL DE UPGRADE DINÂMICO
   ========================================================================== */
.upgrade-box.tier-pro {
    border: 1px solid rgba(0, 119, 255, 0.45) !important;
    box-shadow: 0 12px 35px rgba(0, 119, 255, 0.25), 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}
.upgrade-box.tier-pro .modal-icon { color: #00d2ff !important; }
.upgrade-box.tier-pro .btn-upgrade-action {
    background: linear-gradient(135deg, #0077ff 0%, #00d2ff 100%) !important;
    color: #ffffff !important;
}

.upgrade-box.tier-premium {
    border: 1px solid rgba(255, 193, 7, 0.45) !important;
    box-shadow: 0 12px 35px rgba(255, 193, 7, 0.2), 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}
.upgrade-box.tier-premium .modal-icon { color: #ffc107 !important; }
.upgrade-box.tier-premium .btn-upgrade-action {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%) !important;
    color: #000000 !important;
}
