/* ========================================
   TalEventyret – Stylesheet
   ======================================== */

:root {
  --purple:     #6C63FF;
  --purple-d:   #5A52D5;
  --purple-l:   rgba(108,99,255,0.12);
  --pink:       #FF6584;
  --green:      #2ECC8A;
  --green-l:    rgba(46,204,138,0.15);
  --yellow:     #FFD166;
  --yellow-l:   rgba(255,209,102,0.18);
  --blue:       #06A7E4;
  --orange:     #FF9F1C;
  --red:        #FF4E6A;
  --bg:         #F2F4FF;
  --white:      #FFFFFF;
  --text:       #2B2B44;
  --muted:      #8888AA;
  --border:     #E2E4F0;
  --radius:     20px;
  --radius-sm:  12px;
  --radius-xs:  8px;
  --shadow:     0 4px 24px rgba(108,99,255,0.13);
  --shadow-lg:  0 8px 40px rgba(108,99,255,0.22);
}

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

body {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== SCREENS ========== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px 16px 40px;
  flex-direction: column;
  align-items: center;
  animation: fadeUp .3s ease both;
}
.screen.active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== WELCOME ========== */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.logo-bounce {
  font-size: 80px;
  animation: bounce 2.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(108,99,255,0.35));
}
@keyframes bounce {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-22px) rotate(5deg); }
}

.game-title {
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 600;
}
.subtitle-small { font-size: 1rem; color: var(--muted); }

