body {
    font-family: Arial, sans-serif;
    background: white; /* 背景色をシンプルに */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

#game-container {
    text-align: center;
    max-width: 450px;
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

#message-area {
    min-height: 80px; /* メッセージ領域の高さを固定 */
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    overflow: hidden;
}

#treasure-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    justify-content: center;
}

#treasure-container img {
    width: 80px;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    bottom: 0; /* 下段を固定 */
}

#treasure-container img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    transition: background-color 0.3s;
    margin-top: 20px;
}

button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none;
}

/* コイン画像用演出 */
.coin-animation {
    position: absolute;
    width: 40px; /* 宝箱に合わせて大きさ調整 */
    height: auto;
    animation: fly-out 1s ease-in-out forwards, pop-up 0.5s ease-in-out;
    z-index: 10;
}

@keyframes fly-out {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-200px) scale(1);
        opacity: 0;
    }
}

@keyframes pop-up {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* ド派手な最高金額更新演出 */
.highest-score-effect {
    animation: flash 1s ease-in-out, pop-up-scale 0.6s ease-in-out;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4);
    border-radius: 15px;
    padding: 10px;
}

@keyframes flash {
    0%, 100% {
        background-color: rgba(255, 255, 255, 0.5);
    }
    50% {
        background-color: rgba(255, 255, 0, 0.9);
    }
}

@keyframes pop-up-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}
