/* ============ TinyMax Games — bright & vibrant light theme ============ */
:root {
  --bg: #f6f7ff;
  --bg-soft: #edeffd;
  --card: #ffffff;
  --text: #211f3d;
  --muted: #67658c;
  --primary: #6447ff;
  --blue: #2fa8ff;
  --pink: #ff5fa2;
  --orange: #ffb340;
  --cyan: #1899e8;      /* link-safe blue, also used by legal pages */
  --purple: #8b5cf6;
  --grad: linear-gradient(135deg, var(--primary), var(--blue));
  --grad-warm: linear-gradient(135deg, var(--pink), var(--orange));
  --radius: 22px;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}
.container { width: min(1140px, 92%); margin: 0 auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ Nav ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 18px 0;
  transition: background .3s, padding .3s, box-shadow .3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px);
  padding: 10px 0;
  box-shadow: 0 4px 24px rgba(33, 31, 61, .1);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
}
.logo-accent { color: var(--primary); }
.logo-mark {
  position: relative; display: inline-block; width: 30px; height: 30px; border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(255, 255, 255, .3) 0 38deg, transparent 38deg 178deg,
      rgba(255, 255, 255, .14) 178deg 216deg, transparent 216deg),
    repeating-radial-gradient(circle at 50%, #3a3564 0 1.5px, #211f3d 1.5px 3.5px);
  box-shadow: 0 4px 12px rgba(100, 71, 255, .35);
  animation: vinyl-spin 2.6s linear infinite;
}
.logo-mark::before {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--blue) 60%, var(--pink));
}
.logo-mark::after {
  content: ''; position: absolute; inset: 13px; border-radius: 50%;
  background: var(--bg);
}
@keyframes vinyl-spin { to { transform: rotate(360deg); } }

.nav-links { display: flex; align-items: center; gap: 30px; font-weight: 700; }
.nav-links a { opacity: .85; transition: opacity .2s, color .2s; }
.nav-links a:hover { opacity: 1; color: var(--primary); }
.nav-cta {
  background: var(--grad); padding: 9px 22px; border-radius: 999px;
  opacity: 1 !important; color: #fff !important;
  box-shadow: 0 4px 18px rgba(100, 71, 255, .35);
  transition: transform .2s;
}
.nav-cta:hover { transform: translateY(-2px); }

.nav-burger { display: none; background: none; border: 0; cursor: pointer; }
.nav-burger span {
  display: block; width: 26px; height: 3px; margin: 5px 0;
  background: var(--text); border-radius: 2px; transition: .3s;
}

/* ============ Hero ============ */
.hero {
  position: relative; min-height: min(100vh, 860px);
  display: flex; align-items: center;
  text-align: center; overflow: hidden;
  padding: 120px 0 60px;
  background: linear-gradient(180deg, #eef0ff, var(--bg));
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .3; }
.glow-1 { width: 480px; height: 480px; background: var(--primary); top: -120px; left: -120px; }
.glow-2 { width: 420px; height: 420px; background: var(--pink); bottom: -100px; right: -80px; }
.glow-3 { width: 320px; height: 320px; background: var(--blue); top: 40%; left: 60%; opacity: .2; }

.falling-tiles { position: absolute; inset: 0; }
.falling-tiles .tile {
  position: absolute; top: -90px;
  border-radius: 8px;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(14deg); }
}

.hero-inner { position: relative; }
.hero-kicker {
  display: inline-block; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; font-size: .85rem; color: var(--primary);
  background: rgba(100, 71, 255, .08); border: 1px solid rgba(100, 71, 255, .25);
  padding: 7px 18px; border-radius: 999px; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700; line-height: 1.08; margin-bottom: 22px;
}
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); margin-bottom: 36px; }
.hero-sub strong { color: var(--primary); }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.btn {
  display: inline-block; font-weight: 800; font-size: 1.05rem;
  padding: 15px 36px; border-radius: 999px; transition: transform .2s, box-shadow .2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 26px rgba(100, 71, 255, .35); }
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 34px rgba(100, 71, 255, .5); }
.btn-ghost { border: 2px solid rgba(33, 31, 61, .2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); }

