/* ============================================
   Mastermind Games — Apple-inspired Design System
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  opacity: 0;
  animation: pageFadeIn 0.6s ease forwards;
}

@keyframes pageFadeIn {
  to { opacity: 1; }
}

a {
  color: #0071e3;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0077ed;
  text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #1d1d1f;
}

/* ---------- Container ---------- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
}

.container--wide {
  max-width: 1200px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 48px;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav--scrolled {
  background: rgba(251, 251, 253, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 18px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.nav__logo:hover {
  color: #1d1d1f;
  text-decoration: none;
}

.nav__logo span {
  color: #0071e3;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav__links a {
  font-size: 12px;
  font-weight: 500;
  color: #1d1d1f;
  letter-spacing: 0;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.nav__links a:hover {
  opacity: 1;
  text-decoration: none;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.nav__toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #1d1d1f;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav__toggle.open span:nth-child(2) {
  opacity: 0;
}

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

/* Mobile menu */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(251, 251, 253, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px 22px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9998;
}

.nav__mobile-menu.show {
  opacity: 1;
  transform: translateY(0);
}

.nav__mobile-menu a {
  display: block;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 500;
  color: #1d1d1f;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav__mobile-menu a:hover {
  text-decoration: none;
  color: #0071e3;
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 113, 227, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #0071e3;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 20px;
  color: #1d1d1f;
}

.hero__subtitle {
  font-size: clamp(17px, 2.5vw, 21px);
  color: #6e6e73;
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.5;
  font-weight: 400;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  gap: 8px;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: #0071e3;
  color: #fff;
}

.btn--primary:hover {
  background: #0077ed;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: #0071e3;
  border: 2px solid #0071e3;
}

.btn--outline:hover {
  background: #0071e3;
  color: #fff;
}

.btn--dark {
  background: #1d1d1f;
  color: #fff;
}

.btn--dark:hover {
  background: #333;
  color: #fff;
}

.btn--danger {
  background: #ff3b30;
  color: #fff;
}

.btn--danger:hover {
  background: #e0332b;
  color: #fff;
}

.btn--disabled {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
  cursor: default;
  border: 2px solid rgba(255, 149, 0, 0.3);
}

.btn--disabled:hover {
  background: rgba(255, 149, 0, 0.2);
  color: #ff9500;
}

.btn--large {
  padding: 16px 36px;
  font-size: 19px;
}

.btn--small {
  padding: 8px 20px;
  font-size: 14px;
}

/* ---------- Stats Bar ---------- */
.stats {
  background: #1d1d1f;
  padding: 48px 0;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stats__item {
  position: relative;
}

.stats__number {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.stats__label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.56);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* ---------- Section Styles ---------- */
.section {
  padding: 100px 0;
}

.section--gray {
  background: #f5f5f7;
}

.section--dark {
  background: #1d1d1f;
  color: #fff;
}

.section--dark h2,
.section--dark h3 {
  color: #fff;
}

.section__eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #0071e3;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section__title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.section__subtitle {
  font-size: 19px;
  color: #6e6e73;
  max-width: 600px;
  line-height: 1.5;
}

.section--dark .section__subtitle {
  color: rgba(255, 255, 255, 0.56);
}

.section__header {
  text-align: center;
  margin-bottom: 56px;
}

.section__header .section__subtitle {
  margin: 0 auto;
}

/* ---------- Game Cards / App Cards ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.game-card {
  display: block;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

.game-card--soon {
  cursor: default;
}

.game-card--soon:hover {
  text-decoration: none;
  color: inherit;
}

.game-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
}

.game-card__body {
  padding: 20px 24px 24px;
}

.game-card__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.game-card__badge--featured {
  color: #0071e3;
}

.game-card__badge--soon {
  color: #ff9500;
}

.game-card__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #1d1d1f;
}

.game-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.game-card__tag {
  font-size: 11px;
  font-weight: 600;
  color: #6e6e73;
  background: #f5f5f7;
  padding: 4px 10px;
  border-radius: 980px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-card__stars {
  color: #ff9500;
  font-size: 14px;
  letter-spacing: 1px;
}

.game-card__rating-text {
  font-size: 13px;
  color: #6e6e73;
  font-weight: 500;
}

.game-card__status {
  font-size: 13px;
  font-weight: 600;
  color: #ff9500;
}

.game-card__arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0071e3;
  font-size: 16px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.game-card:hover .game-card__arrow {
  background: #0071e3;
  color: #fff;
  transform: translateX(2px);
}

/* ---------- Feature / About Cards ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.feature-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.feature-card__body {
  padding: 24px;
}

.feature-card__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #1d1d1f;
}

.feature-card__text {
  font-size: 15px;
  color: #6e6e73;
  line-height: 1.5;
}

/* Card Image Placeholder (gradient + emoji) */
.card__image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  border-radius: 0;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  text-align: center;
  padding: 80px 0;
  background: linear-gradient(135deg, #1d1d1f 0%, #2d2d30 100%);
  color: #fff;
}

