/**
 * Han Online - Main Stylesheet
 * All classes use g407- prefix for namespace isolation
 * Mobile-first design, max-width 430px
 */

/* === CSS Variables === */
:root {
  --g407-primary: #FF8C00;
  --g407-secondary: #FFEB3B;
  --g407-accent: #FFAA00;
  --g407-bg-dark: #1A1A1A;
  --g407-bg-card: #222222;
  --g407-bg-section: #1E1E1E;
  --g407-text-light: #E5E5E5;
  --g407-text-muted: #999999;
  --g407-text-white: #FFFFFF;
  --g407-border: #333333;
  --g407-success: #4CAF50;
  --g407-danger: #FF4444;
  --g407-gradient: linear-gradient(135deg, #FF8C00, #FFAA00);
  --g407-shadow: 0 2px 8px rgba(0,0,0,0.4);
  --g407-radius: 8px;
  --g407-radius-sm: 4px;
  --g407-transition: all 0.3s ease;
}

/* === Reset & Base === */
*, *::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, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--g407-bg-dark);
  color: var(--g407-text-light);
  line-height: 1.5rem;
  font-size: 1.4rem;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--g407-primary); text-decoration: none; }
a:hover { color: var(--g407-secondary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === Container === */
.g407-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.2rem;
}
.g407-wrapper {
  padding: 1.5rem 1.2rem;
}

/* === Header === */
.g407-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 5.6rem;
  background: linear-gradient(180deg, #1A1A1A, #111111);
  border-bottom: 1px solid var(--g407-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  z-index: 1000;
}
.g407-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.g407-logo {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.6rem;
}
.g407-site-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g407-primary);
  white-space: nowrap;
}
.g407-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.g407-btn-register {
  background: var(--g407-gradient);
  color: var(--g407-bg-dark);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--g407-transition);
}
.g407-btn-register:hover { transform: scale(1.05); box-shadow: 0 0 12px rgba(255,140,0,0.5); }
.g407-btn-login {
  background: transparent;
  color: var(--g407-primary);
  border: 1px solid var(--g407-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--g407-transition);
}
.g407-btn-login:hover { background: rgba(255,140,0,0.1); }
.g407-menu-toggle {
  background: none;
  border: none;
  color: var(--g407-text-light);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.4rem;
  display: none;
}

/* === Mobile Menu === */
.g407-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--g407-transition);
}
.g407-menu-overlay.g407-active { opacity: 1; visibility: visible; }
.g407-mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #111111;
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.g407-mobile-menu.g407-active { right: 0; }
.g407-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--g407-border);
}
.g407-menu-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g407-primary);
}
.g407-menu-close {
  background: none;
  border: none;
  color: var(--g407-text-light);
  font-size: 2rem;
  cursor: pointer;
}
.g407-menu-links li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  color: var(--g407-text-light);
  font-size: 1.4rem;
  border-bottom: 1px solid #222;
  transition: var(--g407-transition);
}
.g407-menu-links li a:hover {
  background: rgba(255,140,0,0.1);
  color: var(--g407-primary);
}
.g407-menu-links li a i,
.g407-menu-links li a .material-icons {
  width: 2rem;
  text-align: center;
  font-size: 1.6rem;
}

/* === Main Content === */
.g407-main {
  padding-top: 5.6rem;
  min-height: 100vh;
}

/* === Carousel === */
.g407-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
}
.g407-slide {
  display: none;
  width: 100%;
  aspect-ratio: 16/9;
}
.g407-slide img { width: 100%; height: 100%; object-fit: cover; }
.g407-slide-active { display: block; animation: g407fadeSlide 0.5s ease; }
@keyframes g407fadeSlide {
  from { opacity: 0.3; } to { opacity: 1; }
}

/* === Section Titles === */
.g407-section {
  padding: 1.5rem 1.2rem;
}
.g407-section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--g407-primary);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.g407-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 2rem;
  background: var(--g407-gradient);
  border-radius: 2px;
}
.g407-subtitle {
  font-size: 1.4rem;
  color: var(--g407-text-muted);
  margin-bottom: 1rem;
}