.equalizer { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 46px; }
.equalizer span {
  width: 8px; border-radius: 4px; height: 100%;
  background: var(--grad);
  animation: eq 1.1s ease-in-out infinite;
  transform-origin: bottom;
}
.equalizer span:nth-child(odd) { background: var(--grad-warm); }
.equalizer span:nth-child(1)  { animation-delay: -.9s; }
.equalizer span:nth-child(2)  { animation-delay: -.7s; }
.equalizer span:nth-child(3)  { animation-delay: -.5s; }
.equalizer span:nth-child(4)  { animation-delay: -.3s; }
.equalizer span:nth-child(5)  { animation-delay: -.1s; }
.equalizer span:nth-child(6)  { animation-delay: -.8s; }
.equalizer span:nth-child(7)  { animation-delay: -.6s; }
.equalizer span:nth-child(8)  { animation-delay: -.4s; }
.equalizer span:nth-child(9)  { animation-delay: -.2s; }
.equalizer span:nth-child(10) { animation-delay: -1s; }
.equalizer span:nth-child(11) { animation-delay: -.55s; }
.equalizer span:nth-child(12) { animation-delay: -.35s; }
.equalizer span:nth-child(13) { animation-delay: -.75s; }
.equalizer span:nth-child(14) { animation-delay: -.15s; }
.equalizer span:nth-child(15) { animation-delay: -.95s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ============ Stats ============ */
.stats { padding: 70px 0; background: var(--bg-soft); }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
}
.stat-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-weight: 700; }

/* ============ Sections ============ */
.section-title {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700;
  text-align: center; margin-bottom: 14px;
}
.section-title.left { text-align: left; }
.section-sub { text-align: center; color: var(--muted); font-size: 1.15rem; margin-bottom: 56px; }

/* ============ Games ============ */
.games { padding: 110px 0; }
.games-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 26px; }
.game-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  grid-column: span 4;
  border: 1px solid rgba(33, 31, 61, .08);
  box-shadow: 0 6px 22px rgba(33, 31, 61, .07);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.game-card:hover {
  transform: translateY(-8px);
  border-color: rgba(100, 71, 255, .4);
  box-shadow: 0 22px 50px rgba(63, 50, 153, .18);
}
.game-card.featured { grid-column: span 12; display: grid; grid-template-columns: 1.1fr 1fr; }
.game-card.featured .game-art { min-height: 320px; }

