@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700;9..40,800&family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap");

/* WORTDAF — Dashboard */

:root {
  --canvas: #f3f7f4;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #173229;
  --ink-soft: #4a5f57;
  --muted: #6f8078;
  --line: #dfe7e2;
  --line-strong: #c9d6cf;
  --green: #22b573;
  --green-dark: #178a57;
  --green-soft: #e2f6ec;
  --green-border: #a8d9c2;
  --yellow: #ffb703;
  --yellow-dark: #d98f00;
  --yellow-soft: #fff4d6;
  --blue: #2f80ed;
  --blue-soft: #e5effd;
  --red: #e5533d;
  --red-soft: #fdeae6;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 0 rgba(23, 50, 41, 0.06);
  --shadow-button: 0 4px 0 var(--green-dark);
  --shadow-button-active: 0 1px 0 var(--green-dark);
  --transition: 140ms ease;

  /* Dashboard aliases */
  --ink-secondary: var(--ink-soft);
  --surface-subtle: var(--surface-soft);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --green-deep: var(--green-dark);
  --green-tint: var(--green-soft);
  --amber: var(--yellow-dark);
  --amber-tint: var(--yellow-soft);
  --radius: var(--radius-md);
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(34, 181, 115, 0.45);
  outline-offset: 2px;
}

/* Header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;

  display: flex;
  align-items: center;
  gap: 14px;

  width: 100%;
  min-height: 72px;
  height: auto;

  margin: 0;
  padding: 8px clamp(16px, 4vw, 40px);

  background: var(--surface);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(110px, 18vw, 200px);
  height: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.edition {
  padding: 8px 14px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 2px solid var(--green-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.top-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--transition);
}

.top-link:hover {
  color: var(--green-dark);
}

.top-link span {
  margin-left: 4px;
  color: var(--green-dark);
}

/* Dashboard Layout */

.dashboard {
  width: 90%;
  max-width: 1700px;
  margin-inline: auto;
  padding: 28px 0 56px;
}

/* Welcome Section */

