/**
 * PhFun Core Stylesheet
 * File: css/theme-df79.css
 * All classes use g797- prefix for namespace isolation
 * Colors: #141414 (dark bg), #A9A9A9 (light text)
 */

/* === CSS Variables === */
:root {
  --g797-primary: #141414;
  --g797-secondary: #A9A9A9;
  --g797-accent: #D4AF37;
  --g797-accent2: #C0392B;
  --g797-bg: #0D0D0D;
  --g797-bg2: #1A1A1A;
  --g797-bg3: #222222;
  --g797-text: #A9A9A9;
  --g797-text-light: #CCCCCC;
  --g797-text-white: #FFFFFF;
  --g797-border: #333333;
  --g797-radius: 8px;
  --g797-radius-lg: 12px;
  --g797-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --g797-header-h: 56px;
  --g797-bottom-nav-h: 60px;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--g797-bg);
  color: var(--g797-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--g797-accent); text-decoration: none; }
a:hover { color: var(--g797-text-white); }

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

.g797-wrapper {
  width: 100%;
  position: relative;
}

/* === Header === */
.g797-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--g797-header-h);
  background: var(--g797-primary);
  border-bottom: 1px solid var(--g797-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
}

.g797-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.g797-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.g797-site-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g797-accent);
  letter-spacing: 0.5px;
}

.g797-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.g797-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--g797-radius);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  min-width: 44px;
}

.g797-btn-register {
  background: var(--g797-accent);
  color: var(--g797-primary);
}

.g797-btn-register:hover {
  background: #E5C04B;
  transform: scale(1.03);
}

.g797-btn-login {
  background: transparent;
  color: var(--g797-accent);
  border: 1px solid var(--g797-accent);
}

.g797-btn-login:hover {
  background: rgba(212, 175, 55, 0.1);
}

.g797-menu-toggle {
  background: none;
  border: none;
  color: var(--g797-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Mobile Menu === */
.g797-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
}

.g797-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background: var(--g797-bg2);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

.g797-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--g797-border);
}

.g797-mobile-menu-title {
  font-size: 1.6rem;
  color: var(--g797-accent);
  font-weight: 700;
}

.g797-menu-close {
  background: none;
  border: none;
  color: var(--g797-text);
  font-size: 2.2rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g797-mobile-menu a {
  display: block;
  padding: 1rem 0;
  color: var(--g797-text-light);
  font-size: 1.4rem;
  border-bottom: 1px solid var(--g797-border);
  transition: color 0.2s;
}

.g797-mobile-menu a:hover {
  color: var(--g797-accent);
}

/* === Main Content === */
.g797-main {
  padding-top: calc(var(--g797-header-h) + 0.8rem);
  min-height: 100vh;
}

/* === Carousel === */
.g797-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--g797-radius-lg);
  margin-bottom: 1.5rem;
}

.g797-carousel-slide {
  display: none;
  width: 100%;
  cursor: pointer;
}

.g797-carousel-slide img {
  width: 100%;
  height: auto;
  border-radius: var(--g797-radius-lg);
}

.g797-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.g797-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.g797-dot-active {
  background: var(--g797-accent) !important;
}

/* === Section Headings === */
.g797-section {
  margin-bottom: 2rem;
}

.g797-section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--g797-text-white);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--g797-accent);
  display: inline-block;
}

/* === Game Grid === */
.g797-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.g797-game-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.g797-game-item:hover {
  transform: scale(1.05);
}

.g797-game-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--g797-radius);
  margin-bottom: 0.3rem;
  object-fit: cover;
}

