/* Galactic Wins NZ - Main Stylesheet */
/* Design System Implementation */

/* ========== CSS Variables from Design System ========== */
:root {
  /* Core Colors */
  --bg-deep-space: #283060;
  --bg-deep-space-2: #22306A;
  --ink-white: #FFFFFF;
  --ink-muted: #B9C3D3;
  --ink-subtle: #8FA0BA;
  --accent-yellow: #F4CF1C;
  --accent-amber: #F2B11A;
  --accent-cyan: #2CCFEF;
  --accent-purple: #D446D7;
  --accent-blue: #3C5CA5;
  --outline-soft: #324060;
  --outline-hard: #3C5CA5;
  --surface-card-top: #2B376B;
  --surface-card-bottom: #1F274F;
  
  /* Typography */
  --font-display: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-ui: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --line-tight: 1.15;
  --line-normal: 1.35;
  --line-relaxed: 1.5;
  
  /* Layout */
  --container-max-width: 1200px;
  --section-spacing-y: 32px;
  --radius-card: 12px;
  --radius-button: 12px;
  --radius-pill: 999px;
  --radius-banner: 16px;
  
  /* Shadows & Effects */
  --shadow-soft: 0 6px 16px rgba(0,0,0,0.22);
  --shadow-med: 0 10px 24px rgba(0,0,0,0.30);
  --shadow-hard: 0 14px 36px rgba(0,0,0,0.38);
  --glow-cyan: 0 0 16px rgba(44,207,239,0.55);
  
  /* Z-index */
  --z-base: 0;
  --z-elevated: 10;
  --z-floating: 100;
  --z-overlay: 1000;
}

/* ========== Global Reset & Base Styles ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: var(--line-relaxed);
  color: var(--ink-white);
  background-color: var(--bg-deep-space);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #6EE8FB;
}

a:focus-visible {
  outline: 0 0 0 3px rgba(44,207,239,0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(28px, 5vw, 48px);
  color: var(--ink-white);
}

h2 {
  font-size: clamp(24px, 4vw, 36px);
  color: var(--ink-white);
  margin-top: 2.5rem;
}

h3 {
  font-size: clamp(20px, 3vw, 28px);
  color: var(--ink-white);
  margin-top: 2rem;
}

h4, h5 {
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--ink-muted);
}

p {
  margin-bottom: 1rem;
  color: var(--ink-white);
}

strong {
  font-weight: var(--weight-bold);
  color: var(--ink-white);
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--ink-white);
}

.meta, .timestamp {
  color: var(--ink-subtle);
  font-size: 14px;
}

/* ========== Container & Layout ========== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: var(--section-spacing-y) 0;
}

/* ========== Header Styles ========== */
header {
  background: var(--bg-deep-space);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: var(--z-overlay);
  backdrop-filter: blur(10px);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.header-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-nav {
  display: none;
  padding: 16px 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  gap: 28px;
  justify-content: center;
  align-items: center;
}

.nav-menu a {
  color: var(--ink-white);
  font-weight: var(--weight-medium);
  font-size: 16px;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--accent-cyan);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
}

/* Mobile Menu */
.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: var(--z-overlay);
}

.burger span {
  width: 24px;
  height: 2px;
  background: var(--ink-white);
  transition: all 0.3s ease;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  background: var(--bg-deep-space-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 24px 20px;
  z-index: calc(var(--z-overlay) - 1);
  box-shadow: var(--shadow-med);
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}

.mobile-menu.active {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  margin: 0 0 24px 0;
}

.mobile-nav-list li {
  margin-bottom: 0;
}

.mobile-nav-list a {
  display: block;
  padding: 12px 16px;
  color: var(--ink-white);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-card);
  transition: background 0.2s ease;
}

.mobile-nav-list a:hover, .mobile-nav-list a.active {
  background: rgba(255,255,255,0.06);
  color: var(--accent-cyan);
}

