/* public/css/app.css — MindForge IQ game UI styles */
/* Extends theme.css design tokens */

.app-main {
  padding-top: 80px;
  min-height: 100vh;
}

/* ── MODE SELECTOR ── */
.mode-select {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px;
}
.mode-header {
  text-align: center;
  margin-bottom: 48px;
}
.mode-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.mode-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .mode-grid { grid-template-columns: 1fr; }
}
.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
  color: var(--text-primary);
  font-family: var(--font-body);
}
.mode-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.mode-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.mode-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.mode-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.mode-stats {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── GAME SECTION ── */
.game-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 24px;
}
.hidden { display: none !important; }

/* HUD */
.game-hud {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 32px;
}
.hud-score, .hud-time, .hud-round {
  text-align: center;
}
.hud-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.hud-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.game-instructions {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
}

/* ── FOCUS GAME ── */
.focus-arena {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.focus-target {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,0.8) 0%, rgba(0,229,255,0.2) 70%, transparent 100%);
  box-shadow: 0 0 30px rgba(0,229,255,0.5), 0 0 60px rgba(0,229,255,0.3);
  transform: translate(-50%, -50%);
  cursor: pointer;
  animation: pulse 0.8s ease-in-out infinite alternate;
  display: none;
}
.focus-target.active {
  display: block;
}
@keyframes pulse {
  from { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(0,229,255,0.4), 0 0 40px rgba(0,229,255,0.2); }
  to   { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 40px rgba(0,229,255,0.6), 0 0 80px rgba(0,229,255,0.3); }
}
.focus-spawn-point {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* ── MEMORY GAME ── */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}
.memory-cell {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.memory-cell:hover {
  border-color: var(--border-accent);
}
.memory-cell.flash {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.memory-cell.correct {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.5);
}
.memory-cell.wrong {
  background: rgba(255, 60, 60, 0.15);
  border-color: rgba(255, 60, 60, 0.5);
}
.memory-cell.disabled {
  pointer-events: none;
}

/* ── SPELLING GAME ── */
.spelling-arena {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
}
.spelling-word {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 32px;
  min-height: 60px;
}
.spelling-word.fade-out {
  animation: wordFade 0.4s ease-out forwards;
}
@keyframes wordFade {
  from { opacity: 1; }
  to   { opacity: 0; transform: scale(0.95); }
}
.spelling-word.fade-in {
  animation: wordFadeIn 0.3s ease-out forwards;
}
@keyframes wordFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.spelling-input {
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 20px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.spelling-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.spelling-input.correct {
  border-color: rgba(0, 255, 136, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}
.spelling-input.wrong {
  border-color: rgba(255, 60, 60, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 60, 60, 0.1);
  animation: shake 0.4s ease-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.spelling-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
}

/* ── RESULTS ── */
.results-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 60px 24px;
}
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 0 60px rgba(0,229,255,0.1);
}
.results-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.results-score {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.results-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.results-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
.results-stat {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.results-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.results-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: #33eeff; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--border-accent); color: var(--text-primary); }

/* ── DAILY LIMIT BANNER ── */
.limit-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 20px 28px;
  max-width: 420px;
  width: calc(100% - 48px);
  text-align: center;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,229,255,0.1);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.limit-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.limit-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.limit-banner-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.limit-banner-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.limit-banner .btn-upgrade {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.limit-banner .btn-upgrade:hover { background: #33eeff; }
.limit-banner .btn-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.limit-banner .btn-dismiss:hover { border-color: var(--border-accent); color: var(--text-secondary); }

/* Session counter badges on mode cards */
.session-pip {
  display: inline-flex;
  gap: 4px;
  margin-top: 8px;
}
.session-pip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.session-pip-dot.used {
  background: var(--accent);
}

/* ── ONBOARDING OVERLAY ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.onboarding-inner {
  width: 100%;
  max-width: 460px;
}
.ob-step {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 0 80px rgba(0,229,255,0.08), 0 24px 64px rgba(0,0,0,0.6);
  animation: obStepIn 0.3s ease-out;
}
@keyframes obStepIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ob-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  animation: obIconPulse 2.5s ease-in-out infinite;
}
@keyframes obIconPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}
.ob-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.ob-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Progress pips */
.ob-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.ob-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, transform 0.3s;
}
.ob-pip.active {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--accent);
}
.ob-pip.done {
  background: rgba(0,229,255,0.5);
}

/* Mode cards in onboarding */
.ob-modes {
  text-align: left;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ob-mode {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.ob-mode-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-mode-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.ob-mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* How-it-works tips */
.ob-tips {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}
.ob-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}
.ob-tip-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

/* Primary button */
.btn-ob-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-ob-primary:hover {
  background: #33eeff;
  transform: translateY(-1px);
}

/* ── FIRST-COMPLETION CELEBRATION ── */
.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.88);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.celebration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 24px;
  padding: 56px 48px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 0 120px rgba(0,229,255,0.12), 0 24px 80px rgba(0,0,0,0.7);
  animation: celebIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes celebIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.celebration-burst {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: burstOut 1.2s ease-out forwards;
}
.ring-2 { animation-delay: 0.15s; }
.ring-3 { animation-delay: 0.3s; }
@keyframes burstOut {
  0%   { opacity: 0.8; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(2.5); }
}
.burst-icon {
  animation: starPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
@keyframes starPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}
.celebration-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.celebration-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.celebration-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* Confetti particles */
.celebration-card::before,
.celebration-card::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: confettiFall 1s ease-out forwards;
}
.celebration-card::before {
  background: var(--accent);
  top: 20%;
  left: 30%;
  animation-delay: 0.1s;
}
.celebration-card::after {
  background: #f59e0b;
  top: 25%;
  right: 25%;
  animation-delay: 0.25s;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(40px) scale(0.5); }
}
/* Upgrade CTA inside celebration */
.celebration-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-celebration-skip {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.btn-celebration-skip:hover {
  color: var(--text-secondary);
}
/* milestone prompt icon */
.milestone-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}.btn-test-offer {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-radius: 8px;
  color: #00e5ff;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn-test-offer:hover {
  background: rgba(0, 229, 255, 0.08);
}
