/* ================================================
   456Lane Games — Clean White Design System
   Inspired by Apple.com clarity and simplicity
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@700;900&display=swap');

/* ---- DESIGN TOKENS ---- */
:root {
  /* Apple-style whites & grays */
  --bg:            #ffffff;
  --bg-alt:        #f5f5f7;
  --bg-card:       #ffffff;
  --bg-hover:      #f5f5f7;

  /* Borders */
  --border:        #d2d2d7;
  --border-light:  #e8e8ed;

  /* Typography — Apple palette */
  --text:          #1d1d1f;
  --text-2:        #6e6e73;
  --text-3:        #86868b;

  /* Accent — purple used sparingly */
  --primary:       #7c3aed;
  --primary-dark:  #6d28d9;
  --primary-light: #9f67ff;
  --primary-bg:    #f3eeff;

  /* Semantic */
  --green:         #34c759;
  --red:           #ff3b30;
  --orange:        #ff9500;
  --blue:          #007aff;

  /* Shadows — very subtle, Apple style */
  --shadow-xs:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.1), 0 0 1px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.06);
  --shadow-hover: 0 20px 60px rgba(0,0,0,0.14), 0 0 1px rgba(0,0,0,0.06);

  /* Radius */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a0a8; }

/* ================================================
   HEADER — Frosted glass, Apple style
   ================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
nav a:hover, nav a.active { color: var(--text); background: var(--bg-alt); }

.nav-cta {
  margin-left: auto;
  background: var(--primary) !important;
  color: #fff !important;
  padding: 7px 18px !important;
  border-radius: var(--r-full) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  transition: background 0.2s, transform 0.2s !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; transform: translateY(-1px); }

.hamburger { display: none; flex-direction: column; cursor: pointer; gap: 5px; padding: 4px; }
.hamburger span { width: 20px; height: 1.5px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* ================================================
   HERO — Bold, spacious, Apple-like
   ================================================ */
.hero {
  background: var(--bg);
  padding: 96px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Very subtle background dot pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #d2d2d7 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 20px;
}
.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

/* Apple-style CTA buttons */
.btn-hero-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: var(--r-full);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,58,237,0.35);
}

.btn-hero-secondary {
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  transition: background 0.2s, transform 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-secondary:hover { background: #ebebf0; transform: translateY(-2px); }

/* Hero stats — Apple product stats style */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg-alt);
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.hero-stat {
  flex: 1;
  padding: 20px 12px;
  text-align: center;
  position: relative;
}
.hero-stat + .hero-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 1px;
  background: var(--border);
}
.hero-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.1;
}
.hero-stat-label {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

/* ================================================
   MAIN WRAPPER
   ================================================ */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

/* ================================================
   SECTION DIVIDER
   ================================================ */
.section-divider {
  height: 1px;
  background: var(--border-light);
  margin: 64px 0;
}

/* ================================================
   SECTION HEADERS
   ================================================ */
.sec-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}
.sec-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 6px;
}
.sec-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
}
.sec-sub {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* ================================================
   CATEGORY TABS
   ================================================ */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-full);
  background: var(--bg-alt);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tab-btn:hover { background: #ebebf0; color: var(--text); }
.tab-btn.active { background: var(--text); color: #fff; }

/* ================================================
   GAME CARDS — Clean Apple product card style
   ================================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 80px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.game-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-hover);
}

.game-thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5rem;
  position: relative;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
}

.game-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.game-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
}
.game-badge {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-left: auto;
}
.badge-hot   { background: #fff1f0; color: #ff3b30; }
.badge-new   { background: #f0f8ff; color: #007aff; }
.badge-fun   { background: #f0fdf4; color: #34c759; }
.badge-brain { background: #fffbf0; color: #ff9500; }

.game-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 6px;
}
.game-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 18px;
}
.game-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 11px 0;
  border-radius: var(--r-full);
  width: 100%;
  transition: background 0.2s, transform 0.15s;
}
.game-play-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ================================================
   FEATURED BANNER — Apple hero product highlight
   ================================================ */
.featured-banner {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 52px 56px;
  margin-bottom: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.featured-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(124,58,237,0.06), transparent 70%);
  pointer-events: none;
}

.featured-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  margin-bottom: 14px;
}
.featured-banner h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.15;
}
.featured-banner p { color: var(--text-2); font-size: 1rem; margin-bottom: 28px; max-width: 440px; line-height: 1.6; }

