/* Mini Games Hub Styles */

/* Override body centering for games pages */
main[data-page="games"] {
    width: 100%;
    max-width: none;
    align-self: stretch;
}

/* Main container - full width */
.games-container {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 60px);
    margin: 0;
    padding: 20px 30px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Section Headers */
.games-section {
    margin-bottom: 35px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.section-header .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Music Toggle Button */
.music-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    min-width: 120px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.music-toggle-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.music-toggle-btn.playing {
    border-color: var(--border-accent);
    color: var(--border-accent);
}

.music-toggle-btn.playing .music-off {
    display: none;
}

.music-toggle-btn.playing .music-on {
    display: block !important;
}

.music-toggle-btn .music-slash {
    stroke: currentColor;
}

.music-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.section-icon {
    color: var(--border-accent);
    font-weight: bold;
}

/* Games Grid - Multi-column layout */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    flex: 1 1 auto;
    align-content: start;
}

/* Force multiple columns on wider screens */
@media (min-width: 700px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1800px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Game Card */
.game-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.game-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 20px var(--shadow-color);
    transform: translateY(-2px);
}

.game-card.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.game-card.coming-soon:hover {
    transform: none;
    opacity: 0.85;
}

/* Game Icon */
.game-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.ascii-icon {
    font-size: 11px;
    line-height: 1.2;
    color: var(--border-accent);
    margin: 0;
    white-space: pre;
    font-family: GohuFont14NerdFont, monospace;
}

/* Game Info */
.game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.game-name {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.game-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Badges */
.game-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin-right: 5px;
}

.game-badge.badge-featured {
    background-color: var(--border-accent);
    border-color: var(--border-accent);
    color: var(--bg-color);
}

.game-badge.badge-new {
    background-color: #4a9;
    border-color: #4a9;
    color: #fff;
}

.game-badge.badge-popular {
    background-color: #f80;
    border-color: #f80;
    color: #fff;
}

/* Info Cards */
.games-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.info-card {
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.info-card h3 {
    color: var(--border-accent);
    margin: 0 0 10px 0;
    font-size: 16px;
}

.info-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Sound & Settings Controls */
.games-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 10px var(--shadow-color);
}

.control-btn svg {
    stroke: currentColor;
}

/* User Stats Section */
.user-stats-section {
    margin-bottom: 40px;
    padding: 25px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--border-accent);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hidden Games Section */
.hidden-games-section {
    border: 1px dashed var(--border-accent);
    padding: 25px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
}

.hidden-games-section .section-title {
    border-bottom-color: var(--border-accent);
}

.glitch-text {
    position: relative;
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.8; transform: translateX(-2px); }
    94% { opacity: 0.9; transform: translateX(2px); }
    96% { opacity: 0.7; transform: translateX(-1px); }
}

.hidden-game {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 255, 0, 0.05) 100%);
}

.hidden-game:hover {
    box-shadow: 0 0 25px var(--border-accent);
}

.game-badge.badge-secret {
    background: linear-gradient(45deg, #9b59b6, #3498db);
    border: none;
    color: #fff;
}

/* Secret Hint */
.secret-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: help;
    opacity: 0.5;
    transition: all 0.3s ease;
    z-index: 100;
}

.secret-hint:hover {
    opacity: 1;
    border-color: var(--border-accent);
    color: var(--border-accent);
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    .games-container {
        padding: 20px 15px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .game-icon {
        width: 100%;
        height: 70px;
    }

    .game-info {
        align-items: center;
    }

    .games-controls {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-value {
        font-size: 24px;
    }

    .games-info {
        grid-template-columns: 1fr;
    }
}
