.brain-card {
  width: 100%;
  max-width: 500px;
  background: linear-gradient(135deg, rgba(19, 103, 229, 0.12), rgba(56, 189, 248, 0.06));
  border: 1px solid var(--border-hi, rgba(19, 103, 229, 0.55));
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: 360px;
}
.brain-question {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.01em;
  user-select: none;
  padding: 6px 0;
}
.brain-stage {
  flex: 1;
  display: grid; place-items: center;
  background: rgba(5, 5, 20, 0.4);
  border-radius: 12px;
  padding: 18px;
  min-height: 240px;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.brain-feedback {
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}
.brain-feedback.win { color: var(--success, #34d399); font-weight: 700; }
.brain-feedback.fail { color: #ef4444; }
.brain-feedback.hint { color: #fde047; }

/* Level 1: panda in bears */
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.emoji-grid > span {
  font-size: 30px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
}
.emoji-grid > span:hover { background: rgba(19, 103, 229, 0.2); transform: scale(1.1); }

/* Level 2: numbers row */
.num-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.num-row > button {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: transform 0.1s;
}
.num-row > button:hover { transform: translateY(-3px); }

/* Level 3: t-shirt */
.tshirt-wrap { position: relative; display: grid; place-items: center; }
.tshirt-svg { width: 180px; height: 180px; }
.tshirt-input {
  width: 80px;
  padding: 8px 10px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: white;
  border-radius: 8px;
  font-family: inherit; font-size: 18px;
  text-align: center;
  font-weight: 700;
}
.tshirt-submit {
  padding: 8px 16px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border: none;
  color: white;
  font-family: inherit; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

/* Level 4: sleeping dog */
.sleep-wrap { display: grid; place-items: center; gap: 8px; cursor: pointer; }
.sleep-emoji { font-size: 88px; transition: transform 0.2s; }
.sleep-zzz {
  font-size: 28px;
  color: #38bdf8;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
  animation: zzzfloat 2s ease-in-out infinite;
}
@keyframes zzzfloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.sleep-emoji.awake { animation: wiggle 0.5s ease; }
@keyframes wiggle {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.1) rotate(-8deg); }
  75% { transform: scale(1.15) rotate(8deg); }
}

/* Level 5: catch the fly */
.fly-arena {
  position: relative;
  width: 100%; height: 220px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0a0a25, #1e1b4b);
}
.fly {
  position: absolute;
  font-size: 36px;
  cursor: pointer;
  user-select: none;
  transition: left 0.15s linear, top 0.15s linear;
}

/* Level 6: largest number trick */
.size-row { display: flex; gap: 16px; align-items: center; justify-content: center; }
.size-row > button {
  background: linear-gradient(135deg, #6366f1, #1367e5);
  border: none;
  color: white;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 14px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

/* Level 7: equation */
.eq-row {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 30px; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}
.eq-slot {
  min-width: 50px; height: 60px;
  border: 2px dashed rgba(19, 103, 229, 0.5);
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(20, 20, 58, 0.5);
}
.eq-slot.filled { border-style: solid; background: linear-gradient(135deg, #6366f1, #1367e5); }
.eq-tokens { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.eq-token {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 10px;
  font-size: 22px; font-weight: 700;
  color: white;
  cursor: grab;
  user-select: none;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}
.eq-token.used { opacity: 0.3; pointer-events: none; }

/* Level 8: light switch */
.dark-room {
  width: 100%; height: 220px;
  border-radius: 12px;
  background: #000;
  position: relative;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.4s;
}
.dark-room.lit { background: linear-gradient(180deg, #fde047, #f59e0b); }
.bulb {
  font-size: 80px;
  filter: grayscale(1) brightness(0.4);
  transition: filter 0.3s;
}
.dark-room.lit .bulb { filter: none; }
.dark-room .hint-text {
  position: absolute; bottom: 12px; left: 0; right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}
.dark-room.lit .hint-text { color: rgba(0, 0, 0, 0.5); }

.win-banner {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(34, 197, 94, 0.95);
  color: white;
  font-size: 32px;
  font-weight: 700;
  border-radius: 12px;
  animation: pop 0.3s ease;
  pointer-events: none;
}
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 540px) {
  .num-row > button { width: 50px; height: 50px; font-size: 22px; }
  .emoji-grid > span { font-size: 24px; width: 36px; height: 36px; }
}
