@font-face {
    font-family: 'GothicWar';
    src: url('font/font.otf') format('opentype');
}

@font-face {
    font-family: 'LightFont';
    src: url('font/light.ttf') format('truetype');
}

html, body {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: fixed;
}

body {
    font-family: 'LightFont', sans-serif;
    color: #ffffff;
    margin: 0;
    position: relative;
    background-image: url('/resource/background.png');
    background-size: cover;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: -1;
}

h1 {
    font-family: 'GothicWar', sans-serif;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
                 0 0 20px rgba(255, 255, 255, 0.5),
                 0 0 30px rgba(255, 255, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
                     0 0 20px rgba(255, 255, 255, 0.5),
                     0 0 30px rgba(255, 255, 255, 0.3);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 30px rgba(255, 255, 255, 0.6),
                     0 0 40px rgba(255, 255, 255, 0.4);
    }
}

#song-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 10px;
}

.song-item {
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease-out;
}

.song-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.song-item h2 {
    font-family: 'LightFont', sans-serif;
    font-size: 1em;
    margin: 4px 0;
    color: #ffffff;
    font-weight: normal;
}

.song-item p {
    font-size: 0.7em;
    color: #999999;
    margin: 0;
}

audio {
    width: 100%;
    margin-top: 8px;
}

@media (min-width: 375px) {
    #song-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .song-item h2 {
        font-size: 1em;
    }

    .song-item p {
        font-size: 0.8em;
    }
}

@media (min-width: 768px) {
    #song-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 20px;
    }

    .song-item {
        padding: 15px;
    }

    .song-item h2 {
        font-size: 1.1em;
    }

    .song-item p {
        font-size: 0.9em;
    }
}

#content {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
}

.audio-player {
    position: fixed;
    bottom: 2vh;
    left: 2vh;
    right: 2vh;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.audio-player img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 10px;
}

.audio-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.audio-title {
    font-size: 0.9em;
    color: #ffffff;
    margin: 0;
}

.audio-artist {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.audio-controls {
    display: flex;
    align-items: center;
}

.audio-controls button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2em;
    cursor: pointer;
    margin: 0 5px;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
    cursor: pointer;
    position: relative;
    border-radius: 3px;
}

.progress {
    height: 100%;
    background-color: #ffffff;
    width: 0;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 3px;
}

@media (max-width: 600px) {
    .audio-player {
        padding: 8px;
    }

    .audio-info {
        margin-right: 10px;
    }

    .progress-bar {
        width: 60px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 320px) {
    h1 {
        font-size: 1.2em;
    }
}

.audio-player.hidden {
    display: none;
}

@keyframes lerpToPlayer {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(var(--target-x), var(--target-y));
    }
}

.lerping {
    animation: lerpToPlayer 0.5s ease-in-out forwards;
    pointer-events: none;
}

.currently-playing {
    visibility: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 80%;
}

.popup h2 {
    margin-top: 0;
    color: #ffffff;
}

.popup p {
    color: #cccccc;
}

.popup button {
    background-color: #333333;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 3px;
}

.popup button:hover {
    background-color: #444444;
}
