/* ぜんたいのスタイル */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f0e6ff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('images/castle-bg.svg');
    background-size: cover;
    background-position: center;
    color: #333;
}

/* がめんのスタイル */
.screen {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
}

.hidden {
    display: none;
}

h1 {
    color: #6a0dad;
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

h2 {
    color: #6a0dad;
    font-size: 2.5em;
    margin-bottom: 20px;
}

p {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.instructions {
    background-color: rgba(106, 13, 173, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.instructions p {
    font-size: 1.2em;
    margin-bottom: 8px;
}

/* ボタンのスタイル */
button {
    background-color: #6a0dad;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.5em;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
}

button:hover {
    background-color: #8e44ad;
    transform: scale(1.05);
}

/* キャラクターせんたくのスタイル */
.character-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.character-option {
    background-color: #f8f8f8;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    width: 150px;
}

.character-option:hover {
    background-color: #e0e0ff;
    transform: scale(1.05);
}

.character-option.selected {
    background-color: #d0d0ff;
    border: 3px solid #6a0dad;
}

.character-option img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* むずかしさせんたくのスタイル */
.difficulty-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.difficulty-option {
    width: 150px;
}

/* ゲームがめんのスタイル */
#game-screen {
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.5em;
    width: 100%;
}

/* うごかすボタンのスタイル */
.control-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.horizontal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.control-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background-color: #6a0dad;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-button:active {
    background-color: #8e44ad;
    transform: scale(0.95);
}

#maze-container {
    display: grid;
    gap: 0;
    margin: 0 auto;
}

/* めいろのセルのスタイル */
.cell {
    width: 40px;
    height: 40px;
    box-sizing: border-box;
}

.wall {
    background-color: #6a0dad;
}

.path {
    background-color: #f8f8f8;
}

.player {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.goal {
    background-image: url('images/treasure.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.coin {
    background-image: url('images/coin.svg');
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
}

.gem {
    background-image: url('images/gem.svg');
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy {
    background-image: url('images/monster.svg');
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .cell {
        width: 30px;
        height: 30px;
    }
    
    h1 {
        font-size: 2.5em;
    }
    
    h2 {
        font-size: 2em;
    }
    
    p {
        font-size: 1.2em;
    }
    
    button {
        font-size: 1.2em;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 20px;
        height: 20px;
    }
    
    .character-option {
        width: 120px;
    }
    
    .character-option img {
        width: 80px;
        height: 80px;
    }
}