:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-input: #0b1120;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --accent: #eab308;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 12px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* ---------------- AUTH SCREEN ---------------- */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
}

.app-logo {
  font-size: 3rem;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------------- INPUTS & BUTTONS ---------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: normal;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-accent {
  background: #d97706;
  color: #fff;
}
.btn-accent:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

/* ---------------- APP HEADER & NAV ---------------- */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stat-pill strong {
  color: var(--text-main);
}
.due-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.due-pill strong {
  color: #fbbf24;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  font-size: 0.85rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Tab navigation */
.sub-nav {
  display: flex;
  overflow-x: auto;
  background: #131d31;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------------- MAIN LAYOUT ---------------- */
.main-content {
  flex: 1;
  padding: 30px 20px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.page-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome-banner {
  text-align: center;
  padding: 20px;
}
.welcome-banner h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.welcome-banner p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Mode List & Card Layout */
.modes-list-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* Wide Mode Cards (Üben & Handlungssituationen) */
.mode-card-wide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.7) 100%);
}
.mode-header-wide {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mode-title-desc {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mode-title-row h3 {
  font-size: 1.35rem;
  margin: 0;
}
.badge-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.mode-action-wrap {
  display: flex;
  align-items: center;
}

/* 2x2 Progress Grid in Top-Right */
.progress-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 10px 14px;
  flex: 1;
  max-width: 480px;
  min-width: 290px;
}
.progress-grid-2x2 .progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-grid-2x2 .progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.progress-grid-2x2 .progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-grid-2x2 .progress-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
}

/* Bottom Action Row in Wide Cards */
.mode-bottom-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.mode-highscore-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #facc15;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.28);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mode-highscore-badge .highscore-val {
  color: #fef08a;
  font-weight: 700;
}

.quiz-highscore-tag {
  display: inline-block;
  font-size: 0.88rem;
  color: #facc15;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.quiz-record-alert {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.35));
  border: 2px solid #eab308;
  color: #fef08a;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 14px 0;
  text-align: center;
}

