/*
Theme Name: Ninetales Gaming
Theme URI: https://ninetales.live
Author: Ninetales Team
Author URI: https://ninetales.live
Description: Complete responsive WordPress Gaming Theme with built-in Admin Panel, HTML5 Game ZIP Uploader, Ad Monetization Engine, and Pre-roll Interstitial Ad System. Designed for Ninetales.live.
Version: 1.2.0
License: GNU General Public License v2 or later
Text Domain: ninetales
Tags: gaming, dark-mode, responsive-layout, custom-menu, custom-options, ad-management, html5-games
*/

/* ==========================================================================
   1. CORE CSS VARIABLES & RESET
   ========================================================================== */
:root {
  --bg-dark: #0b0a10;
  --bg-card: #141224;
  --bg-card-hover: #1c1a32;
  --bg-glass: rgba(20, 18, 36, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 0, 85, 0.3);
  
  --primary: #ff0055;
  --primary-glow: rgba(255, 0, 85, 0.4);
  --secondary: #7928ca;
  --accent-cyan: #00f2fe;
  --accent-gold: #ffb703;
  --accent-green: #00f5d4;
  
  --text-main: #f8f9fa;
  --text-muted: #a0a5ba;
  --text-dim: #6c738f;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
  background: none;
}

/* ==========================================================================
   2. LAYOUT & CONTAINER
   ========================================================================== */
.nt-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

.nt-main-content {
  flex: 1;
  padding: 24px 0 60px;
}

.nt-grid {
  display: grid;
  gap: 20px;
}

.nt-grid-games {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

@media (min-width: 768px) {
  .nt-grid-games {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1200px) {
  .nt-grid-games {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.nt-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.nt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.nt-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.nt-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
  font-size: 1.2rem;
}

.nt-logo-text span {
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nt-nav-desktop {
  display: none;
}

@media (min-width: 992px) {
  .nt-nav-desktop {
    display: flex;
    align-items: center;
    gap: 24px;
  }
  
  .nt-nav-desktop a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
  }
  
  .nt-nav-desktop a:hover,
  .nt-nav-desktop a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Search Bar */
.nt-search-form {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.nt-search-input {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0 45px 0 20px;
  color: #fff;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nt-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.nt-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.nt-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.2rem;
}

@media (min-width: 992px) {
  .nt-mobile-toggle {
    display: none;
  }
}

/* Mobile Navigation Drawer */
.nt-mobile-drawer {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark);
  z-index: 999;
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
}

.nt-mobile-drawer.active {
  display: flex;
}

.nt-mobile-drawer a {
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
}

/* Category Pills Bar */
.nt-category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.nt-category-bar::-webkit-scrollbar {
  display: none;
}

.nt-cat-pill {
  white-space: nowrap;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nt-cat-pill:hover,
.nt-cat-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* ==========================================================================
   4. GAME CARDS & GRID
   ========================================================================== */
.nt-game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.nt-game-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
}

.nt-card-thumb-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
  background: #100f1c;
}

.nt-card-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nt-game-card:hover .nt-card-thumb {
  transform: scale(1.08);
}

.nt-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  z-index: 2;
}

.nt-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 10, 16, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  z-index: 3;
}

.nt-game-card:hover .nt-card-overlay {
  opacity: 1;
}

.nt-play-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 0 20px var(--primary);
  transform: scale(0.8);
  transition: var(--transition);
}

.nt-game-card:hover .nt-play-icon {
  transform: scale(1);
}

.nt-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nt-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nt-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nt-rating {
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

/* ==========================================================================
   5. SINGLE GAME PAGE & PLAYER FRAME
   ========================================================================== */
.nt-game-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .nt-game-layout {
    grid-template-columns: 1fr 340px;
  }
}

.nt-player-container {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md), 0 0 30px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-color);
}

.nt-player-frame-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #05040a;
}

.nt-player-frame-wrapper.portrait {
  padding-top: 133.33%; /* 3:4 portrait */
  max-width: 500px;
  margin: 0 auto;
}

.nt-game-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Pre-roll Interstitial Ad Overlay */
.nt-preroll-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 10, 16, 0.95);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.nt-preroll-ad-box {
  width: 100%;
  max-width: 640px;
  min-height: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.2);
}

.nt-skip-ad-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  box-shadow: 0 0 15px var(--primary-glow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nt-skip-ad-btn.disabled {
  background: #333;
  color: #888;
  box-shadow: none;
  cursor: not-allowed;
}

/* Player Control Bar */
.nt-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.nt-game-title-header {
  font-size: 1.3rem;
  font-weight: 800;
}

.nt-action-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nt-btn-action {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.nt-btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

.nt-btn-action.liked {
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   6. MONETIZATION & AD CONTAINERS
   ========================================================================== */
.nt-ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  text-align: center;
  width: 100%;
}

.nt-ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.nt-ad-header {
  max-width: 728px;
  margin: 15px auto;
}

.nt-ad-under-player {
  max-width: 728px;
  margin: 24px auto;
}

.nt-ad-sidebar {
  max-width: 300px;
  margin: 0 auto 20px;
}

.nt-ad-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-top: 1px solid var(--border-glow);
  z-index: 9999;
  padding: 6px 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.nt-ad-close-btn {
  position: absolute;
  right: 10px;
  top: -12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Demo Placeholder Ad Styling (If no code pasted) */
.nt-ad-placeholder {
  width: 100%;
  min-height: 90px;
  background: linear-gradient(135deg, rgba(121, 40, 202, 0.1), rgba(255, 0, 85, 0.1));
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 15px;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.nt-footer {
  background: #07060c;
  border-top: 1px solid var(--border-color);
  padding: 50px 0 30px;
  margin-top: auto;
}

.nt-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.nt-footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

.nt-footer-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}

.nt-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nt-footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nt-footer-links a:hover {
  color: var(--primary);
}

.nt-footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ==========================================================================
   8. UTILITIES & SECTIONS
   ========================================================================== */
.nt-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.nt-section-title h2 {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nt-section-title h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.nt-view-all {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.nt-view-all:hover {
  text-decoration: underline;
}

.nt-hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #1c1032, #0b0a10);
  border: 1px solid var(--border-glow);
  padding: 40px 30px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nt-hero-content {
  max-width: 550px;
  z-index: 2;
}

.nt-hero-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.nt-hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
}

.nt-hero-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.nt-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 20px var(--primary-glow);
}

.nt-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--primary);
}

/* ==========================================================================
   10. LIVE VISITOR COUNTER STYLES
   ========================================================================== */
.nt-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.nt-footer-visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.25);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.12);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  color: #e0e6ed;
  margin-top: 6px;
  transition: all 0.3s ease;
}

.nt-footer-visitor-counter:hover {
  border-color: rgba(0, 245, 212, 0.6);
  box-shadow: 0 0 25px rgba(0, 245, 212, 0.25);
  transform: translateY(-2px);
}

.nt-live-dot {
  width: 10px;
  height: 10px;
  background-color: #00f5d4;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px #00f5d4, 0 0 20px #00f5d4;
  animation: ntPulseDot 1.6s infinite ease-in-out;
}

@keyframes ntPulseDot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(0, 245, 212, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 245, 212, 0);
  }
}

.nt-visitor-icon {
  color: #00f5d4;
}

.nt-visitor-text strong {
  color: #00f5d4;
  font-size: 1.05rem;
  font-weight: 800;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.nt-pulse-num {
  color: #ff0055 !important;
  transform: scale(1.18);
}
