.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#modal-hero-details .modal-content {
    max-width: 1200px;
    width: 95%;
    padding: 0;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    max-height: none;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close-modal:hover {
    color: white;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 16px;
}

.modal-title h2 {
    margin: 0;
    font-size: 1.8rem;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.modal-section-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    margin-top: 20px;
}

/* Settings Modal Specifics */
.settings-group {
    margin-bottom: 24px;
}

.settings-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.volume-control-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent, #646cff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(100, 108, 255, 0.5);
}

.volume-label {
    min-width: 45px;
    text-align: right;
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent, #646cff);
}

.btn-icon.large {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
}

.game-notice-panel {
    max-width: 460px;
    text-align: center;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border-glass));
}

.game-notice-panel.warning { border-color: color-mix(in srgb, var(--warning) 58%, var(--border-glass)); }
.game-notice-panel.danger { border-color: color-mix(in srgb, var(--danger) 58%, var(--border-glass)); }
.game-notice-eyebrow { margin: 0 0 8px; color: var(--text-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.game-notice-panel h2 { margin: 0; color: var(--text-main); font-size: 1.5rem; }
.game-notice-message { margin: 14px 0 22px; color: var(--text-muted); line-height: 1.55; white-space: pre-line; }
.game-notice-actions { display: flex; gap: 10px; }
.game-notice-actions .btn { min-height: 48px; }
.game-notice-actions .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 420px) {
    .game-notice-actions { flex-direction: column-reverse; }
}

.settings-danger-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.settings-danger-copy {
    flex: 1;
    min-width: 0;
}

.settings-danger-copy h3 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1rem;
}

.settings-danger-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.settings-danger-zone .btn {
    width: auto;
    min-height: 44px;
    flex-shrink: 0;
}

.settings-footer {
    margin-top: 20px;
    text-align: right;
}

@media (max-width: 520px) {
    .settings-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-danger-zone .btn {
        width: 100%;
    }
}
