.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Game Info Panel */
.game-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.control-group label {
    color: white;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

.control-group select {
    padding: 8px 15px;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.control-group select:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.3);
}

.top-buttons {
    display: flex;
    gap: 40px;
    flex-shrink: 0;
}

.start-game-btn {
    padding: 10px 25px;
    font-size: 15px;
    font-weight: bold;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.start-game-btn:active {
    transform: translateY(0);
}

.start-game-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stats {
    display: flex;
    gap: 30px;
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.stat-label {
    color: white;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

.stat-value {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    min-width: 50px;
    text-align: center;
}

/* Game Layout */
.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Left Panel */
.left-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.panel-card h2 {
    color: #667eea;
    font-size: 24px;
    margin: 0 0 10px 0;
    text-align: center;
}

.panel-card h3 {
    color: #667eea;
    font-size: 18px;
    margin: 0 0 15px 0;
}

.game-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid #667eea;
}

/* Middle Panel - Canvas */
.middle-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

#mazeCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    background: white;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block;
    /* Prevent page scrolling while interacting with the maze on touch devices */
    touch-action: none;
    -ms-touch-action: none;
}

.controls-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 32px;
    justify-content: center;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 14px 0;
    box-shadow: 0 1px 8px rgba(102,126,234,0.10);
    width: 100%;
    margin-left: 0;
}
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.start-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Right Panel - Ads */
.right-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ad-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

/* Celebration Modal */
.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.celebration-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.5s;
    max-width: 500px;
}

@keyframes scaleIn {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

.flowers {
    font-size: 40px;
    margin: 15px 0;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.celebration-content h1 {
    color: #667eea;
    font-size: 48px;
    margin: 20px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.celebration-content p {
    font-size: 18px;
    color: #666;
    margin: 15px 0;
}

.celebration-stats {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.celebration-stats p {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.celebration-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.play-again-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: bold;
    background: white;
    color: #667eea;
    border: 2px solid white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.play-again-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
    background: #f0f4ff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }

    .left-panel, .right-panel {
        width: 100%;
    }

    .middle-panel {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px 20px;
    }

    .stats {
        justify-content: space-around;
        gap: 20px;
        flex-direction: column;
    }

    .control-group, .stat-item {
        width: 100%;
    }

    .canvas-container {
        margin-bottom: 15px;
    }

    .middle-panel {
        padding: 16px;
    }

    #mazeCanvas {
        max-width: 100%;
    }

    .controls-section {
        flex-wrap: wrap;
    }

    .game-btn {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    .middle-panel {
        padding: 14px;
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }

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