/* === 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:#0a1628;color:#dce6f0;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 === */
.site-header{background:#0f1f35;border-bottom:1px solid #1a3350;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.2em;font-weight:800;background:linear-gradient(135deg,#2dd4bf,#22d3ee);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.header-search{display:flex;align-items:center;background:#0a1628;border:1px solid #1a3350;border-radius:10px;padding:6px 12px;width:180px}
.header-search input{background:none;border:none;outline:none;color:#dce6f0;font-size:.85em;width:100%}
.header-search svg{width:16px;height:16px;color:#506880;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:14px;overflow:hidden;aspect-ratio:16/10}
.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,.85))}
.carousel-overlay h3{font-size:.95em;font-weight:700;color:#fff;margin-bottom:2px}
.carousel-overlay p{font-size:.72em;color:#8ca0b8;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(10,22,40,.7);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;pointer-events:all;border:1px solid #1a3350}
.carousel-btn svg{width:20px;height:20px;color:#dce6f0}
.carousel-dots{display:flex;justify-content:center;gap:5px;margin-top:8px}
.carousel-dot{width:8px;height:8px;border-radius:50%;background:#1a3350;transition:all .2s}
.carousel-dot.active{background:#2dd4bf;width:20px;border-radius:4px}

/* === CATEGORY GRID === */
.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:12px;background:#0f1f35;border:1px solid #1a3350;transition:all .2s;-webkit-tap-highlight-color:transparent}
.category-item:active{background:#1a3350;transform:scale(.96)}
.category-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center}
.category-icon svg{width:20px;height:20px;fill:currentColor}
.cat-action .category-icon{background:#ef444420;color:#ef4444}
.cat-puzzle .category-icon{background:#2dd4bf20;color:#2dd4bf}
.cat-arcade .category-icon{background:#22d3ee20;color:#22d3ee}
.cat-brain .category-icon{background:#a78bfa20;color:#a78bfa}
.cat-sports .category-icon{background:#34d39e20;color:#34d399}
.cat-classic .category-icon{background:#f472b620;color:#f472b6}
.cat-speed .category-icon{background:#fb923c20;color:#fb923c}
.cat-all .category-icon{background:#2dd4bf20;color:#2dd4bf}
.category-name{font-size:.68em;font-weight:600;color:#8ca0b8;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:#ef444420;color:#ef4444}
.badge-blue{background:#22d3ee20;color:#22d3ee}
.badge-orange{background:#fb923c20;color:#fb923c}
.badge-purple{background:#a78bfa20;color:#a78bfa}
.badge-green{background:#34d39e20;color:#34d399}
.badge-cyan{background:#2dd4bf20;color:#2dd4bf}
.badge-content .badge-title{font-size:.9em;font-weight:700;color:#dce6f0}
.badge-content .badge-subtitle{font-size:.7em;color:#506880}

/* === GAME SCROLLABLE ROW === */
.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:110px;scroll-snap-align:start}
.game-cover{width:110px;height:110px;border-radius:14px;overflow:hidden;background:#0f1f35;transition:transform .2s}
.game-cover:active{transform:scale(.95)}
.game-cover img{width:100%;height:100%;object-fit:cover}
.game-card-title{font-size:.7em;font-weight:600;color:#8ca0b8;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:16px;overflow:hidden;position:relative}
.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:#2dd4bf20;color:#2dd4bf;font-size:.72em;font-weight:700;padding:4px 12px;border-radius:6px;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:#8ca0b8;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,#2dd4bf,#22d3ee);color:#0a1628;font-size:1.1em;font-weight:700;border-radius:14px;border:none;cursor:pointer;transition:transform .15s,box-shadow .15s;-webkit-tap-highlight-color:transparent;text-decoration:none}
.detail-cta-btn:hover{transform:scale(1.04);box-shadow:0 8px 28px rgba(45,212,191,.35)}
.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:#0f1f35;display:flex;align-items:center;padding:0 12px;gap:10px}
.game-fs-back{display:flex;align-items:center;gap:6px;color:#8ca0b8;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 #0f1f35}
.seo-section h2{font-size:1.05em;font-weight:700;color:#dce6f0;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:#0f1f35;border-radius:12px;padding:14px}
.benefit-item h3{font-size:.82em;font-weight:700;color:#2dd4bf;margin-bottom:4px}
.benefit-item p{font-size:.76em;color:#506880;line-height:1.4}

/* === FOOTER === */
.site-footer{background:#0f1f35;border-top:1px solid #1a3350;padding:20px 16px;text-align:center;margin-top:30px}
.site-footer p{font-size:.76em;color:#3a5068}
.site-footer a{color:#2dd4bf}

/* === 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;
}