.mobile-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: var(--weight-bold);
  font-size: 16px;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-ui);
  text-decoration: none;
  min-width: 60px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

.btn--primary {
  background: linear-gradient(180deg, #F4CF1C 0%, #F2B11A 100%);
  color: #0C1B2E;
}

.btn--primary:hover {
  background: linear-gradient(180deg, #F7D63A 0%, #F4BE18 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  transform: translateY(-2px);
  color: #0C1B2E;
}

.btn--primary:active {
  background: linear-gradient(180deg, #E9C317 0%, #D79C12 100%);
  transform: translateY(1px);
}

.btn--primary:focus-visible {
  outline: 0 0 0 3px rgba(244,207,28,0.45);
  outline-offset: 2px;
}

.btn--secondary {
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: var(--ink-white);
}

.btn--secondary:hover {
  background: rgba(255,255,255,0.06);
  color: var(--ink-white);
}

.btn--secondary:active {
  background: rgba(255,255,255,0.10);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn--secondary:focus-visible {
  outline: 0 0 0 2px rgba(44,207,239,0.45);
  outline-offset: 2px;
}

/* ========== Hero Section ========== */
#hero {
  background: linear-gradient(315deg, #5A2E91 0%, #7B2C8A 35%, #D446D7 60%, #F2B11A 100%);
  border-radius: var(--radius-banner);
  padding: 48px 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-med);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: start;
}

.hero-text h1 {
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.reading-time {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--ink-white);
}

.fact-checked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(44,207,239,0.18);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--ink-white);
  margin-top: 16px;
}

.hero-image-wrapper {
  position: relative;
}

.hero-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.hero-cta-center {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ========== Breadcrumbs ========== */
.breadcrumbs {
  padding: 16px 0;
  font-size: 14px;
}

.breadcrumbs-list {
  display: flex;
  list-style: none;
  margin: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumbs-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.breadcrumbs-list li:not(:last-child)::after {
  content: '›';
  color: var(--ink-subtle);
}

.breadcrumbs-list a {
  color: var(--ink-subtle);
}

.breadcrumbs-list a:hover {
  color: var(--accent-cyan);
}

.breadcrumbs-list span {
  color: var(--ink-white);
}

/* ========== Table of Contents ========== */
.toc {
  background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-soft);
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toc-header h2 {
  font-size: 20px;
  margin: 0;
}

.toc-toggle {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 4px;
  line-height: 1;
}

.toc.collapsed .toc-toggle {
  transform: rotate(180deg);
}

.toc-list {
  list-style: none;
  margin: 20px 0 0 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.toc.collapsed .toc-list {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  display: block;
  padding: 8px 12px;
  color: var(--ink-muted);
  border-radius: var(--radius-card);
  transition: all 0.2s ease;
}

.toc-list a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--ink-white);
}

.toc-list a.active {
  background: rgba(44,207,239,0.15);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
}

/* ========== Games Section ========== */
#games {
  margin-bottom: 48px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.game-card {
  background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.game-card:hover {
  box-shadow: var(--shadow-med);
  border-color: var(--outline-hard);
  transform: translateY(-2px);
}

.game-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}

.game-card h3 {
  font-size: 16px;
  margin: 0 0 12px 0;
}

.game-card .btn {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  padding: 8px 16px;
  font-size: 14px;
}

.game-card:hover .btn {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Content Sections ========== */
.content-section {
  margin-bottom: 64px;
}

.content-section figure {
  margin: 32px 0;
  text-align: center;
}

.content-section figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  margin: 0 auto;
}

.content-section figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-subtle);
  font-style: italic;
}

/* ========== Tables ========== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

thead {
  background: rgba(255,255,255,0.06);
}

th {
  padding: 16px;
  text-align: left;
  font-weight: var(--weight-bold);
  color: var(--ink-white);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

td {
  padding: 16px;
  color: var(--ink-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

/* ========== Author Section ========== */
#author {
  background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card);
  padding: 32px;
  margin: 48px 0;
  box-shadow: var(--shadow-soft);
}

