/* ============================================================
   settings.css — Settings dialog, map colors, volume sliders,
   mute button, alliance settings, and mobile responsive
   ============================================================ */

/* DIALOGO DE AJUSTES */
#settings-dialog-overlay {
    background: transparent;
    z-index: 150;
}

#settings-dialog {
    min-width: 300px;
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

#settings-dialog-title {
    color: #f0c040;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-option:last-child {
    border-bottom: none;
}

.settings-label {
    color: #ccc;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #888;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: rgba(240, 192, 64, 0.4);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: #f0c040;
}

/* SELETOR DE CORES DO MAPA */
.settings-section-title {
    color: #f0c040;
    font-size: 13px;
    margin-top: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.map-color-options {
    display: flex;
    gap: 8px;
}

.map-color-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
    font-size: 11px;
}

.map-color-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(240, 192, 64, 0.3);
}

.map-color-btn.active {
    background: rgba(240, 192, 64, 0.1);
    border-color: #f0c040;
    color: #f0c040;
}

.map-color-preview {
    width: 40px;
    height: 26px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.classic-preview {
    background: linear-gradient(90deg, #8fbc8f 0%, #deb887 33%, #b0c4de 66%, #f0e68c 100%);
}

.diplomatic-preview {
    background: linear-gradient(90deg, #30e030 0%, #30e030 33%, #e03030 33%, #e03030 66%, #e0e0e0 66%, #e0e0e0 100%);
}

.player-preview {
    background: linear-gradient(90deg, #e87f3a 0%, #e87f3a 33%, #9b59b6 33%, #9b59b6 66%, #d8d8d0 66%, #d8d8d0 100%);
}


/* VOLUME SLIDERS - Ajustes de Áudio */
.volume-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 190px;
}

.volume-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c040;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(240, 192, 64, 0.6);
    transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c040;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 4px rgba(240, 192, 64, 0.6);
}

.volume-value {
    color: #f0c040;
    font-size: 11px;
    font-weight: bold;
    min-width: 32px;
    text-align: right;
}

.number-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.number-input {
    width: 56px;
    padding: 5px 4px;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    -moz-appearance: textfield;
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.number-btn:active {
    background: rgba(255,255,255,0.2);
}

/* BOTÃO MUTE - Player Panel */
.mute-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 18px;
    flex-shrink: 0;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   CONFIGURACOES DA ALIANCA
   ============================================================ */
.alliance-settings {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
}

.alliance-settings-section {
    background: rgba(20, 20, 40, 0.5);
    border: 1px solid rgba(240, 192, 64, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.alliance-settings-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #f0c040;
}

.alliance-settings-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #999;
}

.alliance-settings-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.alliance-settings-radio {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(30, 30, 50, 0.6);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.alliance-settings-radio:hover {
    background: rgba(40, 40, 60, 0.8);
    border-color: rgba(240, 192, 64, 0.3);
}

.alliance-settings-radio input[type="radio"] {
    display: none;
}

.alliance-settings-radio input[type="radio"]:checked + span {
    color: #f0c040;
    font-weight: 600;
}

.alliance-settings-radio input[type="radio"]:checked ~ * {
    color: #f0c040;
}

.alliance-settings-radio:has(input:checked) {
    border-color: rgba(240, 192, 64, 0.6);
    background: rgba(240, 192, 64, 0.1);
}

.alliance-settings-radio span {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
}

.alliance-settings-radio small {
    font-size: 12px;
    color: #888;
}

.alliance-settings-input {
    width: 100%;
    padding: 12px;
    background: rgba(30, 30, 50, 0.6);
    border: 1px solid rgba(240, 192, 64, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 15px;
}

.alliance-settings-input:focus {
    outline: none;
    border-color: rgba(240, 192, 64, 0.6);
    background: rgba(30, 30, 50, 0.8);
}

.alliance-settings-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f0c040 0%, #d4af37 100%);
    border: none;
    border-radius: 6px;
    color: #0a0a1e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.alliance-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 192, 64, 0.4);
}

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

@media (max-width: 768px) {
    .alliance-settings {
        padding: 15px;
        gap: 20px;
    }

    .alliance-settings-section {
        padding: 15px;
    }

    .alliance-settings-section h3 {
        font-size: 15px;
    }

    .referral-stats-summary {
        grid-template-columns: 1fr;
    }

    .referral-code-display,
    .referral-link-display {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }

    #referral-stats-dialog {
        min-width: 90%;
        max-width: 90%;
    }

    #referral-ranking-dialog {
        min-width: 90%;
        max-width: 90%;
    }
}

/* Mobile: volume slider + mute btn */
@media (max-width: 768px) {
    .volume-slider-wrapper {
        max-width: 140px;
        gap: 5px;
        overflow: hidden;
    }

    .volume-slider {
        min-width: 0;
    }

    .volume-value {
        flex-shrink: 0;
    }
    .mute-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}
