/* === 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:#0c1407;color:#dde8d0;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:#13200c;border-bottom:1px solid #243818;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,#a3e635,#65a30d);-webkit-background-clip:text;-webkit-text-fill-color:transparent;letter-spacing:-.3px}
.header-search{display:flex;align-items:center;background:#0c1407;border:1px solid #243818;border-radius:12px;padding:6px 14px;width:180px}
.header-search input{background:none;border:none;outline:none;color:#dde8d0;font-size:.85em;width:100%}
.header-search svg{width:16px;height:16px;color:#5a7040;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(12,20,7,.92))}
.carousel-overlay h3{font-size:.95em;font-weight:700;color:#fff;margin-bottom:2px}
.carousel-overlay p{font-size:.72em;color:#90a878;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:10px;background:rgba(12,20,7,.85);display:flex;align-items:center;justify-content:center;pointer-events:all;border:1px solid #243818}
.carousel-btn svg{width:20px;height:20px;color:#dde8d0}
.carousel-dots{display:flex;justify-content:center;gap:5px;margin-top:8px}
.carousel-dot{width:8px;height:8px;border-radius:50%;background:#243818;transition:all .2s}
.carousel-dot.active{background:#a3e635;width:22px;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:14px;background:#13200c;border:1px solid #243818;transition:all .2s;-webkit-tap-highlight-color:transparent}
.category-item:active{background:#243818;transform:scale(.95)}
.category-icon{width:32px;height:32px;border-radius:9px;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:#a3e63520;color:#a3e635}
.cat-arcade .category-icon{background:#fbbf2420;color:#fbbf24}
.cat-brain .category-icon{background:#a78bfa20;color:#a78bfa}
.cat-sports .category-icon{background:#22c55e20;color:#22c55e}
.cat-classic .category-icon{background:#84cc1620;color:#84cc16}
.cat-speed .category-icon{background:#fb923c20;color:#fb923c}
.cat-all .category-icon{background:#bef26420;color:#bef264}
.category-name{font-size:.68em;font-weight:600;color:#90a878;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:#a3e63520;color:#a3e635}
.badge-orange{background:#fbbf2420;color:#fbbf24}
.badge-purple{background:#a78bfa20;color:#a78bfa}
.badge-green{background:#22c55e20;color:#22c55e}
.badge-cyan{background:#84cc1620;color:#84cc16}
.badge-content .badge-title{font-size:.9em;font-weight:700;color:#dde8d0}
.badge-content .badge-subtitle{font-size:.7em;color:#5a7040}

/* === 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:112px;scroll-snap-align:start}
.game-cover{width:112px;height:112px;border-radius:14px;overflow:hidden;background:#13200c;transition:transform .2s,box-shadow .2s;border:1px solid #243818}
.game-cover:hover{transform:translateY(-3px);box-shadow:0 6px 18px rgba(163,230,53,.12)}
.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:#90a878;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;border:1px solid #243818}
.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:#a3e63515;color:#a3e635;font-size:.72em;font-weight:700;padding:4px 14px;border-radius:8px;text-transform:uppercase;letter-spacing:.5px;border:1px solid #a3e63530}
.detail-main-title{font-size:1.6em;font-weight:800;color:#fff;line-height:1.2}
.detail-main-desc{font-size:.9em;color:#90a878;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,#84cc16,#65a30d);color:#0c1407;font-size:1.1em;font-weight:800;border-radius:12px;border:none;cursor:pointer;transition:transform .15s,box-shadow .15s;-webkit-tap-highlight-color:transparent;text-decoration:none;box-shadow:0 4px 16px rgba(132,204,22,.25)}
.detail-cta-btn:hover{transform:scale(1.04);box-shadow:0 8px 28px rgba(132,204,22,.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:#13200c;display:flex;align-items:center;padding:0 12px;gap:10px;border-bottom:1px solid #243818}
.game-fs-back{display:flex;align-items:center;gap:6px;color:#90a878;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 #13200c}
.seo-section h2{font-size:1.05em;font-weight:700;color:#dde8d0;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:#13200c;border:1px solid #243818;border-radius:12px;padding:14px}
.benefit-item h3{font-size:.82em;font-weight:700;color:#a3e635;margin-bottom:4px}
.benefit-item p{font-size:.76em;color:#5a7040;line-height:1.4}

/* === FOOTER === */
.site-footer{background:#13200c;border-top:1px solid #243818;padding:20px 16px;text-align:center;margin-top:30px}
.site-footer p{font-size:.76em;color:#3a4828}
.site-footer a{color:#a3e635}

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