/* FlinkFinger – Zehnfinger-Training – kid-friendly, high contrast, desktop-first */

:root {
  --bg: #f0f7ff;
  --surface: #ffffff;
  --text: #1a2a3a;
  --muted: #5a6a7a;
  --primary: #2b6cb0;
  --primary-dark: #1e4e8c;
  --success: #2f9e44;
  --success-bg: #d3f9d8;
  --warn: #e67700;
  --error-soft: #fa5252;
  --error-bg: #ffe3e3;
  --shadow: 0 8px 24px rgba(30, 60, 100, 0.12);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Finger colors */
  --f-lp: #ff6b6b; /* linker kleiner */
  --f-lr: #ffa94d; /* linker Ring */
  --f-lm: #ffd43b; /* linker Mittel */
  --f-li: #69db7c; /* linker Zeige */
  --f-th: #74c0fc; /* Daumen */
  --f-ri: #63e6be; /* rechter Zeige */
  --f-rm: #da77f2; /* rechter Mittel */
  --f-rr: #748ffc; /* rechter Ring */
  --f-rp: #f783ac; /* rechter kleiner */
}

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

html {
  font-size: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, #d0ebff 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, #e5dbff 0%, transparent 45%),
    var(--bg);
  line-height: 1.45;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.15rem 1.15rem 2.25rem;
}

.screen[hidden] {
  display: none !important;
}

.screen.active {
  display: block;
}

/* Hero / Menu */
.hero {
  text-align: center;
  margin-bottom: 1rem;
}

