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

:root {
  --bg-dark: #0a0a1a;
  --bg-card: #141428;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --yellow: #facc15;
  --orange: #fb923c;
  --green: #22c55e;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --gradient-hero: linear-gradient(135deg, #0a0a1a 0%, #1e1040 50%, #0a0a1a 100%);
  --gradient-btn: linear-gradient(135deg, var(--purple), var(--pink));
  --max-width: 1200px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--purple-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--cyan); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; }
.nav-logo img { width: 36px; height: 36px; border-radius: 8px; }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--gradient-btn); color: #fff; padding: 8px 20px;
  border-radius: 50px; font-weight: 600; font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124,58,237,0.4); color: #fff; }

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  background: var(--gradient-hero);
  position: relative; overflow: hidden;
  padding-top: 64px;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(236,72,153,0.1) 0%, transparent 60%);
}

.hero .container {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center; position: relative; z-index: 1;
}

.hero-content h1 {
  font-size: 3.5rem; font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, var(--text), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}

.hero-content .tagline {
  font-size: 1.25rem; color: var(--text-muted); margin-bottom: 32px; max-width: 480px;
}

.hero-badges { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; color: var(--purple-light);
}

.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gradient-btn); color: #fff; padding: 14px 32px;
  border-radius: 50px; font-weight: 700; font-size: 1.05rem;
  transition: transform 0.2s, box-shadow 0.2s; border: none; cursor: pointer;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.4); color: #fff; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text); padding: 14px 32px;
  border-radius: 50px; font-weight: 600; font-size: 1.05rem;
  border: 2px solid rgba(255,255,255,0.15);
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--purple-light); background: rgba(124,58,237,0.1); color: #fff; }

.btn-small { padding: 10px 20px; font-size: 0.9rem; }

.hero-visual { display: flex; justify-content: center; position: relative; }

.hero-phone {
  width: 300px; border-radius: 32px;
  filter: drop-shadow(0 20px 60px rgba(124,58,237,0.3));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===== Studio Hero (index.html) ===== */
.studio-hero { min-height: 100vh; }

.studio-hero .container {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}

.hero-split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center; width: 100%; text-align: left;
}

.studio-hero-content { max-width: 540px; }

.studio-hero-content h1 {
  font-size: 3.5rem; font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, var(--text), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 16px;
}

.studio-hero-content .tagline {
  font-size: 1.25rem; color: var(--text-muted); margin-bottom: 32px; max-width: 600px;
}

.studio-hero-content .hero-buttons { justify-content: flex-start; }

/* ===== Hero Game (Playable Tetroit) ===== */
.hero-game-wrapper {
  display: flex; flex-direction: column; align-items: center;
}

.hero-game-phone {
  position: relative;
  width: 320px;
  height: 448px;
  background: linear-gradient(145deg, #1a1040, #0d0d2a);
  border-radius: 36px;
  border: 3px solid rgba(124, 58, 237, 0.3);
  box-shadow: 0 20px 80px rgba(124, 58, 237, 0.25), 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
  padding: 12px;
}

.phone-notch {
  width: 100px; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin: 4px auto 8px;
}

.hero-game-phone canvas {
  width: 100% !important;
  height: calc(100% - 18px) !important;
  border-radius: 24px;
  display: block;
}

.hero-game-hint {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.7;
}

/* Fullscreen button */
.game-fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(124, 58, 237, 0.4);
  border: 1px solid rgba(124, 58, 237, 0.5);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.game-fullscreen-btn:hover {
  background: rgba(124, 58, 237, 0.7);
  transform: scale(1.1);
}

/* Fullscreen close button */
.game-fullscreen-close {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  backdrop-filter: blur(8px);
}
.game-fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Fullscreen mode — the phone element becomes a fixed overlay */
.game-is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #0a0a1a !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.game-is-fullscreen .phone-notch { display: none; }

.game-is-fullscreen canvas {
  width: 380px !important;
  height: 532px !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
  border-radius: 16px;
}

/* Smaller fullscreen on short/wide screens */
@media (max-height: 700px) {
  .game-is-fullscreen canvas {
    width: 300px !important;
    height: 420px !important;
  }
}

@media (max-height: 500px) {
  .game-is-fullscreen canvas {
    width: 220px !important;
    height: 308px !important;
  }
}

/* ===== Games Showcase ===== */
.games-showcase { padding: 80px 0 120px; }

.games-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px;
}

.game-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px; overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  color: var(--text);
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 20px 60px rgba(124,58,237,0.15);
  color: var(--text);
}

