:root {
  --yellow: #FFD60A;
  --orange: #FF6B35;
  --pink:   #FF3D9A;
  --purple: #7C3AED;
  --blue:   #2563EB;
  --teal:   #0D9488;
  --green:  #16A34A;
  --bg:     #0F0A1E;
  --card:   #1A1035;
  --card2:  #221845;
  --text:   #F0E6FF;
  --muted:  #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 18px;
}

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

/* Starfield */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.star-dot {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--d, 3s) ease-in-out infinite var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50%       { opacity: 0.7;  transform: scale(1.5); }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  padding: 20px 16px 60px;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes starPop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-7px); }
  75%       { transform: translateX(7px); }
}

/* ── INDEX PAGE ── */
.hero {
  text-align: center;
  padding: 28px 0 32px;
}
.hero-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 100px;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  color: #A78BFA;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: fadeDown 0.5s ease both;
}
.hero-emoji {
  display: block;
  font-size: clamp(60px, 14vw, 80px);
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite, fadeDown 0.5s 0.1s ease both;
}
.hero h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.2rem, 8vw, 4rem);
  background: linear-gradient(135deg, var(--yellow) 0%, var(--orange) 40%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 10px;
  animation: fadeDown 0.5s 0.15s ease both;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  animation: fadeDown 0.5s 0.2s ease both;
}

.progress-bar-wrap {
  background: var(--card);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeUp 0.5s 0.3s ease both;
}
.progress-emoji { font-size: 1.8rem; flex-shrink: 0; }
.progress-info  { flex: 1; min-width: 0; }
.progress-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.progress-track {
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width 0.8s ease;
}
.progress-count {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--pink);
  white-space: nowrap;
  flex-shrink: 0;
}

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

.lesson-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border-radius: 20px;
  padding: 18px 20px;
  border: 2px solid rgba(255,255,255,0.05);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
  -webkit-tap-highlight-color: transparent;
}
.lesson-card:hover  { transform: translateY(-3px); }
.lesson-card:active { transform: scale(0.98); }

.card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.card-icon-wrap {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  position: relative;
}
.card-num {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 0.7rem;
  color: var(--bg);
}
.card-body { flex: 1; min-width: 0; }
.card-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  margin-bottom: 3px;
  line-height: 1.2;
}
.card-desc {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.card-meta  { display: flex; gap: 6px; flex-wrap: wrap; }
.meta-tag   { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 0.74rem; font-weight: 800; }
.tag-easy   { background: rgba(22,163,74,0.15);  color: #4ade80; }
.tag-medium { background: rgba(255,107,53,0.15); color: var(--orange); }
.tag-ex     { background: rgba(255,255,255,0.06); color: var(--muted); }
.card-stars { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; align-items: center; }
.cs { font-size: 1rem; filter: grayscale(1) opacity(0.25); transition: filter 0.3s; }
.cs.on { filter: none; }
.card-arrow { font-size: 1.5rem; color: var(--muted); transition: all 0.25s; flex-shrink: 0; margin-left: 6px; }
.lesson-card:hover .card-arrow { transform: translateX(4px); color: white; }

.card-yellow:hover { box-shadow: 0 12px 40px rgba(255,214,10,0.15); border-color: rgba(255,214,10,0.35); }
.card-orange:hover { box-shadow: 0 12px 40px rgba(255,107,53,0.15); border-color: rgba(255,107,53,0.35); }
.card-blue:hover   { box-shadow: 0 12px 40px rgba(37,99,235,0.15);  border-color: rgba(37,99,235,0.35); }
.card-purple:hover { box-shadow: 0 12px 40px rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.35); }
.card-yellow .card-icon-wrap { background: rgba(255,214,10,0.12); }
.card-orange .card-icon-wrap { background: rgba(255,107,53,0.12); }
.card-blue   .card-icon-wrap { background: rgba(37,99,235,0.12); }
.card-purple .card-icon-wrap { background: rgba(124,58,237,0.12); }
.card-yellow .card-title { color: var(--yellow); }
.card-orange .card-title { color: var(--orange); }
.card-blue   .card-title { color: #60a5fa; }
.card-purple .card-title { color: #a78bfa; }
.card-yellow .card-num { background: var(--yellow); }
.card-orange .card-num { background: var(--orange); }
.card-blue   .card-num { background: var(--blue); }
.card-purple .card-num { background: var(--purple); }

.footer {
  text-align: center;
  margin-top: 28px;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 600;
}
.footer span { color: var(--pink); }

/* ── LESSON PAGES ── */
.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  animation: fadeDown 0.4s ease both;
}
.back-btn {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.2s;
  min-height: 44px;
}
.back-btn:hover { color: var(--text); }
.lesson-badge {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 100px;
  white-space: nowrap;
}

.lesson-header {
  text-align: center;
  margin-bottom: 20px;
  animation: fadeDown 0.4s 0.08s ease both;
}
.lesson-emoji {
  font-size: clamp(50px, 12vw, 72px);
  display: block;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}
.lesson-header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.7rem, 5.5vw, 2.8rem);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
  line-height: 1.15;
}
.lesson-header p { color: #FFFFFF; font-size: 1.05rem; font-weight: 700; }

.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07); }