.brand-mark {
  margin: 0 0 0.15rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #2b6cb0, #9c36b5 55%, #e8590c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}

.hero h1,
.brand-title {
  margin: 0 0 0.3rem;
  font-size: 1.65rem;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.tip-box {
  background: var(--surface);
  border: 2px solid #a5d8ff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.35rem;
}

.tip-box kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 6px;
  background: #e7f5ff;
  border: 1px solid #74c0fc;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 700;
}

.home-hint {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.lesson-list {
  display: grid;
  gap: 0.75rem;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  border: 2px solid #d0ebff;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.lesson-card:hover,
.lesson-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 10px 28px rgba(43, 108, 176, 0.2);
}

.lesson-num {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
}

.lesson-body {
  flex: 1;
  min-width: 0;
}

.lesson-body strong {
  display: block;
  font-size: 1.05rem;
}

.lesson-body span {
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-best {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 700;
  white-space: nowrap;
}

.footer-note {
  text-align: center;
  margin-top: 1.4rem;
  color: var(--muted);
}

.footer-note p {
  margin: 0.35rem 0;
}

.footer-links {
  margin-top: 0.55rem !important;
}

.link-btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  border-bottom: 2px dotted #74c0fc;
  cursor: pointer;
  padding: 0.1rem 0;
}

.link-btn:hover,
.link-btn:focus-visible {
  color: var(--primary-dark);
  outline: none;
}

/* Practice */
.practice-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.practice-header h2 {
  margin: 0;
  flex: 1;
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #d0ebff;
}

.live-stats strong {
  color: var(--text);
}

.target-area {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
  border: 2px solid #d0ebff;
  min-height: 7rem;
}

.target-text {
  margin: 0;
  font-size: 1.85rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.04em;
  line-height: 1.7;
  word-break: break-word;
  text-align: center;
}

.char {
  display: inline-block;
  padding: 0 0.05em;
  border-radius: 4px;
  transition: background 0.1s ease, color 0.1s ease;
}

.char.done-ok {
  color: var(--success);
  background: var(--success-bg);
}

.char.done-bad {
  color: var(--error-soft);
  background: var(--error-bg);
  text-decoration: underline wavy var(--error-soft);
}

.char.current {
  background: #fff3bf;
  color: var(--text);
  outline: 3px solid #fab005;
  outline-offset: 1px;
  animation: pulse 1s ease-in-out infinite;
}

.char.space.current::before {
  content: "␣";
  opacity: 0.55;
}

@keyframes pulse {
  50% { outline-color: #fcc419; }
}

.input-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback {
  text-align: center;
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.feedback.ok { color: var(--success); }
.feedback.soft { color: var(--warn); }

/* Virtual keyboard */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #2c3e50;
  padding: 0.85rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  user-select: none;
  margin-bottom: 1rem;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.key {
  min-width: 2.35rem;
  height: 2.55rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  background: #eee;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.key.wide { min-width: 4rem; font-size: 0.75rem; }
.key.wider { min-width: 5.5rem; font-size: 0.75rem; }
.key.space { min-width: 18rem; }

.key.home-bump::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  margin-top: 0.15rem;
}

.key.f-lp { background: var(--f-lp); }
.key.f-lr { background: var(--f-lr); }
.key.f-lm { background: var(--f-lm); }
.key.f-li { background: var(--f-li); }
.key.f-th { background: var(--f-th); }
.key.f-ri { background: var(--f-ri); }
.key.f-rm { background: var(--f-rm); }
.key.f-rr { background: var(--f-rr); }
.key.f-rp { background: var(--f-rp); }
.key.f-none { background: #adb5bd; color: #495057; }

.key.hl-target {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #228be6, 0 4px 12px rgba(0, 0, 0, 0.35);
  filter: brightness(1.08);
  z-index: 1;
}

.key.hl-ok {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #2f9e44;
}

.key.hl-miss {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #fa5252;
}

/* Finger legend */
.finger-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  border: 1px solid #dee2e6;
}

.legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Done / celebration */
.celebration {
  text-align: center;
  background: var(--surface);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 3px solid #69db7c;
  max-width: 520px;
  margin: 2rem auto;
}

.celebration-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: bounce 0.8s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.celebration h2 {
  margin: 0 0 0.5rem;
  color: var(--primary-dark);
  font-size: 1.75rem;
}

.done-message {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.done-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.45rem;
  font-size: 1.05rem;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 2px 0 rgba(30, 60, 100, 0.08);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-dark);
  outline: none;
}

.btn-secondary {
  background: #e7f5ff;
  color: var(--primary-dark);
  border-color: #74c0fc;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #d0ebff;
  outline: none;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: #a5d8ff;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: #e7f5ff;
  outline: none;
}

.btn-danger {
  background: #fff5f5;
  color: #c92a2a;
  border-color: #ffa8a8;
  box-shadow: none;
  white-space: nowrap;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #ffe3e3;
  outline: none;
}

/* Tip level note */
.tip-levels {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Profile bar / chip */
.profile-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 2px solid #d0ebff;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow);
}

.profile-chip:hover,
.profile-chip:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.profile-chip-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.profile-chip-text strong {
  font-size: 0.95rem;
}

.profile-chip-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.profile-avatar.lg {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.25rem;
}

.btn-compact {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

/* Lesson badges / title row */
.lesson-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.15rem;
}

.lesson-title-row strong {
  display: inline;
}

.lesson-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e7f5ff;
  color: var(--primary-dark);
}

.lesson-badge.neu {
  background: #ffe8cc;
  color: #d9480f;
}

.lesson-badge.start {
  background: #d3f9d8;
  color: #2b8a3e;
}

.lesson-best {
  max-width: 11rem;
  white-space: normal;
  text-align: right;
  line-height: 1.25;
}

/* Profiles screen */
.profile-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.profile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
}

.profile-row .profile-card {
  flex: 1;
  min-width: 12rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 2px solid #d0ebff;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.profile-card:hover,
.profile-card:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.profile-card.active {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.18);
}

.card-panel {
  background: var(--surface);
  border: 2px solid #d0ebff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  margin: 0.55rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.text-input {
  width: 100%;
  max-width: 320px;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 2px solid #a5d8ff;
  margin-bottom: 0.35rem;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
}

.color-picker,
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatch.selected {
  border-color: #1a2a3a;
  box-shadow: 0 0 0 2px #fff inset;
}

.emoji-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  border: 2px solid #d0ebff;
  background: #f8fbff;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
}

.emoji-btn.selected {
  border-color: var(--primary);
  background: #e7f5ff;
}

.form-error {
  color: var(--error-soft);
  font-weight: 700;
  margin: 0.6rem 0 0;
}

.muted-note {
  color: var(--muted);
  margin: 0.25rem 0;
}

/* Progress / Fortschritt */
.progress-subtitle {
  color: var(--muted);
  margin: 0 0 1rem;
}

.progress-lessons {
  display: grid;
  gap: 0.85rem;
}

.progress-row {
  display: grid;
  gap: 0.25rem;
}

.progress-label strong {
  margin-right: 0.35rem;
}