.game-card-image {
  height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e1040, #0a0a1a);
}

.game-card-image img {
  height: 100%; width: auto; object-fit: contain;
}

.game-card-info { padding: 28px; flex: 1; display: flex; flex-direction: column; }

.game-card-logo {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}

.game-card-logo img {
  width: 52px; height: 52px; border-radius: 12px;
}

.game-card-logo h3 { font-size: 1.25rem; font-weight: 700; }

.game-card-genre {
  font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

.game-card-info > p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; flex: 1; }

.game-card-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.game-card-badges .badge { font-size: 0.8rem; padding: 4px 12px; }

.game-card-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== About Studio ===== */
.about-studio {
  max-width: 700px; margin: 0 auto; text-align: center;
}

.about-studio h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 20px; }
.about-studio p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 16px; }

/* ===== Features Section ===== */
.features { padding: 120px 0; }

.section-header { text-align: center; margin-bottom: 64px; }
.section-header h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}

.feature-card {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; padding: 36px 28px;
  transition: transform 0.3s, border-color 0.3s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(124,58,237,0.3); }

.feature-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}

.feature-icon.purple { background: rgba(124,58,237,0.15); }
.feature-icon.pink { background: rgba(236,72,153,0.15); }
.feature-icon.cyan { background: rgba(34,211,238,0.15); }
.feature-icon.yellow { background: rgba(250,204,21,0.15); }
.feature-icon.orange { background: rgba(251,146,60,0.15); }
.feature-icon.green { background: rgba(34,197,94,0.15); }

.feature-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Screenshots Section ===== */
.screenshots { padding: 120px 0; background: linear-gradient(180deg, var(--bg-dark), #110a28, var(--bg-dark)); }

.screenshots-scroll {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
}

.screenshots-scroll img {
  width: 260px; border-radius: 24px;
  border: 2px solid rgba(124,58,237,0.2);
  transition: transform 0.3s, border-color 0.3s;
}
.screenshots-scroll img:hover { transform: scale(1.03); border-color: var(--purple); }

/* ===== About Section ===== */
.about { padding: 120px 0; }

.about .container {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}

.about-image img {
  width: 100%; max-width: 500px; border-radius: 24px;
  border: 2px solid rgba(124,58,237,0.15);
}

.about-content h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.about-content p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 16px; }

/* ===== CTA Section ===== */
.cta {
  padding: 100px 0; text-align: center;
  background: linear-gradient(135deg, #1e1040 0%, #0a0a1a 100%);
  position: relative;
}

.cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(124,58,237,0.2) 0%, transparent 70%);
}

.cta .container { position: relative; z-index: 1; }
.cta h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.cta p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.cta .btn-primary { font-size: 1.15rem; padding: 16px 40px; }

.app-store-badge { height: 54px; display: inline-block; margin-top: 16px; }

/* ===== Footer ===== */
.footer { padding: 60px 0 32px; border-top: 1px solid rgba(255,255,255,0.06); }

.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 48px;
}

.footer-brand { }
.footer-brand img { width: 40px; height: 40px; border-radius: 8px; margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; }

.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px; text-align: center;
  color: var(--text-muted); font-size: 0.85rem;
}

