/* Statistics Page Styles */

/* Main container */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Statistics content */
.stats-main {
    flex: 1;
    margin-top: 1rem;
}

.stats-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.stats-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.stats-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.player-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-name {
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stats cards grid */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--text-color);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Feature icons for how-to-play page */
.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Special card types */
.stat-card.best-score {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a202c;
}

.stat-card.best-words {
    background: linear-gradient(135deg, #48bb78 0%, #68d391 100%);
    color: white;
}

.stat-card.streak-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.best-score h3,
.stat-card.best-words h3,
.stat-card.streak-card h3 {
    color: inherit;
    opacity: 0.9;
}

.stat-card.best-score .stat-subtext,
.stat-card.best-words .stat-subtext,
.stat-card.streak-card .stat-subtext {
    color: inherit;
    opacity: 0.8;
}

.stat-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-accent);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.stat-card ul {
    color: var(--text-color);
    text-align: left;
    margin: 0;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.stat-card li {
    margin-bottom: 0.5rem;
}

.stat-card li:last-child {
    margin-bottom: 0;
}

.stat-card a {
    color: var(--text-accent);
    text-decoration: none;
}

.stat-card a:hover {
    text-decoration: underline;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-accent);
    margin: 0 0 0.5rem 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.stat-subtext {
    font-size: 0.875rem;
    color: #b3b9c5;
    margin: 0;
    line-height: 1.4;
}

/* Stats sections */
.stats-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-accent);
    margin: 0 0 1.5rem 0;
    text-align: center;
    position: relative;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Stats subsections */
.stats-subsection {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-accent);
    margin: 0 0 1rem 0;
    text-align: center;
}

/* No game stats */
.no-game-stats {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

.no-game-stats h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-accent);
    margin: 0 0 0.5rem 0;
}

.no-game-stats p {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Attempt distribution */
.attempt-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.attempt-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attempt-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-accent);
    min-width: 30px;
    text-align: center;
}

.attempt-bar-container {
    flex: 1;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.attempt-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.attempt-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-accent);
    min-width: 30px;
    text-align: right;
}

/* Text center utility */
.text-center {
    text-align: center;
}

/* Recent games */
.recent-games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.recent-game-card {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: unset;
    cursor: pointer;
    position: relative;
}

.recent-game-card::after {
    content: '📊';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.recent-game-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: var(--bg-light);
    border-color: var(--accent-fg);
}

.recent-game-card:hover::after {
    opacity: 0.7;
}

.recent-game-card:focus-visible {
    outline: 2px solid var(--accent-fg);
    outline-offset: 2px;
}





.game-score {
    font-size: 1.05rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
}

.game-percent {
    font-size: 0.95rem;
    font-weight: 600;
    color: #48bb78;
    margin: 0;
}

.game-words {
    font-size: 0.85rem;
    color: #b3b9c5;
    margin: 0;
}

.game-date {
    font-size: 0.8rem;
    color: #7a8599;
    font-style: italic;
    margin: 0;
}

.recent-game-card .game-score,
.recent-game-card .game-percent,
.recent-game-card .game-words,
.recent-game-card .game-date {
    display: inline-block;
    margin-right: 0.5rem;
}

.recent-game-card .game-date {
    margin-right: 0;
}

/* Game info layout */
.game-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Achievements */
.achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a202c;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.achievement-icon {
    font-size: 1.2rem;
}

.achievement-text {
    font-size: 0.875rem;
}

/* Last game info */
.last-game {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* No stats message */
.no-stats {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.no-stats h3 {
    font-size: 1.5rem;
    color: var(--text-accent);
    margin: 0 0 1rem 0;
}

.no-stats p {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

/* Buttons */
.buttons {
    text-align: center;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    margin: 0 0.5rem 0.5rem 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #64748b;
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(100, 116, 139, 0.4);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-title {
        font-size: 2rem;
    }
    
    .player-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .player-avatar {
        width: 48px;
        height: 48px;
    }
    
    .player-name {
        font-size: 1.25rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .recent-games {
        grid-template-columns: 1fr;
    }
    
    .recent-game-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .game-info {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .achievements {
        flex-direction: column;
        align-items: center;
    }
    
    .achievement-badge {
        width: 100%;
        max-width: 300px;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .stats-subsection {
        padding: 1rem;
    }
    
    .subsection-title {
        font-size: 1.125rem;
    }
    
    .attempt-distribution {
        max-width: 300px;
    }
    
    .attempt-bar {
        gap: 0.5rem;
    }
    
    .attempt-label,
    .attempt-count {
        font-size: 0.75rem;
        min-width: 25px;
    }
    
    .attempt-bar-container {
        height: 16px;
    }
}

@media (max-width: 480px) {
    .stats-header {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }
    
    .stats-title {
        font-size: 1.75rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .recent-games {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .recent-game-card {
        padding: 0.5rem;
    }
    
    .game-info {
        font-size: 0.875rem;
    }
    
    .achievement-badge {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .achievement-icon {
        font-size: 1rem;
    }

    .stats-subsection {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .subsection-title {
        font-size: 1rem;
    }
    
    .no-game-stats {
        padding: 1.5rem 1rem;
    }
    
    .no-game-stats h3 {
        font-size: 1.125rem;
    }
    
    .attempt-distribution {
        max-width: 250px;
        gap: 0.5rem;
    }
    
    .attempt-bar {
        gap: 0.375rem;
    }
    
    .attempt-label,
    .attempt-count {
        font-size: 0.6875rem;
        min-width: 20px;
    }
    
    .attempt-bar-container {
        height: 14px;
    }
}

@media (max-width: 900px) {
    .recent-games {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .recent-games {
        grid-template-columns: 1fr;
    }
}
