body {
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f8ff;
    font-family: "UD デジタル 教科書体", "Arial Rounded MT Bold", sans-serif;
}

#game-container {
    width: 400px;
    height: 500px;
    position: relative;
    background-color: #fff;
    border: 3px solid #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
}

#header {
    height: 60px;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    color: white;
    text-shadow: 2px 2px 0 #333;
}

#message-container {
    height: 30px;
    margin: 5px 0;
    font-size: 1.2em;
    color: #d35400;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.message-text {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

#maze-container {
    width: 390px;
    height: 390px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
}

#maze {
    width: 100%;
    height: 100%;
    position: relative;
}

.wall {
    position: absolute;
    background-color: #2c3e50;
    width: 26px;
    height: 26px;
    border-radius: 3px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    z-index: 5;
    box-sizing: border-box;
}

#character {
    position: absolute;
    width: 22px;
    height: 22px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
    transition: all 0.2s;
    pointer-events: none;
}

#goal {
    position: absolute;
    width: 22px;
    height: 22px;
    background-color: gold;
    border-radius: 50%;
    z-index: 5;
    animation: pulse 1s infinite;
    box-shadow: 0 0 10px gold, inset 0 0 5px rgba(0,0,0,0.3);
    border: 2px solid #fff;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#button-container {
    margin-top: 20px;
    text-align: center;
}

#reset-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 0 #cc2e3d;
    transition: all 0.2s;
}

#reset-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    z-index: 20;
    animation: confetti 2s ease-out;
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}

.en {
    display: block;
    font-size: 0.8em;
    margin-top: 3px;
}