/* Maze Puzzle Styles - Modern Design */

/* Maze SVG Container - The core grid */
.maze-svg-container {
    width: 100%;
    height: auto;
    background: var(--bg-primary);
    display: block;
    aspect-ratio: 1 / 1;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    touch-action: manipulation;
}

.puzzle-grid-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Pause Overlay */
#pauseOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid var(--text-primary);
}

#pauseOverlay.active {
    display: flex;
}

.play-icon-wrapper {
    background: var(--primary-color);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

/* D-Pad Controls (Specific to Maze) */
.d-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 180px;
    margin: 0 auto;
}

.d-pad.single-row {
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 260px;
}

.d-btn {
    width: 55px;
    height: 55px;
    background: var(--bg-primary);
    border: 2px solid var(--text-primary);
    border-radius: 12px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.1s ease;
    user-select: none;
}

.d-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
}

.d-btn:active:not(:disabled) {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: scale(0.95);
}

.d-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Game Stats */
.game-stats-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 350px;
    margin-bottom: 20px;
    justify-content: center;
}

.game-stats {
    flex: 1;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    background: var(--bg-primary);
}

.game-stat-label {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.game-stat-value {
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--text-primary);
}

#wrongCount {
    color: var(--error-color);
}

/* Helper Classes for Clean HTML */
.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flex-gap {
    display: flex;
    gap: 10px;
}

.mirror-x {
    display: inline-flex;
    transform: scaleX(-1);
}

/* SVG Element Styles */
.maze-label-text {
    font-family: monospace;
}

/* Responsive View */
@media (max-width: 900px) {
    #maze-game.selection-screen {
        max-width: 100%;
    }

    .puzzle-grid-wrapper {
        max-width: 100%;
        width: calc(100vw - 30px);
    }

    .d-pad {
        width: 100%;
        max-width: 300px;
    }

    .d-btn {
        width: 100%;
        height: 50px;
    }
}