.progress-label span {
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-meta {
  font-size: 0.88rem;
  color: var(--success);
  font-weight: 700;
}

.progress-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: #e7f5ff;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #69db7c, #2b6cb0);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.progress-trend {
  background: #fff9db;
  border: 1px solid #ffe066;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.85rem;
  font-weight: 600;
  color: #5c3d00;
}

.progress-history {
  display: grid;
  gap: 0.55rem;
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e7f5ff;
}

.history-item strong {
  display: block;
}

.history-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-stats {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.9rem;
  align-self: center;
}


/* Overview (Eltern/Lehrer) */
.overview-wrap {
  padding-top: 0.85rem;
}

.overview-table-scroll {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.overview-table th,
.overview-table td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid #e7f5ff;
  vertical-align: middle;
}

.overview-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overview-name {
  white-space: nowrap;
}

.overview-emoji {
  margin-right: 0.15rem;
}

.overview-card-grid {
  display: none;
  gap: 0.75rem;
}

.overview-card {
  border: 2px solid #d0ebff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #f8fbff;
}

.overview-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.overview-card-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.overview-card-stats li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.overview-card-stats span {
  color: var(--muted);
}

.school-tease {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.25rem 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fff9db;
  border: 1px dashed #ffe066;
  border-radius: 12px;
}

/* Privacy modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 42, 58, 0.45);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
  border: 2px solid #a5d8ff;
}

.modal-card h2 {
  margin: 0 0 0.65rem;
  color: var(--primary-dark);
  font-size: 1.25rem;
}

.modal-body {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.modal-body p {
  margin: 0 0 0.65rem;
}

@media (max-width: 720px) {
  html { font-size: 16px; }
  .target-text { font-size: 1.4rem; }
  .key { min-width: 1.7rem; height: 2.1rem; font-size: 0.8rem; }
  .key.space { min-width: 10rem; }
  .key.wide { min-width: 3rem; }
  .key.wider { min-width: 4rem; }
  .kb-row { gap: 0.2rem; }
  .keyboard { padding: 0.5rem; }
  .overview-table-scroll { display: none; }
  .overview-card-grid { display: grid; }
  .brand-mark { font-size: 1.35rem; }
  .hero h1,
  .brand-title { font-size: 1.4rem; }
  .profile-bar { gap: 0.5rem; }
}


/* ---------- Phase-1 Eltern-Auth Demo ---------- */
.demo-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #7c2d12;
  background: #ffec99;
  border: 1px solid #ffe066;
  border-radius: 999px;
}

.parent-link-status {
  display: flex;
  justify-content: center;
  margin: -0.25rem 0 0.85rem;
}

.parent-status-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #8ce99a;
}

.invite-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 640px) {
  .invite-layout {
    grid-template-columns: 1fr;
  }
}

.invite-code {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.invite-expiry {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--warn);
}

.qr-demo {
  width: min(180px, 100%);
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, #1a2a3a 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(#1a2a3a 25%, transparent 25%) 0 0 / 12px 12px,
    #f8f9fa;
  border: 3px solid #1a2a3a;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 10px #fff;
}

.qr-demo-inner {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #1a2a3a;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  text-align: center;
  max-width: 90%;
}

.qr-demo-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.qr-demo-code {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.parent-auth-actions,
.parent-dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.success-note {
  margin: 0.85rem 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #8ce99a;
}

.parent-dash-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.parent-dash-head p {
  margin: 0;
}

.parent-children-list {
  display: grid;
  gap: 0.75rem;
}

.parent-child-card {
  border: 2px solid #d0ebff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #f8fbff;
}

.parent-child-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.parent-child-head .name-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.parent-child-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.parent-child-stats li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.parent-child-stats span {
  color: var(--muted);
}

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0.75rem;
}

.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 1.35rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 50;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: #1a2a3a;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  text-align: center;
}

.demo-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.demo-toast[hidden] {
  display: block !important;
  visibility: hidden;
}

.demo-toast.show[hidden] {
  visibility: visible;
}

