* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 500;
    font-style: normal;
    color: #333;
}

#start-scene,
#menu-scene,
#loading-scene,
#result-scene {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    transition: opacity 0.5s ease;
}

.scene-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    font-size: 3vw;
}

/* game-video と game-canvas を重ねる */
#game-scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-video,
#game-canvas,
#costume-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#game-video {
    transform: translate(-50%, -50%) scaleX(-1);
}

#start-button {
    padding: 15px 30px;
    font-size: 24px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s ease;
}

#cover-image, #result-cover-image {
    display: block;
    margin: 0 auto;
    margin-bottom: 1vw;
    height: 40vw;
    width: 40vw;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#score {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2.5vw;
    color: white;
    text-shadow: 1px 1px 2px black;
}

#combo {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5vw;
    color: gold;
    text-shadow: 2px 2px 8px #000, 0 0 16px #fff;
    z-index: 10;
}

#volume {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 8px;
    font-size: 1.5vw;
}

.score-button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    color: white;
    transition: background-color 0.3s ease;
    margin: 10px;
}

.score-button img {
    width: 10rem;
    height: 10rem;
    border-radius: 1vw;
    display: block;
    margin-bottom: 8px;
}

.result-button {
    padding: 15px 30px;
    font-size: 1.75vw;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #ffba6b;
    color: white;
    transition: background-color 0.3s ease;
    margin: 1rem;
}

th {
    text-align: right;
}

td {
    text-align: left;
}

#result-score,
#result-combo {
    font-size: 3vw;
    margin-left: 1rem;
}

#result-grade {
    text-align: center;
    font-size: 7vw;
    font-weight: bold;
}

.grade-S {
    /* 文字を虹色グラデーションに（縦方向） */
    background: linear-gradient(to bottom, magenta, yellow, cyan, magenta);
    background-size: auto 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: grade-S 2s linear infinite;
}

@keyframes grade-S {
    0% {
        background-position-y: -100%;
    }
    100% {
        background-position-y: 100%;
    }
}

.grade-A {
    color: gold;
    text-shadow: 2px 2px 8px #000, 0 0 16px #fff;
}

.grade-B {
    color: silver;
    text-shadow: 2px 2px 8px #000, 0 0 16px #fff;
}

.grade-C {
    color: #cd7f32;
    text-shadow: 2px 2px 8px #000, 0 0 16px #fff;
}

.result-buttons {
    margin-top: 1rem;
}