/* Page specific styles for Kafe Games Index */

.featured-banner {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    padding: 10px;
}

.featured-banner-inner {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.featured-item {
    flex: 0 0 100%;
    position: relative;
}

.featured-item img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 24px;
    transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
    filter: brightness(0.8) contrast(1.1);
}

.featured-item:hover img {
    transform: scale(1.08) rotate(0.1deg);
    filter: brightness(1) contrast(1.2);
}

.featured-caption {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.6);
    animation: slideUp 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

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

.search-container {
    margin: 2rem auto;
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.search-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 1.2rem 2rem;
    color: white;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

@keyframes inputGlow {
    0% { box-shadow: 0 0 5px rgba(0, 242, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 242, 255, 0.5); }
    100% { box-shadow: 0 0 5px rgba(0, 242, 255, 0.2); }
}

.search-container input:focus {
    border-color: var(--neon-cyan);
    background: rgba(255, 255, 255, 0.08);
    animation: inputGlow 2s infinite ease-in-out;
    transform: translateY(-2px);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.app-card {
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(30px);
}

.app-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.app-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 242, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 242, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
    pointer-events: none;
}

.app-card:hover::before {
    transform: translateX(100%);
}

.app-box {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-info { 
    padding: 1.5rem; 
    text-align: left; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

.card-info h2 { 
    font-size: 1.1rem; 
    margin-bottom: 0.5rem; 
    color: #fff; 
}

.card-meta { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.8rem; 
    color: var(--text-dim); 
}

/* Trending strip */
.trending-strip { 
    margin: 2rem auto; 
    border-radius: 100px; 
    overflow: hidden; 
    width: 100%; 
    max-width: 1400px; 
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.05), rgba(188, 0, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trending-inner {
    display: flex;
    white-space: nowrap;
    animation: scroll 40s linear infinite;
    width: max-content;
    padding: 10px 0;
}

.trending-inner:hover {
    animation-play-state: paused;
}

.trending-item { 
    background: rgba(255, 255, 255, 0.03); 
    padding: 10px 20px; 
    border-radius: 50px; 
    margin: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.trending-item:hover { 
    border-color: var(--neon-cyan); 
    background: rgba(0, 242, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.2);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.recently-played { margin: 2rem 0; }
.recent-list { 
    display: flex; 
    overflow-x: auto; 
    gap: 1rem; 
    padding-bottom: 1rem; 
    scrollbar-width: none; 
}
.recent-list::-webkit-scrollbar { display: none; }

.recent-card { 
    min-width: 180px; 
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-card:hover { 
    transform: translateY(-8px); 
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--neon-purple);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.recent-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.4s ease;
}

.recent-card:hover img {
    transform: scale(1.05);
}

.recent-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 12px;
    color: var(--text-main);
    text-align: center;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,242,255,0.2);
    color: white;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    transition: 0.3s;
    font-size: 1.2rem;
}

.carousel-arrow:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: var(--glow-cyan);
}

.carousel-arrow.left { left: 1.5rem; }
.carousel-arrow.right { right: 1.5rem; }

@media (max-width: 768px) {
    .featured-item img { height: 280px; }
    .featured-caption { 
        font-size: 1.2rem; 
        bottom: 1rem; 
        left: 1rem;
        padding: 0.8rem 1.2rem;
    }
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .search-container { flex-direction: row; padding: 10px; margin: 1rem auto; }
    .search-container input { padding: 0.8rem 1.2rem; font-size: 0.9rem; }
    .apps-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.8rem !important;
    }
    .app-box { height: 120px; }
    .card-info { padding: 1rem; }
    .card-info h2 { font-size: 0.9rem; }
    .card-meta { font-size: 0.7rem; }
}

@media (max-width: 480px) {
    .featured-item img { height: 200px; }
    .featured-caption { font-size: 1rem; }
    .apps-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Game Modal Styles */
.game-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

#gameFrame {
    width: 85%;
    height: 85%;
    border: 2px solid var(--neon-cyan);
    border-radius: 24px;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.3);
    background: #000;
}

.game-hud {
    width: 85%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--glass-border);
    border-bottom: none;
    margin-bottom: -1px;
}

.hud-title {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

.circular-timer-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 100px;
    height: 100px;
    z-index: 2000000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 40px rgba(245, 176, 65, 0.2), inset 0 0 20px rgba(245, 176, 65, 0.1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    user-select: none;
}

.circular-timer-container:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(245, 176, 65, 0.4);
}

/* Cosmic Ring Effect (Gold) */
.circular-timer-container::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #f5b041, transparent 30%, #f5b041 60%, transparent 100%);
    animation: rotateRing 4s linear infinite;
    opacity: 0.3;
}

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

.timer-svg {
    width: 85%;
    height: 85%;
    transform: rotate(-90deg);
    z-index: 2;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: #f5b041;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    filter: drop-shadow(0 0 12px #f5b041);
    transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}

