/* Pack-Man Game Styles */

#game {
    padding: 20px 0;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary, #f0f0f0);
    border: 3px solid var(--border-color, #000);
    padding: 20px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
}

.game-title {
    font-family: "Courier New", monospace;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--accent-color, #ff00ff);
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 0 var(--border-color, #000);
    letter-spacing: 3px;
}

.game-subtitle {
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: var(--text-secondary, #666);
    text-transform: lowercase;
    margin: 0;
}

.game-canvas-wrapper {
    background: #000;
    border: 3px inset var(--border-color, #666);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px auto;
}

#packman-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #000;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
}

.game-instructions {
    background: var(--bg-primary, #fff);
    border: 2px solid var(--border-color, #000);
    padding: 15px;
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 1.6;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    margin-top: 15px;
}

.game-instructions.collapsed {
    max-height: 0;
    padding: 0 15px;
    margin-top: 0;
    border: none;
}

.game-instructions h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--accent-color, #ff00ff);
    text-transform: uppercase;
}

.game-instructions ul {
    margin: 5px 0;
    padding-left: 20px;
}

.game-instructions li {
    margin: 3px 0;
    color: var(--text-primary, #000);
}

.game-instructions .key {
    background: var(--bg-secondary, #f0f0f0);
    border: 2px outset var(--border-color, #999);
    padding: 2px 6px;
    font-weight: bold;
    color: var(--text-primary, #000);
    white-space: nowrap;
}

.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.game-btn {
    font-family: "Courier New", monospace;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 20px;
    background: linear-gradient(to bottom, var(--nav-bg-light, #ddd), var(--nav-bg-dark, #aaa));
    color: var(--text-primary, #000);
    border: 3px outset var(--nav-border, #999);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s ease;
    min-width: 120px;
}

.game-btn:hover {
    background: var(--accent-color, #ff00ff);
    color: var(--bg-primary, #fff);
    border-color: var(--accent-color, #ff00ff);
}

.game-btn:active {
    border-style: inset;
    background: linear-gradient(to bottom, var(--nav-bg-dark, #aaa), var(--nav-bg-light, #ddd));
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 10px;
    background: #000;
    border: 2px inset var(--border-color, #333);
}

.game-stat {
    font-family: "Courier New", monospace;
    font-size: 14px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    text-align: center;
}

.game-stat-label {
    font-size: 10px;
    color: #00ff00;
    display: block;
    margin-bottom: 5px;
    opacity: 0.7;
}

.game-stat-value {
    font-size: 18px;
    display: block;
}

.game-legend {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-primary, #fff);
    border: 2px solid var(--border-color, #000);
    font-family: "Courier New", monospace;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color, #000);
}

.legend-icon.packman {
    background: #ffff00;
    border-radius: 50%;
}

.legend-icon.ghost {
    background: #ff0000;
}

.legend-icon.pellet {
    background: #000;
    position: relative;
}

.legend-icon.pellet::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffb8ae;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.legend-icon.power {
    background: #000;
    position: relative;
}

.legend-icon.power::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffb8ae;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.legend-text {
    color: var(--text-primary, #000);
    font-size: 10px;
}

/* Dark theme adjustments */
body.dark-theme .game-container {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-theme .game-instructions {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

body.dark-theme .game-instructions li {
    color: var(--text-primary);
}

body.dark-theme .game-legend {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

body.dark-theme .legend-text {
    color: var(--text-primary);
}

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

    .game-title {
        font-size: 20px;
    }

    #packman-canvas {
        max-width: 100%;
        height: auto;
    }

    .game-legend {
        flex-wrap: wrap;
        gap: 10px;
    }

    .game-buttons {
        flex-direction: column;
    }

    .game-btn {
        width: 100%;
    }
}