.welcome-ops {
  display: flex;
  gap: 12px;
  margin: 8px 0;
}
.op-bubble {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900;
  animation: floatBubble ease-in-out infinite;
  box-shadow: var(--shadow);
}
.op-plus  { background: #e8f7ff; color: var(--blue);   animation-duration: 2.4s; }
.op-minus { background: #fff0f3; color: var(--pink);   animation-duration: 2.8s; animation-delay: .3s; }
.op-times { background: #fffbe8; color: var(--orange); animation-duration: 2.2s; animation-delay: .6s; }
.op-div   { background: #e8fff4; color: var(--green);  animation-duration: 3s;   animation-delay: .9s; }

@keyframes floatBubble {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Floating background numbers */
.floating-bg {
  position: fixed; inset: 0;
  pointer-events: none; overflow: hidden; z-index: 0;
}
.floating-bg span {
  position: absolute;
  font-size: 3rem; font-weight: 900;
  opacity: 0.055; color: var(--purple);
  animation: floatUp linear infinite;
}
.floating-bg span:nth-child(1)  { left:5%;  animation-duration:9s;  animation-delay:0s;    top:90%; }
.floating-bg span:nth-child(2)  { left:15%; animation-duration:11s; animation-delay:-3s;   top:80%; }
.floating-bg span:nth-child(3)  { left:30%; animation-duration:8s;  animation-delay:-1.5s; top:95%; }
.floating-bg span:nth-child(4)  { left:50%; animation-duration:10s; animation-delay:-5s;   top:85%; }
.floating-bg span:nth-child(5)  { left:65%; animation-duration:7s;  animation-delay:-2s;   top:90%; }
.floating-bg span:nth-child(6)  { left:80%; animation-duration:12s; animation-delay:-4s;   top:88%; }
.floating-bg span:nth-child(7)  { left:88%; animation-duration:9s;  animation-delay:-7s;   top:92%; }
.floating-bg span:nth-child(8)  { left:40%; animation-duration:13s; animation-delay:-2s;   top:95%; }
.floating-bg span:nth-child(9)  { left:22%; animation-duration:10s; animation-delay:-6s;   top:87%; }

@keyframes floatUp {
  0%   { transform: translateY(0)    rotate(0deg);   opacity: 0.055; }
  10%  { opacity: 0.055; }
  90%  { opacity: 0.055; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ========== SCREEN HEADER ========== */
.screen-header {
  width: 100%; max-width: 620px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.screen-header h2 { font-size: 1.8rem; font-weight: 900; }

/* ========== BUTTONS ========== */
.btn {
  border: none; cursor: pointer;
  font-family: inherit; font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all .18s ease;
  padding: 12px 24px; font-size: 1rem;
  line-height: 1.2;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: #fff;
  box-shadow: 0 4px 18px rgba(108,99,255,.4);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(108,99,255,.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--pink), #e0496a);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,101,132,.4);
}

.btn-outline {
  background: var(--white);
  border: 2.5px solid var(--purple);
  color: var(--purple);
}
.btn-outline:hover { background: var(--purple-l); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-back  { background: transparent; color: var(--muted); padding: 8px 0; font-size: 1rem; }

.btn-xl    { padding: 18px 40px; font-size: 1.25rem; border-radius: var(--radius); width: 100%; max-width: 420px; }
.btn-large { padding: 14px 32px; font-size: 1.1rem; border-radius: var(--radius); }
.btn-sm    { padding: 8px 16px; font-size: .85rem; }
.btn-icon  { padding: 10px 14px; font-size: 1.2rem; background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); }

.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }

/* ========== USERS SCREEN ========== */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  width: 100%; max-width: 620px;
  margin-bottom: 20px;
}

.user-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  transition: all .2s ease;
  position: relative;
}
.user-card:hover {
  border-color: var(--purple);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.user-card .uc-avatar  { font-size: 3.2rem; display: block; margin-bottom: 8px; }
.user-card .uc-name    { font-weight: 800; font-size: 1rem; }
.user-card .uc-level   { font-size: .75rem; color: var(--muted); margin-top: 3px; font-weight: 600; }
.user-card .uc-stars   { font-size: .8rem; margin-top: 4px; font-weight: 700; color: var(--orange); }
.user-card .uc-delete  {
  position: absolute; top: 8px; right: 8px;
  font-size: .75rem; color: var(--muted); opacity: 0;
  background: var(--bg); border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s; cursor: pointer;
}
.user-card:hover .uc-delete { opacity: 1; }

.add-user-wrap { margin-top: 8px; }

/* ========== NEW USER ========== */
.new-user-form { width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 24px; }

.form-section h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.avatar-option {
  font-size: 2rem; text-align: center;
  padding: 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: 3px solid transparent;
  background: var(--white); box-shadow: var(--shadow);
  transition: all .2s;
}
.avatar-option:hover    { transform: scale(1.1); }
.avatar-option.selected { border-color: var(--purple); background: var(--purple-l); transform: scale(1.12); }

.field-label { display: block; font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }

.text-input {
  width: 100%; padding: 14px 18px;
  font-size: 1.1rem; font-family: inherit;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .2s;
  background: var(--white);
}
.text-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-l); }

.grade-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.grade-btn {
  padding: 8px 16px; border-radius: 20px;
  border: 2.5px solid var(--border);
  background: var(--white); cursor: pointer;
  font-family: inherit; font-weight: 700;
  font-size: .9rem; transition: all .2s; color: var(--text);
}
.grade-btn.selected { background: var(--purple); color: #fff; border-color: var(--purple); }
.grade-btn:hover:not(.selected) { border-color: var(--purple); color: var(--purple); }

/* ========== PLACEMENT ========== */
#screen-placement { align-items: center; }

.placement-header {
  width: 100%; max-width: 560px;
  text-align: center; margin-bottom: 28px;
}
.placement-header h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 6px; }

.progress-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
}
.progress-track {
  flex: 1; height: 14px;
  background: var(--border); border-radius: 7px; overflow: hidden;
}
.progress-track.thin { height: 10px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 7px;
  transition: width .5s ease;
}
.progress-label { font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; }

/* ========== PROBLEM AREA ========== */
.problem-area {
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.problem-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}

.op-badge {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px;
  font-size: .82rem; font-weight: 800;
  margin-bottom: 14px;
}

.problem-eq {
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: .03em;
}
.problem-eq sup { font-size: 60%; vertical-align: super; }

.hint-link {
  display: inline-block; margin-top: 14px;
  font-size: .9rem; color: var(--muted);
  text-decoration: underline; cursor: pointer;
  background: none; border: none; font-family: inherit;
}

/* ========== ANSWER AREA ========== */
.answer-area { width: 100%; max-width: 560px; }

.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  padding: 20px 12px;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  border: 3px solid var(--border);
  background: var(--white);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  color: var(--text);
  box-shadow: var(--shadow);
}
.choice-btn:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--purple-l);
  transform: scale(1.03);
}
.choice-btn.correct  { border-color: var(--green); background: var(--green-l); animation: correctPop .4s ease; }
.choice-btn.incorrect{ border-color: var(--red);   background: rgba(255,78,106,.1); animation: shake .4s ease; }

