* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial Rounded MT Bold', 'Arial', sans-serif;
    background-color: #f0f8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    color: #333;
}

.container {
    text-align: center;
    background-color: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 350px;
    max-width: 90%;
}

.description-container p {
    margin: 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.gauge-container {
    margin: 20px 0;
    padding: 0 15px;
}

.gauge-bar {
    width: 100%;
    height: 25px;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #ddd;
}

.gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ff5722, #ff9800);
    transition: width 0.3s ease-out;
    border-radius: 10px;
}

.gauge-text {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.score-timer-container {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    font-size: 20px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.score-timer-container p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-container {
    position: relative;
    height: 300px;
    width: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 3px solid #4682b4;
    border-radius: 15px;
    margin: 0 auto 20px;
    transition: background 0.5s ease-out;
}

.game-container::-webkit-scrollbar {
    display: none;
}

/* 背景レベル */
.game-container.low {
    background: linear-gradient(to bottom, #87ceeb, #e0f7fa),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100"><circle cx="20" cy="20" r="3" fill="white" opacity="0.8"/><circle cx="60" cy="30" r="5" fill="white" opacity="0.8"/><circle cx="100" cy="25" r="3" fill="white" opacity="0.8"/><circle cx="140" cy="35" r="4" fill="white" opacity="0.8"/><circle cx="180" cy="20" r="3" fill="white" opacity="0.8"/></svg>');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: auto 100%;
}

.game-container.mid {
    background: linear-gradient(to bottom, #64b5f6, #bbdefb),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100"><path d="M20,50 Q35,30 50,50 T80,50 T110,50 T140,50 T170,50" stroke="white" stroke-width="2" fill="none" opacity="0.6"/></svg>');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: auto 100%;
}

.game-container.high {
    background: linear-gradient(to bottom, #42a5f5, #90caf9),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100"><path d="M10,30 L40,20 L70,40 L100,10 L130,30 L160,15 L190,35" stroke="white" stroke-width="3" fill="none" opacity="0.7"/></svg>');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: auto 100%;
}

.game-container.space {
    background: linear-gradient(to bottom, #0d47a1, #000000),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100"><circle cx="30" cy="30" r="1" fill="white"/><circle cx="70" cy="20" r="1.5" fill="white"/><circle cx="110" cy="35" r="1" fill="white"/><circle cx="150" cy="15" r="2" fill="white"/><circle cx="190" cy="30" r="1" fill="white"/></svg>');
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: auto 100%;
}

.character {
    position: absolute;
    left: 50%;
    bottom: 50px;
    width: 60px;
    height: 60px;
    z-index: 20;
    transform: translateX(-50%);
    will-change: transform, bottom;
    transition: bottom 0.05s linear;
}

.character img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
    transition: transform 0.1s;
}

.ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to right, #8b4513, #a0522d);
    z-index: 15;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.2);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    z-index: 30;
    border-radius: 12px;
    backdrop-filter: blur(3px);
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

button {
    padding: 15px 25px;
    font-size: 18px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#startButton {
    background: linear-gradient(to right, #4caf50, #2e7d32);
    color: white;
    box-shadow: 0 4px 0 #1b5e20;
}

#tapButton {
    background: linear-gradient(to right, #ff9800, #f57c00);
    color: white;
    box-shadow: 0 4px 0 #e65100;
}

button:disabled {
    background: #cccccc !important;
    box-shadow: 0 4px 0 #999 !important;
    cursor: not-allowed;
    transform: none !important;
}

button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 rgba(0,0,0,0.2);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particle-float 2s ease-out forwards;
    opacity: 0.8;
    filter: blur(0.5px);
    box-shadow: 0 0 10px 2px currentColor;
}

@keyframes particle-float {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), -150px) scale(0.2); opacity: 0; }
}

.result-text {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: text-pop 0.5s ease-out;
}

.result-emoji {
    font-size: 60px;
    margin: 15px 0;
    animation: bounce 0.5s infinite alternate;
}

.result-hint {
    font-size: 16px;
    opacity: 0.8;
    max-width: 80%;
    text-align: center;
    line-height: 1.4;
}

@keyframes text-pop {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-15px) scale(1.1); }
}

/* アイテムスタイル */
.item {
    position: absolute;
    width: 40px;
    height: 40px;
    font-size: 30px;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease-out;
    will-change: transform;
    user-select: none;
    pointer-events: auto;
}

.item-fruit {
    animation: float 3s infinite ease-in-out;
}

.item-skull {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 400px) {
    .container {
        padding: 15px;
        width: 90%;
    }
    
    .game-container {
        height: 250px;
    }
    
    button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .result-text {
        font-size: 24px;
    }
    
    .result-emoji {
        font-size: 50px;
    }
    
    .item {
        width: 35px;
        height: 35px;
        font-size: 25px;
        line-height: 35px;
    }
}