/* ---------- Keyboard layout / Shift layer ---------- */
.layout-chip-wrap {
  display: flex;
  justify-content: center;
  margin: -0.35rem 0 0.75rem;
}
.layout-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: #e7f5ff;
  border: 1px solid #74c0fc;
}
.keyboard-settings {
  margin: 0 0 1rem;
  text-align: left;
}
.keyboard-settings .text-input {
  margin-bottom: 0.65rem;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  margin: 0.35rem 0 0.75rem;
  cursor: pointer;
}
.key {
  position: relative;
  flex-direction: column;
  line-height: 1.05;
  font-size: 0.85rem;
}
.key-main {
  font-weight: 800;
}
.key-shift {
  position: absolute;
  top: 0.2rem;
  right: 0.28rem;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.55;
  color: #212529;
}
.key-alt {
  position: absolute;
  bottom: 0.15rem;
  left: 0.28rem;
  font-size: 0.55rem;
  font-weight: 700;
  opacity: 0.45;
  color: #495057;
}
.key-shift-active {
  opacity: 1;
  color: #1e4e8c;
  font-size: 0.72rem;
  top: 0.15rem;
}
.key-main-dim {
  opacity: 0.35;
}
.key-main-alt {
  color: #5f3dc4;
}
.key-mod {
  background: #ced4da !important;
  color: #212529;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 3.6rem;
}
.key-mod.mod-active,
.key.hl-shift,
.key.hl-alt {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #fcc419;
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.key.hl-shift {
  background: #ffe066 !important;
}
.key.hl-alt {
  background: #d0bfff !important;
}
.keyboard.shift-layer .key-shift {
  opacity: 0.95;
}
.keyboard.alt-layer .key-alt {
  opacity: 0.9;
  color: #5f3dc4;
}
@media (max-width: 720px) {
  .key-mod { min-width: 2.8rem; font-size: 0.65rem; }
  .key-shift, .key-alt { font-size: 0.5rem; }
}
select.text-input {
  appearance: auto;
  cursor: pointer;
}


/* ---- Audit follow-ups: locked lessons, banners, export, PIN ---- */
.lesson-card.lesson-locked {
  opacity: 0.62;
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #f1f5f9;
  box-shadow: none;
}
.lesson-card.lesson-locked:hover,
.lesson-card.lesson-locked:focus-visible {
  transform: none;
  border-color: #cbd5e1;
  box-shadow: none;
}
.lesson-card.lesson-locked .lesson-num {
  background: #94a3b8;
  font-size: 0.95rem;
}
.lesson-badge.locked {
  background: #64748b;
  color: #fff;
}
.unlock-all-row {
  width: 100%;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.device-banner {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 2px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.92rem;
  line-height: 1.4;
}
.device-banner-strong {
  border-color: #ea580c;
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.95rem;
}
.export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.profile-pin-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #334155;
  color: #fff;
}


/* ---------- Klassen-Invites Demo ---------- */
.class-roster-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
}
.class-roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.class-roster-table th,
.class-roster-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
  vertical-align: middle;
}
.class-roster-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.class-roster-table .text-input {
  margin: 0;
  width: 100%;
  min-width: 6rem;
}
.class-csv-paste {
  width: 100%;
  min-height: 6rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}
.class-mapping {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.class-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.class-mapping-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
}
.class-mapping-preview {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-x: auto;
}
.class-status-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.class-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.class-status-row strong {
  font-size: 0.95rem;
}
.class-status-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.status-pill.open {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}
.status-pill.linked {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #8ce99a;
}
.class-subhead {
  margin-top: 1.1rem;
  font-size: 1rem;
}
@media print {
  .practice-header, .device-banner, .footer-note { display: none !important; }
}


/* ================================================================
   FLINKFINGER PROGRESSION v1
   ================================================================ */