.explain-card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px 18px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 14px;
  animation: fadeUp 0.4s ease both;
}
.explain-card h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  line-height: 1.3;
}
.explain-card > p { font-size: 1rem; line-height: 1.65; color: #FFFFFF; font-weight: 700; margin-bottom: 10px; }

.big-eq {
  background: var(--card2);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  text-align: center;
  line-height: 2.2;
  border: 1px solid rgba(255,255,255,0.04);
  overflow-x: auto;
}
.hi-ten  { color: #60a5fa; background: rgba(37,99,235,0.15);  padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-unit { color: #f472b6; background: rgba(255,61,154,0.15); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-mid  { color: var(--orange); background: rgba(255,107,53,0.15); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-res  { color: #4ade80; background: rgba(22,163,74,0.15);  padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-p    { color: #a78bfa; background: rgba(124,58,237,0.15); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-10   { color: #60a5fa; background: rgba(37,99,235,0.15);  padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-r    { color: #4ade80; background: rgba(22,163,74,0.15);  padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.hi-op   { color: var(--muted); margin: 0 3px; }

.steps-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.step-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card2);
  border-radius: 13px;
  padding: 12px 15px;
  border-left: 3px solid currentColor;
}
.step-n {
  width: 28px; height: 28px; border-radius: 50%;
  font-family: 'Fredoka One', cursive; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-text { font-size: 1.05rem; font-weight: 800; line-height: 1.6; color: #FFFFFF; }
.step-text em      { font-style: normal; }
.step-text .green  { color: #4ade80; }
.step-text .orange { color: var(--orange); }

.blocks-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 10px 0; }
.blk { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 0.75rem; user-select: none; }
.blk-ten  { background: linear-gradient(135deg,#3730a3,#1d4ed8); color: white; width: 50px; font-size: 0.7rem; }
.blk-unit { background: linear-gradient(135deg,#be185d,#9333ea); color: white; }
.blk-sep  { color: var(--muted); font-size: 1.3rem; font-family: 'Fredoka One', cursive; }

.circles-wrap  { margin: 12px 0; background: var(--card2); border-radius: 14px; padding: 14px; }
.circles-label { font-size: 0.78rem; font-weight: 800; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.circles-row   { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 5px; }
.circle { width: 33px; height: 33px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 0.7rem; user-select: none; }
.c-have { background: linear-gradient(135deg,#7c3aed,#2563eb); color: white; }
.c-move { background: linear-gradient(135deg,#FF6B35,#FF3D9A); color: white; }
.c-rest { background: rgba(255,255,255,0.05); border: 2px dashed rgba(255,255,255,0.15); color: rgba(255,255,255,0.3); }
.c-ten  { background: linear-gradient(135deg,#0d9488,#16a34a); color: white; }
.circles-sep  { color: var(--muted); font-size: 1.2rem; font-family: 'Fredoka One', cursive; }
.circles-note { font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.ten-frame { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin: 12px 0; background: var(--card2); border-radius: 13px; padding: 10px; }
.tf-cell  { aspect-ratio: 1; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 1rem; border: 1px solid rgba(255,255,255,0.06); transition: all 0.3s; }
.tf-a     { background: linear-gradient(135deg,#7c3aed,#2563eb); color: white; }
.tf-b     { background: linear-gradient(135deg,#FF3D9A,#FF6B35); color: white; }
.tf-empty { background: rgba(255,255,255,0.03); }

.nl-wrap { background: var(--card2); border-radius: 16px; padding: 12px 10px; margin: 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nl-wrap svg { display: block; }

.demo-box      { background: var(--card2); border-radius: 18px; padding: 18px; margin: 12px 0; }
.demo-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.demo-num-box  { background: var(--card); border-radius: 13px; padding: 8px 14px; text-align: center; flex: 1; }
.demo-label    { font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 3px; }
.demo-num-val  { font-family: 'Fredoka One', cursive; font-size: 1.9rem; color: white; }
.demo-op       { font-family: 'Fredoka One', cursive; font-size: 1.6rem; color: var(--muted); padding-bottom: 6px; }
.demo-btn      { width: 100%; padding: 13px; border-radius: 13px; border: none; color: white; font-family: 'Fredoka One', cursive; font-size: 1.05rem; cursor: pointer; transition: all 0.2s; min-height: 48px; }
.demo-btn:active { transform: scale(0.97); }
.demo-result   { margin-top: 12px; display: none; animation: fadeUp 0.3s ease; }
.demo-result.show { display: block; }
.demo-steps    { margin-top: 12px; display: none; animation: fadeUp 0.3s ease; }
.demo-steps.show  { display: block; }
.demo-step-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-family: 'Fredoka One', cursive; font-size: 0.9rem; }
.demo-step-row:last-child { border-bottom: none; }
.demo-arrow    { color: var(--orange); font-size: 1.05rem; }

.practice-section { margin-top: 28px; animation: fadeUp 0.4s 0.3s ease both; }
.practice-card    { background: var(--card); border-radius: 22px; padding: 22px 20px; border: 1px solid rgba(255,255,255,0.05); }
.practice-top     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.practice-title   { font-family: 'Fredoka One', cursive; font-size: 1.2rem; }
.stars-row        { display: flex; gap: 4px; }
.sr               { font-size: 1.3rem; filter: grayscale(1) opacity(0.25); transition: all 0.4s; }
.sr.on            { filter: none; animation: starPop 0.4s ease; }

.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.prog-track   { flex: 1; height: 9px; background: rgba(255,255,255,0.07); border-radius: 100px; overflow: hidden; }
.prog-fill    { height: 100%; border-radius: 100px; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.prog-label   { font-family: 'Fredoka One', cursive; font-size: 0.95rem; min-width: 36px; text-align: right; }

.problem-area { text-align: center; margin-bottom: 18px; }
.problem-q    { font-family: 'Fredoka One', cursive; font-size: clamp(2.8rem, 10vw, 4rem); color: white; margin-bottom: 6px; min-height: 56px; line-height: 1.1; }
.problem-sub  { color: var(--muted); font-size: 0.95rem; font-weight: 700; min-height: 22px; }

.hint-box, .live-visual, .mini-nl, .prac-frame, .visual-helper {
  background: var(--card2); border-radius: 15px; padding: 14px; margin-bottom: 14px;
  display: none; animation: fadeUp 0.3s ease; overflow-x: auto;
}
.hint-box.show, .live-visual.show, .mini-nl.show, .prac-frame.show, .visual-helper.show { display: block; }
.hint-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.95rem; font-weight: 700; line-height: 1.5; }
.hint-row:last-child { border-bottom: none; }
.hint-n { width: 24px; height: 24px; border-radius: 50%; font-family: 'Fredoka One', cursive; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lv-label, .pf-label, .vh-label { font-size: 0.78rem; font-weight: 800; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.lv-eq { font-family: 'Fredoka One', cursive; font-size: clamp(1rem, 3.5vw, 1.3rem); line-height: 2; text-align: center; }

.feedback-line { text-align: center; font-family: 'Fredoka One', cursive; font-size: 1.15rem; min-height: 30px; margin-bottom: 12px; }
.fb-ok  { color: #4ade80; }
.fb-err { color: var(--pink); }

.input-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ans-input {
  width: 130px; padding: 14px 10px; border-radius: 15px;
  border: 2px solid rgba(255,255,255,0.1);
  background: var(--card2); color: white;
  font-family: 'Fredoka One', cursive; font-size: 2rem;
  text-align: center; outline: none; transition: border-color 0.2s;
  -moz-appearance: textfield;
  min-height: 58px;
}
.ans-input::-webkit-outer-spin-button,
.ans-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ans-input:focus   { border-color: #a78bfa; }
.ans-input.correct { border-color: #4ade80; background: rgba(22,163,74,0.1); }
.ans-input.wrong   { border-color: var(--pink); background: rgba(255,61,154,0.08); animation: shake 0.35s ease; }

.btn { padding: 14px 22px; border-radius: 14px; border: none; font-family: 'Fredoka One', cursive; font-size: 1.05rem; cursor: pointer; transition: all 0.2s; white-space: nowrap; min-height: 50px; }
.btn:hover  { transform: translateY(-3px); }
.btn:active { transform: scale(0.97); }
.btn-check  { color: white; }
.btn-hint   { background: rgba(255,255,255,0.07); color: var(--muted); border: 1px solid rgba(255,255,255,0.1); }
.btn-next   { background: linear-gradient(135deg, var(--teal), var(--green)); color: white; }

.finished       { text-align: center; padding: 20px 0; display: none; }
.finished-emoji { font-size: clamp(52px,13vw,72px); display: block; margin-bottom: 12px; animation: float 2s ease-in-out infinite; }
.finished h2    { font-family: 'Fredoka One', cursive; font-size: clamp(1.6rem,5.5vw,2.1rem); margin-bottom: 8px; }
.finished p     { color: var(--muted); font-weight: 700; margin-bottom: 18px; font-size: 0.95rem; }
.finish-btns    { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.celebration { background: linear-gradient(135deg,rgba(124,58,237,0.15),rgba(255,61,154,0.15)); border: 1px solid rgba(167,139,250,0.3); border-radius: 18px; padding: 18px; margin-top: 14px; text-align: center; display: none; }
.celebration.show { display: block; animation: fadeUp 0.5s ease; }
.celebration h3 { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: var(--yellow); margin-bottom: 8px; }
.celebration p  { color: var(--muted); font-size: 0.9rem; font-weight: 700; line-height: 1.6; }
.all-stars      { font-size: 1.8rem; letter-spacing: 3px; display: block; margin: 8px 0; }

.partners-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 6px 0; }
.partner-card  { background: var(--card2); border-radius: 15px; padding: 14px 10px; text-align: center; border: 2px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.25s; user-select: none; -webkit-tap-highlight-color: transparent; }
.partner-card:hover  { transform: translateY(-3px); }
.partner-card:active { transform: scale(0.96); }
.partner-card.flipped { border-color: #4ade80; background: rgba(22,163,74,0.08); }
.pc-sum    { font-family: 'Fredoka One', cursive; font-size: 1.2rem; margin-bottom: 5px; }
.pc-dots   { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; margin: 5px 0; }
.pd        { width: 10px; height: 10px; border-radius: 50%; }
.pc-equals { font-family: 'Fredoka One', cursive; font-size: 0.85rem; color: var(--muted); transition: color 0.3s; }
.partner-card.flipped .pc-equals { color: #4ade80; }

.memory-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 10px 0; }
.mem-card    { background: var(--card2); border-radius: 13px; padding: 12px 6px; text-align: center; border: 2px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.22s; min-height: 62px; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.mem-card:hover    { border-color: #a78bfa; transform: translateY(-2px); }
.mem-card.selected { border-color: var(--yellow); background: rgba(255,214,10,0.08); }
.mem-card.matched  { border-color: #4ade80; background: rgba(22,163,74,0.1); pointer-events: none; }
.mem-card.wrong    { border-color: var(--pink); animation: shake 0.3s ease; }
.mem-front  { font-family: 'Fredoka One', cursive; font-size: 1.4rem; color: white; }
.mem-status { text-align: center; font-family: 'Fredoka One', cursive; font-size: 0.9rem; color: var(--muted); margin-top: 8px; min-height: 22px; }

.jump-sequence   { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center; margin-bottom: 8px; }
.jump-chip       { padding: 5px 11px; border-radius: 100px; font-family: 'Fredoka One', cursive; font-size: 0.88rem; }
.chip-start      { background: rgba(124,58,237,0.25); color: #c4b5fd; }
.chip-jump10     { background: rgba(255,107,53,0.25); color: var(--orange); }
.chip-jump-small { background: rgba(255,214,10,0.2);  color: var(--yellow); }
.chip-result     { background: rgba(22,163,74,0.25);  color: #4ade80; font-size: 1.05rem; }
.chip-arrow      { color: var(--muted); font-size: 0.95rem; }

/* ── DESKTOP ── */
@media (min-width: 900px) {
  html { font-size: 20px; }
  body { overflow-x: hidden; }
  .container { max-width: 860px; margin: 0 auto; padding: 32px 40px 64px; }
  .lessons-grid { grid-template-columns: 1fr 1fr; }
  .partners-grid { grid-template-columns: repeat(6,1fr); }
  .memory-grid { grid-template-columns: repeat(6,1fr); }
  .input-row { justify-content: center; }
}

/* ── MOBIL ── */
@media (max-width: 480px) {
  html { font-size: 18px; }
  .container { padding: 14px 12px 60px; }
  .problem-q { font-size: 2.5rem; }
  .ans-input { width: 100%; font-size: 2rem; }
  .input-row { flex-direction: column; }
  .btn { width: 100%; }
  .partners-grid { grid-template-columns: repeat(2,1fr); }
  .card-stars { display: none; }
}
