:root {
  --page-bg: #f6f5fb;
  --board-bg: #ffffff;
  --border: #d9d7e2;
  --text: #30303a;
  --muted: #4a4a55;
  --primary: #4a68f2;
  --primary-soft: #ddecff;
  --shadow: 0 12px 30px rgba(83, 74, 116, 0.12);
  --card-shadow: 0 8px 22px rgba(83, 74, 116, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

button {
  font: inherit;
}

.board {
  width: min(1820px, calc(100vw - 70px));
  min-height: calc(100vh - 70px);
  margin: 35px auto;
  display: grid;
  grid-template-columns: 33% 1fr;
  background: var(--board-bg);
  border: 1px solid #dad7e1;
  border-radius: 42px;
  box-shadow: var(--shadow);
  overflow: hidden;
}


.grades-panel {
  padding: 46px 38px 38px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 255, 0.98));
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

.panel-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 2.1vw, 3.1rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel-icon {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(180deg, #dff0ff 0%, #cbe2f6 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  flex: 0 0 auto;
}

.cap-cap {
  position: absolute;
  left: 50%;
  top: 31px;
  width: 43px;
  height: 24px;
  background: #4b67f1;
  transform: translateX(-50%);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}

.cap-cap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 24px;
  height: 10px;
  transform: translateX(-50%);
  background: #4b67f1;
  border-radius: 0 0 8px 8px;
}

.cap-tassel {
  position: absolute;
  left: 58px;
  top: 42px;
  width: 2px;
  height: 22px;
  background: #4b67f1;
  transform: rotate(12deg);
  transform-origin: top center;
}

.cap-tassel::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b67f1;
}

.grade-list {
  display: grid;
  gap: 28px;
}

.grade-item,
.subject-card {
  appearance: none;
  border: 0;
  text-align: left;
}

.grade-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 22px 18px 18px;
  border-radius: 22px;
  background: #f6f4fb;
  box-shadow: inset 0 0 0 1px #d8d5df, 0 6px 18px rgba(82, 74, 115, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.grade-item:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px #d8d5df, 0 10px 20px rgba(82, 74, 115, 0.12);
}

.grade-item.active {
  background: var(--primary);
  box-shadow: 0 10px 26px rgba(74, 104, 242, 0.28);
}

.grade-item.active .grade-title,
.grade-item.active .arrow-circle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.9);
}

.grade-item.active .arrow-circle::before {
  border-color: #fff;
}

.grade-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.grade-title {
  font-size: clamp(1.3rem, 1.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.arrow-circle {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(61, 61, 71, 0.65);
  display: grid;
  place-items: center;
  color: #4d4d57;
  flex: 0 0 auto;
}

.arrow-circle::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 1.7px solid currentColor;
  border-right: 1.7px solid currentColor;
  transform: rotate(45deg);
  margin-left: -3px;
}

.subjects-panel {
  padding: 58px 60px 44px;
}

.subjects-panel h2 {
  margin: 0 0 44px;
  color: var(--primary);
  font-size: clamp(2.1rem, 2.5vw, 3.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 70px 62px;
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 188px;
  padding: 34px 36px;
  border-radius: 36px;
  background: #fff;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(222, 222, 232, 0.85);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(83, 74, 116, 0.18);
}

.subject-card[data-action="navigate"] {
  outline: 2px solid transparent;
}

.subject-badge {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--badge-bg, #dbeeff);
}

.subject-badge img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.subject-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.subject-name {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.45rem, 1.7vw, 2.15rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.subject-desc {
  margin: 0;
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  line-height: 1.25;
  font-weight: 600;
  color: #35353d;
}

.subject-arrow {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.4px solid rgba(69, 69, 82, 0.6);
  display: grid;
  place-items: center;
  color: #4f4f58;
  flex: 0 0 auto;
}

.subject-arrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 1.7px solid currentColor;
  border-right: 1.7px solid currentColor;
  transform: rotate(45deg);
  margin-left: -3px;
}

@media (max-width: 1180px) {
  .board {
    grid-template-columns: 1fr;
  }

  .grades-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .subject-grid {
    gap: 24px;
  }
}

@media (max-width: 780px) {
  .board {
    width: calc(100vw - 24px);
    margin: 12px auto;
    border-radius: 28px;
  }

  .grades-panel,
  .subjects-panel {
    padding: 22px;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .grade-item,
  .subject-card {
    border-radius: 24px;
  }

.subject-card {
    min-height: auto;
    padding: 24px;
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-icon--math {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f5e9ff 0%, #dcc7ff 100%);
  background-image: url('../assets/grade4.png');
  background-size: contain;
}

.math-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(74, 104, 242, 0.13);
  color: #4a68f2;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(74, 104, 242, 0.08);
}

.math-board {
  grid-template-columns: 36% 1fr;
}

.math-topics-panel {
  padding-right: 34px;
}

.math-topic-list {
  display: grid;
  gap: 22px;
}

.math-topic-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px 18px 18px;
  border: 0;
  border-radius: 24px;
  background: #f6f4fb;
  box-shadow: inset 0 0 0 1px #d8d5df, 0 6px 18px rgba(82, 74, 115, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.math-topic-item:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px #d8d5df, 0 10px 20px rgba(82, 74, 115, 0.12);
}

.math-topic-item.active {
  background: #4a68f2;
  box-shadow: 0 10px 26px rgba(74, 104, 242, 0.28);
}

.math-topic-item.active .math-topic-name,
.math-topic-item.active .math-topic-hint,
.math-topic-item.active .arrow-circle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.9);
}

.math-topic-item.active .arrow-circle::before {
  border-color: #fff;
}

.math-topic-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--topic-bg);
  color: var(--topic-fg);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.math-topic-badge img{
  width: 100%;
}

.math-topic-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.math-topic-name {
  color: var(--text);
  font-size: clamp(1.2rem, 1.3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.math-topic-hint {
  color: #5f6270;
  font-size: 0.95rem;
  font-weight: 600;
}

.math-subtopics-panel {
  padding-top: 58px;
}

.math-helper {
  margin: -26px 0 34px;
  color: #5f6270;
  font-size: 1rem;
  font-weight: 600;
}

.math-subtopic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.math-subtopic-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 128px;
  padding: 26px 24px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(222, 222, 232, 0.85);
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.math-subtopic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(83, 74, 116, 0.18);
}

.math-subtopic-card[data-action="navigate"] {
  outline: 2px solid transparent;
}

.math-subtopic-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--subtopic-bg);
  color: var(--subtopic-fg);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.math-subtopic-copy {
  min-width: 0;
}

.math-subtopic-copy h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.1;
  font-weight: 800;
}

.math-subtopic-copy p {
  margin: 0;
  color: #4b4f5d;
  font-size: 0.96rem;
  line-height: 1.35;
  font-weight: 600;
}

.math-subtopic-index {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f4f8;
  color: #5c6270;
  font-size: 0.9rem;
  font-weight: 800;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .math-board {
    grid-template-columns: 1fr;
  }

  .math-topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-subtopic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .math-topic-list {
    grid-template-columns: 1fr;
  }

  .math-subtopic-card {
    min-height: auto;
    padding: 22px;
  }

  .math-topic-item {
    border-radius: 22px;
  }
}
