/* Maze Game Styles */
.maze-container {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.maze-game-wrapper {
    background: white;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08);
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
    padding: 2rem;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    /* Prevent double-tap zoom on the entire maze game */
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.maze-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(-45deg, #1a365d, #2d3748, #2b6cb7, #3182ce);
    background-size: 400% 400%;
    animation: Gradient 15s ease infinite;
    border-radius: 24px;
    z-index: -1;
}

@keyframes Gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.maze-page {
    position: relative;
    z-index: 1;
    font-family: Georgia, serif;
    text-align: center;
}

.maze-level-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: black;
}

.maze-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: black !important;
}

.maze-level-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.maze-level-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    color: black !important;
}

.maze-level-info p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    color: black !important;
}

.maze-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.maze-character h3 {
    margin: 1rem 0 0 0;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    color: black !important;
}

.maze-character-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.maze-message-container {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.maze-message {
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

.maze-game-screen {
    color: white;
}

.maze-menu {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.maze-menu h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white !important;
}

.maze-menu p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: white !important;
}

.maze-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.maze-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#mazeCanvas {
    width: 80vmin !important;
    height: 80vmin !important;
    max-width: 80vmin !important;
    max-height: 80vmin !important;
    border: 3px solid white;
    border-radius: 12px;
    background: white;
    display: block;
    margin: 0 auto;
}

/* Mobile Direction Controls */
.maze-mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.maze-control-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.maze-direction-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin: 4px;
    /* Prevent double-tap zoom and text selection */
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Alternate button colors like the game buttons */
.maze-direction-btn:nth-child(1) { /* Up button */
    background: var(--olivine);
    border-color: var(--olivine);
}

.maze-direction-btn:nth-child(1):hover {
    background: white;
    color: var(--olivine);
    border-color: var(--olivine);
    transform: scale(1.1);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(1) { /* Left button */
    background: var(--air-superiority-blue);
    border-color: var(--air-superiority-blue);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(1):hover {
    background: white;
    color: var(--air-superiority-blue);
    border-color: var(--air-superiority-blue);
    transform: scale(1.1);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(2) { /* Down button */
    background: var(--olivine);
    border-color: var(--olivine);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(2):hover {
    background: white;
    color: var(--olivine);
    border-color: var(--olivine);
    transform: scale(1.1);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(3) { /* Right button */
    background: var(--air-superiority-blue);
    border-color: var(--air-superiority-blue);
}

.maze-control-row:nth-child(2) .maze-direction-btn:nth-child(3):hover {
    background: white;
    color: var(--air-superiority-blue);
    border-color: var(--air-superiority-blue);
    transform: scale(1.1);
}

.maze-direction-btn:active,
.maze-direction-btn.pressed {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    filter: brightness(0.9);
}

/* Hide mobile controls on larger screens */
@media (min-width: 768px) {
    .maze-mobile-controls {
        display: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .maze-game-wrapper {
        padding: 1rem;
    }
    
    .maze-title {
        font-size: 2rem;
    }
    
    .maze-level-info {
        padding: 1.5rem;
    }
    
    .maze-character-image {
        width: 120px;
        height: 120px;
    }
    
    #mazeCanvas {
        width: 100% !important;
        max-width: 350px !important;
        height: 350px !important;
    }
}