.cta-banner__title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  color: #fff;
}

.cta-banner__text {
  font-size: 19px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

/* ---------- Footer ---------- */
.footer {
  background: #f5f5f7;
  padding: 48px 0 24px;
  border-top: 1px solid #d2d2d7;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer__col-title {
  font-size: 12px;
  font-weight: 700;
  color: #1d1d1f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.footer__links {
  list-style: none;
}

.footer__links li {
  margin-bottom: 8px;
}

.footer__links a {
  font-size: 13px;
  color: #6e6e73;
  font-weight: 400;
  transition: color 0.3s ease;
}

.footer__links a:hover {
  color: #0071e3;
  text-decoration: none;
}

.footer__bottom {
  border-top: 1px solid #d2d2d7;
  padding-top: 20px;
  text-align: center;
}

.footer__copy {
  font-size: 12px;
  color: #6e6e73;
}

.footer__bottom-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.footer__bottom-links a {
  font-size: 12px;
  color: #6e6e73;
}

/* ---------- Legal Layout ---------- */
.legal-hero {
  padding: 120px 0 48px;
  text-align: center;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}

.legal-hero__title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.legal-hero__subtitle {
  font-size: 17px;
  color: #6e6e73;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 64px 0;
}

.legal-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

.legal-sidebar a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  border-left: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.legal-sidebar a:hover {
  color: #0071e3;
  text-decoration: none;
}

.legal-sidebar a.active {
  color: #0071e3;
  border-left-color: #0071e3;
  font-weight: 600;
}

.legal-content h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 48px 0 16px;
  color: #1d1d1f;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  font-size: 15px;
  color: #424245;
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 16px 24px;
  font-size: 15px;
  color: #424245;
  line-height: 1.7;
}

.legal-content li {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .legal-sidebar {
    position: static;
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 12px;
    border-bottom: 1px solid #d2d2d7;
  }

  .legal-sidebar a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
  }

  .legal-sidebar a.active {
    border-left: none;
    border-bottom-color: #0071e3;
  }
}

/* ---------- Delete Account / Form Section ---------- */
.form-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 22px 80px;
  background: linear-gradient(135deg, #1d1d1f 0%, #0d0d0f 50%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(255, 59, 48, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.form-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.form-card__icon {
  font-size: 48px;
  margin-bottom: 24px;
  text-align: center;
}

.form-card__title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-align: center;
}

.form-card__desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 32px;
}

.form-card__warning {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.form-card__warning p {
  font-size: 13px;
  color: #ff6961;
  line-height: 1.5;
}

.form-card__warning strong {
  color: #ff3b30;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.form-field input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 17px;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.3s ease, background 0.3s ease;
  outline: none;
}

.form-field input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-field input:focus {
  border-color: rgba(255, 59, 48, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.form-card .btn {
  width: 100%;
  margin-top: 8px;
}

.form-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  display: none;
}

.form-message--success {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.2);
  display: block;
}

.form-message--error {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.2);
  display: block;
}

/* ---------- 404 Page ---------- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 22px;
  background: linear-gradient(135deg, #1d1d1f 0%, #0d0d0f 50%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
}

.error-page::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.error-page__code {
  font-size: clamp(100px, 20vw, 200px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0071e3, #5e5ce6, #bf5af2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-page__title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.error-page__text {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.56);
  margin-bottom: 36px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale--visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reveal-fade--visible {
  opacity: 1;
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ---------- Coming Soon Badge ---------- */
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 149, 0, 0.12);
  color: #ff9500;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 980px;
  border: 1px solid rgba(255, 149, 0, 0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .hero {
    padding: 120px 0 60px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .section {
    padding: 64px 0;
  }

  .cta-banner {
    padding: 56px 0;
  }

  .form-card {
    padding: 32px 24px;
  }

  .games-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
}
