/* === RESET & BASE === */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:'Segoe UI',system-ui,-apple-system,sans-serif;background:#120818;color:#e8daf0;line-height:1.6;min-height:100vh;overflow-x:hidden}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
button{cursor:pointer;border:none;background:none;font:inherit;color:inherit}

/* === HEADER — gradient bar === */
.site-header{background:linear-gradient(90deg,#1a0d24,#2a1238);border-bottom:1px solid #3a1850;padding:12px 16px;position:sticky;top:0;z-index:100}
.header-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between}
.site-logo{display:flex;align-items:center;gap:8px}
.site-logo h1{font-size:1.25em;font-weight:800;background:linear-gradient(135deg,#e879f9,#f0abfc);-webkit-background-clip:text;-webkit-text-fill-color:transparent;letter-spacing:-.5px}
.header-search{display:flex;align-items:center;background:#120818;border:1px solid #3a1850;border-radius:20px;padding:6px 14px;width:180px}
.header-search input{background:none;border:none;outline:none;color:#e8daf0;font-size:.85em;width:100%}
.header-search svg{width:16px;height:16px;color:#7a5090;flex-shrink:0;margin-right:6px}

/* === CAROUSEL === */
.carousel-container{position:relative;max-width:1200px;margin:0 auto;padding:12px 16px;overflow:hidden}
.carousel-wrapper{display:flex;transition:transform .4s ease;will-change:transform}
.carousel-slide{min-width:100%;padding:0 4px}
@media(min-width:600px){.carousel-slide{min-width:50%}}
@media(min-width:900px){.carousel-slide{min-width:33.33%}}
.carousel-slide a{display:block;position:relative;border-radius:16px;overflow:hidden;aspect-ratio:16/10;box-shadow:0 4px 20px rgba(232,121,249,.08)}
.carousel-slide img{width:100%;height:100%;object-fit:cover}
.carousel-overlay{position:absolute;bottom:0;left:0;right:0;padding:14px;background:linear-gradient(transparent,rgba(0,0,0,.88))}
.carousel-overlay h3{font-size:.95em;font-weight:700;color:#fff;margin-bottom:2px}
.carousel-overlay p{font-size:.72em;color:#b090c8;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.carousel-controls{position:absolute;top:50%;left:8px;right:8px;display:flex;justify-content:space-between;transform:translateY(-50%);pointer-events:none}
.carousel-btn{width:34px;height:34px;border-radius:50%;background:rgba(18,8,24,.8);display:flex;align-items:center;justify-content:center;pointer-events:all;border:1px solid #3a1850}
.carousel-btn svg{width:20px;height:20px;color:#e8daf0}
.carousel-dots{display:flex;justify-content:center;gap:5px;margin-top:8px}
.carousel-dot{width:8px;height:8px;border-radius:50%;background:#2a1238;transition:all .2s}
.carousel-dot.active{background:#e879f9;width:20px;border-radius:4px}

/* === CATEGORY GRID — pill-shaped items === */
.category-grid-container{max-width:1200px;margin:0 auto;padding:8px 16px}
.category-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
@media(min-width:600px){.category-grid{grid-template-columns:repeat(8,1fr)}}
.category-item{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 4px;border-radius:16px;background:linear-gradient(135deg,#1a0d24,#221030);border:1px solid #301845;transition:all .2s;-webkit-tap-highlight-color:transparent}
.category-item:active{background:#301845;transform:scale(.95)}
.category-icon{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.category-icon svg{width:20px;height:20px;fill:currentColor}
.cat-action .category-icon{background:#f4394e20;color:#f4394e}
.cat-puzzle .category-icon{background:#e879f920;color:#e879f9}
.cat-arcade .category-icon{background:#fb923c20;color:#fb923c}
.cat-brain .category-icon{background:#a78bfa20;color:#a78bfa}
.cat-sports .category-icon{background:#34d39920;color:#34d399}
.cat-classic .category-icon{background:#f0abfc20;color:#f0abfc}
.cat-speed .category-icon{background:#fbbf2420;color:#fbbf24}
.cat-all .category-icon{background:#c084fc20;color:#c084fc}
.category-name{font-size:.68em;font-weight:600;color:#9878b0;text-align:center}

/* === GAME SECTION === */
.game-section{max-width:1200px;margin:0 auto;padding:8px 16px 16px}
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.badge-card{display:flex;align-items:center;gap:8px}
.badge-icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.badge-icon svg{width:20px;height:20px;fill:currentColor}
.badge-red{background:#f4394e20;color:#f4394e}
.badge-blue{background:#e879f920;color:#e879f9}
.badge-orange{background:#fb923c20;color:#fb923c}
.badge-purple{background:#a78bfa20;color:#a78bfa}
.badge-green{background:#34d39920;color:#34d399}
.badge-cyan{background:#c084fc20;color:#c084fc}
.badge-content .badge-title{font-size:.9em;font-weight:700;color:#e8daf0}
.badge-content .badge-subtitle{font-size:.7em;color:#7a5090}

/* === GAME SCROLLABLE ROW — larger cards with glow === */
.game-row{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.game-row::-webkit-scrollbar{display:none}
.game-card{flex-shrink:0;width:115px;scroll-snap-align:start}
.game-cover{width:115px;height:115px;border-radius:16px;overflow:hidden;background:#1a0d24;transition:transform .2s,box-shadow .2s;border:1px solid #2a1238}
.game-cover:hover{transform:scale(1.05);box-shadow:0 4px 18px rgba(232,121,249,.15)}
.game-cover:active{transform:scale(.94)}
.game-cover img{width:100%;height:100%;object-fit:cover}
.game-card-title{font-size:.7em;font-weight:600;color:#9878b0;text-align:center;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* === GAME DETAIL PAGE === */
.game-detail-wrapper{max-width:600px;margin:0 auto;padding:0 16px}
.detail-hero-section{display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px;margin-bottom:24px}
.detail-image-container{width:100%;max-width:400px;border-radius:18px;overflow:hidden;position:relative;box-shadow:0 8px 32px rgba(232,121,249,.12)}
.detail-image-container img{width:100%;height:auto;display:block}
.detail-content-container{width:100%;max-width:400px;display:flex;flex-direction:column;align-items:center;gap:8px}
.detail-header{display:flex;flex-direction:column;align-items:center;gap:6px}
.detail-badge{display:inline-block;background:#e879f918;color:#e879f9;font-size:.72em;font-weight:700;padding:4px 14px;border-radius:20px;text-transform:uppercase;letter-spacing:.5px}
.detail-main-title{font-size:1.6em;font-weight:800;color:#fff;line-height:1.2}
.detail-main-desc{font-size:.9em;color:#b090c8;line-height:1.5;max-width:400px}
.detail-cta-section{margin-top:8px}
.detail-cta-btn{display:inline-flex;align-items:center;gap:10px;padding:14px 36px;background:linear-gradient(135deg,#d946ef,#a855f7);color:#fff;font-size:1.1em;font-weight:700;border-radius:50px;border:none;cursor:pointer;transition:transform .15s,box-shadow .15s;-webkit-tap-highlight-color:transparent;text-decoration:none;box-shadow:0 4px 20px rgba(217,70,239,.3)}
.detail-cta-btn:hover{transform:scale(1.04);box-shadow:0 8px 28px rgba(217,70,239,.4)}
.detail-cta-btn:active{transform:scale(.97)}
.detail-cta-btn svg{flex-shrink:0}
@media(min-width:700px){
  .game-detail-wrapper{max-width:800px}
  .detail-hero-section{flex-direction:row;text-align:left;align-items:flex-start}
  .detail-image-container{width:280px;max-width:280px;flex-shrink:0}
  .detail-content-container{align-items:flex-start}
  .detail-header{align-items:flex-start}
}

/* === GAME IFRAME FULLSCREEN === */
.game-fs{position:fixed;inset:0;z-index:2147483647;background:#000;display:none}
.game-fs.active{display:flex;flex-direction:column}
.game-fs iframe{flex:1;width:100%;border:none}
.game-fs-bar{height:44px;background:#1a0d24;display:flex;align-items:center;padding:0 12px;gap:10px}
.game-fs-back{display:flex;align-items:center;gap:6px;color:#b090c8;font-size:.85em;font-weight:600}
.game-fs-back svg{width:18px;height:18px}

/* === SEO CONTENT === */
.seo-section{max-width:1200px;margin:20px auto;padding:16px;border-top:1px solid #1a0d24}
.seo-section h2{font-size:1.05em;font-weight:700;color:#e8daf0;margin-bottom:12px}
.seo-benefits{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:500px){.seo-benefits{grid-template-columns:1fr}}
.benefit-item{background:linear-gradient(135deg,#1a0d24,#221030);border:1px solid #301845;border-radius:14px;padding:14px}
.benefit-item h3{font-size:.82em;font-weight:700;color:#e879f9;margin-bottom:4px}
.benefit-item p{font-size:.76em;color:#7a5090;line-height:1.4}

/* === FOOTER === */
.site-footer{background:linear-gradient(90deg,#1a0d24,#2a1238);border-top:1px solid #3a1850;padding:20px 16px;text-align:center;margin-top:30px}
.site-footer p{font-size:.76em;color:#4a3060}
.site-footer a{color:#e879f9}

/* === GAME PLAYING === */
body.game-playing > div:not(.game-fs),
body.game-playing > iframe,
body.game-playing > ins {
  z-index: 1 !important;
}
body.game-playing > .game-fs {
  z-index: 2147483647 !important;
}