.input-row {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  margin-top: 4px;
}
.answer-input {
  width: 130px; padding: 14px 10px;
  font-size: 2.2rem; font-weight: 900;
  text-align: center;
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit; outline: none;
  transition: all .2s;
  background: var(--white);
  color: var(--text);
}
.answer-input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-l); }
.answer-input.correct  { border-color: var(--green); background: var(--green-l); animation: correctPop .4s ease; }
.answer-input.incorrect{ border-color: var(--red);   background: rgba(255,78,106,.08); animation: shake .4s ease; }

@keyframes correctPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(4px); }
}

/* ========== FEEDBACK ========== */
.feedback-area {
  width: 100%; max-width: 560px;
  padding: 18px 20px;
  border-radius: var(--radius);
  text-align: center;
  animation: fadeUp .3s ease both;
}
.feedback-area.fb-correct   { background: var(--green-l);  border: 2px solid var(--green); }
.feedback-area.fb-incorrect { background: var(--yellow-l); border: 2px solid var(--yellow); }

.fb-emoji   { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.fb-message { font-size: 1.2rem; font-weight: 800; }
.fb-answer  { font-size: .95rem; color: var(--muted); margin-top: 4px; }
.fb-stars   { font-size: 1.6rem; margin-top: 8px; animation: starsIn .5s ease; }

@keyframes starsIn {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.next-area {
  width: 100%; max-width: 560px;
  display: flex; justify-content: center;
  padding-top: 8px;
}

.hidden { display: none !important; }

/* ========== PROBLEM TOP BAR ========== */
.problem-topbar {
  width: 100%; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.streak-badge {
  background: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow);
}
.session-counter {
  font-weight: 700; font-size: .9rem; color: var(--muted);
}

/* ========== HOME ========== */
.home-top {
  width: 100%; max-width: 620px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.player-pill { display: flex; align-items: center; gap: 12px; }
.avatar-xl   { font-size: 3.6rem; }
.player-name { font-size: 1.5rem; font-weight: 900; }
.world-label { font-size: .88rem; color: var(--muted); font-weight: 700; margin-top: 2px; }

.xp-section { width: 100%; max-width: 620px; margin-bottom: 22px; }
.xp-track   { height: 18px; background: var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 6px; }
.xp-fill    { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 9px; transition: width 1s ease; }
.xp-row     { display: flex; justify-content: space-between; font-weight: 700; font-size: .9rem; }
.xp-label   { color: var(--muted); }

/* World scroll */
.worlds-scroll {
  width: 100%; max-width: 620px;
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 6px;
  margin-bottom: 22px;
  scrollbar-width: none;
}
.worlds-scroll::-webkit-scrollbar { display: none; }

.world-tile {
  flex: 0 0 120px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  transition: all .2s;
}
.world-tile.wt-current  { border-color: var(--purple); box-shadow: 0 4px 20px rgba(108,99,255,.3); }
.world-tile.wt-done     { border-color: var(--green); }
.world-tile.wt-locked   { opacity: .45; }
.world-tile .wt-icon    { font-size: 2rem; display: block; margin-bottom: 6px; }
.world-tile .wt-name    { font-size: .78rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.world-tile .wt-grade   { font-size: .68rem; color: var(--muted); margin-top: 3px; }
.world-tile .wt-here    { font-size: .65rem; font-weight: 900; color: var(--purple); margin-top: 4px; }
.world-tile .wt-done-lbl{ font-size: .7rem; color: var(--green); font-weight: 800; margin-top: 4px; }

.play-btn   { margin-bottom: 16px; }

.home-actions { display: flex; gap: 12px; width: 100%; max-width: 420px; }
.home-actions .btn { flex: 1; }

/* ========== RESULTS ========== */
#screen-results { justify-content: center; }
.results-inner {
  width: 100%; max-width: 500px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.res-emoji  { font-size: 5rem; }
.res-title  { font-size: 2.2rem; font-weight: 900; }
.res-pct    { font-size: 1rem; color: var(--muted); font-weight: 700; }

.res-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%;
  background: var(--white); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.stat-val   { font-size: 2rem; font-weight: 900; color: var(--purple); }
.stat-lbl   { font-size: .8rem; color: var(--muted); font-weight: 700; }
.levelup-banner {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 1.2rem; font-weight: 900; width: 100%;
}

/* ========== OVERLAYS ========== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20,18,40,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn .25s ease;
  padding: 16px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 480px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
.modal-sm { max-width: 360px; text-align: center; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; font-weight: 700;
  transition: background .2s;
}
.modal-close:hover { background: var(--border); }

/* ========== HINT MODAL ========== */
.hint-recap {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  font-size: 1.6rem; font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: .03em;
}

.hint-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.hint-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg); border-radius: var(--radius-sm); padding: 12px;
}
.step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--purple); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .82rem;
}
.step-txt { font-size: .95rem; line-height: 1.55; color: var(--text); }
.step-txt strong { color: var(--purple); }

.hint-visual {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  overflow-x: auto;
}

/* Number line */
.nl-wrap {
  display: flex; align-items: center; gap: 4px;
  min-width: max-content; padding: 4px 0;
}
.nl-num {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 800; font-size: .85rem;
  background: var(--border); color: var(--text);
}
.nl-num.nl-start { background: var(--purple); color: #fff; }
.nl-num.nl-end   { background: var(--green);  color: #fff; }
.nl-num.nl-step  { background: var(--yellow); color: var(--text); }
.nl-arrow { font-size: .9rem; color: var(--orange); font-weight: 900; }

/* Multiplication grid */
.mul-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.mul-group {
  display: flex; flex-wrap: wrap; gap: 3px;
  background: var(--purple-l);
  border: 2px solid var(--purple);
  border-radius: var(--radius-xs);
  padding: 6px;
}
.mul-dot { font-size: 1.2rem; }

/* ========== STATS ========== */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
}
.stat-card .sv { font-size: 1.8rem; font-weight: 900; color: var(--purple); }
.stat-card .sl { font-size: .78rem; color: var(--muted); font-weight: 700; }

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 12px 26px; border-radius: 30px;
  font-weight: 700; font-size: 1rem;
  z-index: 2000; pointer-events: none;
  animation: toastIn .3s ease;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== STREAK POP ========== */
.streak-pop {
  position: fixed; top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem; font-weight: 900;
  color: var(--orange);
  z-index: 900; pointer-events: none;
  animation: streakPop .9s ease forwards;
  text-shadow: 0 4px 16px rgba(255,159,28,.5);
  white-space: nowrap;
}
@keyframes streakPop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.6); }
  30%  { opacity: 1; transform: translate(-50%,-50%) scale(1.2); }
  70%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-70%) scale(.9); }
}

/* ========== CONFETTI ========== */
.conf-piece {
  position: fixed;
  border-radius: 3px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-80px) rotate(0deg);    opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 400px) {
  .problem-eq  { font-size: 2rem; }
  .choice-btn  { font-size: 1.4rem; padding: 16px 8px; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .mc-grid     { grid-template-columns: 1fr 1fr; }
}