.author-content {
  display: flex;
  gap: 24px;
  align-items: start;
}

.author-avatar {
  flex-shrink: 0;
}

.author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent-cyan);
  box-shadow: var(--shadow-soft);
}

.author-info h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.author-bio {
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.author-updated {
  font-size: 14px;
  color: var(--ink-subtle);
}

/* ========== FAQ Section ========== */
#faq {
  margin: 48px 0;
}

.faq-list {
  margin-top: 32px;
}

details {
  background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

details:hover {
  border-color: var(--outline-hard);
}

details[open] {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-med);
}

summary {
  font-weight: var(--weight-bold);
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-white);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 24px;
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

details[open] summary::after {
  content: '−';
}

details p {
  margin-top: 16px;
  color: var(--ink-muted);
  line-height: var(--line-relaxed);
}

/* ========== Footer ========== */
footer {
  background: var(--bg-deep-space-2);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-content {
  display: grid;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand img {
  height: 50px;
  width: auto;
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--ink-subtle);
  font-size: 14px;
}

.footer-links h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--ink-white);
}

.footer-links ul {
  list-style: none;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--ink-muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-payments {
  margin-top: 24px;
}

.footer-payments h4 {
  font-size: 14px;
  margin-bottom: 12px;
}

.payment-methods {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.payment-methods svg, .payment-methods img {
  height: 32px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.payment-methods svg:hover, .payment-methods img:hover {
  opacity: 1;
}

.footer-responsible {
  margin-top: 24px;
}

.footer-responsible a {
  display: inline-block;
}

.footer-responsible img {
  height: 40px;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-responsible img:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px;
  text-align: center;
  color: var(--ink-subtle);
  font-size: 14px;
}

/* ========== Back to Top Button ========== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: linear-gradient(180deg, #F4CF1C 0%, #F2B11A 100%);
  color: #0C1B2E;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-med);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: var(--z-floating);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: linear-gradient(180deg, #F7D63A 0%, #F4BE18 100%);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hard);
}

/* ========== Responsive Design ========== */
@media (min-width: 768px) {
  .burger {
    display: none;
  }
  
  .header-nav {
    display: block;
  }
  
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .games-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
  }
  
  .author-content {
    flex-direction: row;
  }
  
  table {
    display: table;
  }
}

@media (max-width: 767px) {
  .header-cta {
    display: none;
  }
  
  .burger {
    display: flex;
  }
  
  #hero {
    padding: 32px 20px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    overflow-x: auto;
    display: flex;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 16px;
  }
  
  .game-card {
    min-width: 200px;
    scroll-snap-align: start;
  }
  
  .game-card .btn {
    opacity: 1;
    transform: translateY(0);
  }
  
  .author-content {
    flex-direction: column;
    text-align: center;
  }
  
  .author-avatar {
    align-self: center;
  }
  
  /* Mobile table cards */
  table.mobile-cards {
    display: block;
    border: none;
    background: none;
  }
  
  table.mobile-cards thead {
    display: none;
  }
  
  table.mobile-cards tbody {
    display: block;
  }
  
  table.mobile-cards tr {
    display: block;
    background: linear-gradient(180deg, var(--surface-card-top) 0%, var(--surface-card-bottom) 100%);
    border: 1px solid var(--outline-soft);
    border-radius: var(--radius-card);
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
  }
  
  table.mobile-cards td {
    display: block;
    text-align: left;
    padding: 8px 0;
    border: none;
  }
  
  table.mobile-cards td::before {
    content: attr(data-label);
    font-weight: var(--weight-bold);
    color: var(--ink-white);
    display: block;
    margin-bottom: 4px;
  }
  
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ========== Utility Classes ========== */
.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ========== Accessibility ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

