/* styles.css · partea 3/5 */
.lesson-check:hover,
.lesson-check[aria-pressed="true"] {
  color: #071b19;
  border-color: var(--domain-accent);
  background: var(--domain-accent);
}

.subject-cta {
  width: min(100% - 80px, 1360px);
  margin: 100px auto;
  padding: 50px 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 20px 48px rgba(17, 21, 61, 0.09);
}

.subject-cta h2 {
  max-width: 780px;
  font-size: clamp(2.5rem, 4vw, 4.25rem);
}

/* Problem library */

.problems-page {
  --domain-accent: var(--teal);
}

.problems-hero {
  padding: 85px max(40px, calc((100vw - 1360px) / 2)) 78px;
  display: grid;
  grid-template-columns: 1.2fr 0.65fr;
  gap: 85px;
  align-items: end;
  color: white;
  background:
    radial-gradient(circle at 88% 20%, rgba(34, 184, 167, 0.16), transparent 25%),
    linear-gradient(125deg, #11153d, #090d29);
}

.problems-hero .subject-breadcrumb {
  margin-bottom: 48px;
}

.problems-hero .kicker {
  color: var(--teal);
}

.problems-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 5.4vw, 6.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.problems-hero > p {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  line-height: 1.75;
}

.problem-explorer-wrap {
  width: min(100% - 80px, 1360px);
  margin: 0 auto;
  padding: 68px 0 110px;
}

.problem-tools {
  padding: 25px;
  display: grid;
  grid-template-columns: 1.05fr 0.7fr 0.45fr 0.75fr;
  gap: 22px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 15px 38px rgba(17, 21, 61, 0.07);
}

.filter-group > span,
.filter-group label,
.problem-search label {
  display: block;
  margin: 0 0 10px 2px;
  color: #6d746f;
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-buttons button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #555c5a;
  background: #faf9f4;
  cursor: pointer;
  font-size: 0.78rem;
}

.filter-buttons button:hover,
.filter-buttons button.active {
  color: #061a18;
  border-color: var(--teal);
  background: var(--teal-pale);
}

.filter-level select,
.problem-search > div {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #343a3b;
  background: #faf9f4;
}

.filter-level select {
  padding: 0 12px;
}

.problem-search > div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.problem-search > div span {
  color: var(--teal-dark);
  font-size: 1.2rem;
}

.problem-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.78rem;
}

.problem-results-heading {
  margin: 32px 0 20px;
  display: flex;
  justify-content: space-between;
  color: #737976;
  font-size: 0.76rem;
}

.problem-results-heading p {
  margin: 0;
}

.problem-results-heading strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.problem-card {
  --problem-color: #ef7652;
  position: relative;
  min-height: 310px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(253, 252, 248, 0.78);
  box-shadow: 0 12px 30px rgba(17, 21, 61, 0.055);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.problem-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--problem-color);
}

.problem-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--problem-color) 65%, transparent);
  box-shadow: 0 18px 39px rgba(17, 21, 61, 0.1);
}