.welcome {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  align-items: center;
  gap: 28px;
  padding: 30px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome .eyebrow {
  color: var(--green-dark);
}

.welcome h1 {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.welcome h1 span {
  color: var(--green-dark);
  font-style: italic;
}

.welcome-text {
  max-width: 480px;
  margin: 16px 0 26px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

/* Main Button */

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  height: auto;
  padding: 12px 18px;
  color: #ffffff;
  background: var(--green);
  border: 0;
  border-bottom: 4px solid var(--green-dark);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-button);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition:
    transform var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.primary-btn:hover {
  color: #ffffff;
  background: #26c07b;
  transform: none;
}

.primary-btn:active {
  transform: translateY(3px);
  box-shadow: var(--shadow-button-active);
}

.primary-btn span {
  font-size: 16px;
}

.button-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex-shrink: 0;
}

.last-selection {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* Word Card */

.welcome-art {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.art-ring {
  display: none;
}

.word-tile {
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: var(--ink);
  background: var(--green-soft);
  border: 2px solid var(--green-border);
  border-radius: var(--radius-lg);
}

.word-tile small {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.word-tile strong {
  margin: 8px 0 6px;
  color: var(--green-dark);
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}

.word-tile > span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.word-chip {
  display: inline-block;
  align-self: flex-start;
  padding: 5px 10px;
  color: var(--green-dark);
  background: var(--surface);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

/* Statistics */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 36px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-right: 2px solid var(--line);
}

.stat-card:last-child {
  border-right: 0;
}

.stat-icon {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.stat-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* Section Headings */

.section-block {
  margin-bottom: 36px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
}

.section-heading h2,
.panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-caption {
  color: var(--muted);
  font-size: 13px;
}

/* Level Cards */

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

.level-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 20px;
  grid-template-rows: auto auto 1fr auto;
  column-gap: 18px;
  overflow: hidden;
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition:
    border-color var(--transition),
    background var(--transition);
}

.level-card:hover {
  border-color: var(--green-border);
  background: var(--green-soft);
  box-shadow: none;
}

.level-code {
  grid-column: 1;
  grid-row: 1 / 4;
  color: var(--green);
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 0.95;
}

.level-book {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.level-card h3 {
  grid-column: 2;
  grid-row: 2;
  margin: 4px 0 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.level-card p {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.level-meta {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  color: var(--muted);
  border-top: 2px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

.level-arrow {
  width: 20px;
  height: 20px;
  margin-left: auto;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.65;
  transition:
    transform var(--transition),
    opacity var(--transition);
}

.level-card:hover .level-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.mini-progress {
  grid-column: 1 / 4;
  grid-row: 5;
  height: 4px;
  margin: 18px -22px -22px;
  background: var(--surface-soft);
}

.mini-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.3s ease;
}

/* B2 Card */

.level-card-b2 {
  background: var(--surface);
  border-color: var(--line);
}

.level-card-b2:hover {
  background: var(--yellow-soft);
  border-color: #f4d488;
}

.level-card-b2 .level-code,
.level-card-b2:hover .level-arrow {
  color: var(--yellow-dark);
}

.level-card-b2 .mini-progress i {
  background: var(--yellow);
}

/* Bottom Panels */

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  padding: 22px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line);
}

.panel-heading .eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
}

.panel-heading h2 {
  font-size: 19px;
}

.panel-symbol {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 6px;
  object-fit: contain;
  background: var(--green-soft);
  border: 2px solid var(--green-border);
  border-radius: 12px;
}

.recent-content,
.word-content {
  padding-top: 16px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  margin-top: 14px;
  padding: 6px 0;
  color: var(--green-dark);
  background: none;
  border: 0;
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover {
  color: var(--green-dark);
  text-decoration: none;
}

.text-button span {
  margin-left: 5px;
}

.recent-item,
.recent-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 2px solid var(--line);
}

.recent-item:last-child,
.recent-entry:last-child {
  border-bottom: 0;
}

.recent-item a,
.recent-entry a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.word-content strong,
.word-main {
  display: block;
  color: var(--green-dark);
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.word-content p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* Footer */

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  margin-top: 32px;
  color: var(--muted);
  border-top: 2px solid var(--line);
  font-size: 12px;
}

footer b {
  padding: 0 6px;
  color: var(--line-strong);
}

/* Typography */

body,
button,
input,
select,
.text-button {
  font-family: "DM Sans", "Noto Sans Arabic", system-ui, sans-serif;
}

/* Responsive */

@media (max-width: 900px) {
  .welcome {
    grid-template-columns: 1fr;
    padding: 36px 32px;
  }

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

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(-n + 2) {
    border-bottom: 2px solid var(--line);
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 64px;
    height: auto;
    padding-inline: 8px 16px;
  }

  .dashboard {
    width: calc(100% - 28px);
    padding-top: 18px;
  }

  .welcome {
    padding: 20px 18px;
  }

  .section-heading {
    flex-direction: column;
    gap: 4px;
  }

  .levels-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-card {
    padding: 12px;
  }

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(-n + 2) {
    border-bottom: 2px solid var(--line);
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Learning Path — Welcome Visual */

.welcome-art {
  min-width: 0;
}

.learning-path {
  position: relative;
  padding: 26px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
}

.path-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.path-label {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.path-caption {
  padding: 5px 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.path-title {
  display: flex;
  flex-direction: column;
  margin-top: 30px;
  line-height: 1.35;
}

.path-title span {
  color: var(--ink-soft);
  font-size: 17px;
}

.path-title strong {
  color: var(--ink);
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.level-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 34px;
}

.path-line {
  position: absolute;
  top: 16px;
  left: 12%;
  right: 12%;
  height: 3px;
  background: var(--line-strong);
}

.path-level {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.level-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.path-level.active .level-dot {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green-dark);
}

.path-level strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.path-level small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.path-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
  padding-top: 17px;
  border-top: 2px solid var(--line);
}

.path-footer > span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.path-footer-line {
  flex: 1;
  height: 3px;
  background: var(--green-border);
}

.path-footer p {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 700px) {
  .learning-path {
    padding: 20px 14px;
  }

  .path-title {
    margin-top: 22px;
  }

  .path-title strong {
    font-size: 22px;
  }

  .level-path {
    gap: 3px;
  }

  .path-level small {
    font-size: 9px;
  }

  .path-footer p {
    font-size: 12px;
  }
}

/* =================================
   Dashboard Action Buttons
================================= */

/* Öffnen */

.recent-item a,
.recent-entry a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 36px;
  padding: 7px 13px;

  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);

  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.recent-item a:hover,
.recent-entry a:hover {
  color: var(--green-dark);
  background: #d3f0e1;
  border-color: var(--green);
}

/* Anderes Wort anzeigen */

#newWordBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 40px;
  padding: 8px 12px;

  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);

  font-family: inherit;
  font-size: 12px;
  font-weight: 800;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

#newWordBtn:hover {
  background: #d3f0e1;
  border-color: var(--green);
}

#newWordBtn .button-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  object-fit: contain;
  flex-shrink: 0;
}

/* Keep both buttons aligned */

/* Recent Activity — Layout */

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
}

.recent-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.recent-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.recent-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.recent-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 76px;
  padding: 9px 12px;
  white-space: nowrap;
}

.recent-open .dashboard-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Word of the Day Button */

#newWordBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

#newWordBtn .button-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Mobile */

@media (max-width: 600px) {
  .recent-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .recent-open {
    justify-self: start;
  }
}

/* Topbar — refined edition and navigation */

/* Topbar navigation */

.edition {
  padding: 0;
  color: var(--muted);
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.top-link:hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--ink-soft);
  text-decoration: none;
}

