/* ============================================
   Fast-Zero-Cross — Global Styles
   ============================================ */

:root {
  --bg-dark: #0E1428;
  --bg-card: #151B33;
  --bg-input: #1A2140;
  --accent-cyan: #5BC4FF;
  --accent-red: #FF6B5C;
  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --border-color: #2A3458;
  --glow-cyan: 0 0 20px rgba(91, 196, 255, 0.4), 0 0 60px rgba(91, 196, 255, 0.15);
  --glow-cyan-strong: 0 0 30px rgba(91, 196, 255, 0.6), 0 0 80px rgba(91, 196, 255, 0.25);
  --font-main: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-weight: 600;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

a:hover {
  color: #8DD8FF;
}

/* ============================================
   Typography — BIG, BOLD, neurodivergent-friendly
   ============================================ */

h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h3 {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.3;
}

p {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  line-height: 1.6;
}

/* ============================================
   Layout helpers
   ============================================ */

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-block;
  padding: 20px 48px;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  font-family: var(--font-main);
  color: var(--bg-dark);
  background: var(--accent-cyan);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  box-shadow: var(--glow-cyan);
  text-decoration: none;
}

.btn:hover {
  background: #8DD8FF;
  color: var(--bg-dark);
  box-shadow: var(--glow-cyan-strong);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--red {
  background: var(--accent-red);
  box-shadow: 0 0 20px rgba(255, 107, 92, 0.4), 0 0 60px rgba(255, 107, 92, 0.15);
}

.btn--red:hover {
  background: #FF8A7E;
  box-shadow: 0 0 30px rgba(255, 107, 92, 0.6), 0 0 80px rgba(255, 107, 92, 0.25);
}

.btn--loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.btn--loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 12px;
  border: 3px solid var(--bg-dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Form styles
   ============================================ */

.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input::placeholder {
  color: #546E7A;
  font-weight: 500;
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(91, 196, 255, 0.2);
}

.form-error {
  color: var(--accent-red);
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 24px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer a {
  color: var(--text-secondary);
  font-weight: 600;
}

.footer a:hover {
  color: var(--accent-cyan);
}

/* ============================================
   Game container
   ============================================ */

#game-container {
  width: 100%;
  max-width: 1024px;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px auto;
  overflow: hidden;
}

#game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   Pulse animation for success checkmark
   ============================================ */

.checkmark {
  font-size: 80px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

/* ============================================
   Back link
   ============================================ */

.back-link {
  display: inline-block;
  margin-top: 32px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
}

.back-link:hover {
  color: var(--accent-cyan);
}

/* ============================================
   Responsive tweaks
   ============================================ */

@media (max-width: 600px) {
  .btn {
    padding: 18px 32px;
    width: 100%;
  }

  .card {
    padding: 32px 20px;
  }

  .page-wrapper {
    padding: 16px;
  }

  #game-container {
    aspect-ratio: 3 / 4;
  }
}
