/* ============================================
   Xelob Game Portal - Core Styles
   Gradient Colorful Theme (Responsive)
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Content wrapper - centers content */
.huvflc-content-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Header / Navigation (full viewport width) ---- */

.huvflc-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #ffc371 100%);
}

.huvflc-navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
}

.huvflc-nav-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.huvflc-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.huvflc-logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.huvflc-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.huvflc-menu-toggle img {
    height: 24px;
    display: block;
}

/* PC: inline nav links */
.huvflc-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.huvflc-menu li a {
    display: block;
    padding: 6px 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 16px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.huvflc-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ---- Hero Carousel ---- */

.huvflc-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    margin: 16px 0 8px;
    aspect-ratio: 16 / 4;
    background: linear-gradient(135deg, #f857a622, #ff585822);
}

.huvflc-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.huvflc-carousel-slide {
    min-width: 100%;
    position: relative;
    overflow: hidden;
}

.huvflc-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.huvflc-carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff;
}

.huvflc-carousel-overlay h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.huvflc-carousel-overlay p {
    font-size: 0.8rem;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.huvflc-carousel-dots {
    position: absolute;
    bottom: 8px;
    right: 16px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.huvflc-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: none;
    padding: 0;
}

.huvflc-carousel-dot.active {
    background: #fff;
    transform: scale(1.3);
}

.huvflc-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}

.huvflc-carousel-btn:hover {
    background: rgba(255, 255, 255, 0.45);
}

.huvflc-carousel-prev { left: 10px; }
.huvflc-carousel-next { right: 10px; }

/* ---- Game Card Grid Items ---- */

.huvflc-game-item {
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.huvflc-game-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(248, 87, 166, 0.18);
}

.huvflc-game-item a {
    text-decoration: none;
    display: block;
}

.huvflc-game-thumb {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.huvflc-game-thumb img {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: #e8e8e8;
}

.huvflc-game-item:hover .huvflc-game-thumb img {
    transform: scale(1.05);
}

.huvflc-game-label {
    padding: 6px 8px;
    text-align: center;
}

.huvflc-game-label p {
    font-size: 0.78rem;
    color: #444;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* Game card with description (homepage) */
.huvflc-game-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.huvflc-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(248, 87, 166, 0.18);
}

.huvflc-game-card a {
    text-decoration: none;
    display: block;
    color: inherit;
}

.huvflc-game-card .huvflc-game-thumb img {
    aspect-ratio: 1 / 1;
}

.huvflc-game-card-info {
    padding: 8px 10px;
}

.huvflc-game-card-info h3 {
    font-size: 0.82rem;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.huvflc-game-card-info p {
    font-size: 0.72rem;
    color: #777;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* ---- Section Title Bar ---- */

.huvflc-section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #ffc371 100%);
    border-radius: 12px;
    margin: 0 16px;
}

.huvflc-section-bar p {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.huvflc-section-bar img {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.huvflc-section-bar img:hover {
    opacity: 1;
}

/* ---- Content Sections ---- */

.huvflc-section {
    padding: 12px 0;
}

.huvflc-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 10px 16px;
}

.huvflc-grid-4 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 10px 16px;
}

.huvflc-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 16px;
}

.huvflc-span-2 {
    grid-column: span 2;
    grid-row: span 2;
}

/* ---- Hot Recommendation (Top Banner Grid) ---- */

.huvflc-hot-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 12px 16px;
}

.huvflc-hot-grid .huvflc-game-thumb img {
    border-radius: 12px;
}

/* ---- Footer ---- */

.huvflc-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #ffc371 100%);
    color: #fff;
    margin-top: 24px;
}

.huvflc-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 12px;
}

.huvflc-footer-links a {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.15s;
}

.huvflc-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.huvflc-copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ---- Floating Action Buttons ---- */

.huvflc-fab-group {
    position: fixed;
    bottom: 80px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 50;
}

.huvflc-fab-group.visible {
    display: flex;
}

.huvflc-fab {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(67, 233, 123, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.huvflc-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(67, 233, 123, 0.5);
}

.huvflc-fab img {
    width: 18px;
    height: 18px;
}

/* ---- Game Detail Page ---- */

.huvflc-detail-hero {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 24px 20px;
    gap: 24px;
}

.huvflc-detail-info {
    flex: 1;
    min-width: 0;
}

.huvflc-detail-info h1 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 10px;
}

.huvflc-detail-info .huvflc-detail-desc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 18px;
}

.huvflc-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #ffc371 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(248, 87, 166, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.huvflc-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 87, 166, 0.5);
}

.huvflc-play-btn img {
    width: 22px;
    height: 22px;
}

.huvflc-detail-cover {
    width: 260px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.huvflc-detail-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* ---- Game Info Section (How to Play / Tips / Review) ---- */

.huvflc-game-info-section {
    margin: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.huvflc-game-info-section h2 {
    font-size: 1.05rem;
    color: #f857a6;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f857a622;
}

.huvflc-game-info-section p,
.huvflc-game-info-section ul {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.7;
}

.huvflc-game-info-section ul {
    padding-left: 20px;
}

.huvflc-game-info-section li {
    margin-bottom: 6px;
}

.huvflc-game-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.huvflc-meta-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f857a615, #ff585815);
    border-radius: 20px;
    font-size: 0.78rem;
    color: #f857a6;
    font-weight: 500;
}

/* ---- Game Iframe Page ---- */

.huvflc-iframe-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.huvflc-iframe-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    cursor: pointer;
}

