/* Game Page Specific Styles */
.game-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

/* Game Header */
.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--spacing-md) 0;
}

.game-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.game-title h1 {
    color: white;
    margin-bottom: 0.25rem;
    text-align: center;
}

.game-title p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.875rem;
    text-align: center;
}

.game-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

#game-help {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

@media (max-width: 992px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
}

/* Game Sidebar */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.instructions-card,
.leaderboard-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions-card h3,
.leaderboard-card h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: white;
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.instructions-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-md);
}

.instructions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.9);
}

.instruction-item i {
    color: #4ade80;
    width: 20px;
    text-align: center;
}

.difficulty-selector h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.difficulty-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.difficulty-btn {
    flex: 1;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.difficulty-btn:hover,
.difficulty-btn.active {
    background: var(--primary-indigo);
    border-color: var(--primary-indigo);
}

/* Leaderboard */
.leaderboard-list {
    list-style: none;
    margin-bottom: var(--spacing-md);
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-list li:last-child {
    border-bottom: none;
}

.leaderboard-name {
    font-weight: 600;
    color: white;
}

.leaderboard-score {
    color: #fbbf24;
    font-weight: 700;
}

#view-full-leaderboard {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

#view-full-leaderboard:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-heading);
}

/* Game Scene */
.game-scene {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.adventure-map {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.map-room {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-medium);
}

.map-room.current {
    background: var(--primary-indigo);
    border-color: var(--primary-indigo);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.map-room.completed {
    background: #10b981;
    border-color: #10b981;
}

.map-room i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.map-room span {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.map-connector {
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

/* Math Problem */
.math-problem-container {
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.problem-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.problem-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    text-transform: uppercase;
}

.problem-number {
    background: var(--primary-indigo);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

#problem-text {
    font-size: 3rem;
    color: white;
    margin: var(--spacing-md) 0;
    font-weight: 700;
}

.problem-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.problem-hint i {
    color: #fbbf24;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 576px) {
    .answer-options {
        grid-template-columns: 1fr;
    }
}

.answer-option {
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.answer-option.correct {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.answer-option.incorrect {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.answer-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Game Feedback */
.game-feedback {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    margin-top: var(--spacing-md);
    display: none;
}

.game-feedback.correct {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 2px solid #10b981;
    display: block;
}

.game-feedback.incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid #ef4444;
    display: block;
}

.game-feedback.game-over {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

/* Game Footer */
.game-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
}

.game-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.game-progress {
    flex: 1;
    min-width: 300px;
}

.progress-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-indigo);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.game-share {
    display: flex;
    gap: var(--spacing-sm);
}

#share-score,
#save-progress {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

#share-score:hover,
#save-progress:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex-grow: 1;
}

.help-section {
    margin-bottom: var(--spacing-lg);
}

.help-section h4 {
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.help-section p,
.help-section ul {
    color: var(--gray-600);
}

.help-section ul {
    margin-left: var(--spacing-lg);
}

.help-section li {
    margin-bottom: 0.5rem;
}

.difficulty-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.diff-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.diff-label {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

.diff-label.beginner {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 2px solid #10b981;
}

.diff-label.intermediate {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.diff-label.advanced {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.diff-info p {
    margin: 0;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

/* Responsive Game Styles */
@media (max-width: 768px) {
    .game-header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .adventure-map {
        gap: 0.5rem;
    }
    
    .map-room {
        width: 60px;
        height: 60px;
    }
    
    .map-connector {
        width: 15px;
    }
    
    #problem-text {
        font-size: 2.5rem;
    }
    
    .game-footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .game-progress {
        min-width: 100%;
    }
}