.timer-text {
    position: absolute;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 15px #f5b041, 0 0 30px rgba(245, 176, 65, 0.5);
    z-index: 3;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Tick Pulse Animation (Gold) */
.timer-text.tick {
    transform: scale(1.2);
    color: #f5b041;
}

/* Critical Overdrive state (Stays Red for urgency) */
.circular-timer-container.critical {
    border-color: rgba(255, 71, 87, 0.5);
    box-shadow: 0 0 60px rgba(255, 71, 87, 0.4);
}
.circular-timer-container.critical .timer-progress {
    stroke: #ff4757;
    filter: drop-shadow(0 0 15px #ff4757);
}
.circular-timer-container.critical .timer-text {
    color: #ff4757;
    text-shadow: 0 0 15px #ff4757;
}

.circular-timer-container.critical::before {
    background: conic-gradient(from 0deg, #ff4757, transparent 30%, #ff4757 60%, transparent 100%);
    animation-duration: 1.5s;
}

@media (max-width: 768px) {
    .circular-timer-container {
        bottom: 25px;
        left: 25px;
        width: 80px;
        height: 80px;
    }
    .timer-text { font-size: 1.4rem; }
}

.hud-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

@media (max-width: 768px) {
    .game-hud {
        width: 95%;
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    .reward-timer-hud {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}


.reward-timer-hud {
    background: rgba(255, 217, 0, 0.1);
    border: 1px solid rgba(255, 217, 0, 0.3);
    padding: 6px 15px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--neon-yellow);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(255, 217, 0, 0.1);
}

.reward-timer-hud span {
    color: #fff;
    min-width: 50px;
}



.treasure-box {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 217, 0, 0.3);
    box-shadow: 0 0 30px rgba(255, 217, 0, 0.1), inset 0 0 15px rgba(255, 217, 0, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: floatTreasure 3s ease-in-out infinite;
    cursor: pointer;
    z-index: 2200;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.treasure-box:hover {
    transform: scale(1.1) translateY(-5px);
    border-color: var(--neon-yellow);
    box-shadow: 0 0 40px rgba(255, 217, 0, 0.4);
}

.treasure-box img { 
    width: 50px; 
    height: 50px; 
    filter: drop-shadow(0 0 10px rgba(255, 217, 0, 0.5));
    transition: transform 0.5s ease;
}

.treasure-box:hover img {
    transform: rotate(10deg) scale(1.1);
}

#treasureTimer { 
    font-family: 'Orbitron', sans-serif; 
    color: var(--neon-yellow); 
    font-weight: 700; 
    font-size: 1.2rem;
    text-shadow: 0 0 12px rgba(255, 217, 0, 0.6);
    letter-spacing: 1px;
}

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

@keyframes pulseTimer {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#treasureTimer.pulse {
    animation: pulseTimer 1s infinite ease-in-out;
}

#rewardPopup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(25px);
    padding: 2.5rem;
    border-radius: 30px;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 80px rgba(0, 242, 255, 0.2), inset 0 0 20px rgba(255,255,255,0.05);
    z-index: 20002;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

@keyframes reward-pop {
    from { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#rewardPopup h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

#rewardPopup p {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.reward-btn {
    width: 100%;
    padding: 12px;
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}

.reward-btn:hover {
    box-shadow: 0 0 30px var(--neon-cyan);
    transform: translateY(-3px);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Ad Container Styles */
.ad-leaderboard-container {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    overflow: hidden;
    min-height: 90px;
}

.ad-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2050;
    display: none; /* Hidden by default, shown on desktop */
}

.ad-side-left {
    left: 2rem;
}

.ad-side-right {
    right: 2rem;
}

@media (min-width: 1400px) {
    .ad-side {
        display: block;
    }
    #gameFrame {
        width: calc(100% - 400px); /* Leave room for side ads */
        max-width: 1000px;
    }
}

@media (max-width: 1024px) {
    .ad-leaderboard-container {
        display: none;
    }
}

/* --- Diwali/Festive Ribbon Styling --- */
.diwali-ribbon {
    margin: 3rem auto;
    padding: 2.5rem 1rem;
    background: rgba(10, 10, 20, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 1400px;
}

.diwali-ribbon::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.05) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    z-index: 0;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ribbon-text {
    position: relative;
    z-index: 2;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 5px;
    background: linear-gradient(to right, #fff, var(--neon-cyan), var(--neon-purple), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 4s linear infinite;
    text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

@keyframes textGradient {
    to { background-position: 200% center; }
}

#visitCount {
    color: var(--neon-lime);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(204, 255, 0, 0.5);
}

/* Sparkles */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px var(--neon-cyan);
    opacity: 0;
    animation: sparkleAnim 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes sparkleAnim {
    0%, 100% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
}

.sparkle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 70%; left: 85%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { top: 40%; left: 95%; animation-delay: 1s; }
.sparkle:nth-child(4) { top: 85%; left: 15%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { top: 15%; left: 50%; animation-delay: 2s; }

@media (max-width: 768px) {
    .ribbon-text {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    .diwali-ribbon {
        padding: 1.5rem 0.5rem;
        margin: 2rem 1rem;
        width: auto;
    }
}
.visitor-stats {
    text-align: center;
    font-size: 1.1rem;
    margin: 10px 0;
    color: #00ff44;
    position: relative;
    z-index: 2;
    font-weight: 600;
}
