/**
 * KingPH Layout Styles
 * Version: 1.0.0
 * All classes use v66d- prefix for namespace isolation
 */

/* CSS Variables */
:root {
  --v66d-primary: #48D1CC;
  --v66d-primary-light: #00FFFF;
  --v66d-bg-dark: #2C2C2C;
  --v66d-bg-medium: #696969;
  --v66d-text-light: #F8F8FF;
  --v66d-text-dim: #cccccc;
  --v66d-border: #444444;
  --v66d-shadow: rgba(0, 255, 255, 0.1);
  --v66d-gradient: linear-gradient(135deg, #48D1CC 0%, #00FFFF 100%);
  --v66d-header-height: 64px;
  --v66d-bottom-nav-height: 60px;
}

/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--v66d-text-light);
  background-color: var(--v66d-bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.v66d-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px;
}

.v66d-wrapper {
  padding-top: var(--v66d-header-height);
  padding-bottom: var(--v66d-bottom-nav-height);
}

/* Header */
.v66d-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--v66d-header-height);
  background: linear-gradient(180deg, var(--v66d-bg-dark) 0%, #1a1a1a 100%);
  border-bottom: 1px solid var(--v66d-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 10px var(--v66d-shadow);
}

.v66d-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.v66d-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--v66d-text-light);
}

.v66d-logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.v66d-logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--v66d-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.v66d-header-buttons {
  display: flex;
  gap: 8px;
}

.v66d-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v66d-btn-primary {
  background: var(--v66d-gradient);
  color: var(--v66d-bg-dark);
  box-shadow: 0 2px 8px rgba(72, 209, 204, 0.3);
}

.v66d-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 209, 204, 0.5);
}

.v66d-btn-secondary {
  background: transparent;
  color: var(--v66d-primary);
  border: 2px solid var(--v66d-primary);
}

.v66d-btn-secondary:hover {
  background: var(--v66d-primary);
  color: var(--v66d-bg-dark);
}

.v66d-btn:active {
  transform: scale(0.98);
}

.v66d-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.v66d-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--v66d-primary);
  transition: all 0.3s ease;
}

.v66d-menu-toggle.v66d-open span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.v66d-menu-toggle.v66d-open span:nth-child(2) {
  opacity: 0;
}

.v66d-menu-toggle.v66d-open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.v66d-mobile-menu {
  position: fixed;
  top: var(--v66d-header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--v66d-bg-dark);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.v66d-mobile-menu.v66d-menu-open {
  transform: translateX(0);
}

.v66d-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.v66d-mobile-menu.v66d-menu-open + .v66d-menu-overlay {
  opacity: 1;
  visibility: visible;
}

.v66d-menu-content {
  padding: 24px 16px;
}

.v66d-menu-section {
  margin-bottom: 32px;
}

.v66d-menu-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--v66d-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.v66d-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v66d-menu-links a {
  color: var(--v66d-text-light);
  text-decoration: none;
  font-size: 1.5rem;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.v66d-menu-links a:hover {
  background: var(--v66d-bg-medium);
  color: var(--v66d-primary);
}

.v66d-menu-links i {
  font-size: 1.8rem;
  color: var(--v66d-primary);
}

/* Carousel */
.v66d-carousel {
  position: relative;
  width: 100%;
  height: 180px;
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--v66d-shadow);
}

.v66d-carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.v66d-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.v66d-carousel-slide.v66d-active {
  opacity: 1;
}

.v66d-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v66d-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.v66d-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.v66d-carousel-dot.v66d-active {
  background: var(--v66d-primary);
  width: 24px;
  border-radius: 4px;
}

/* Game Grid */
.v66d-game-section {
  margin: 32px 0;
}

.v66d-section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--v66d-text-light);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.v66d-section-title i {
  color: var(--v66d-primary);
  font-size: 2.2rem;
}

.v66d-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.v66d-game-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--v66d-bg-medium);
  border: 2px solid transparent;
}

.v66d-game-card:hover {
  border-color: var(--v66d-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 16px var(--v66d-shadow);
}

.v66d-game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.v66d-game-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  color: var(--v66d-text-light);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 4px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content Sections */
.v66d-content-section {
  background: var(--v66d-bg-medium);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.v66d-content-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--v66d-primary);
  margin-bottom: 16px;
}

.v66d-content-section p {
  color: var(--v66d-text-dim);
  line-height: 1.8;
  margin-bottom: 12px;
}

.v66d-content-section a {
  color: var(--v66d-primary);
  text-decoration: none;
  font-weight: 600;
}

.v66d-content-section a:hover {
  text-decoration: underline;
}

/* Feature List */
.v66d-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v66d-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(72, 209, 204, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--v66d-primary);
}

.v66d-feature-item i {
  color: var(--v66d-primary);
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.v66d-feature-item h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--v66d-text-light);
  margin-bottom: 4px;
}

.v66d-feature-item p {
  font-size: 1.2rem;
  color: var(--v66d-text-dim);
  line-height: 1.6;
}

/* Bottom Navigation */
.v66d-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--v66d-bottom-nav-height);
  background: linear-gradient(180deg, #1a1a1a 0%, var(--v66d-bg-dark) 100%);
  border-top: 1px solid var(--v66d-border);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  box-shadow: 0 -2px 10px var(--v66d-shadow);
}

.v66d-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--v66d-text-dim);
  min-width: 60px;
  min-height: 60px;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.v66d-bottom-nav a:hover {
  color: var(--v66d-primary);
  background: rgba(72, 209, 204, 0.1);
}

.v66d-bottom-nav a.v66d-nav-active {
  color: var(--v66d-primary);
}

.v66d-bottom-nav i {
  font-size: 2.2rem;
}

.v66d-bottom-nav span {
  font-size: 1rem;
  font-weight: 500;
}

/* Footer */
.v66d-footer {
  background: var(--v66d-bg-dark);
  border-top: 1px solid var(--v66d-border);
  padding: 32px 16px 100px;
  margin-top: 48px;
}

.v66d-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.v66d-footer-links a {
  color: var(--v66d-text-dim);
  text-decoration: none;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.v66d-footer-links a:hover {
  color: var(--v66d-primary);
}

.v66d-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.v66d-partners img {
  width: 50px;
  height: 30px;
  object-fit: contain;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.v66d-partners img:hover {
  opacity: 1;
  transform: scale(1.1);
}

.v66d-copyright {
  text-align: center;
  color: var(--v66d-text-dim);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Touch Feedback */
.v66d-btn:active,
.v66d-game-card:active {
  transform: scale(0.95);
}

.v66d-touching {
  opacity: 0.8;
}

/* Animations */
.v66d-animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.v66d-animate-on-scroll.v66d-animated {
  opacity: 1;
  transform: translateY(0);
}

/* Desktop Styles */
@media (min-width: 769px) {
  .v66d-container {
    max-width: 1200px;
  }

  .v66d-game-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
  }

  .v66d-bottom-nav {
    display: none;
  }

  .v66d-wrapper {
    padding-bottom: 32px;
  }

  .v66d-footer {
    padding-bottom: 32px;
  }
}

/* Utility Classes */
.v66d-text-center {
  text-align: center;
}

.v66d-mt-1 { margin-top: 8px; }
.v66d-mt-2 { margin-top: 16px; }
.v66d-mt-3 { margin-top: 24px; }
.v66d-mb-1 { margin-bottom: 8px; }
.v66d-mb-2 { margin-bottom: 16px; }
.v66d-mb-3 { margin-bottom: 24px; }

.v66d-hidden {
  display: none !important;
}

.v66d-visible {
  display: block !important;
}