.progression-card {
  margin: 0 auto 1.35rem;
  padding: 1rem 1.15rem;
  background:
    radial-gradient(circle at 90% 10%, rgba(116, 192, 252, 0.22), transparent 35%),
    linear-gradient(135deg, #ffffff, #f7fbff);
  border: 2px solid #d0ebff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.progression-top,
.progression-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.progression-top {
  margin-bottom: 0.7rem;
}

.progression-tier {
  display: inline-block;
  margin-right: 0.55rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #e7f5ff;
  color: #1864ab;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.progression-tier[data-tier="SPORT"] {
  background: #e5dbff;
  color: #6741d9;
}

.progression-tier[data-tier="SUPERCAR"] {
  background: #fff3bf;
  color: #e67700;
}

.progression-tier[data-tier="HYPER"] {
  background: #d3f9d8;
  color: #2b8a3e;
}

.progression-tier[data-tier="MASTER"] {
  background: #ffe3e3;
  color: #c92a2a;
}

.progression-tier[data-tier="GOLD"] {
  background: linear-gradient(135deg, #fff3bf, #ffd43b);
  color: #7a4f00;
}

.progression-tier[data-tier="LEGEND"] {
  background: linear-gradient(135deg, #343a40, #7048e8);
  color: white;
}

.progression-level {
  font-size: 1.05rem;
}

.progression-xp-total {
  font-weight: 900;
  color: var(--primary-dark);
}

.xp-bar {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ecef;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
}

.xp-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #228be6, #845ef7, #f06595);
  transition: width 0.6s ease;
}

.progression-bottom {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

#progression-next-reward {
  text-align: right;
  font-weight: 700;
}

.done-progression {
  max-width: 520px;
  margin: 1rem auto 1.3rem;
}

.done-xp-earned {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #e7f5ff;
  border: 2px solid #a5d8ff;
}

.done-xp-earned strong {
  color: #1864ab;
  font-size: 1.2rem;
}

.level-up-panel {
  margin-top: 1rem;
  padding: 1.25rem;
  text-align: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at center top, rgba(255,255,255,.7), transparent 45%),
    linear-gradient(135deg, #fff3bf, #e5dbff, #d0ebff);
  border: 2px solid #ffd43b;
  box-shadow: 0 12px 36px rgba(103, 65, 217, 0.18);
  animation: flinkLevelUp 0.55s ease both;
}

.level-up-kicker {
  font-weight: 1000;
  letter-spacing: 0.12em;
  color: #f08c00;
}

.level-up-number {
  margin-top: 0.25rem;
  font-size: 1.8rem;
  font-weight: 1000;
  color: #5f3dc4;
}

.level-up-tier {
  margin-top: 0.25rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.level-up-reward {
  margin-top: 0.9rem;
}

.reward-unlocked {
  display: block;
  margin: 0.35rem auto;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}

@keyframes flinkLevelUp {
  0% {
    opacity: 0;
    transform: scale(.88) translateY(10px);
  }
  70% {
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 700px) {
  .progression-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  #progression-next-reward {
    text-align: left;
  }
}


/* =========================================================
   FLINKFINGER PROGRESSION v1.1
   Fortschritt + Familienübersicht
   ========================================================= */

.progress-level-card {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 2px solid #d0ebff;
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 10%, rgba(116,192,252,.18), transparent 35%),
    #fff;
  box-shadow: var(--shadow);
}

.progress-level-head,
.progress-level-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.progress-level-head {
  margin-bottom: .7rem;
}

.progress-level-meta {
  margin-top: .55rem;
  font-size: .84rem;
  color: var(--muted);
}

.progress-reward-meta {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid #dee2e6;
  color: var(--muted);
  font-size: .86rem;
}

.overview-tier {
  display: inline-block;
  margin-left: .3rem;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: #e7f5ff;
  color: #1864ab;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
}

@media (max-width: 700px) {
  .progress-level-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
}



/* ================================================================
   FLINKFINGER GARAGE / COLLECTION v1
   ================================================================ */

.garage-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border: 2px solid #d0ebff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%,
      rgba(116,192,252,.22), transparent 38%),
    linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: var(--shadow);
}

.garage-level {
  margin-left: .55rem;
  font-size: 1.15rem;
}

.garage-xp {
  color: var(--primary-dark);
  font-size: 1.15rem;
}

.garage-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
  margin: 1rem 0;
}

.garage-summary-box {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .85rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 2px solid #d0ebff;
  box-shadow: var(--shadow);
}

.garage-summary-box span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.garage-summary-box strong {
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.garage-active-card {
  margin: 1rem 0 1.4rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 2px solid #ffd43b;
  background:
    radial-gradient(circle at 90% 0%,
      rgba(255,212,59,.30), transparent 40%),
    linear-gradient(135deg, #fff9db, #fff);
}

.garage-active-label {
  display: block;
  margin-bottom: .65rem;
  color: #e67700;
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .1em;
}

#garage-active-content {
  display: flex;
  align-items: center;
  gap: .8rem;
}

#garage-active-content div {
  display: flex;
  flex-direction: column;
}

#garage-active-content span:not(.garage-active-icon) {
  color: var(--muted);
  font-size: .82rem;
}

.garage-active-icon {
  font-size: 2.1rem;
}

.garage-section-title {
  margin-top: 1.5rem;
}