.featured-icon {
  font-size: 8rem;
  line-height: 1;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* ================================================
   WHY SECTION — 3-column feature tiles
   ================================================ */
.why-section { margin-bottom: 80px; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.why-card {
  background: var(--bg-alt);
  border-radius: var(--r-xl);
  padding: 36px 28px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.why-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.why-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
}
.why-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  margin-bottom: 8px;
}
.why-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ================================================
   SEO BLOCK
   ================================================ */
.seo-block {
  background: var(--bg-alt);
  border-radius: var(--r-xl);
  padding: 40px 44px;
  margin-bottom: 60px;
}
.seo-block h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 16px;
}
.seo-block p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 12px;
}
.seo-block p:last-child { margin-bottom: 0; }

/* ================================================
   FOOTER — Clean, Apple-style
   ================================================ */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo { font-size: 1rem; display: inline-block; margin-bottom: 12px; }
.footer-brand p { font-size: 0.84rem; color: var(--text-3); line-height: 1.7; max-width: 220px; }
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-2);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 0.84rem;
  color: var(--text-3);
  margin-bottom: 9px;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom p { font-size: 0.78rem; color: var(--text-3); }
.footer-bottom a { color: var(--primary); }

/* ================================================
   GAME PAGES
   ================================================ */
.game-wrapper {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

.game-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.game-stats { display: flex; gap: 28px; }
.game-stat  { text-align: center; }
.game-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.game-stat-label {
  font-size: 0.64rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
  font-weight: 500;
}

.game-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-full);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.25);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #ebebf0; }

/* Game canvas container */
.game-canvas-container {
  background: #111116;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 480px;
  position: relative;
  touch-action: none;
  box-shadow: var(--shadow-md);
}

/* Instructions */
.game-instructions {
  background: var(--bg-alt);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-top: 14px;
}
.game-instructions h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-instructions ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.game-instructions li {
  font-size: 0.84rem;
  color: var(--text-2);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.game-instructions li::before { content: '›'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* Overlay */
.overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.96);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
  border-radius: var(--r-xl);
  text-align: center;
  padding: 28px;
}
.overlay h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 8px;
}
.overlay p { color: var(--text-2); margin-bottom: 24px; font-size: 0.95rem; }

/* Difficulty pills */
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 6px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.pill:hover { background: #ebebf0; color: var(--text); }
.pill.active { background: var(--text); border-color: var(--text); color: #fff; }

/* Responsive canvas */
canvas { max-width: 100%; height: auto; display: block; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .games-grid      { grid-template-columns: repeat(2, 1fr); }
  .footer-grid     { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 768px) {
  .games-grid      { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .featured-banner { grid-template-columns: 1fr; padding: 32px 28px; }
  .featured-icon   { font-size: 5rem; }
  .why-grid        { grid-template-columns: 1fr; gap: 12px; }
  .footer-grid     { grid-template-columns: 1fr 1fr; gap: 28px; }
  .game-stats      { gap: 18px; }
  .game-info-bar   { padding: 12px 16px; }
}

@media (max-width: 600px) {
  nav { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 60px 16px 48px; }
  .main-wrap { padding: 0 16px 80px; }
  .featured-banner { padding: 28px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .games-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .game-thumb { height: 120px; font-size: 3.8rem; }
  .game-info-bar { flex-direction: column; align-items: flex-start; }
  .game-controls { width: 100%; }
  .game-controls .btn { flex: 1; }
  .game-stats { gap: 14px; }
  .hero-stats { flex-direction: column; border: none; gap: 8px; background: transparent; max-width: 100%; box-shadow: none; }
  .hero-stat { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-alt); }
  .hero-stat + .hero-stat::before { display: none; }
  .game-canvas-container { min-height: 320px; }
  .pill-group { width: 100%; }
  .pill { flex: 1; text-align: center; }
  button { font-size: 16px; }
  input, select { font-size: 16px; }
}

@media (max-width: 400px) {
  .games-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}

/* Animations */
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.6 } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
