/* =========================================
   ConclaveHub Games - Core Styles
   ========================================= */

/* --- Tutorial Overlay --- */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tutorial-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tutorial-overlay.active .tutorial-card {
    transform: translateY(0);
}

.tutorial-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    z-index: 10;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tutorial-close:hover {
    background: #334155;
    color: white;
}

.tutorial-media {
    height: 160px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #334155;
}

.tutorial-body {
    padding: 1.5rem;
}

.tutorial-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tutorial-content {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    transition: all 0.3s;
}

.tutorial-dot.active {
    background: #f59e0b;
    transform: scale(1.2);
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.tutorial-btn {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-btn--secondary {
    background: transparent;
    color: #94a3b8;
    border: 1px solid transparent;
}

.tutorial-btn--secondary:hover {
    color: white;
    background: #334155;
}

.tutorial-btn--primary {
    background: #f59e0b;
    color: #1e293b;
    border: none;
    margin-left: auto;
}

.tutorial-btn--primary:hover {
    background: #fbbf24;
}

/* --- Glass Panel (Added for consistent modals) --- */
.glass-panel {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- Leaderboard Modal --- */
.leaderboard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    z-index: 100;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.leaderboard-header {
    padding: 1.5rem;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-close {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.settings-close:hover {
    background: #1e293b;
    color: white;
}

.leaderboard-content {
    flex: 1;
    overflow-y: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 1rem;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #1e293b;
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid #1e293b;
    color: white;
}

.leaderboard-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1e293b;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}

.rank-1 { background: #fbbf24; color: #78350f; }
.rank-2 { background: #94a3b8; color: #0f172a; }
.rank-3 { background: #b45309; color: #fffbeb; }

.leaderboard-score {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: #f59e0b;
}

.leaderboard-date {
    font-size: 0.75rem;
    color: #64748b;
}

.leaderboard-footer {
    padding: 1.5rem;
    border-top: 1px solid #1e293b;
    background: #1e293b;
    border-radius: 0 0 1rem 1rem;
}

/* Score Submission */
.score-submission {
    padding: 2rem;
    text-align: center;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.score-value {
    font-size: 3rem;
    font-weight: 800;
    color: #22c55e;
    margin: 1rem 0;
    font-family: 'Space Mono', monospace;
}

.name-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.name-input {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    outline: none;
    transition: all 0.2s;
}

.name-input:focus {
    border-color: #f59e0b;
}

.submit-btn {
    background: #f59e0b;
    color: #1e293b;
    border: none;
    padding: 0 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #fbbf24;
}

/* --- Settings Modal --- */
.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    z-index: 100;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.settings-content {
    padding: 1.5rem;
}

.settings-row {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.settings-value {
    color: #f59e0b;
    font-family: monospace;
}

.settings-slider {
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #f59e0b;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

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

.settings-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #f59e0b;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.1s;
}

.settings-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
}

.toggle-switch {
    width: 48px;
    height: 24px;
    background: #334155;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #22c55e;
}

.toggle-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(24px);
}

/* --- Achievement Toast --- */
.achievement-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.achievement-toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    min-width: 300px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideInDown 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), fadeOut 0.5s ease-in 4.5s forwards;
    pointer-events: auto;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.achievement-icon {
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    color: #f59e0b;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.achievement-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.achievement-desc {
    color: #94a3b8;
    font-size: 0.8rem;
}

.achievement-reward {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
