* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background-color: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

.background-layer.visible {
    opacity: 1;
    visibility: visible;
}

.chart-container {
    position: relative;
    overflow: hidden;
    background-color: #fff;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.background-layer.visible .chart-container {
    transform: scale(1);
    opacity: 1;
}

.chart-container:nth-child(1) {
    transition-delay: 0.2s;
}

.chart-container:nth-child(2) {
    transition-delay: 0.4s;
}

.chart-container:nth-child(3) {
    transition-delay: 0.6s;
}

.chart-container:nth-child(4) {
    transition-delay: 0.8s;
}

.chart-container:nth-child(5) {
    transition-delay: 1.0s;
}

.chart-container:nth-child(6) {
    transition-delay: 1.2s;
}

.background-chart {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.chart-container:hover .background-chart {
    opacity: 0.9;
}

.main-content {
    position: fixed;
    top: 30vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-container {
    position: relative;
    z-index: 1;
}

.image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 0, 0, 0.1), transparent);
    animation: flicker 4s infinite;
    border-radius: 10px;
}

.overlay-content {
    position: relative;
    width: 100%;
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: auto;
    transition: height 0.3s ease, opacity 1s ease;
}

.overlay-content.hidden {
    height: 0;
    margin-top: 0;
    overflow: hidden;
}

.main-image {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease;
    display: block;
    margin: 0 auto;
}

.audio-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.audio-prompt {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 0, 0, 0.3);
    color: white;
    min-width: 280px;
}

.audio-prompt:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
    border-color: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

.prompt-text {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.play-icon-container {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.play-icon,
.pause-icon {
    position: relative;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    z-index: 2;
}

.sound-wave {
    position: absolute;
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: wave 2s infinite;
    opacity: 0;
}

.wave-1 {
    animation-delay: 0s;
}

.wave-2 {
    animation-delay: 0.5s;
}

.wave-3 {
    animation-delay: 1s;
}

@keyframes wave {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes flicker {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
    }
}

@media screen and (max-width: 768px) {
    .container {
        overflow-y: auto;
    }

    .background-layer {
        position: relative;
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, minmax(300px, 1fr));
    }

    .main-content {
        position: fixed;
        z-index: 2;
        padding: 20px;
    }

    .main-image {
        max-width: 80%;
    }

    .audio-prompt {
        padding: 12px 20px;
        min-width: 240px;
    }

    .prompt-text {
        font-size: 1rem;
    }

    .play-icon,
    .pause-icon {
        font-size: 20px;
    }

    .chart-container {
        height: auto;
        min-height: 300px;
    }
}

@media screen and (max-width: 480px) {
    .audio-prompt {
        padding: 10px 15px;
        min-width: 200px;
    }

    .prompt-text {
        font-size: 0.9rem;
    }

    .play-icon,
    .pause-icon {
        font-size: 18px;
    }
}