/* MiniGamePlanet — Brain Tests shared styles + site-wide badge styles.
   Each game page sets its accent via inline `style="--bt-accent:#xxxxxx"`
   on the .bt-main wrapper. All color values use the real MGP variables
   defined in mgp-core.css (--mgp-text, --mgp-text-muted, --mgp-text-heading,
   --mgp-surface, --mgp-border) so they adapt to light AND dark mode and
   stay readable when nested inside the dark-mode <main> (which is rendered
   on a near-white surface). Fallbacks default to readable LIGHT-mode colors
   so we never end up with white text on a white background. */

.bt-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  color: var(--mgp-text, #1E293B);
}

.bt-header h1 {
  font-size: 60px;
  line-height: 1.05;
  margin: 0;
  color: var(--mgp-text-heading, #0F172A);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bt-tagline {
  color: var(--mgp-text-muted, #64748B);
  margin: 6px 0 0;
  font-size: 16px;
}

.bt-modes {
  display: flex;
  gap: 8px;
  margin: 22px 0;
  flex-wrap: wrap;
}

.bt-tab {
  padding: 8px 18px;
  border-radius: 999px;
  background: #1e293b;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}

.bt-tab:hover { transform: translateY(-1px); }

.bt-tab-active {
  background: var(--bt-accent, #6366f1);
  color: #ffffff;
}

.bt-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--mgp-text, #1E293B);
  font-size: 13px;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 600;
}

.bt-stage {
  text-align: center;
  padding: 28px 0;
  min-height: 360px;
}

.bt-prompt {
  font-size: 22px;
  color: var(--mgp-text-heading, #0F172A);
  margin-bottom: 28px;
  line-height: 1.4;
  font-weight: 600;
}

.bt-prompt strong {
  color: var(--bt-accent, #6366f1);
  font-weight: 800;
}

.bt-tap-btn {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--bt-accent, #6366f1);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: transform .1s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bt-tap-btn:active { transform: scale(.97); }

.bt-pulse { animation: btPulse 1.6s ease-in-out infinite; }

@keyframes btPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.bt-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 22px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #0f172a;
}

.bt-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  color: #0f172a;
  font-size: 15px;
}

.bt-row strong { color: #0f172a; font-weight: 700; }

.bt-points {
  font-size: 44px;
  font-weight: 800;
  text-align: center;
  color: var(--bt-accent, #6366f1);
  margin: 14px 0;
}

.bt-results {
  text-align: center;
  padding: 28px 16px;
  color: var(--mgp-text, #1E293B);
}

.bt-final-score {
  font-size: 150px;
  font-weight: 900;
  color: var(--bt-accent, #6366f1);
  line-height: 1;
}

.bt-final-suffix {
  font-size: 30px;
  color: var(--mgp-text-muted, #64748B);
  margin-top: -12px;
}

.bt-final-msg {
  font-size: 18px;
  color: var(--mgp-text-heading, #0F172A);
  margin: 22px 0;
  line-height: 1.5;
  font-weight: 600;
}

.bt-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 28px auto 0;
}

.bt-primary {
  padding: 16px;
  background: var(--bt-accent, #6366f1);
  color: #ffffff;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.bt-primary:hover { filter: brightness(1.08); }
.bt-primary:active { transform: scale(.98); }
.bt-primary:disabled { opacity: 0.6; cursor: wait; }

.bt-secondary {
  padding: 16px;
  background: #1e293b;
  color: #ffffff;
  border-radius: 12px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.bt-secondary:hover { filter: brightness(1.15); }

.bt-ghost {
  padding: 12px;
  background: transparent;
  color: var(--mgp-text-muted, #64748B);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.bt-ghost:hover { color: var(--mgp-text-heading, #0F172A); }

.bt-canvas {
  touch-action: none;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  background: #0f172a;
  max-width: 100%;
}

.bt-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 32px;
  background: #111111;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 9999;
}

.bt-toast-show { opacity: 1; }

.bt-seo {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--mgp-border, #E2E8F0);
  color: var(--mgp-text, #1E293B);
  line-height: 1.7;
}

.bt-seo h2 {
  color: var(--mgp-text-heading, #0F172A);
  margin-top: 22px;
  font-size: 22px;
  font-weight: 700;
}

.bt-seo p { margin: 12px 0; color: var(--mgp-text, #1E293B); }

.bt-notice {
  font-size: 13px;
  color: var(--mgp-text-muted, #64748B);
  margin-top: 10px;
}

/* Brain Tests hub grid */
.bt-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0 12px;
}

.bt-hub-card {
  display: block;
  text-decoration: none;
  background: #f1f5f9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  transition: transform .15s ease, box-shadow .15s ease;
}

.bt-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

.bt-hub-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #0f172a;
}

.bt-hub-card-body { padding: 12px 14px 14px; }

.bt-hub-card-title {
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 4px;
  color: #0f172a;
}

.bt-hub-card-tag {
  font-size: 13px;
  color: #475569;
  margin: 0;
  line-height: 1.4;
}

/* ===================================================================
   SITE-WIDE BADGE SYSTEM (used by buildGameCard in /js/shared.js).
   Applied to game-card badge elements. High contrast on both dark and
   light surfaces. All text meets WCAG AA against the badge fill.
   =================================================================== */
.mgp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #ffffff;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
}

.mgp-badge-hot      { background: #ef4444; color: #ffffff; }
.mgp-badge-popular  { background: #f59e0b; color: #1f1300; }
.mgp-badge-new      { background: #10b981; color: #ffffff; }
.mgp-badge-trending { background: #8b5cf6; color: #ffffff; }
.mgp-badge-top      { background: #3b82f6; color: #ffffff; }
.mgp-badge-staff    { background: #ec4899; color: #ffffff; }
