body {
    margin: 0;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: url('./GAZOU/HAIKEI.webp');
    background-repeat: repeat;
    background-size: 320px;
    position: relative;
}

#game-container {
    width: 100%;
    max-width: 600px;
    height: auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 100;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

#start-screen {
    position: relative;
    padding-bottom: 80px;
}

#start-screen h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 15px;
}

#start-screen p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

#start-button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.5em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#start-button:hover {
    background-color: #45a049;
}

#game-screen h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 20px;
}

#master-area {
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

#master-hand {
    max-width: 180px;
    height: auto;
    position: relative;
    z-index: 10;
}

#player-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.janken-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    position: relative;
    display: inline-block;
    z-index: 1;
}

.janken-button img {
    width: 120px;
    height: auto;
    border: 4px solid #333;
    border-radius: 50%;
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease, width 0.3s ease, height 0.3s ease;
    display: block;
}

.janken-button.kakutei-button img {
    border: none;
    width: 156px;
    height: auto;
    border-radius: 0;
}

.janken-button:hover img {
    transform: scale(1.05);
    border-color: #007bff;
}

.janken-button.kakutei-button:hover img {
    border-color: transparent;
}

.janken-button:active {
    transform: translateY(2px);
    border-radius: 50%;
}

.janken-button.kakutei-button:active {
    border-radius: 0;
}

#reset-button {
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#reset-button:hover {
    background-color: #007bb5;
}

#back-to-start-button {
    background-color: #555;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#back-to-start-button:hover {
    background-color: #333;
}

.hidden {
    display: none;
}

#start-image {
    max-width: 80%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 5px;
}

#result-animation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#result-animation-screen.active {
    opacity: 1;
    visibility: visible;
}

#ussu-image {
    max-width: 80%;
    max-height: 80%;
    height: auto;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#kakutei-animation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#kakutei-animation-screen.active {
    opacity: 1;
    visibility: visible;
}

#kakutei-image-animated {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    opacity: 0;
    transform: translateY(-100vh);
}

#kakutei-image-animated.animate-drop-in {
    animation: drop-in-fade-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#volume-control {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    color: #333;
    z-index: 101;
    position: relative;
}

#volume-slider {
    width: 150px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    transition: background 0.2s;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

#volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-moz-range-thumb:active {
    cursor: grabbing;
}

#volume-slider::-ms-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-ms-thumb:active {
    cursor: grabbing;
}

#volume-value {
    min-width: 40px;
    text-align: left;
}

#janken-video {
    z-index: 50;
}

.overlay-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 20;
}

#kakutei-background-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 50;
}

#kakutei-background-video-container video {
    position: absolute;
    object-fit: cover;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blinking {
    animation: blink 0.1s linear 3;
}

@keyframes rainbow-glow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.rainbow-glow {
    animation: rainbow-glow 1s linear infinite;
}

@keyframes drop-in-fade-in {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    60% {
        transform: translateY(0%) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(0%) scale(1);
        opacity: 1;
    }
}

#kakutei-dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#kakutei-dark-overlay.active {
    opacity: 1;
    visibility: visible;
}

.social-media-links {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.social-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.social-icon-link:hover {
    transform: translateY(-5px);
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}