@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Poppins:wght@700&display=swap');

:root {
    --bg-color: #0b0f19;
    --card-bg: #1a2235;
    --primary: #00e5ff;
    --secondary: #ff007f;
    --text-main: #ffffff;
    --text-muted: #c0d0e0;
    --glass-bg: rgba(26, 34, 53, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: 'Inter', sans-serif; line-height: 1.6; overflow-x: hidden; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Glassmorphism Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container { max-width: 1400px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; align-items: center; }
.logo a { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: 1px; background: linear-gradient(45deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; transition: color 0.3s ease; text-transform: uppercase; }
.nav-links a:hover { color: var(--primary); }
.search-box { display: flex; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 30px; padding: 0 10px; align-items: center; }
.search-box input { background: transparent; border: none; color: #fff; outline: none; padding: 0 10px; height: 48px; width: 200px; font-family: 'Inter', sans-serif; }
.search-box button { background: transparent; border: none; color: var(--primary); cursor: pointer; font-size: 20px; padding: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }

/* 2-Column Layout (Matching the screenshot) */
.layout-wrapper { max-width: 1400px; margin: 30px auto; padding: 0 20px; display: flex; gap: 30px; }
.main-content { flex: 1; min-width: 0; }
.sidebar-content { width: 320px; flex-shrink: 0; }

/* Ad Slot styles */
.ad-slot { background: rgba(0,0,0,0.3); border: 1px dashed var(--glass-border); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 20px; }
.ad-below-game { width: 100%; height: 90px; margin: 20px 0; }
.ad-sidebar { width: 100%; min-height: 250px; }

/* Section Title */
.section-title { font-family: 'Poppins', sans-serif; font-size: 24px; margin: 30px 0 20px 0; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 4px; height: 24px; background: var(--secondary); border-radius: 4px; }

/* Games Grid */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.game-card { background: var(--card-bg); border-radius: 15px; overflow: hidden; text-decoration: none; border: 1px solid var(--glass-border); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: block; }
.game-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border-color: var(--primary); }
.game-card img { width: 100%; height: 120px; object-fit: cover; border-bottom: 1px solid var(--glass-border); transition: transform 0.3s ease; }
.game-card:hover img { transform: scale(1.05); }
.game-card-info { padding: 12px; background: var(--card-bg); }
.game-card h3 { color: var(--text-main); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sidebar Featured Games */
.sidebar-list { display: flex; flex-direction: column; gap: 15px; }
.sidebar-card { display: flex; align-items: center; gap: 15px; background: var(--card-bg); padding: 10px; border-radius: 12px; text-decoration: none; border: 1px solid var(--glass-border); transition: all 0.2s ease; }
.sidebar-card:hover { border-color: var(--primary); transform: translateX(-5px); }
.sidebar-card img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; }
.sidebar-card h4 { color: #fff; font-size: 14px; margin-bottom: 4px; }
.sidebar-card span { color: var(--text-muted); font-size: 12px; }

/* Game Detail (Main Game Area) */
.iframe-wrapper { width: 100%; height: 500px; background: #000; border-radius: 12px; overflow: hidden; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.5); border: 1px solid var(--glass-border); }
.iframe-wrapper iframe { width: 100%; height: 100%; border: none; }
.iframe-wrapper.fullscreen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; border-radius: 0; }
.btn-fullscreen { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); color: #fff; border: 1px solid var(--glass-border); padding: 8px 15px; border-radius: 8px; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 600; transition: all 0.3s ease; }
.btn-fullscreen:hover { background: var(--primary); color: #000; }

.game-info { margin-top: 20px; padding: 20px; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--glass-border); }
.game-info h1 { font-family: 'Poppins', sans-serif; font-size: 28px; margin-bottom: 15px; color: var(--primary); }

/* Comments Section */
.comment-form { background: var(--card-bg); padding: 20px; border-radius: 12px; margin: 20px 0; border: 1px solid var(--glass-border); }
.modern-input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: #fff; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.3s ease; }
.modern-input:focus { border-color: var(--primary); }
.modern-btn { background: linear-gradient(45deg, var(--primary), #00b4d8); color: #000; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; text-transform: uppercase; transition: transform 0.2s ease; }
.modern-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 229, 255, 0.4); }
.comment-item { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--glass-border); margin-bottom: 15px; display: flex; flex-direction: column; }
.comment-item strong { color: var(--primary); font-size: 15px; }
.comment-item span { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.comment-item p { margin-top: 10px; color: #ffffff; }

/* Footer */
footer { background: var(--card-bg); border-top: 1px solid var(--glass-border); padding: 40px 0; margin-top: 60px; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--primary); }

@media (max-width: 1024px) {
    .layout-wrapper { flex-direction: column; }
    .sidebar-content { width: 100%; }
}

/* Dynamic Search Dropdown */
.search-container { position: relative; }
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1001;
}
.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s ease;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(0,229,255,0.1); }
.search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}
.search-item span { font-size: 14px; font-weight: 600; }
.search-no-results { padding: 15px; color: var(--text-muted); font-size: 14px; text-align: center; }

/* Iframe Masking (Click to Play) */
.game-mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mask-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-btn {
    background: linear-gradient(45deg, var(--secondary), #ff4d4d);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255,0,127,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
}
.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(255,0,127,0.8);
}


/* Rating System */
.rating-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.05);
    padding: 5px 15px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}
.rating-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}
.stars {
    display: inline-flex;
    flex-direction: row-reverse;
}
.stars span {
    font-size: 22px;
    color: #444;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}
.stars span.active {
    color: #ffc107;
}
/* When hovering over the container, revert active stars to gray so hover effect is clear */
.stars:hover span.active {
    color: #444;
}
/* Highlight hovered star and all preceding stars (which are following siblings due to row-reverse) */
.stars span:hover,
.stars span:hover ~ span {
    color: #ffc107 !important;
    transform: scale(1.1);
}
/* When voted, lock it down */
.stars[data-voted="true"] span {
    pointer-events: none;
    color: #444 !important;
}
.stars[data-voted="true"] span.voted-star,
.stars[data-voted="true"] span.voted-star ~ span {
    color: #ffc107 !important;
}



