/* Copyright (c) 2024-2026. Jericho Crosby (Chalwk) */

.maze-panel {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.maze-title {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.maze-subtitle {
    color: var(--gray);
}

.maze-instructions {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(203, 213, 225, 0.1);
    border-radius: var(--radius);
}

.instructions-title {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 700;
    margin: 0 6px;
}

.pill.green {
    background: rgba(34, 197, 94, 0.12);
    color: #9ef0b4;
}

.pill.red {
    background: rgba(239, 68, 68, 0.12);
    color: #ffb4b4;
}

.maze-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.maze-left-controls {
    display: flex;
    gap: 0.5rem;
}

.maze-right-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.size-select-label {
    font-weight: 500;
    color: var(--dark);
}

.maze-size-select {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-light);
    background: white;
    margin-left: 0.5rem;
}

.maze-game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(203, 213, 225, 0.1);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
}

.stat-label {
    color: var(--primary);
}

.stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    margin-left: 0.5rem;
}

.maze-game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    min-height: 300px;
}

.maze-container {
    display: grid;
    gap: 3px;
    background: var(--darker);
    padding: 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.maze-touch-controls {
    text-align: center;
    margin-bottom: 1.5rem;
}

.touch-controls-title {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.dpad-btn:active {
    transform: translateY(2px);
    opacity: 0.9;
}

.dpad-row {
    display: flex;
    gap: 0.5rem;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 6px;
    transition: background-color 200ms ease, transform 120ms ease;
}

.wall {
    background: linear-gradient(180deg, #273144, #1b2432);
    opacity: 0.95;
}

.path {
    background: linear-gradient(180deg, #071226, #071226);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.player {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.18);
    transform: scale(1.02);
}

.player::after {
    content: "";
    display: block;
    width: 60%;
    height: 60%;
    margin: 8% auto 0;
    border-radius: 3px;
    background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02));
    opacity: 0.6;
}

.end {
    background: linear-gradient(180deg, #fb7185, #ef4444);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.16);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.06);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.hint {
    background: linear-gradient(180deg, #fffbeb, #fef3c7);
    box-shadow: 0 6px 12px rgba(255, 223, 93, 0.12);
    transform: scale(0.98);
    animation: hintGlow 900ms ease-in-out;
}

@keyframes hintGlow {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    60% {
        transform: scale(1.03);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .maze-controls-top {
        flex-direction: column;
        align-items: stretch;
    }

    .maze-left-controls, .maze-right-controls {
        width: 100%;
        justify-content: center;
    }

    .maze-container {
        max-width: 90vw;
        overflow: auto;
    }
}