:root {
  --primary: #2d7ff9;
  --primary-hover: #1a66d6;
  --bg-main: #eef5ff;
  --bg-card: #ffffff;
  --text-dark: #2c3e50;
  --text-muted: #7f8c8d;
  --gold: #f39c12;
  --border-dash: #b4d2ff;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-dark);
  padding: 20px;
}

/* ================= CONTAINER ================= */
.container {
  max-width: 1400px;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================= HEADER ================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px 32px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(45, 127, 249, 0.06);
}

.back {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.back:hover {
  transform: translateX(-4px);
}

.student {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.points {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(243, 156, 18, 0.1);
  padding: 6px 16px;
  border-radius: 50px;
}

/* ================= MAIN CARD ================= */
.card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(45, 127, 249, 0.08);
}

.lessonTitle {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 6px;
}

.lessonInfo {
  text-align: center;
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
  background: rgba(45, 127, 249, 0.08);
  display: table;
  margin: 0 auto 16px auto;
  padding: 6px 16px;
  border-radius: 50px;
}

.questionCounter {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ================= GAMIFIED PROGRESS STARS ================= */
.starProgress {
  text-align: center;
  font-size: 24px;
  letter-spacing: 4px;
  color: #ddd;
  margin-bottom: 24px;
}
.starProgress span {
  transition: color 0.3s ease;
}
.starProgress span.active {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

/* ================= TWO-PANEL LAYOUT ================= */
.lessonLayout {
  display: flex;
  gap: 32px;
  margin-top: 16px;
}

/* LEFT PANEL (Math Engine) */
.leftPanel {
  flex: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 30px 24px;
  min-height: 500px;
}

.mathQuestion {
  font-size: 52px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  margin-top: 20px;
  color: #2c3e50;
}

.answerRow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  width: 100%;
}

.answerRow label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
}

.answerBox {
  width: 180px;
  height: 64px;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  border: 3px solid #cbdfff;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.answerBox:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45, 127, 249, 0.15);
}

/* RIGHT PANEL (Scratch Pad) */
.rightPanel {
  flex: 7;
  display: flex;
  flex-direction: column;
}

.rightPanel h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rightPanel h2::before {
  content: '📝';
}

#scratchPad {
  width: 100%;
  height: 440px;
  background: #ffffff;
  border: 3px dashed var(--border-dash);
  border-radius: var(--radius-md);
  cursor: crosshair;
}

/* ================= MODERN BUTTONS ================= */
.playButton {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-hover);
  transition: all 0.1s ease;
  width: auto;
}

.playButton:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--primary-hover);
}

#clearPad {
  align-self: flex-end;
  background: #e17055;
  box-shadow: 0 4px 0 #c24d32;
  font-size: 14px;
  padding: 8px 20px;
  margin-top: 12px;
}

#clearPad:active {
  box-shadow: 0 0 0 #c24d32;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 992px) {
  .lessonLayout {
    flex-direction: column;
  }
  .leftPanel, .rightPanel {
    width: 100%;
    flex: none;
  }
  .leftPanel {
    min-height: auto;
  }
}

.mathBlock{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    font-size:64px;
    font-weight:bold;
    line-height:1.2;
}

.top, .bottom{
    width:120px;
    text-align:right;
}

.line{
    border-top:4px solid #000;
    margin-top:8px;
}
