html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: url('./assets/images/bg2.png') no-repeat center center fixed;
    background-size: cover;
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
}

/* ===== HEADER FIXED ===== */
.logo-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: transparent;
    padding: 10px 0;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    pointer-events: none;
}

.logo-header * {
    pointer-events: auto;
}

.logo-header h1 {
    margin: 10px;
}

.logo-header img {
    max-height: 86px;
}

.title {
    font-size: 1.6em;
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(270deg, red, orange, yellow, green, cyan, blue, violet, red);
    background-size: 1400% 1400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 5s linear infinite;
    margin: 0;
}

.title2 {
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(270deg, red, orange, yellow, green, cyan, blue, violet, red);
    background-size: 1400% 1400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 5s linear infinite;
    margin: 0;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===== RESET MẶC ĐỊNH LOGO GRID ===== */
.logo-grid {
    overflow-y: auto;
    scroll-behavior: smooth;
}

.logo-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* ===== COMPONENTS ===== */
.logo-card img {
    max-width: 80%;
    border-radius: 12px;
    margin-bottom: 20px;
}

.logo-name {
    font-size: 1.4em;
    font-weight: bold;
    color: white;
    margin-top: 10px;
}

.vote-count {
    font-size: 14px;
    color: white;
    margin-top: 20px;
}


.left-gif {
    display: none;
}

/* ===== POPUP ===== */
.popup-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    overflow: auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.popup-info-content {
    background: white;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-sizing: border-box;
    margin: auto;
}

.popup-info-content.contet-info {
    background: #2d2c2c;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-sizing: border-box;
    margin: auto;
}

.popup-info .close-btn {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 28px;
    color: red;
    cursor: pointer;
    font-weight: bold;
    z-index: 3000;
}

/* ===== MOBILE (MẶC ĐỊNH) ===== */
@media (max-width: 1079px) {

    html,
    body {
        background: url('./assets/images/bg-mobile.png') no-repeat center center fixed !important;
        background-size: cover !important;
        margin: 0;
        padding: 0;
        height: 100%;
        width: 100%;
    }

    .layout-wrapper {
        padding-top: 175px;
        padding-bottom: 120px;
        /* height: calc(100vh - 140px); */
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .logo-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 12px;
        box-sizing: border-box;
        overflow-y: auto;
        /* max-height: calc(33vw * 2 + 12px); */
        max-height: calc(40vw * 2 + 12px);
        flex: 1;
    }

    .logo-card {
        background: rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        padding: 8px 4px;
        overflow: hidden;
        text-align: center;
        border: 1px solid #fff000;
        min-height: 89px;
    }

    .logo-card img {
        width: 50%;
        max-height: 45%;
        object-fit: contain;
        margin-bottom: 0px !important;
    }

    .logo-name {
        font-size: 13px;
        color: #fff;
        font-weight: bold;
        line-height: 1.2;
        text-align: center;
        padding: 0 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 0px !important;
    }

    .vote-count {
        font-size: 10px;
        color: #ccc;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 4px;
        margin-top: 0px !important;
    }

    .logo-grid .vote-btn {
        display: none !important;
        background-color: black !important;
    }

    .vote-btn {
        margin-top: 20px;
        padding: 10px 20px;
        font-weight: bold;
        background: #e52323;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: 0.3s;
    }

    .vote-btn:hover {
        opacity: 0.7;
    }

    .scroll-down,
    .scroll-up {
        position: fixed;
        font-size: 40px;
        color: white;
        z-index: 999;
        cursor: pointer;
        opacity: 0.8;
        transition: opacity 0.3s;
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
    }

    .info-text {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        font-size: 16px;
        font-weight: bold;
        color: #fff;
        background: rgba(255, 0, 0, 0.85);
        padding: 6px 10px;
        border-radius: 8px;
        cursor: pointer;
        z-index: 999;
        transition: background 0.3s;
        bottom: 15%;
    }

    .info-text:hover {
        background: rgba(255, 0, 0, 1);
    }

    .popup-info .show-in-popup {
        display: inline-block !important;
    }

    .popup-info h2 {
        color: white !important;
    }

    .popup-info p {
        color: white !important;
    }

    .popup-info-content p {
        font-size: 15px;
    }

    .popup-info-content span {
        font-size: 15px;
    }

    .popup-info .back-buttonp {
        display: none;
    }

}



/* ===== DESKTOP ===== */
@media (min-width: 1080px) {
    .logo-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
        justify-content: center;
        max-width: 950px;
        margin: 160px auto 0;
        padding: 0 20px;
        max-height: 700px;
        scrollbar-width: none;
        min-width: 950px;
    }

    .logo-card {
        height: 330px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        width: 100%;
    }

    .logo-card:hover {
        transform: scale(1.05);
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
    }

    .layout-wrapper {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 40px 20px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .left-gif {
        display: block;
    }

    .left-gif img {
        max-width: 824px;
    }

    .scroll-indicator {
        left: 95%;
    }

    .scroll-down {
        position: fixed;
        font-size: 40px;
        color: white;
        z-index: 999;
        cursor: pointer;
        opacity: 0.8;
        transition: opacity 0.3s;
        left: 97%;
        right: 11px;
        bottom: 20px;
    }

    .info {
        position: fixed;
        left: 97%;
        right: 5px;
        font-size: 40px;
        color: white;
        z-index: 999;
        cursor: pointer;
        opacity: 0.8;
        transition: opacity 0.3s;
        bottom: 80px;
    }

    .info-text {
        position: fixed;
        right: 65px;
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        background: rgba(255, 0, 0, 0.8);
        padding: 10px 16px;
        border-radius: 8px;
        cursor: pointer;
        z-index: 999;
        transition: background 0.3s;
        top: 10% !important;
        left: 75% !important;
        bottom: unset !important;
        transform: none !important;
    }

    .vote-btn {
        margin-top: 20px;
        padding: 10px 20px;
        font-weight: bold;
        background: white;
        color: black;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: 0.3s;
    }
}

/* ===== INFO TEXT (MOBILE) ===== */
.info-text {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: rgba(255, 0, 0, 0.8);
    padding: 5px 5px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 999;
    transition: background 0.3s;
    bottom: 15%;
}

.info-text:hover {
    background: rgba(255, 0, 0, 1);
}