.garage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.reward-card {
  position: relative;
  min-height: 215px;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 18px;
  border: 2px solid #dee2e6;
  background: #fff;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.reward-unlocked-card {
  border-color: #74c0fc;
  box-shadow: 0 8px 24px rgba(34,139,230,.10);
}

.reward-unlocked-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(34,139,230,.16);
}

.reward-locked-card {
  background: linear-gradient(135deg, #f8f9fa, #edf2f7);
  opacity: .72;
}

.reward-active {
  border-color: #ffd43b;
  box-shadow: 0 10px 30px rgba(240,140,0,.18);
}

.reward-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.reward-card-icon {
  font-size: 2.4rem;
  line-height: 1;
}

.reward-status {
  padding: .25rem .48rem;
  border-radius: 999px;
  font-size: .63rem;
  font-weight: 1000;
  letter-spacing: .05em;
}

.reward-status.is-unlocked {
  color: #2b8a3e;
  background: #d3f9d8;
}

.reward-status.is-locked {
  color: #868e96;
  background: #e9ecef;
}

.reward-category {
  margin-top: .85rem;
  color: #868e96;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.reward-name {
  margin: .25rem 0 .4rem;
  font-size: 1.05rem;
}

.reward-description {
  flex: 1;
  margin: 0 0 .8rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.overview-tier {
  display: inline-block;
  padding: .1rem .35rem;
  border-radius: 999px;
  background: #e7f5ff;
  color: #1864ab;
  font-size: .6rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .garage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .garage-summary {
    grid-template-columns: 1fr;
  }

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

  .garage-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}



/* ================================================================
   FLINKFINGER THREE.JS GARAGE v2
   ================================================================ */

.garage-3d-shell {
  overflow: hidden;
  margin: 1rem 0 1.25rem;
  border: 2px solid #b6ddff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -20%, rgba(116,192,252,.30), transparent 45%),
    linear-gradient(180deg, #101828 0%, #182437 65%, #101722 100%);
  box-shadow: 0 16px 42px rgba(20,40,75,.18);
  color: #fff;
}

.garage-3d-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0;
}

.garage-3d-kicker {
  display: block;
  color: #74c0fc;
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .14em;
}

.garage-3d-head h3 {
  margin: .22rem 0 .15rem;
  color: #fff;
  font-size: 1.4rem;
}

.garage-3d-head p {
  margin: 0;
  color: #adb5bd;
  font-size: .82rem;
}

.garage-3d-lock {
  padding: .38rem .7rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #ced4da;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .07em;
}

.garage-3d-lock.unlocked {
  border-color: rgba(81,207,102,.55);
  background: rgba(81,207,102,.14);
  color: #8ce99a;
}

.garage-3d-stage {
  position: relative;
  height: 430px;
  min-height: 320px;
}

#garage-3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#garage-3d-canvas:active {
  cursor: grabbing;
}

.garage-3d-overlay {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: .7rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(255,255,255,.58);
  font-size: .68rem;
}

.garage-color-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.2rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
}

.garage-color-panel > div:first-child {
  display: flex;
  flex-direction: column;
}

.garage-color-panel strong {
  color: white;
}

.garage-color-hint {
  color: #868e96;
  font-size: .7rem;
}

.garage-color-options {
  display: flex;
  gap: .55rem;
}

.garage-color-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 3px solid rgba(255,255,255,.30);
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  transition: transform .15s ease, border-color .15s ease;
}

.garage-color-btn:hover {
  transform: scale(1.12);
}

.garage-color-btn.selected {
  border-color: white;
  transform: scale(1.12);
  box-shadow:
    0 0 0 3px rgba(116,192,252,.55),
    0 3px 10px rgba(0,0,0,.25);
}

@media (max-width: 650px) {
  .garage-3d-stage {
    height: 330px;
  }

  .garage-color-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .garage-3d-overlay {
    flex-direction: column;
    gap: .1rem;
  }
}



/* ================================================================
   FLINKFINGER XP / MASTERY ENGINE v2
   ================================================================ */

.done-mastery-summary {
  max-width: 520px;
  margin: .8rem auto 1rem;
  padding: 1rem;
  border-radius: 16px;
  background:
    linear-gradient(
      135deg,
      rgba(231,245,255,.95),
      rgba(243,240,255,.95)
    );
  border: 2px solid #d0ebff;
}

.mastery-grade {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-bottom: .8rem;
}

.mastery-grade > span {
  font-size: 2rem;
}

