/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* ===== i18n: Hide all translated elements by default ===== */
[data-lang] {
  display: none !important;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  border-bottom-color: var(--border);
  padding: 10px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  transition: opacity 0.3s;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-logo:hover {
  opacity: 0.8;
}

/* Nav links: li uses display:contents so hidden <a> children take zero space */
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.nav-links li {
  display: contents;
}

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.3s;
  padding: 4px 0;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Navbar right group (lang-switcher + hamburger) — ALWAYS visible */
.navbar-right {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Language Switcher — ALWAYS visible, never hidden */
.lang-switcher {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.3s ease;
  white-space: nowrap;
}

.lang-switcher-btn:hover {
  border-color: var(--accent);
}

.lang-switcher-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
}

.lang-switcher.open .lang-switcher-btn svg {
  transform: rotate(180deg);
}

.lang-arrow {
  font-size: 0.7rem;
  line-height: 1;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.lang-option.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.lang-flag-img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Hamburger — hidden by default, shown in mobile via media query */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 30% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(100, 60, 255, 0.04) 0%, transparent 50%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 4rem);
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: wordFadeIn 0.6s forwards;
}

@keyframes wordFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-verse-ref {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 300;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 400;
  opacity: 0;
  animation: fadeInUp 0.8s 0.8s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  min-height: 48px;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: all 0.3s;
  opacity: 0;
  animation: fadeInUp 0.8s 1s forwards;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Sections Common ===== */
.section {
  padding: clamp(64px, 10vw, 120px) 0;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-line {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 16px auto 0;
}

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Games Section ===== */
.games-section {
  background: var(--bg-primary);
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
  transform: scale(1.02);
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.game-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}

.game-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.05);
}

.game-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

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

.game-card-overlay-text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-card-overlay-text svg {
  width: 14px;
  height: 14px;
}

.game-card-body {
  padding: 1.25rem 1.5rem;
  flex-grow: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.game-card-title {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.game-card-tagline {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex-grow: 1;
}

.game-card-stores {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1.5rem 1.25rem;
}

.game-card-stores a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.game-card-stores a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.store-icon {
  height: 24px !important;
  width: 24px !important;
  display: block !important;
  filter: brightness(0) invert(1) !important;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.game-card-stores a:hover .store-icon {
  opacity: 1;
}

/* ===== About Section ===== */
.about-section {
  background: var(--bg-secondary);
}

.about-layout {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}

.about-bio {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: center;
}

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  color: var(--text-primary);
  text-align: center;
}

.about-stats .separator {
  color: var(--accent);
}

/* ===== Contact Section ===== */
.contact-section {
  background: var(--bg-primary);
}

.contact-content {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

a.contact-item:hover {
  color: var(--accent);
}

.contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.footer-copy a {
  color: var(--text-secondary);
  transition: color 0.3s;
}

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

/* ===== Mobile Nav Overlay ===== */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

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

/* ===== Responsive ===== */

/* Tablet+: 2 column games grid */
@media (min-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (<1024px): show hamburger, hide nav-links */
@media (max-width: 1023px) {
  .nav-links {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }

  .mobile-nav {
    display: flex;
  }
}

/* Desktop (>=1024px): show nav-links, hide hamburger */
@media (min-width: 1024px) {
  .hamburger {
    display: none !important;
  }

  .nav-links {
    display: flex !important;
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .nav-inner {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .container {
    padding: 0 1rem;
  }

  .game-card-body {
    padding: 1rem;
  }

  .game-card-stores {
    padding: 0 1rem 1rem;
  }

  .hero-cta {
    padding: 12px 24px;
    font-size: 0.88rem;
  }

  .lang-switcher-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }

  .lang-flag-img {
    width: 16px;
    height: 11px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

/* ===== Subpage Styles ===== */
.subpage {
  padding-top: 100px;
  min-height: calc(100vh - 160px);
  background: var(--bg-secondary);
}

.subpage .page-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: clamp(32px, 6vw, 56px);
  color: var(--accent);
  letter-spacing: -0.02em;
}

.subpage .page-title-line {
  width: 64px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 16px auto 0;
}

.subpage .game-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.5rem, 5vw, 3rem);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.subpage .game-description {
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 1.8;
  margin-bottom: 24px;
}

.subpage .game-feature {
  margin-bottom: 20px;
}

.subpage .game-feature strong {
  color: var(--text-primary);
}

.subpage .highlight {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.subpage .platforms-section {
  text-align: center;
  margin: 40px 0;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.subpage .platforms-title {
  font-family: 'Sora', sans-serif;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.subpage .platform-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.subpage .platform-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
  text-decoration: none;
}

.subpage .platform-tag:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.subpage .platform-tag img {
  width: 28px;
  height: 28px;
  opacity: 0.5;
  transition: opacity 0.3s;
  filter: brightness(0) invert(1);
}

.subpage .platform-tag:hover img {
  opacity: 1;
}

.subpage .screenshots-section {
  margin-top: 40px;
}

.subpage .screenshots-title {
  font-family: 'Sora', sans-serif;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.subpage .screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px;
  margin-top: 24px;
}

.subpage .screenshot {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.subpage .screenshot:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.subpage .screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.subpage .button-container {
  text-align: center;
  margin-top: 40px;
}

.subpage .back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  min-height: 48px;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 12px;
  transition: all 0.3s;
  text-decoration: none;
}

.subpage .back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* Policy page */
.subpage .policy-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.5rem, 5vw, 3rem);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.subpage .effective-date {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 24px;
  text-align: center;
}

.subpage .policy-section {
  margin-bottom: 28px;
}

.subpage .policy-section h2 {
  font-family: 'Sora', sans-serif;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.subpage .policy-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.subpage .contact-info-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.subpage .contact-info-box h3 {
  font-family: 'Sora', sans-serif;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.subpage .contact-info-box p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.subpage .contact-info-box a {
  color: var(--accent);
  transition: opacity 0.3s;
}

.subpage .contact-info-box a:hover {
  opacity: 0.8;
}
