/* 迷宫游戏样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--dark-color);
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.game-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background-color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 3px solid var(--dark-color);
    font-weight: 600;
    font-size: 1.2rem;
}

.stat-label {
    margin-right: 5px;
    color: var(--secondary-color);
}

.game-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 20px;
}

@media (min-width: 768px) {
    .game-content {
        flex-direction: row;
    }
}

#game-canvas {
    flex: 2;
    height: 500px;
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
    overflow: hidden;
}

.game-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
}

.control-pad {
    width: 180px;
    height: 180px;
}

.control-button {
    cursor: pointer;
    transition: var(--transition);
}

.control-button:hover .button-bg {
    fill: var(--primary-color);
    transform: scale(1.05);
    filter: drop-shadow(0 0 3px rgba(52, 152, 219, 0.5));
}

.control-button:active .button-bg {
    fill: var(--accent-color);
    transform: scale(0.95);
}

.button-bg {
    fill: var(--secondary-color);
    stroke: var(--dark-color);
    stroke-width: 3;
    transition: all 0.2s ease;
}

.button-icon {
    fill: white;
    transition: all 0.2s ease;
}

.game-instructions {
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
}

.game-instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
}

.game-instructions p {
    margin-bottom: 10px;
}

.game-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 4px solid var(--dark-color);
    text-align: center;
    font-weight: 600;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    border: 3px solid var(--dark-color);
    margin-top: 10px;
    box-shadow: var(--box-shadow);
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#new-game-btn {
    background-color: var(--accent-color);
    font-size: 1.1rem;
    padding: 12px 24px;
}

#new-game-btn:hover {
    background-color: #c0392b;
}

/* 胜利弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    border: 5px solid var(--dark-color);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.result-stats {
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-stats p {
    margin: 10px 0;
}