/* =============================================
   PeakDuel - Custom Styles
   ============================================= */

:root {
    --peak-primary: #2563eb;
    --peak-secondary: #64748b;
    --peak-success: #22c55e;
    --peak-warning: #f59e0b;
    --peak-mountain-dark: #1e3a5f;
    --peak-mountain-light: #38bdf8;
    --peak-snow: #f0f9ff;
}

/* General */
body {
    background: linear-gradient(135deg, var(--peak-snow) 0%, #e0f2fe 100%);
    min-height: 100vh;
}

.navbar-brand i {
    color: var(--peak-snow);
}

/* Screens */
.screen {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Avatar Selection */
.avatar-option {
    width: 70px;
    height: 70px;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option:hover {
    border-color: var(--peak-primary);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--peak-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.avatar-option img,
.avatar-option svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-display {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    padding: 8px;
    border: 2px solid var(--peak-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-display img,
.avatar-display svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 5px;
    border: 2px solid var(--peak-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-small img,
.avatar-small svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Game Code */
.game-code {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5rem;
    background: var(--peak-snow);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    border: 2px dashed var(--peak-primary);
}

/* Category Selection */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.category-option {
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.category-option:hover {
    border-color: var(--peak-primary);
    background: var(--peak-snow);
}

.category-option.selected {
    border-color: var(--peak-primary);
    background: var(--peak-primary);
    color: white;
}

.category-option i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Quiz */
.quiz-card {
    border: none;
    border-radius: 1rem;
}

.quiz-question {
    font-size: 1.25rem;
    line-height: 1.6;
}

.quiz-answer {
    padding: 1rem 1.5rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    background: white;
    width: 100%;
    font-size: 1rem;
}

.quiz-answer:hover:not(:disabled) {
    border-color: var(--peak-primary);
    background: var(--peak-snow);
}

.quiz-answer.selected {
    border-color: var(--peak-primary);
    background: var(--peak-primary);
    color: white;
}

.quiz-answer.correct {
    border-color: var(--peak-success);
    background: var(--peak-success);
    color: white;
}

.quiz-answer.wrong {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

.quiz-answer:disabled {
    cursor: not-allowed;
}

/* Mountain Visualization */
.mountain-container {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #90EE90 100%);
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.mountain-svg {
    width: 100%;
    height: 350px;
}

.mountain-path {
    fill: none;
    stroke: #8B4513;
    stroke-width: 3;
    stroke-dasharray: 8, 4;
}

.mountain-body {
    fill: #6B7280;
}

.mountain-snow {
    fill: white;
}

.mountain-avatar {
    transition: all 0.5s ease-out;
}

.mountain-step {
    fill: rgba(255, 255, 255, 0.3);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1;
}

/* Player Scores in Quiz */
.player-score {
    font-size: 1.5rem;
    font-weight: bold;
}

/* End Screen */
.winner-announcement {
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.end-card-winner {
    border: 3px solid var(--peak-warning) !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

/* Highscore */
#highscore-list tr:nth-child(1) td:first-child {
    color: #FFD700;
    font-weight: bold;
}

#highscore-list tr:nth-child(2) td:first-child {
    color: #C0C0C0;
    font-weight: bold;
}

#highscore-list tr:nth-child(3) td:first-child {
    color: #CD7F32;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 576px) {
    .avatar-option {
        width: 55px;
        height: 55px;
    }
    
    .game-code {
        font-size: 1.5rem;
        letter-spacing: 0.3rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quiz-question {
        font-size: 1.1rem;
    }
    
    .mountain-container {
        min-height: 300px;
        padding: 1rem;
    }
    
    .player-score {
        font-size: 1.2rem;
    }
}