/* 4 Progress Bars Stack */
.progress-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
}
.progress-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.progress-bars-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 18px;
}
.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.progress-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.fill-green {
  background: linear-gradient(90deg, #059669, #10b981);
}
.fill-yellow {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}
.fill-red {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}
.fill-gray {
  background: linear-gradient(90deg, #475569, #64748b);
}

/* Rows for Flat/Compact Mode Cards */
.mode-row-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.mode-row-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.mode-card-flat {
  padding: 16px 20px;
}
.mode-flat-content {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.mode-flat-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-flat-text h3 {
  font-size: 1.15rem;
  margin: 0;
}
.mode-flat-text p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

/* Type Badges (Wert vs Definition) */
.badge-wert {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-def {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.mode-icon {
  font-size: 2.2rem;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stats-card h3 {
  margin-bottom: 16px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-box {
  background: var(--bg-main);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------------- CARD CONTAINER / BOXES ---------------- */
.card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.setup-box {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-box h2 {
  font-size: 1.8rem;
}

.setup-box .desc {
  color: var(--text-muted);
  line-height: 1.5;
}

.rating-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--bg-main);
  padding: 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.config-group {
  align-items: center;
  gap: 12px;
}

.count-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.count-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.count-btn.active, .count-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

#practice-card-count {
  width: 70px;
  padding: 8px;
  text-align: center;
}

/* ---------------- PROGRESS BAR ---------------- */
.session-progress-bar-container {
  max-width: 700px;
  margin: 0 auto 20px auto;
}

.session-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.round-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

/* ---------------- FLASHCARD DISPLAY ---------------- */
.flashcard-wrapper {
  max-width: 700px;
  margin: 0 auto;
  perspective: 1000px;
}

.flashcard {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.side-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  margin-bottom: 16px;
}

.card-face-back .side-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.card-face-back {
  border-top: 2px dashed var(--border-color);
  margin-top: 20px;
  padding-top: 20px;
}

.card-content-text {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-main);
  word-break: break-word;
}

.card-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Controls under card */
.card-controls {
  max-width: 700px;
  margin: 24px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn-flip {
  min-width: 220px;
}

.rating-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.btn-rating {
  flex: 1;
  max-width: 180px;
  padding: 16px 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, background-color 0.2s;
  font-family: inherit;
}
.btn-rating:hover {
  transform: translateY(-3px);
}
.btn-rating .rating-icon {
  font-size: 1.8rem;
}
.btn-rating .rating-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-rating-red {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-rating-red:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-rating-yellow {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}
.btn-rating-yellow:hover {
  background: rgba(245, 158, 11, 0.3);
}

.btn-rating-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.btn-rating-green:hover {
  background: rgba(16, 185, 129, 0.3);
}

.finish-icon {
  font-size: 3.5rem;
}

/* ---------------- TEST MODUS ---------------- */
.test-question-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.test-question-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.55;
  color: #93c5fd;
}

.test-input-group textarea {
  resize: vertical;
  min-height: 100px;
}

.results-header {
  text-align: center;
  margin-bottom: 24px;
}
.score-display {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.result-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-box {
  background: var(--bg-main);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.result-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.result-box-content {
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.result-eval-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.eval-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.eval-checkbox-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

/* ---------------- WER WIRD MILLIONÄR ---------------- */
.quiz-header-bar {
  max-width: 700px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-score-pill {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.quiz-question-box {
  max-width: 700px;
  margin: 0 auto 24px auto;
  background: var(--bg-card);
  border: 2px solid #6366f1;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  text-align: center;
}

.quiz-question-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
}

.quiz-options-grid {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quiz-option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.35;
}
.quiz-option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: #6366f1;
  transform: translateY(-2px);
}
.option-letter {
  background: rgba(255, 255, 255, 0.1);
  color: #a5b4fc;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #a7f3d0;
  animation: pulseGreen 0.5s;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5;
  animation: shake 0.3s;
}

@keyframes pulseGreen {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-next-container {
  max-width: 700px;
  margin: 24px auto 0 auto;
  text-align: center;
}

/* ---------------- ADMIN VIEW ---------------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.admin-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.admin-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-tab-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.proposals-list, .cards-admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proposal-item, .card-item-admin {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.proposal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.add-password-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.flex-1 {
  flex: 1;
  min-width: 180px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------------- ALERTS ---------------- */
.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
}
.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 650px) {
  .app-header {
    padding: 10px 14px;
  }
  .header-center {
    display: none;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .result-columns {
    grid-template-columns: 1fr;
  }
  .rating-buttons {
    flex-direction: column;
  }
  .btn-rating {
    max-width: 100%;
    flex-direction: row;
    justify-content: center;
  }
}

/* ================= HANDLUNGSSITUATIONEN STYLES ================= */
.situations-wrapper {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.situations-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 22px 26px;
  gap: 20px;
}

.situations-banner h2 {
  font-size: 1.45rem;
  margin-bottom: 6px;
  color: #6ee7b7;
}

.situations-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.situations-stats-pill {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.situations-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.situations-filter-grid {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.situations-filter-grid .flex-2 {
  flex: 2;
  min-width: 260px;
}

.situations-filter-grid .flex-1 {
  flex: 1;
  min-width: 160px;
}

.situations-action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
}

.triplet-nav-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.triplet-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.triplet-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.triplet-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.triplet-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.triplet-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.triplet-btn.learned {
  border-color: var(--success);
}

.situation-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.situation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.situation-index-counter {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.situation-header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-topic {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-variant {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.badge-status {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge-status.learned {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.5);
}

.badge-status.unsure {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.5);
}

.situation-main-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 20px;
  line-height: 1.4;
}

.situation-scenario-block {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 5px solid var(--danger);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.scenario-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fca5a5;
  font-size: 0.95rem;
}

.scenario-content {
  line-height: 1.65;
  color: #e2e8f0;
  font-size: 1rem;
  white-space: pre-wrap;
}

.situation-task-block {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.task-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fde047;
  font-size: 0.95rem;
}

.task-content {
  line-height: 1.6;
  color: #fef08a;
  font-weight: 500;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.scratchpad-box {
  margin-bottom: 22px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(11, 17, 32, 0.5);
}

.scratchpad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  user-select: none;
}

.scratchpad-header:hover {
  color: var(--text-main);
}

.scratchpad-body {
  margin-top: 10px;
}

.situation-reveal-row {
  margin-top: 10px;
}

.situation-solution-area {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease;
}

.solution-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.solution-title {
  font-size: 1.15rem;
  color: #6ee7b7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.solution-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.solution-step-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  line-height: 1.65;
  color: #f1f5f9;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.solution-step-card strong {
  color: #93c5fd;
}

.situation-rating-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.rating-prompt {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-main);
}

.situations-overview-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.overview-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.overview-box-header h3 {
  font-size: 1.25rem;
  color: #93c5fd;
}

.overview-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.overview-topic-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.overview-topic-card h4 {
  font-size: 0.95rem;
  color: #f8fafc;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.overview-variant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-variant-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.overview-variant-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.overview-variant-btn.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.2);
}

.overview-variant-btn.learned {
  border-left: 3px solid var(--success);
}

/* ================= FOOTER STYLES ================= */
.app-footer {
  margin-top: auto;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.7);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.footer-dot {
  color: rgba(148, 163, 184, 0.4);
}

/* ================= MODALS & OVERLAYS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.auth-modal-card {
  max-width: 420px;
  width: 100%;
  padding: 32px;
  text-align: center;
}

.legal-card {
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.5);
}

.legal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.legal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.legal-tab-btn.active {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.legal-modal-body {
  padding: 24px;
  overflow-y: auto;
  line-height: 1.65;
  color: #e2e8f0;
  font-size: 0.94rem;
}

.legal-modal-body h3 {
  font-size: 1.25rem;
  color: #93c5fd;
  margin-bottom: 8px;
}

.legal-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.legal-section-block {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.legal-section-block h4 {
  color: #60a5fa;
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.legal-modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.5);
}

/* ---------------- ACCOUNT SETTINGS & DATA TRANSPARENCY ---------------- */
.account-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.account-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
  margin-bottom: 8px;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.account-card.danger-card {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.03);
}

.account-card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.account-card-header .card-icon {
  font-size: 2rem;
  line-height: 1;
}

.account-card-header h3 {
  font-size: 1.22rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.account-card-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.account-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.data-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.data-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.account-info-note {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  color: #93c5fd;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-modal-link {
  text-align: center;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-modal-link a, .auth-modal-link span {
  color: #60a5fa;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.auth-modal-link a:hover, .auth-modal-link span:hover {
  color: #93c5fd;
}

/* ---------------- CATALOG & FEEDBACK STYLES ---------------- */
.catalog-container {
  max-width: 1100px;
  margin: 0 auto;
}

.catalog-filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  min-width: 280px;
}

.catalog-category-filter {
  display: flex;
  gap: 8px;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: #475569;
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.catalog-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.catalog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.catalog-card-term {
  font-size: 1.15rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1.35;
}

.catalog-card-def {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 14px;
  white-space: pre-line;
  word-break: break-word;
}

.catalog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 10px;
  margin-top: auto;
}

.btn-feedback {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-feedback:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.catalog-status-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------------- ADMIN FEEDBACK MODERATION ---------------- */
.admin-feedback-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.admin-feedback-type {
  font-weight: 600;
  color: #f59e0b;
}

.admin-feedback-user {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-feedback-content {
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.admin-feedback-card-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------------- TEST DIRECTION SELECTOR ---------------- */
.direction-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.direction-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.direction-btn:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.direction-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.direction-btn .dir-icon {
  font-size: 1.4rem;
}

.direction-btn .dir-text {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.direction-btn .dir-text small {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* ---------------- MATHE-TRAINER (FACHRECHNEN) ---------------- */
.math-trainer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.math-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.math-filter-header {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.math-subcat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.math-problem-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.math-problem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.math-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.math-actions-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.math-problem-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1.35;
}

.math-formula-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 8px 14px;
  border-radius: 8px;
  width: fit-content;
}

.math-formula-hint .hint-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
}

.math-formula-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  color: #e0e7ff;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.math-question-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 20px;
  white-space: pre-line;
}

.math-input-form {
  margin-top: 4px;
}

.math-input-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.math-field-wrapper {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.math-field-wrapper label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.math-input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.math-input-with-unit input {
  padding-right: 70px;
  font-size: 1.15rem;
  font-weight: 600;
}

.math-unit-badge {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  pointer-events: none;
}

.math-feedback-alert {
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.98rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}

.math-feedback-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.math-feedback-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.math-solution-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.math-toggle-solution-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.math-toggle-solution-btn:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

.math-solution-drawer {
  margin-top: 14px;
  animation: fadeIn 0.25s ease;
}

.math-solution-inner {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.math-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.math-step-card strong {
  color: #38bdf8;
  display: block;
  margin-bottom: 4px;
}

/* ---------------- HANDLUNGSSITUATIONEN & STÖRFALLMANAGEMENT ---------------- */
.situations-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.situations-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.situations-banner .banner-text h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #f87171;
}

.situations-banner .banner-text p {
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
  max-width: 750px;
}

.situations-stats-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #34d399;
}

.situations-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}

.situations-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.situations-filter-grid .flex-2 {
  flex: 2;
  min-width: 250px;
}

.situations-filter-grid .flex-1 {
  flex: 1;
  min-width: 180px;
}

.situations-action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
}

.triplet-nav-box {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.triplet-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.triplet-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.triplet-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.triplet-btn:hover {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

.triplet-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  font-weight: 700;
  color: #93c5fd;
}

.triplet-btn.learned {
  border-left: 3px solid #10b981;
}

.situation-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--shadow);
}

.situation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.situation-index-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: #93c5fd;
}

.situation-header-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-topic {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-variant {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-status {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-status.learned {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.badge-status.unsure {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.situation-main-title {
  font-size: 1.35rem;
  color: #f1f5f9;
  line-height: 1.4;
  margin: 0;
}

.situation-scenario-block,
.situation-task-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-block-header,
.task-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scenario-content {
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.65;
  font-size: 1.05rem;
  color: var(--text-main);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  padding: 18px 22px;
}

.task-content {
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.65;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 16px 20px;
}

.scratchpad-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.scratchpad-header-static {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #93c5fd;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border-color);
}

.scratchpad-header {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  user-select: none;
}

.scratchpad-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.scratchpad-body {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
}

.scratchpad-body textarea {
  width: 100%;
  resize: vertical;
}

.situation-reveal-row {
  margin-top: 8px;
}

.situation-solution-area {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.25s ease;
}

.solution-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.solution-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: #34d399;
}

.solution-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.solution-step-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.6;
  font-size: 0.98rem;
}

.solution-step-card strong {
  color: #6ee7b7;
  font-size: 1.02rem;
  display: block;
  margin-bottom: 6px;
}

.situations-overview-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}

.situations-overview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.overview-topic-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-topic-card h4 {
  font-size: 0.95rem;
  color: #93c5fd;
  margin: 0;
  line-height: 1.3;
}

.overview-variant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-variant-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.15s ease;
}

.overview-variant-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.overview-variant-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 600;
}

.overview-variant-btn.learned {
  border-left: 3px solid #10b981;
}

/* Badges & Moderation Styles */
.badge-crown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #facc15;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-diamond {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-checkmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-status-active {
  color: #34d399;
  font-weight: 600;
}

.badge-status-closed {
  color: #f87171;
  font-weight: 600;
}

.review-status-box {
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.review-status-box.info {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--border-color);
  color: var(--text-muted);
}

/* ================= CATEGORY MULTI-SELECT CHIPS & HEADINGS ================= */
.category-selection-wrapper {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.category-selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.category-selection-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.category-selection-buttons {
  display: flex;
  gap: 6px;
}

.category-selection-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-group-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
}

.category-heading-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 2px;
  text-align: left;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.category-heading-btn:hover {
  color: var(--primary);
}

.category-heading-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-heading-badge {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 12px;
}

.category-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-left: 4px;
}

.category-chip-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.category-chip-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.08);
}

.category-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.category-chip-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

.category-selection-status {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
}

/* ================= QUIZ MULTIPLIER ================= */
.quiz-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-multiplier-pill {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  transition: all 0.25s ease;
}

.quiz-multiplier-pill.pulse {
  animation: multiplierPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(239, 68, 68, 0.45));
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.quiz-multiplier-pill.reset {
  animation: multiplierShake 0.45s ease;
  border-color: #ef4444;
  color: #f87171;
  background: rgba(239, 68, 68, 0.25);
}

@keyframes multiplierPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes multiplierShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ================= TOP 3 BESTENLISTEN (GOLD, SILBER, BRONZE) ================= */
.top3-box {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.top3-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top3-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

/* Gold */
.top-gold {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

/* Silber */
.top-silver {
  color: #e2e8f0;
  background: rgba(226, 232, 240, 0.10);
  border-color: rgba(226, 232, 240, 0.35);
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.12);
}

/* Bronze */
.top-bronze {
  color: #f59e0b;
  background: rgba(205, 127, 50, 0.14);
  border-color: rgba(205, 127, 50, 0.45);
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.15);
}

.top-empty {
  color: #64748b;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  font-style: italic;
  font-weight: 500;
}

/* ================= TOP 3 OPT-IN CARD ================= */
.top3-optin-card {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.4);
  text-align: left;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.top3-optin-msg {
  font-size: 0.95rem;
  font-weight: 600;
  color: #bfdbfe;
  margin-bottom: 12px;
}

.top3-optin-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.top3-optin-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 0.9rem;
}

.top3-optin-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ================= XP & LEVEL SYSTEM STYLES ================= */
.stat-pill.level-pill {
  cursor: pointer;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.stat-pill.level-pill:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.level-mini-progress {
  width: 44px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.level-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.level-mini-xp {
  font-size: 0.72rem;
  color: #fef3c7;
  opacity: 0.85;
}

/* Home Dashboard Level Card */
.levels-dashboard-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.levels-dashboard-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.2);
}

.levels-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.overall-level-badge-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overall-star-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.overall-level-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overall-level-title-row h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fef3c7;
}

.overall-rank-title {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.overall-xp-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.overall-xp-total-box {
  text-align: right;
}

.total-xp-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.total-xp-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f59e0b;
}

.overall-progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.overall-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.domains-overview-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.domains-overview-title-row h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.domains-max-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 8 Domains Grid */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.domain-level-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.domain-level-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

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

.domain-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
}

.domain-icon {
  font-size: 1.15rem;
}

.domain-level-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.domain-xp-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.domain-xp-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.domain-xp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Specific Domain Bar Accents */
.domain-mathe .domain-xp-bar { background: linear-gradient(90deg, #6366f1, #a855f7); }
.domain-chemie .domain-xp-bar { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.domain-biologie .domain-xp-bar { background: linear-gradient(90deg, #10b981, #34d399); }
.domain-mechanik .domain-xp-bar { background: linear-gradient(90deg, #f97316, #fb923c); }
.domain-elektrotechnik .domain-xp-bar { background: linear-gradient(90deg, #eab308, #fde047); }
.domain-sicherheit .domain-xp-bar { background: linear-gradient(90deg, #ef4444, #f87171); }
.domain-praxis .domain-xp-bar { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.domain-allgemein .domain-xp-bar { background: linear-gradient(90deg, #64748b, #94a3b8); }

/* Overall Banner in Modal */
.overall-level-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 16px 20px;
}

.overall-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.overall-badge-pill {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* Floating XP Indicator */
.floating-xp-indicator {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(245, 158, 11, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: floatUpFade 1.3s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}

@keyframes floatUpFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -15px) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -35px) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -55px) scale(0.9);
  }
}

/* Level Up Toast & Celebration */
.level-up-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  border: 2px solid #fef08a;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5), 0 0 20px rgba(254, 240, 138, 0.6);
  color: #0f172a;
  padding: 16px 28px;
  border-radius: 16px;
  text-align: center;
  z-index: 10000;
  pointer-events: auto;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-toast.active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.levelup-sparkle {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #451a03;
  margin-bottom: 4px;
}

.levelup-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
  animation: levelUpBounce 0.8s infinite alternate ease-in-out;
}

@keyframes levelUpBounce {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.18) translateY(-4px); }
}

.levelup-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin-bottom: 2px;
}

.levelup-desc {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fef3c7;
}
