/* ============================
   Nút "Check New Games"
   ============================ */

#game-news-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff4757, #e84393, #7d5fff);
    background-size: 200% 200%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    padding: 12px 22px 12px 16px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 71, 87, 0.55), 0 0 0 rgba(255, 71, 87, 0.6);
    z-index: 1001;
    animation: btnGradient 5s ease infinite, floatUpDown 3s ease-in-out infinite, ringPulse 2.2s ease-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: transform .25s ease, box-shadow .25s ease;
}

#game-news-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 26px rgba(255, 71, 87, 0.8);
}

#game-news-btn .game-news-btn-icon {
    font-size: 19px;
    animation: iconWiggle 1.8s ease-in-out infinite;
}

#game-news-btn .game-news-btn-text {
    white-space: nowrap;
}

#game-news-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #fff;
    color: #e84393;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}

@media (max-width: 480px) {
    #game-news-btn .game-news-btn-text {
        display: none;
    }
    #game-news-btn {
        padding: 12px 14px;
    }
}


/* Overlay */

#game-news-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
}


/* ============================
   Popup
   ============================ */

#game-news-popup {
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: -100%;
    right: 20px;
    width: 320px;
    max-height: 78vh;
    background: linear-gradient(180deg, #201f33, #16151f);
    border: 1px solid rgba(255, 71, 87, 0.4);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
    color: #fff;
    padding: 18px 16px 12px;
    transition: bottom 0.4s ease;
    z-index: 1002;
    font-family: "Segoe UI", sans-serif;
}

#game-news-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

#game-news-close:hover {
    background: #ff4757;
    color: #fff;
}

#game-news-popup h3 {
    margin: 0 0 4px 0;
    font-size: 17px;
    text-align: center;
    background: linear-gradient(90deg, #ff6b81, #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

#game-news-popup ul {
    list-style: none;
    padding: 4px 2px 4px 0;
    margin: 4px -6px 0 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ff4757 transparent;
}

#game-news-popup ul::-webkit-scrollbar {
    width: 5px;
}

#game-news-popup ul::-webkit-scrollbar-thumb {
    background: #ff4757;
    border-radius: 10px;
}

#game-news-popup li {
    margin: 0 0 8px 0;
}


/* Link / card item */

#game-news-popup a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: #262538;
    color: #fff;
    text-decoration: none;
    transition: background .25s ease, transform .2s ease;
}

#game-news-popup a:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.35), rgba(126, 95, 255, 0.35));
    transform: translateX(2px);
}

#game-news-popup a img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.game-news-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.game-news-title {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-news-error {
    text-align: center;
    color: #aaa;
    padding: 12px 0;
}


/* Tag cơ bản */

.tag {
    align-self: flex-start;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: .3px;
}


/* NEW → nhấp nháy glow */

.tag.new {
    background: #27ae60;
    animation: tagGlow 1.5s infinite;
}


/* FIXED → rung nhẹ */

.tag.fix {
    background: #3498db;
    animation: tagShake 2s infinite;
}


/* UPDATE → đổi màu liên tục */

.tag.update {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    color: #000;
    animation: tagColorShift 3s infinite;
    background-size: 200% 200%;
}


/* HOT → bounce */

.tag.hot {
    background: #e74c3c;
    animation: tagBounce 1.5s infinite;
}


/* Khi bật */

#game-news-popup.active {
    bottom: 0;
}

#game-news-overlay.active {
    display: block;
}


/* Animation item list */

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes floatUpDown {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes ringPulse {
    0% {
        box-shadow: 0 4px 18px rgba(255, 71, 87, 0.55), 0 0 0 0 rgba(255, 71, 87, 0.55);
    }
    70% {
        box-shadow: 0 4px 18px rgba(255, 71, 87, 0.55), 0 0 0 14px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 4px 18px rgba(255, 71, 87, 0.55), 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

@keyframes iconWiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-12deg);
    }
    75% {
        transform: rotate(12deg);
    }
}


/* Tag effects */

@keyframes tagGlow {
    0% {
        box-shadow: 0 0 4px #27ae60;
    }
    50% {
        box-shadow: 0 0 12px #2ecc71;
    }
    100% {
        box-shadow: 0 0 4px #27ae60;
    }
}

@keyframes tagShake {
    0%,
    100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-5deg);
    }
    40% {
        transform: rotate(5deg);
    }
    60% {
        transform: rotate(-5deg);
    }
    80% {
        transform: rotate(5deg);
    }
}

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

@keyframes tagBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}