.top-link span {
  margin: 0;
  color: var(--ink-soft);
}

#newWordBtn:hover {
  text-decoration: none;
}

/* A1–B2: simple neutral label */
.topbar .edition {
  padding: 8px 14px;
  color: var(--green-dark);
  background: var(--yellow-soft);
  border: 2px solid #f4d488;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.topbar .top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 140ms ease;
}

.topbar .top-link:hover {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: var(--green-border);
  text-decoration: none;
}

/* WORTDAF — Book Cover Level Colors */

/* A1 — Kurs DaF */
.level-card[href*="level=A1"] {
  --level-color: #b0c050;
  --level-tint: #f5f7e9;
  --level-border: #dce3ad;
}

/* A2 — Kurs DaF */
.level-card[href*="level=A2"] {
  --level-color: #50c0c0;
  --level-tint: #eaf7f7;
  --level-border: #b5e2e2;
}

/* B1 — Kurs DaF */
.level-card[href*="level=B1"] {
  --level-color: #80c080;
  --level-tint: #eff7ef;
  --level-border: #c4e0c4;
}

/* B2 — Kontext */
.level-card[href*="level=B2"] {
  --level-color: #f06050;
  --level-tint: #fdf0ee;
  --level-border: #f2c2bc;
}

/* Apply colors */
.level-card[href*="level="] .level-code {
  color: var(--level-color);
}

.level-card[href*="level="] .mini-progress i {
  background: var(--level-color);
}

.level-card[href*="level="]:hover {
  background: var(--level-tint);
  border-color: var(--level-border);
}

.level-card[href*="level="]:hover .level-arrow {
  color: var(--level-color);
}

/* Remove old B2 yellow styling */
.level-card-b2,
.level-card-b2:hover {
  background: var(--surface);
  border-color: var(--line);
}

.level-card-b2 .level-code,
.level-card-b2:hover .level-arrow {
  color: var(--level-color);
}

.level-card-b2 .mini-progress i {
  background: var(--level-color);
}

/* Learning Path — Book Cover Colors */

/* A1 */
.level-path > .path-level:nth-child(2) .level-dot {
  color: #7e8b32;
  background: #f5f7e9;
  border-color: #b0c050;
}

.level-path > .path-level:nth-child(2) strong {
  color: #8d9c35;
}