.mastery-grade div {
  display: flex;
  flex-direction: column;
}

.mastery-grade strong {
  color: var(--primary-dark);
  font-size: 1rem;
  letter-spacing: .04em;
}

.mastery-grade div span {
  color: var(--muted);
  font-size: .8rem;
}

.xp-breakdown {
  display: grid;
  gap: .35rem;
  padding-top: .75rem;
  border-top: 1px solid #dbe4ee;
}

.xp-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;

  padding: .35rem .5rem;
  border-radius: 8px;

  font-size: .78rem;
}

.xp-breakdown-row strong {
  white-space: nowrap;
  color: #1864ab;
}

.xp-perfect {
  background: #fff3bf;
}

.xp-perfect strong {
  color: #e67700;
}

.xp-improvement {
  background: #d3f9d8;
}

.xp-improvement strong {
  color: #2b8a3e;
}

.xp-record {
  background: #e5dbff;
}

.xp-record strong {
  color: #6741d9;
}

.xp-mastery {
  background: #fff0f6;
}

.xp-mastery strong {
  color: #c2255c;
}



/* ================================================================
   FLINKFINGER MASTERY v2.1
   ================================================================ */

.lesson-mastery {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  padding: .16rem .42rem;
  border-radius: 999px;

  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;

  background: #f1f3f5;
  color: #868e96;
  white-space: nowrap;
}

.lesson-mastery.mastery-3 {
  background: #e7f5ff;
  color: #1971c2;
}

.lesson-mastery.mastery-4 {
  background: #fff3bf;
  color: #e67700;
}

.lesson-mastery.mastery-5 {
  background:
    linear-gradient(
      135deg,
      #fff3bf,
      #ffe066
    );

  color: #9c6500;

  box-shadow:
    0 0 0 1px rgba(255,193,7,.22),
    0 3px 10px rgba(240,140,0,.10);
}



/* ================================================================
   FLINKFINGER WORLD SWITCH v1.1
   ================================================================ */

.world-theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  margin: 1rem 0 .75rem;
  padding: .85rem 1rem;

  border: 2px solid #d0ebff;
  border-radius: 16px;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,.96),
      rgba(231,245,255,.96)
    );
}

.world-theme-bar > div:first-child {
  display: flex;
  flex-direction: column;
}

.world-theme-label {
  color: #868e96;
  font-size: .65rem;
  font-weight: 1000;
  letter-spacing: .10em;
}

#world-theme-title {
  margin-top: .12rem;
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.world-theme-buttons {
  display: flex;
  gap: .5rem;
}

.world-theme-buttons .base-theme-btn {
  min-width: 110px;
}

@media (max-width: 650px) {
  .world-theme-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .world-theme-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .world-theme-buttons .base-theme-btn {
    min-width: 0;
  }
}



/* ================================================================
   FLINKFINGER COMPANION COLLECTION v1
   ================================================================ */

.companion-selector {
  margin: 1rem 0;
  padding: 1rem;

  border-radius: 18px;
  border: 2px solid #d0ebff;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,.98),
      rgba(239,247,255,.98)
    );
}

.companion-selector-head {
  margin-bottom: .75rem;
}

.companion-selector-head > div {
  display: flex;
  flex-direction: column;
}

.companion-line-grid {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0,1fr));
  gap: .65rem;
}

.companion-line {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-height: 102px;

  padding: .75rem;

  border: 2px solid #dee2e6;
  border-radius: 14px;

  background: white;

  cursor: pointer;

  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.companion-line:hover {
  transform: translateY(-2px);
}

.companion-line.active {
  border-color: var(--line);

  box-shadow:
    0 0 0 3px rgba(34,139,230,.08),
    0 10px 25px rgba(0,0,0,.08);
}

.companion-line > span {
  font-size: 1.65rem;
}

.companion-line strong {
  margin-top: .32rem;
  color: #172b4d;
}

.companion-line small {
  margin-top: .15rem;
  color: #868e96;
}

@media (max-width: 900px) {
  .companion-line-grid {
    grid-template-columns:
      repeat(3,1fr);
  }
}

@media (max-width: 600px) {
  .companion-line-grid {
    grid-template-columns:
      repeat(2,1fr);
  }
}



/* Auto-World v1 */
#world-theme-bar {
  display: none !important;
}

#garage-3d-canvas {
  touch-action: none;
  user-select: none;
}

