/* Amblify Vision Training Suite — styles (matched to amblify.net) */

:root {
  /* Brand palette (from amblify.net) */
  --primary:        #0ea5e9;   /* sky-500  */
  --primary-dark:   #0284c7;   /* sky-600  */
  --secondary:      #6366f1;   /* indigo-500 */
  --secondary-dark: #4f46e5;   /* indigo-600 */
  --accent:         #14b8a6;   /* teal-500 */
  --accent-dark:    #0d9488;   /* teal-600 */

  --bg:        #0a0f1e;        /* matched dark background */
  --card-bg:   rgba(15, 23, 42, 0.7); /* glass-like card */
  --text:      #f1f5f9;        /* white text */
  --subtext:   #cbd5e1;        /* slate-300 */
  --muted:     #94a3b8;        /* slate-400 */
  --border:    rgba(255, 255, 255, 0.1);

  --radius:    16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);

  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 80% -10%, rgba(20, 184, 166, 0.10), transparent 60%),
    radial-gradient(50rem 40rem at -10% 10%, rgba(99, 102, 241, 0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 11px 22px; border: none; border-radius: 999px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary   { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px rgba(14, 165, 233, 0.30); }
.btn-primary:hover   { box-shadow: 0 12px 26px rgba(14, 165, 233, 0.40); }
.btn-accent    { background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%); color: #fff; box-shadow: 0 8px 20px rgba(20, 184, 166, 0.30); }
.btn-accent:hover    { box-shadow: 0 12px 26px rgba(20, 184, 166, 0.40); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary) 0%, #a855f7 100%); color: #fff; box-shadow: 0 8px 20px rgba(99, 102, 241, 0.30); }
.btn-secondary:hover { box-shadow: 0 12px 26px rgba(99, 102, 241, 0.40); }

/* ── Top nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 68px; padding: 0 clamp(20px, 5vw, 56px);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--gradient); box-shadow: 0 6px 16px rgba(14, 165, 233, 0.30);
}
.nav-logo-text { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 0.95rem; font-weight: 500; color: var(--subtext);
  text-decoration: none; transition: color 0.15s;
}
.nav-links a:hover { color: var(--primary); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-lang { font-size: 0.9rem; font-weight: 500; color: var(--muted); }

/* ── Hero ── */
.hero {
  max-width: 860px; margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) 24px 56px; text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(14, 165, 233, 0.10); color: var(--primary);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 999px; padding: 7px 18px;
  font-size: 0.82rem; font-weight: 600; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 20px;
}
.hero p {
  font-size: 1.08rem; color: var(--subtext); max-width: 620px;
  margin: 0 auto 40px; line-height: 1.7;
}
.hero-stats {
  display: flex; justify-content: center; gap: 0;
  max-width: 460px; margin: 0 auto;
  background: var(--card-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.hero-stat { flex: 1; padding: 18px 20px; border-right: 1px solid var(--border); }
.hero-stat:last-child { border-right: none; }
.hero-stat-val {
  font-size: 1.7rem; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-stat-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-top: 3px; }

/* ── Section ── */
.section { max-width: 1080px; margin: 0 auto; padding: 0 24px 72px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -1px; }
.section-sub { font-size: 1rem; color: var(--subtext); margin-top: 12px; }

/* ── Game cards ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer; display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 165, 233, 0.45);
}

.card-thumb {
  position: relative; height: 168px; overflow: hidden;
  display: grid; place-items: center;
}
.card-thumb-icon { font-size: 4.6rem; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2)); z-index: 1; }
.thumb-aim    { background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%); }
.thumb-pursue { background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%); }
.thumb-react  { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); }
.thumb-deco { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); }

.card-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  align-self: flex-start;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.tag-primary   { background: rgba(14, 165, 233, 0.12); color: var(--primary-dark); }
.tag-accent    { background: rgba(20, 184, 166, 0.12); color: var(--accent-dark); }
.tag-secondary { background: rgba(99, 102, 241, 0.12); color: var(--secondary-dark); }

.card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.card p  { font-size: 0.9rem; color: var(--subtext); line-height: 1.6; margin-bottom: 18px; flex: 1; }

.card-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.card-meta-item { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-btn { padding: 9px 18px; font-size: 0.88rem; }

/* Difficulty pips */
.difficulty { display: flex; gap: 4px; align-items: center; font-size: 0.55rem; }
.pip { color: var(--border); line-height: 1; }
.pip.on           { color: var(--primary); }
.pip.on-accent    { color: var(--accent); }
.pip.on-secondary { color: var(--secondary); }

/* ── How it works ── */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how-card {
  background: var(--card-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 22px; text-align: center; box-shadow: var(--shadow-sm);
}
.how-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.7rem;
  background: rgba(14, 165, 233, 0.10);
}
.how-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 7px; }
.how-card p  { font-size: 0.88rem; color: var(--subtext); line-height: 1.6; }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-inner p { font-size: 0.85rem; color: var(--muted); }



/* ── Responsive ── */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .nav-cta { display: none; }
}

/* ── Game modal — fully responsive ── */
#game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.70);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  /* No padding on smallest screens — added via clamp below */
  padding: clamp(0px, 2.5vw, 20px);
  overflow: hidden;
  overscroll-behavior: contain;
}
#game-modal.open { display: flex; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 1100px;
  /* Fill all available height within the padded modal overlay */
  height: calc(100vh - clamp(0px, 5vw, 40px));
  height: calc(100dvh - clamp(0px, 5vw, 40px));
  background: var(--card-bg);
  border-radius: clamp(0px, 2.5vw, var(--radius-lg));
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
  min-height: 52px;
}

.modal-title {
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: var(--subtext);
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  touch-action: manipulation;
}
.modal-close:hover  { background: var(--border); color: var(--text); }
.modal-close:active { transform: scale(0.92); }

#game-iframe {
  flex: 1 1 0;
  width: 100%;
  height: 0;          /* flex: 1 takes care of actual height */
  border: none;
  background: var(--bg);
  display: block;
  touch-action: auto;
}

/* ── Full-screen modal on phones ── */
@media (max-width: 600px) {
  #game-modal {
    padding: 0;
    align-items: stretch;
  }
  .modal-box {
    border-radius: 0;
    height: 100vh;
    height: 100dvh;
    border: none;
    max-width: 100%;
  }
  .modal-header {
    padding: 10px 14px;
    /* Push below iOS notch if present */
    padding-top: max(10px, env(safe-area-inset-top));
  }
}
