/* minigames/pacman.css */
.pacman-wrap {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5% 100px;
}

.minigames-breadcrumb {
    padding-top: 28px;
    margin-bottom: 24px;
}

.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}

.breadcrumb-back svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.breadcrumb-back:hover {
    color: var(--accent-gold);
    gap: 10px;
}

.breadcrumb-back:hover svg {
    transform: translateX(-3px);
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
}

.game-board-area {
    order: 2;
    flex: 1;
    width: 100%;
    max-width: 1250px;
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.035);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-header {
    width: 100%;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-stats {
    width: 100%;
    max-width: 1140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f7;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid #eee;
    font-family: monospace;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80px;
}

.stat-box:last-child {
    justify-content: flex-end;
}

.action-btn {
    background: var(--accent-gold);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 15px;
}

.action-btn:hover {
    opacity: 0.9;
}

.grid-wrapper {
    position: relative;
    padding: 8px;
    background: #111;
    border-radius: 12px;
    border: 3px solid #333;
    display: flex;
    justify-content: center;
    max-width: 100%;
    box-sizing: border-box;
}

#pacman-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    background: #000;
    border-radius: 4px;
}

/* Overlay */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
}

.game-overlay.hidden,
.hidden {
    display: none !important;
}

.overlay-content {
    position: relative;
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.overlay-close:hover {
    color: #333;
    background: #f0f0f0;
}

.overlay-content h2 {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-family: var(--header-font);
}

.overlay-content p {
    color: #666;
    margin-bottom: 24px;
    font-size: 16px;
}

#high-score-form {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

#high-score-form p {
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 18px;
}

#player-name {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 16px;
}

/* Controls Hint */
.controls-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
    text-align: center;
    line-height: 1.5;
}

/* Scores Sidebar */
.scores-area {
    order: 1;
    width: 100%;
    max-width: 1250px;
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 32px 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.035);
    flex-shrink: 0;
}

.scores-area h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-family: var(--header-font);
    text-align: center;
}

.scores-list {
    min-height: 50px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.score-item:last-child {
    border-bottom: none;
}

.score-rank {
    width: 28px;
    font-weight: bold;
    color: #999;
    font-size: 14px;
}

.score-item:nth-child(1) .score-rank {
    color: #FFD700;
}

.score-item:nth-child(2) .score-rank {
    color: #C0C0C0;
}

.score-item:nth-child(3) .score-rank {
    color: #CD7F32;
}

.score-name {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.score-time {
    font-family: monospace;
    font-size: 15px;
    font-weight: bold;
    color: var(--accent-gold);
}

@media (max-width: 600px) {
    .scores-area {
        padding: 24px 16px;
    }

    .game-board-area {
        padding: 20px 10px;
    }

    #pacman-canvas {
        max-width: 100%;
        height: auto;
    }
}