.problem-astronomie { --problem-color: #39a6dc; }

.problem-astrofizica { --problem-color: #8d72e8; }

.problem-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.problem-card-header span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #686f6d;
  background: #f0efe9;
  font-size: 0.61rem;
}

.problem-card-header span:first-child {
  color: color-mix(in srgb, var(--problem-color) 80%, #17203a);
  background: color-mix(in srgb, var(--problem-color) 13%, white);
}

.problem-chapter {
  margin: 32px 0 10px !important;
  color: color-mix(in srgb, var(--problem-color) 76%, #243047) !important;
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.62rem !important;
  font-weight: 740;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.problem-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.problem-card > p:not(.problem-chapter) {
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.problem-card-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(17, 21, 61, 0.09);
}

.problem-card-footer > span {
  color: #838a87;
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.63rem;
}

.problem-card-footer button {
  padding: 0;
  border: 0;
  color: color-mix(in srgb, var(--problem-color) 83%, #18213d);
  background: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
}

.problem-card-footer button span {
  display: inline-block;
  margin-left: 6px;
  transition: transform 160ms ease;
}

.problem-card-footer button:hover span { transform: translateX(4px); }

.solved-stamp {
  position: absolute;
  right: 20px;
  bottom: 72px;
  color: var(--teal-dark);
  font-size: 0.65rem;
  font-weight: 750;
}

.problem-card.is-solved {
  border-color: rgba(34, 184, 167, 0.42);
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.empty-state button {
  margin-top: 10px;
  padding: 10px 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: #08231f;
  background: var(--teal-pale);
  cursor: pointer;
}

.dialog-open { overflow: hidden; }

.problem-dialog-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 24, 0.73);
  backdrop-filter: blur(12px);
}

.problem-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  padding: 38px;
  overflow-y: auto;
  border-radius: 19px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.dialog-close {
  position: absolute;
  right: 20px;
  top: 18px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 1.45rem;
}

.dialog-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-right: 45px;
}

.dialog-labels span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #626967;
  background: #eeede7;
  font-size: 0.61rem;
}

.problem-dialog h2 {
  margin: 25px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dialog-statement {
  color: #444b4d;
  font-size: 0.98rem;
  line-height: 1.75;
}

.problem-formula {
  margin: 24px 0;
  padding: 21px;
  border-left: 3px solid var(--teal);
  color: var(--indigo);
  background: #efeee8;
  font-family: var(--font-geist-mono), monospace;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

.problem-hint {
  margin: 20px 0;
  padding: 15px 17px;
  border: 1px solid rgba(34, 184, 167, 0.25);
  border-radius: 10px;
  background: rgba(216, 241, 235, 0.4);
}

.problem-hint summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.problem-hint p {
  margin: 12px 0 0;
  color: #58615e;
  font-size: 0.83rem;
  line-height: 1.6;
}

.reveal-solution {
  margin-top: 3px;
  cursor: pointer;
}

.solution-block {
  margin-top: 27px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.solution-block .kicker { margin-bottom: 17px; }

.solution-block ol {
  margin: 0;
  padding-left: 24px;
}

.solution-block li {
  padding: 8px 0 8px 7px;
  color: #4d5554;
  font-size: 0.88rem;
  line-height: 1.65;
}

.final-answer {
  margin-top: 20px;
  padding: 17px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-radius: 10px;
  background: var(--teal-pale);
}

.final-answer span {
  color: #4b6662;
  font-size: 0.72rem;
}

.final-answer strong {
  color: #0e5d54;
  font-family: var(--font-geist-mono), monospace;
}

.dialog-footer {
  margin-top: 26px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.mark-solved {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #5d6462;
  background: transparent;
  cursor: pointer;
  font-size: 0.74rem;
}

.mark-solved.is-active {
  color: #0c5f56;
  border-color: rgba(34, 184, 167, 0.5);
  background: var(--teal-pale);
}

.dialog-footer > span {
  color: #939896;
  font-size: 0.61rem;
}

/* Leaderboard */

.leaderboard-page {
  --domain-accent: var(--teal);
}

.leaderboard-hero {
  position: relative;
  min-height: 470px;
  padding: 78px max(40px, calc((100vw - 1360px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.52fr);
  gap: 86px;
  align-items: end;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 88% 14%, rgba(34, 184, 167, 0.2), transparent 27%),
    linear-gradient(126deg, #11153d 0%, #090d29 100%);
}

.leaderboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 94px 94px;
  mask-image: linear-gradient(90deg, transparent 24%, #000 100%);
}

.leaderboard-hero-copy,
.leaderboard-hero-note {
  position: relative;
  z-index: 1;
}

.leaderboard-hero .subject-breadcrumb {
  margin-bottom: 50px;
}

.leaderboard-hero .kicker {
  color: var(--teal);
}

.leaderboard-hero h1 {
  max-width: 930px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.7rem, 5.5vw, 6.25rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.052em;
}

.leaderboard-hero-note {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
}

.leaderboard-hero-note .live-dot {
  width: 9px;
  height: 9px;
  margin-right: 9px;
  display: inline-block;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(34, 184, 167, 0.12);
}

.leaderboard-hero-note strong {
  color: var(--teal);
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.leaderboard-hero-note p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.86rem;
  line-height: 1.7;
}

.leaderboard-wrap {
  width: min(100% - 80px, 1360px);
  margin: 0 auto;
  padding: 68px 0 110px;
}

.leaderboard-toolbar {
  padding: 20px 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 15px 38px rgba(17, 21, 61, 0.07);
}

.leaderboard-toolbar > div:first-child > span {
  display: block;
  margin: 0 0 10px 2px;
  color: #6d746f;
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