.huvflc-iframe-back img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ---- Article / Legal Pages ---- */

.huvflc-article {
    padding: 24px 20px;
    color: #444;
}

.huvflc-article h1 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 3px solid;
    border-image: linear-gradient(135deg, #f857a6, #ff5858) 1;
}

.huvflc-article h2 {
    font-size: 1.05rem;
    color: #f857a6;
    margin: 20px 0 8px;
}

.huvflc-article p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.huvflc-article ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.huvflc-article li {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 6px;
}

/* ---- 404 Error Page ---- */

.huvflc-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.huvflc-error-code {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f857a6, #ff5858, #ffc371);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

.huvflc-error-msg {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 24px;
}

.huvflc-error-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #ffc371 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(248, 87, 166, 0.3);
    transition: transform 0.2s;
}

.huvflc-error-btn:hover {
    transform: translateY(-2px);
}

/* ---- Channel Page Title ---- */

.huvflc-channel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    margin: 16px;
    background: linear-gradient(135deg, #f857a615, #ff585815);
    border-radius: 16px;
}

.huvflc-channel-header img {
    width: 24px;
    height: 24px;
}

.huvflc-channel-header h1 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

/* ---- Recommend More Section ---- */

.huvflc-more-section {
    padding: 16px 0;
}

.huvflc-more-title {
    text-align: center;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f857a6;
}

/* ---- Utility ---- */

.huvflc-body-spacer {
    margin-top: 8px;
}

/* ============================================
   RESPONSIVE - PC (min-width: 769px) - 6 columns
   ============================================ */

@media (min-width: 769px) {
    .huvflc-grid-3,
    .huvflc-grid-4,
    .huvflc-grid-2,
    .huvflc-hot-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   RESPONSIVE - Tablet (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    .huvflc-navbar {
        padding: 0 12px;
        height: 52px;
    }

    .huvflc-logo-title {
        font-size: 1.1rem;
    }

    .huvflc-logo-icon {
        width: 32px;
        height: 32px;
    }

    .huvflc-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 52px;
        right: 0;
        width: 220px;
        max-height: calc(100vh - 52px);
        overflow-y: auto;
        background: #fff;
        box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 0 16px;
        padding: 8px 0;
        z-index: 200;
    }

    .huvflc-menu.open {
        display: flex;
        animation: hwSlideIn 0.2s ease-out;
    }

    @keyframes hwSlideIn {
        from { opacity: 0; transform: translateX(20px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .huvflc-menu li a {
        padding: 12px 20px;
        font-size: 0.9rem;
        color: #444;
        border-radius: 0;
    }

    .huvflc-menu li a:hover {
        background: linear-gradient(90deg, #f857a622, #ff585822);
        color: #f857a6;
    }

    .huvflc-menu-toggle {
        display: block;
    }

    /* Grids: 3 columns on tablet */
    .huvflc-grid-3,
    .huvflc-grid-4,
    .huvflc-grid-2,
    .huvflc-hot-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px 12px;
    }

    /* Detail: stack on tablet */
    .huvflc-detail-hero {
        flex-direction: column;
        align-items: center;
        padding: 16px;
    }

    .huvflc-detail-cover {
        width: 50%;
    }

    .huvflc-carousel {
        aspect-ratio: 16 / 5;
        margin: 12px 0 6px;
        border-radius: 12px;
    }

    .huvflc-section-bar {
        margin: 0 12px;
    }
}

/* ============================================
   RESPONSIVE - Mobile (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    .huvflc-navbar {
        padding: 0 10px;
        height: 48px;
    }

    .huvflc-logo-title {
        font-size: 1rem;
    }

    .huvflc-logo-icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    /* Grids: 2 columns on mobile for homepage */
    .huvflc-hot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    /* Section grids: 2 columns for homepage */
    .huvflc-section > .huvflc-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    /* More Games: 3 columns on mobile */
    .huvflc-more-section .huvflc-grid-3,
    .huvflc-grid-4 {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    /* Channel page grid: 2 columns on mobile */
    .huvflc-grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 12px;
    }

    .huvflc-section-bar {
        margin: 0 10px;
        padding: 8px 14px;
    }

    .huvflc-detail-hero {
        padding: 12px;
        gap: 12px;
    }

    .huvflc-detail-cover {
        width: 60%;
    }

    .huvflc-detail-info h1 {
        font-size: 1.2rem;
    }

    .huvflc-game-info-section {
        margin: 12px;
        padding: 16px;
    }

    .huvflc-carousel {
        aspect-ratio: 16 / 6;
        margin: 10px 0 4px;
        border-radius: 10px;
    }

    .huvflc-carousel-overlay h3 {
        font-size: 0.95rem;
    }

    .huvflc-carousel-overlay p {
        font-size: 0.72rem;
    }

    .huvflc-carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .huvflc-fab-group {
        bottom: 60px;
        right: 10px;
    }

    .huvflc-channel-header {
        margin: 10px;
        padding: 12px;
    }

    .huvflc-menu {
        top: 48px;
        max-height: calc(100vh - 48px);
    }
}