/* === Game Grid === */
.g407-game-category-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--g407-accent);
  margin: 1.2rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--g407-border);
}
.g407-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.g407-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--g407-transition);
  border-radius: var(--g407-radius);
  padding: 0.4rem;
}
.g407-game-item:hover { transform: translateY(-2px); background: rgba(255,140,0,0.08); }
.g407-game-icon {
  width: 7rem;
  height: 7rem;
  border-radius: var(--g407-radius);
  object-fit: cover;
  margin-bottom: 0.4rem;
  border: 1px solid var(--g407-border);
}
.g407-game-name {
  font-size: 1.1rem;
  color: var(--g407-text-light);
  text-align: center;
  line-height: 1.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* === Cards === */
.g407-card {
  background: var(--g407-bg-card);
  border-radius: var(--g407-radius);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--g407-border);
}
.g407-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g407-text-white);
  margin-bottom: 0.8rem;
}
.g407-card-text {
  font-size: 1.3rem;
  color: var(--g407-text-muted);
  line-height: 1.8rem;
}

/* === Promo Button === */
.g407-promo-btn {
  display: inline-block;
  background: var(--g407-gradient);
  color: var(--g407-bg-dark);
  padding: 1rem 2rem;
  border-radius: 2.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--g407-transition);
  text-align: center;
  min-width: 20rem;
}
.g407-promo-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(255,140,0,0.4); }
.g407-text-link {
  color: var(--g407-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.g407-text-link:hover { color: var(--g407-secondary); }

/* === Footer === */
.g407-footer {
  background: #111111;
  padding: 2rem 1.2rem 3rem;
  border-top: 1px solid var(--g407-border);
}
.g407-footer-brand {
  font-size: 1.3rem;
  color: var(--g407-text-muted);
  line-height: 1.8rem;
  margin-bottom: 1.5rem;
}
.g407-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.g407-footer-link {
  background: var(--g407-bg-card);
  color: var(--g407-text-light);
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-size: 1.2rem;
  border: 1px solid var(--g407-border);
  cursor: pointer;
  transition: var(--g407-transition);
}
.g407-footer-link:hover { border-color: var(--g407-primary); color: var(--g407-primary); }
.g407-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  margin: 1.2rem 0;
}
.g407-partner-logo {
  height: 2.4rem;
  opacity: 0.7;
  filter: grayscale(0.5);
}
.g407-copyright {
  text-align: center;
  font-size: 1.1rem;
  color: var(--g407-text-muted);
  margin-top: 1rem;
}

/* === Bottom Navigation === */
.g407-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 6rem;
  background: linear-gradient(180deg, #1E1E1E, #111111);
  border-top: 1px solid var(--g407-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}
.g407-bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: 5.2rem;
  background: none;
  border: none;
  color: var(--g407-text-muted);
  cursor: pointer;
  transition: var(--g407-transition);
  padding: 0.4rem;
  position: relative;
}
.g407-bottom-nav-btn:hover,
.g407-bottom-nav-active {
  color: var(--g407-primary);
}
.g407-bottom-nav-btn:hover { transform: scale(1.1); }
.g407-bottom-nav-btn .g407-nav-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.g407-bottom-nav-btn .g407-nav-label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2rem;
}
.g407-bottom-nav-active::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 2.4rem;
  height: 3px;
  background: var(--g407-primary);
  border-radius: 0 0 2px 2px;
}

/* === Content Typography === */
.g407-content-text {
  font-size: 1.3rem;
  color: var(--g407-text-muted);
  line-height: 2rem;
  margin-bottom: 1rem;
}
.g407-content-text strong {
  color: var(--g407-text-light);
}
.g407-highlight {
  color: var(--g407-primary);
  font-weight: 600;
}
.g407-h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--g407-text-white);
  margin-bottom: 1rem;
  line-height: 2.6rem;
}
.g407-h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--g407-primary);
  margin: 1.5rem 0 0.8rem;
}
.g407-h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--g407-accent);
  margin: 1.2rem 0 0.6rem;
}

/* === Responsive === */
@media (min-width: 769px) {
  .g407-bottom-nav { display: none; }
  .g407-menu-toggle { display: inline-block; }
  body { max-width: 430px; }
}
@media (max-width: 768px) {
  .g407-main { padding-bottom: 8rem; }
  .g407-footer { padding-bottom: 8rem; }
  .g407-menu-toggle { display: inline-block; }
}