/* ===== Sort the Potions Theme ===== */
.theme-potions {
  --bg-dark: #0a1a0f;
  --bg-card: #0f2818;
  --gradient-hero: linear-gradient(135deg, #0a1a0f 0%, #0f3020 50%, #0a1a0f 100%);
}

.nav-potions {
  background: rgba(10, 26, 15, 0.85);
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
}

.nav-cta-potions {
  background: linear-gradient(135deg, #15803d, #22c55e);
}
.nav-cta-potions:hover { box-shadow: 0 4px 20px rgba(34,197,94,0.4); }

.hero-potions::before {
  background: radial-gradient(ellipse at 30% 50%, rgba(34,197,94,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(250,204,21,0.1) 0%, transparent 60%);
}

.hero-potions .hero-content h1 {
  background: linear-gradient(135deg, var(--text), #4ade80);
  -webkit-background-clip: text; background-clip: text;
}

.hero-potions .hero-phone {
  filter: drop-shadow(0 20px 60px rgba(34,197,94,0.3));
}

.badge-potions {
  background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3);
  color: #4ade80;
}

.btn-potions {
  background: linear-gradient(135deg, #15803d, #22c55e);
}
.btn-potions:hover { box-shadow: 0 8px 30px rgba(34,197,94,0.4); }

.btn-secondary-potions:hover {
  border-color: #4ade80; background: rgba(34,197,94,0.1);
}

.feature-card-potions:hover { border-color: rgba(34,197,94,0.3); }

.screenshots-potions {
  background: linear-gradient(180deg, var(--bg-dark), #0f2818, var(--bg-dark));
}

.screenshots-potions .screenshots-scroll img {
  border-color: rgba(34,197,94,0.2);
}
.screenshots-potions .screenshots-scroll img:hover { border-color: var(--green); }

.theme-potions .about-image img {
  border-color: rgba(34,197,94,0.15);
}

.cta-potions {
  background: linear-gradient(135deg, #0f3020 0%, #0a1a0f 100%);
}

.cta-potions::before {
  background: radial-gradient(ellipse at center, rgba(34,197,94,0.2) 0%, transparent 70%);
}

.theme-potions .footer {
  border-top-color: rgba(34,197,94,0.1);
}

.theme-potions a { color: #4ade80; }
.theme-potions a:hover { color: var(--cyan); }

/* ===== Legal Pages ===== */
.legal-page { padding: 120px 0 80px; }
.legal-page .container { max-width: 800px; }
.legal-page h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 8px; }
.legal-page .last-updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 40px; }
.legal-page h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 12px; color: var(--purple-light); }
.legal-page p, .legal-page li { color: var(--text-muted); font-size: 1rem; margin-bottom: 10px; }
.legal-page ul { padding-left: 24px; margin-bottom: 16px; }
.legal-page a { color: var(--cyan); }

/* ===== Support Page ===== */
.support-page { padding: 120px 0 80px; }
.support-page .container { max-width: 800px; text-align: center; }
.support-page h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.support-page .lead { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 48px; }

.support-card {
  background: var(--bg-card); border: 1px solid rgba(124,58,237,0.15);
  border-radius: 20px; padding: 48px; text-align: left; margin-bottom: 32px;
}
.support-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
.support-card p { color: var(--text-muted); margin-bottom: 12px; }
.support-card .email-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gradient-btn); color: #fff; padding: 12px 28px;
  border-radius: 50px; font-weight: 600; margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.support-card .email-link:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,0.4); color: #fff; }

.support-info { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: left; }
.support-info-card {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 28px;
}
.support-info-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.support-info-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 968px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content h1 { font-size: 2.8rem; }
  .hero-content .tagline { margin: 0 auto 32px; }
  .hero-badges { justify-content: center; }
  .hero-buttons { justify-content: center; }
  .hero-visual { margin-top: 40px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .about .container { grid-template-columns: 1fr; text-align: center; }
  .about-image { display: flex; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand p { margin: 0 auto; }
  .games-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }

  /* Hero game - tablet */
  .hero-split {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }
  .studio-hero { min-height: auto; padding-top: 100px; padding-bottom: 60px; }
  .studio-hero-content { max-width: 600px; margin: 0 auto; }
  .studio-hero-content .hero-buttons { justify-content: center; }
  .hero-game-wrapper { margin-top: 0; }
  .hero-game-phone {
    width: 280px;
    height: 392px;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0; background: rgba(10,10,26,0.97);
    padding: 24px; gap: 16px; border-bottom: 1px solid rgba(124,58,237,0.15);
  }
  .theme-potions .nav-links.open {
    background: rgba(10,26,15,0.97);
    border-bottom-color: rgba(34,197,94,0.15);
  }
  .hero-content h1 { font-size: 2.2rem; }
  .studio-hero-content h1 { font-size: 2.2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .screenshots-scroll img { width: 200px; }
  .section-header h2, .about-content h2, .cta h2 { font-size: 2rem; }
  .about-studio h2 { font-size: 2rem; }
  .support-info { grid-template-columns: 1fr; }
  .hero-phone { width: 240px; }
  .game-card-image { height: 240px; }

  /* Hero game - mobile */
  .studio-hero { padding-top: 80px; padding-bottom: 40px; }
  .hero-split { gap: 24px; }
  .hero-game-phone {
    width: 260px;
    height: 364px;
    border-radius: 28px;
  }
  .studio-hero-content .tagline { font-size: 1.05rem; }
  .hero-game-hint { font-size: 0.8rem; }
}

@media (max-width: 400px) {
  .hero-game-phone {
    width: 230px;
    height: 322px;
    border-radius: 24px;
    padding: 8px;
  }
  .studio-hero-content h1 { font-size: 1.85rem; }
}