.game-art {
  position: relative; min-height: 190px;
  display: flex; align-items: center; justify-content: center;
}
.game-icon {
  width: 104px; height: 104px; border-radius: 26px;
  box-shadow: 0 14px 34px rgba(33, 31, 61, .3), 0 0 0 3px rgba(255, 255, 255, .6);
  transition: transform .3s;
}
.game-card:hover .game-icon { transform: scale(1.07) rotate(-3deg); }
.game-card.featured .game-icon { width: 176px; height: 176px; border-radius: 42px; }
.art-piano  { background: linear-gradient(135deg, #c1b5ff, #8ec9ff 140%); }
.art-rolling{ background: linear-gradient(135deg, #8ee8ff, #6aa9ff 160%); }
.art-hair   { background: linear-gradient(135deg, #ffc1d8, #ffa68b 160%); }
.art-dress  { background: linear-gradient(135deg, #d9b8ff, #ffd28a 180%); }

.badge {
  position: absolute; top: 18px; left: 18px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: .85rem;
  padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(100, 71, 255, .4);
}

.game-body { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.game-card.featured .game-body { justify-content: center; padding: 40px; }
.game-body h3 { font-size: 1.35rem; }
.game-card.featured h3 { font-size: 1.9rem; }
.game-body p { color: var(--muted); }
.game-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-chip {
  background: rgba(100, 71, 255, .08); font-weight: 700; font-size: .85rem;
  padding: 5px 13px; border-radius: 999px;
}
.store-link { font-weight: 800; color: var(--primary); transition: color .2s; }
.store-link:hover { color: var(--blue); }

/* ============ Spotlight ============ */
.spotlight { padding: 110px 0; background: var(--bg-soft); overflow: hidden; }
.spotlight-inner {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 70px; align-items: center;
}
.spotlight-copy > p { color: var(--muted); font-size: 1.1rem; margin-bottom: 24px; }
.spotlight-copy > p strong { color: var(--primary); }
.feature-list { list-style: none; margin-bottom: 34px; }
.feature-list li {
  padding: 11px 0; font-weight: 700;
  border-bottom: 1px dashed rgba(33, 31, 61, .15);
}

.spotlight-visual { position: relative; display: flex; justify-content: center; }
.phone {
  width: 250px; height: 510px; border-radius: 38px;
  background: #211f3d; padding: 14px;
  border: 1px solid rgba(33, 31, 61, .2);
  box-shadow: 0 40px 80px rgba(33, 31, 61, .35), 0 0 70px rgba(100, 71, 255, .2);
  transform: rotate(-5deg);
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 26px; overflow: hidden;
  background: linear-gradient(180deg, #f0edff, #dcd4ff);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.lane { position: relative; border-right: 1px solid rgba(33, 31, 61, .1); }
.lane:last-child { border-right: 0; }
.lane i {
  position: absolute; left: 8%; width: 84%; height: 64px; top: -70px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--primary), var(--blue));
  box-shadow: 0 4px 14px rgba(100, 71, 255, .45);
  animation: tile-fall 2.4s linear infinite;
  animation-delay: var(--d);
}
@keyframes tile-fall { to { transform: translateY(560px); } }

.float-note { position: absolute; font-size: 2rem; animation: floaty 3.5s ease-in-out infinite; }
.float-note.n1 { top: 6%; left: 8%; animation-delay: 0s; }
.float-note.n2 { bottom: 12%; left: 2%; animation-delay: 1.2s; }
.float-note.n3 { top: 18%; right: 6%; animation-delay: 2.2s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

/* ============ About ============ */
.about { padding: 110px 0; }
.about-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.about-card {
  background: var(--card); border-radius: var(--radius); padding: 32px 26px;
  border: 1px solid rgba(33, 31, 61, .08);
  box-shadow: 0 6px 22px rgba(33, 31, 61, .07);
  transition: transform .3s, border-color .3s;
}
.about-card:hover { transform: translateY(-6px); border-color: rgba(47, 168, 255, .5); }
.about-icon { font-size: 2.6rem; margin-bottom: 16px; }
.about-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.about-card p { color: var(--muted); font-size: .97rem; }

/* ============ Careers ============ */
.careers { padding: 40px 0 110px; }
.careers-inner {
  background: linear-gradient(135deg, rgba(100, 71, 255, .1), rgba(47, 168, 255, .1));
  border: 1px solid rgba(100, 71, 255, .22);
  border-radius: 32px; text-align: center; padding: 70px 40px;
}
.careers .section-sub { margin-bottom: 34px; }

/* ============ Footer ============ */
.footer { background: #e7eafc; padding: 70px 0 30px; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px;
  padding-bottom: 46px; border-bottom: 1px solid rgba(33, 31, 61, .12);
}
.footer-tag { color: var(--muted); margin-top: 14px; }
.footer h4 { margin-bottom: 16px; color: var(--primary); }
.footer-grid a { display: block; color: var(--muted); padding: 5px 0; transition: color .2s; }
.footer-grid a:hover { color: var(--primary); }
.footer .logo { display: inline-flex; color: var(--text); }
.footer .logo-mark::after { background: #e7eafc; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 26px; color: var(--muted); font-size: .85rem;
}

/* ============ Legal pages ============ */
.legal { padding: 150px 0 90px; max-width: 820px; }
.legal h1 { font-size: 2.4rem; margin-bottom: 8px; }
.legal .updated { color: var(--muted); margin-bottom: 40px; }
.legal h2 { font-size: 1.4rem; margin: 36px 0 12px; color: var(--primary); }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 22px; margin: 10px 0; }

/* ============ Reveal animation (only when JS is running) ============ */
html.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .games-grid { grid-template-columns: repeat(6, 1fr); }
  .game-card { grid-column: span 3; }
  .game-card.featured { grid-column: span 6; grid-template-columns: 1fr; }
  .spotlight-inner { grid-template-columns: 1fr; gap: 50px; }
  .spotlight-visual { order: 2; }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px);
    flex-direction: column; justify-content: center; gap: 34px;
    font-size: 1.25rem;
    box-shadow: -10px 0 40px rgba(33, 31, 61, .15);
    transform: translateX(100%); transition: transform .35s ease;
  }
  .nav-links.open { transform: none; }
  .nav-burger { display: block; position: relative; z-index: 110; }
  .nav-burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .games-grid { grid-template-columns: 1fr; }
  .game-card, .game-card.featured { grid-column: span 1; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