.g797-game-item span {
  font-size: 1.1rem;
  color: var(--g797-text);
  display: block;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Cards === */
.g797-card {
  background: var(--g797-bg2);
  border: 1px solid var(--g797-border);
  border-radius: var(--g797-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.g797-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--g797-text-white);
  margin-bottom: 0.8rem;
}

.g797-card-text {
  font-size: 1.3rem;
  color: var(--g797-text);
  line-height: 1.6;
}

/* === Promo Link Styles === */
.g797-promo-link {
  color: var(--g797-accent);
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}

.g797-promo-link:hover {
  color: var(--g797-text-white);
  text-decoration: underline;
}

.g797-promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  background: var(--g797-accent);
  color: var(--g797-primary);
  font-size: 1.4rem;
  font-weight: 700;
  border: none;
  border-radius: var(--g797-radius);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.g797-promo-btn:hover {
  background: #E5C04B;
  transform: scale(1.03);
}

/* === Footer === */
.g797-footer {
  background: var(--g797-primary);
  border-top: 1px solid var(--g797-border);
  padding: 2rem 0 1rem;
  margin-top: 2rem;
}

.g797-footer-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.g797-footer-brand p {
  font-size: 1.2rem;
  color: var(--g797-text);
  line-height: 1.5;
}

.g797-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.g797-footer-links a {
  font-size: 1.1rem;
  color: var(--g797-text-light);
  padding: 0.3rem 0.6rem;
  transition: color 0.2s;
}

.g797-footer-links a:hover {
  color: var(--g797-accent);
}

.g797-footer-promo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.g797-footer-promo-btn {
  padding: 0.5rem 1rem;
  background: var(--g797-accent);
  color: var(--g797-primary);
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--g797-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.g797-footer-promo-btn:hover {
  background: #E5C04B;
}

.g797-footer-copy {
  text-align: center;
  font-size: 1.1rem;
  color: var(--g797-secondary);
  padding-top: 1rem;
  border-top: 1px solid var(--g797-border);
}

/* === Bottom Navigation (Mobile) === */
.g797-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--g797-bottom-nav-h);
  background: var(--g797-primary);
  border-top: 1px solid var(--g797-border);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.g797-bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 52px;
  background: none;
  border: none;
  color: var(--g797-text);
  cursor: pointer;
  transition: all 0.2s;
  gap: 2px;
  position: relative;
}

.g797-bottom-nav-btn i,
.g797-bottom-nav-btn .material-icons,
.g797-bottom-nav-btn ion-icon {
  font-size: 22px;
}

.g797-bottom-nav-btn span {
  font-size: 1rem;
  color: var(--g797-text);
}

.g797-bottom-nav-btn:hover,
.g797-bottom-nav-active {
  color: var(--g797-accent);
  transform: scale(1.05);
}

.g797-bottom-nav-btn:hover span,
.g797-bottom-nav-active span {
  color: var(--g797-accent);
}

.g797-bottom-nav-btn:active {
  transform: scale(0.95);
}

.g797-bottom-nav-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--g797-accent);
  border-radius: 1px;
}

/* === Responsive: Show bottom nav on mobile === */
@media (max-width: 768px) {
  .g797-bottom-nav {
    display: flex;
  }

  .g797-main {
    padding-bottom: 80px !important;
  }

  .g797-footer {
    padding-bottom: 80px;
  }
}

/* === Responsive: Desktop adjustments === */
@media (min-width: 769px) {
  .g797-bottom-nav {
    display: none;
  }

  .g797-container {
    max-width: 600px;
  }
}

/* === Utility Classes === */
.g797-text-center { text-align: center; }
.g797-text-accent { color: var(--g797-accent); }
.g797-text-white { color: var(--g797-text-white); }
.g797-mb-1 { margin-bottom: 0.8rem; }
.g797-mb-2 { margin-bottom: 1.5rem; }
.g797-mb-3 { margin-bottom: 2rem; }
.g797-mt-1 { margin-top: 0.8rem; }
.g797-mt-2 { margin-top: 1.5rem; }
.g797-fw-bold { font-weight: 700; }
.g797-hidden { display: none; }

/* === H1 Page Title === */
.g797-page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--g797-text-white);
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* === List Styles === */
.g797-list {
  list-style: none;
  padding: 0;
}

.g797-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--g797-border);
  font-size: 1.3rem;
  color: var(--g797-text);
  line-height: 1.5;
}

/* === Winner Badge === */
.g797-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  color: var(--g797-primary);
  background: var(--g797-accent);
}

/* === Divider === */
.g797-divider {
  border: none;
  border-top: 1px solid var(--g797-border);
  margin: 1.5rem 0;
}

/* === Table styles === */
.g797-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.2rem;
}

.g797-table th,
.g797-table td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--g797-border);
  text-align: left;
}

.g797-table th {
  background: var(--g797-bg3);
  color: var(--g797-accent);
  font-weight: 600;
}

.g797-table td {
  color: var(--g797-text);
}