/* A2 */
.level-path > .path-level:nth-child(3) .level-dot {
  color: #319b9b;
  background: #eaf7f7;
  border-color: #50c0c0;
}

.level-path > .path-level:nth-child(3) strong {
  color: #319b9b;
}

/* B1 */
.level-path > .path-level:nth-child(4) .level-dot {
  color: #579957;
  background: #eff7ef;
  border-color: #80c080;
}

.level-path > .path-level:nth-child(4) strong {
  color: #579957;
}

/* B2 */
.level-path > .path-level:nth-child(5) .level-dot {
  color: #d84e40;
  background: #fdf0ee;
  border-color: #f06050;
}

.level-path > .path-level:nth-child(5) strong {
  color: #d84e40;
}

/* Active Level */
.level-path .path-level.active .level-dot {
  color: #fff;
  background: var(--level-color, #b0c050);
  border-color: var(--level-color, #b0c050);
}

/* Connection Line */
.path-line {
  background: linear-gradient(
    to right,
    #b0c050 0%,
    #50c0c0 35%,
    #80c080 68%,
    #f06050 100%
  );
}

/* Footer Progress Line */
.path-footer-line {
  background: linear-gradient(to right, #b0c050, #50c0c0, #80c080, #f06050);
}

/* Neutralize the generic A1–B2 badge */
.path-caption {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
}

/* =================================
   Level Cards — Book Covers
================================= */

.level-card {
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 18px;
  align-items: stretch;
  min-height: 184px;
  padding: 18px;
}

/* Book Cover */

.level-cover {
  grid-column: 1;
  grid-row: 1;

  width: 92px;
  height: 132px;

  align-self: center;
  object-fit: cover;
  object-position: center;

  border: 1px solid var(--line);
  border-radius: 3px;
}

/* Card Content */

.level-card-content {
  grid-column: 2;
  grid-row: 1;

  display: flex;
  flex-direction: column;
  min-width: 0;
}

.level-card-content .level-code {
  font-size: 29px;
  line-height: 1.1;
}

.level-card-content .level-book {
  margin-top: 5px;
}

.level-card-content h3 {
  margin: 5px 0;
  font-size: 16px;
}

.level-card-content p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.level-card-content .level-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
}

.level-card-content .level-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--level-color);
  font-size: 20px;
  font-weight: 700;
}

/* Progress Bar */

.level-card .mini-progress {
  grid-column: 1 / -1;
  grid-row: 2;

  margin: 16px -18px -18px;
}

/* Mobile */

@media (max-width: 500px) {
  .level-card {
    grid-template-columns: 76px minmax(0, 1fr);
    column-gap: 14px;
    min-height: 160px;
    padding: 14px;
  }

  .level-cover {
    width: 76px;
    height: 110px;
  }

  .level-card .mini-progress {
    margin: 14px -14px -14px;
  }
}
.primary-btn .button-icon {
  filter: brightness(0) invert(1);
}

@media (max-width: 500px) {
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    min-width: 0;
  }

  .stat-card > div {
    min-width: 0;
    width: 100%;
  }

  .stat-card p {
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: break-word;
  }

  .stat-card strong {
    font-size: 22px;
  }

  .stat-card small {
    font-size: 11px;
    line-height: 1.4;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
}
@media (max-width: 500px) {
  .learning-path {
    padding: 14px 10px;
  }

  .path-title {
    margin-top: 14px;
  }

  .path-title span {
    font-size: 14px;
  }

  .path-title strong {
    font-size: 19px;
  }

  .level-path {
    margin-top: 22px;
    gap: 2px;
  }

  .level-dot {
    width: 30px;
    height: 30px;
    font-size: 9px;
  }

  .path-level {
    gap: 5px;
  }

  .path-level strong {
    font-size: 13px;
  }

  .path-level small {
    font-size: 9px;
  }

  .path-footer {
    margin-top: 18px;
    padding-top: 12px;
    gap: 6px;
  }

  .path-footer p {
    font-size: 9px;
  }
}
