.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
}

.page-transition-overlay.fade-out {
    opacity: 0;
}

.page-transition-overlay.fade-in {
    opacity: 1;
    pointer-events: all;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cinzel', serif;
    background: url('../pic/guilds/guilds_pic.avif') no-repeat center center fixed;
    background-size: cover;
    color: #e5e5e5;
    overflow-x: hidden;
}

.background-fog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: -1;
}

.content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    font-size: clamp(32px, 8vw, 56px);
    margin-bottom: 30px;
    text-shadow: 0 0 20px black;
    color: #fff;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

#guildSearch {
    width: 100%;
    max-width: 500px;
    padding: 15px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #555;
    color: #bdab8d;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    text-align: center;
    outline: none;
    transition: 0.3s;
    border-radius: 5px;
}

.guild-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding-bottom: 100px;
}

@media (min-width: 768px) {
    .guild-list {
        grid-template-columns: 1fr 1fr;
    }
}

.guild-item {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    opacity: 0;
    transform: translateY(40px);
}

.guild-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.guild-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #bdab8d;
}

.guild-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    transition: filter 0.5s ease;
}

.guild-info {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    box-sizing: border-box;
}

.guild-info h3 {
    margin: 0;
    font-size: clamp(20px, 4vw, 26px);
    text-shadow: 2px 2px 5px black;
    color: #bdab8d;
}

.guild-info p {
    margin: 5px 0 0;
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
}

.music-control {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.music-control:hover {
    border-color: rgba(180, 220, 255, 0.6);
    transform: scale(1.1);
    text-shadow: 0 0 10px #fff;
}

.music-control.playing {
    border-color: rgba(0, 200, 255, 0.8);
    color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), inset 0 0 10px rgba(0, 210, 255, 0.2);
    animation: musicPulse 2s infinite ease-in-out;
}

@keyframes musicPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(0, 210, 255, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    }
}

.music-control.playing::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(0, 210, 255, 0.3);
    animation: rotateRing 4s linear infinite;
}

@keyframes rotateRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    max-width: 850px;
    margin: 20px auto;
    background: #151515;
    border: 1px solid #333;
    padding: clamp(20px, 5vw, 40px);
    border-radius: 15px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 40px;
    cursor: pointer;
    color: #777;
}

.modal-body h1 {
    font-size: clamp(24px, 5vw, 42px);
    color: #bdab8d;
    text-align: left;
    margin-bottom: 20px;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-card {
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
}

.gallery-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.gallery-card-info {
    padding: 10px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.8);
    color: #aaa;
}

.back-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #2d2d2d;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: 0.3s;
    z-index: 50;
    border: 1px solid #444;
}

@media (max-width: 480px) {
    .back-btn {
        right: 10px;
        bottom: 10px;
        padding: 10px 15px;
    }
}
