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

:root {
  --bg:            #f0f4f0;
  --card:          #ffffff;
  --primary:       #2d6a4f;
  --primary-light: #52b788;
  --wrong:         #e63946;
  --correct:       #2d6a4f;
  --text:          #1a1a2e;
  --muted:         #6c757d;
  --border:        #dee2e6;
  --accent-bg:     #f0f4f8;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

#app {
  width: 100%;
  max-width: 560px;
}

#app.app-wide {
  max-width: 1440px;
}

/* Header */
header { text-align: center; margin-bottom: 2rem; position: relative; z-index: 10; }
header h1 { font-size: 2rem; color: var(--primary); }
#header-sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; min-height: 1.2rem; }

/* ── Auth screen ─────────────────────────────────────── */
#auth-screen {
  display: flex;
  justify-content: center;
}
#auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
#auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-field { margin-bottom: 1rem; }
.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-field input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.auth-field input:focus { border-color: var(--primary-light); }

#auth-error {
  color: var(--wrong);
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.3rem;
  margin-bottom: 0.8rem;
}

#auth-submit-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 0.3rem;
}
#auth-submit-btn:hover:not(:disabled) { opacity: 0.87; }
#auth-submit-btn:disabled { opacity: 0.5; cursor: default; }

/* Header user area */
#header-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
  min-height: 1.4rem;
}
#logout-btn,
#change-password-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
#logout-btn:hover { background: var(--accent-bg); color: var(--text); }
#admin-btn {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
#admin-btn:hover { border-color: var(--primary-light); color: var(--primary); }
#teacher-btn {
  background: #eef8f3;
  border: 1px solid #cde8d8;
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
}
#teacher-btn:hover { border-color: var(--primary-light); background: #e3f4eb; }
#home-grid {
  display: grid;
  gap: 1.25rem;
}

body.home-dashboard {
  background: #f4f7f4;
}

body.home-dashboard #app {
  max-width: 1120px;
}

body.home-dashboard header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

body.home-dashboard header h1 {
  font-size: 2rem;
  line-height: 1;
}

body.home-dashboard #header-sub {
  display: none;
}

body.home-dashboard #header-user {
  justify-content: flex-end;
  margin-top: 0;
  min-height: 0;
}

/* Admin panel */
#admin-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
}
#teacher-card {
  background: var(--card);
  border: 1px solid #dfe6e2;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(28, 54, 43, 0.08);
  padding: 1.3rem;
  max-width: 1440px;
  margin: 0 auto;
}
#admin-back-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.8rem;
}
#teacher-back-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.8rem;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-head h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.panel-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.panel-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.panel-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.panel-tab-content {
  display: none;
}
.panel-tab-content.active {
  display: block;
}
.dashboard-split {
  display: grid;
  grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  gap: 1rem;
}
.dashboard-main-section {
  min-width: 0;
}
.dashboard-empty-state-section {
  display: grid;
  align-content: start;
}
.dashboard-section-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
#admin-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2rem;
}
#admin-status.error {
  color: var(--wrong);
}
#admin-refresh-btn,
#teacher-refresh-btn,
#create-teacher-btn,
#teacher-create-folder-btn,
#admin-save-home-sets-btn,
#teacher-create-class-btn,
#teacher-create-set-btn,
#teacher-cancel-edit-set-btn,
.admin-save-role-btn,
.admin-delete-user-btn,
.teacher-add-student-btn,
.teacher-assign-set-btn,
.teacher-save-assignments-btn,
.teacher-remove-assignment-btn,
  .teacher-remove-student-btn,
  .student-class-request-btn,
  .teacher-edit-set-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
#admin-refresh-btn:hover,
#teacher-refresh-btn:hover,
#create-teacher-btn:hover,
#teacher-create-folder-btn:hover,
#admin-save-home-sets-btn:hover,
#teacher-create-class-btn:hover,
#teacher-create-set-btn:hover,
#teacher-cancel-edit-set-btn:hover,
.admin-save-role-btn:hover,
.admin-delete-user-btn:hover,
.teacher-add-student-btn:hover,
.teacher-assign-set-btn:hover,
.teacher-save-assignments-btn:hover,
.teacher-remove-assignment-btn:hover,
  .teacher-remove-student-btn:hover,
  .student-class-request-btn:hover,
  .teacher-edit-set-btn:hover { opacity: 0.9; }
#admin-refresh-btn:disabled,
#teacher-refresh-btn:disabled,
#create-teacher-btn:disabled,
#teacher-create-folder-btn:disabled,
#admin-save-home-sets-btn:disabled,
#teacher-create-class-btn:disabled,
#teacher-create-set-btn:disabled,
#teacher-cancel-edit-set-btn:disabled,
.admin-save-role-btn:disabled,
.admin-delete-user-btn:disabled,
.teacher-add-student-btn:disabled,
.teacher-assign-set-btn:disabled,
.teacher-save-assignments-btn:disabled,
.teacher-remove-assignment-btn:disabled,
  .teacher-remove-student-btn:disabled,
  .student-class-request-btn:disabled { opacity: 0.55; cursor: default; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.admin-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #fcfefd;
}
.admin-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.8rem;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.admin-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}
#admin-users-summary {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.admin-home-sets-list {
  display: grid;
  gap: 0.65rem;
}
.admin-home-set-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.admin-home-set-row input {
  margin-top: 0.2rem;
}
.admin-home-set-copy {
  display: grid;
  gap: 0.2rem;
}
.admin-home-set-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.admin-home-set-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

#password-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
#password-modal.hidden {
  display: none;
}
.password-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 38, 0.36);
}
.password-modal-card {
  position: relative;
  width: min(100%, 440px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.2);
  padding: 1.4rem;
}
.password-modal-card h2 {
  margin: 0 0 1rem;
  color: var(--text);
}
#password-modal-error {
  min-height: 1.2rem;
  color: var(--wrong);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}
.password-policy-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: -0.25rem 0 1rem;
}
.admin-table-wrap {
  overflow-x: auto;
}
#admin-users-table {
  width: 100%;
  border-collapse: collapse;
}
#admin-users-table th,
#admin-users-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
#admin-users-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
#admin-users-table td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#admin-users-table .admin-save-role-btn,
#admin-users-table .admin-delete-user-btn,
#admin-users-table .admin-reset-password-btn {
  min-width: 82px;
  min-height: 40px;
  white-space: nowrap;
}
#admin-users-table .admin-delete-user-btn {
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
}
.admin-role-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}
.admin-password-reset-field {
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

@media (max-width: 700px) {
  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-split {
    grid-template-columns: 1fr;
  }
  .panel-tabbar {
    gap: 0.45rem;
  }
  #header-user {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
  .teacher-set-toolbar {
    grid-template-columns: 1fr;
  }
  .teacher-set-visibility-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .teacher-due-date-field {
    grid-column: 2;
  }
}
.category-section { margin-bottom: 1.8rem; }
.category-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.set-card {
  background: var(--card);
  border-radius: 14px;
  padding: 1.2rem 1.2rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.set-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  border-color: var(--primary-light);
}
.set-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.set-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.set-card-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.set-card-bar-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 0.3s;
}
.set-card-pct {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.3rem;
  text-align: right;
}

/* Home dashboard */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  background: #fff;
  border: 1px solid #dfe6e2;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 10px 28px rgba(28, 54, 43, 0.06);
}
.home-eyebrow {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.home-hero h2 {
  font-size: 1.85rem;
  line-height: 1.1;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.home-hero p {
  color: var(--muted);
  font-size: 0.95rem;
}
.home-hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.home-primary-action,
.home-secondary-action {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}
.home-primary-action {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.home-secondary-action {
  background: #fff;
  color: var(--text);
}
.home-primary-action:disabled,
.home-secondary-action:disabled {
  opacity: 0.48;
  cursor: default;
}
.home-section {
  display: grid;
  gap: 0.7rem;
}
.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.home-section-title {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b6570;
}
.home-section-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}
.home-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}
.home-card-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.practice-card {
  display: grid;
  align-content: start;
  min-height: 176px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #dfe6e2;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 5px 18px rgba(24, 42, 34, 0.05);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  font: inherit;
}
.practice-card:hover {
  transform: translateY(-2px);
  border-color: #9bcfba;
  box-shadow: 0 12px 28px rgba(24, 42, 34, 0.09);
}
.practice-card-static {
  cursor: default;
}
.practice-card-static:hover {
  transform: none;
}
.practice-card-assignment {
  border-left: 4px solid #c7822b;
}
.practice-card-course {
  border-left: 4px solid var(--primary);
}
.practice-card-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.practice-card-title {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 850;
  margin-bottom: 0.25rem;
}
.practice-card-meta {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.65rem;
}
.practice-card-desc {
  color: #34413b;
  font-size: 0.9rem;
  line-height: 1.38;
  min-height: 2.5rem;
}
.assignment-due-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  margin-top: 0.7rem;
  font-size: 0.76rem;
  font-weight: 850;
}
.assignment-due-normal {
  background: #eaf4ef;
  color: var(--primary);
}
.assignment-due-soon {
  background: #fff4df;
  color: #9a5b12;
}
.assignment-due-overdue {
  background: #ffe8ea;
  color: #b42330;
}
.practice-card-progress {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebe7;
  margin-top: 0.9rem;
}
.practice-card-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.practice-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.55rem;
}
.practice-card-foot strong {
  color: var(--primary);
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  body.home-dashboard header,
  .home-hero {
    grid-template-columns: 1fr;
  }
  body.home-dashboard #header-user,
  .home-hero-actions {
    justify-content: flex-start;
  }
  .home-card-grid,
  .home-card-grid-featured {
    grid-template-columns: 1fr;
  }
}

/* Back button */
#back-btn, #browse-back-btn, #course-back-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0 1rem 0;
  display: block;
}
#back-btn:hover, #browse-back-btn:hover, #course-back-btn:hover { color: var(--text); }

/* ── Course screen ──────────────────────────────────── */
#course-screen {
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
#course-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text);
}
#course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* Course tile on home ────────────────────────────── */
.course-tile {
  border: 2px solid var(--primary) !important;
  background: linear-gradient(135deg, #f0e8ff 0%, #ffe8f8 100%) !important;
}
.course-tile-es1000 {
  border: 2px solid #c07010 !important;
  background: linear-gradient(135deg, #fff8e8 0%, #ffe8c8 100%) !important;
}
.course-tile-podstawowe {
  border: 2px solid #0e8a6a !important;
  background: linear-gradient(135deg, #e8fff6 0%, #c8f0e4 100%) !important;
}
.course-tile-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

/* ── Browse screen ───────────────────────────────────────── */
#browse-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--primary);
}
#browse-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}
#browse-table thead th {
  background: var(--primary);
  color: #fff;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#browse-table thead th:last-child { width: 48px; }
#browse-table tbody tr { border-bottom: 1px solid var(--border); }
#browse-table tbody tr:last-child { border-bottom: none; }
#browse-table tbody tr:hover { background: var(--accent-bg); }
#browse-table tbody td {
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}
#teacher-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2rem;
}
#teacher-status.error {
  color: var(--wrong);
}
.teacher-form-grid {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
#teacher-set-items {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.45;
  font-family: inherit;
  resize: vertical;
  min-height: 15rem;
}
#teacher-set-items:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 0.45rem;
}
.teacher-inline-field input {
  min-width: 0;
}
#teacher-set-folder {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
}
#teacher-set-folder:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -0.1rem;
}
#teacher-sets-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.teacher-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid #dfe6e2;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0.38rem 0.62rem;
  font-size: 0.82rem;
  line-height: 1;
}
.teacher-stat-chip strong {
  color: var(--text);
}
.teacher-stat-icon {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #eaf4ef;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
}
.teacher-set-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.teacher-set-toolbar input,
.teacher-set-toolbar select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
}
.teacher-set-toolbar input:focus,
.teacher-set-toolbar select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.14);
}
.teacher-classes-list,
.teacher-sets-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}
.teacher-folder-section,
.student-assignment-folder {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.teacher-folder-section summary,
.student-assignment-folder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  list-style: none;
  background: #f8fbf9;
}
.teacher-folder-section summary::-webkit-details-marker,
.student-assignment-folder summary::-webkit-details-marker {
  display: none;
}
.teacher-folder-section summary::after,
.student-assignment-folder summary::after {
  content: "v";
  color: var(--muted);
  transition: transform 0.16s ease;
}
.teacher-folder-section[open] summary::after,
.student-assignment-folder[open] summary::after {
  transform: rotate(180deg);
}
.teacher-folder-section summary strong,
.student-assignment-folder summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}
.teacher-folder-sets {
  display: grid;
  gap: 0;
}
.teacher-set-table {
  overflow-x: auto;
}
.teacher-set-table-head,
.teacher-set-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 72px 110px minmax(150px, 0.8fr) 150px;
  align-items: center;
  gap: 0.75rem;
}
.teacher-set-table-head {
  padding: 0.7rem 0.95rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.teacher-set-row {
  min-width: 760px;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid #edf1ee;
}
.teacher-set-row:last-child {
  border-bottom: 0;
}
.teacher-set-row-main {
  min-width: 0;
}
.teacher-empty-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 1rem;
}
.teacher-class-card,
.teacher-set-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem;
  background: #fff;
}
.teacher-class-title,
.teacher-set-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.teacher-class-meta,
.teacher-set-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.teacher-class-desc,
.teacher-set-desc {
  font-size: 0.88rem;
  color: var(--text);
  min-height: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teacher-set-count,
.teacher-set-created {
  color: var(--muted);
  font-size: 0.9rem;
}
.teacher-set-folder-control {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.7rem;
}
.teacher-set-folder-control label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.teacher-set-folder-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
}
.teacher-set-folder-select:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-class-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  margin-top: 0.8rem;
}
.teacher-class-student-username {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
}
.teacher-class-student-username:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-class-assignment-select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
  background: #fff;
}
.teacher-class-assignment-select:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-class-form-assignments {
  margin-top: 0.95rem;
}
.teacher-class-assignments-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 0.95rem;
  background: #fff;
  overflow: hidden;
}
.teacher-class-assignments-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
}
.teacher-class-assignments-panel summary::-webkit-details-marker {
  display: none;
}
.teacher-class-assignments-panel summary::after {
  content: "v";
  color: var(--muted);
  transition: transform 0.16s ease;
}
.teacher-class-assignments-panel[open] summary::after {
  transform: rotate(180deg);
}
.teacher-class-assignments-panel summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}
.teacher-set-visibility-list {
  display: grid;
  gap: 0.65rem;
  padding: 0 0.75rem 0.75rem;
}
.teacher-set-visibility-folder {
  display: grid;
  gap: 0.4rem;
}
.teacher-set-visibility-folder-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.teacher-set-visibility-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 180px);
  align-items: center;
  gap: 0.65rem;
  border-radius: 8px;
  background: var(--accent-bg);
  padding: 0.55rem 0.65rem;
}
.teacher-set-visibility-check {
  display: grid;
  place-items: center;
}
.teacher-set-visibility-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex: 0 0 auto;
}
.teacher-set-visibility-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.teacher-set-visibility-copy span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.teacher-set-visibility-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}
.teacher-due-date-field {
  display: grid;
  gap: 0.25rem;
}
.teacher-due-date-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.teacher-assignment-due-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.5rem;
  font-size: 0.84rem;
}
.teacher-assignment-due-input:disabled {
  opacity: 0.55;
  background: #f4f6f5;
}
.teacher-assignment-due-input:focus {
  outline: none;
  border-color: var(--primary-light);
}
.teacher-class-assignment-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}
.teacher-class-assignments-list,
.teacher-class-students-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.teacher-class-assignments-list li,
.teacher-class-students-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--accent-bg);
  font-size: 0.88rem;
}
.teacher-class-assignment-copy,
.teacher-class-student-copy {
  display: grid;
  gap: 0.12rem;
}
.teacher-class-assignments-list strong,
.teacher-class-students-list strong {
  font-size: 0.9rem;
  color: var(--text);
}
.teacher-class-assignment-copy span,
.teacher-class-student-copy span {
  color: var(--muted);
}
.teacher-remove-student-btn {
  padding: 0.42rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.teacher-remove-assignment-btn {
  padding: 0.42rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.teacher-class-assignments-empty,
.teacher-class-students-empty {
  justify-content: flex-start !important;
  color: var(--muted);
}
.student-assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}
.student-assignment-folder {
  margin-top: 0.75rem;
}
.student-assignment-folder .student-assignments-grid {
  padding: 0 0.75rem 0.75rem;
}
.home-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 0 0.75rem 0.75rem;
}
.student-assignment-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem;
  background: linear-gradient(180deg, #fff8ed 0%, #fff 100%);
}
.student-assignment-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.student-assignment-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.student-assignment-desc {
  font-size: 0.88rem;
  color: var(--text);
  min-height: 2.5rem;
}
.student-assignment-open-btn {
  margin-top: 0.75rem;
}
.student-class-request-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.student-class-request-btn-secondary {
  background: #eef2f6;
  color: var(--text);
}
.teacher-set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.admin-delete-user-btn,
.teacher-delete-set-btn {
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
#teacher-cancel-edit-set-btn,
.teacher-edit-set-btn {
  background: #eef2f6;
  color: var(--text);
  padding: 0.55rem 0.75rem;
}
.admin-delete-user-btn:hover:not(:disabled),
.teacher-delete-set-btn:hover:not(:disabled) {
  opacity: 0.92;
}
.admin-delete-user-btn:disabled,
.teacher-delete-set-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
#browse-table tbody td.col-pl   { color: var(--muted); }
#browse-table tbody td.col-es   { font-weight: 600; }
#browse-table tbody td.col-espl { color: var(--muted); font-size: 0.85rem; }
#browse-table tbody td.col-tts  { text-align: center; padding: 0.3rem; }

.tts-btn {
  background: none;
  border: none;
  .teacher-form-grid {
    grid-template-columns: 1fr;
  }
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.tts-btn:hover { background: var(--accent-bg); }
.tts-btn.playing { color: var(--primary); }

#browse-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Mode selector ──────────────────────────────────────────────────────── */
.mode-selector,
.direction-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 4px;
}
.direction-selector {
  max-width: 100%;
}
.mode-btn,
.direction-btn {
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 0.55rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  transition: background 0.18s, color 0.18s;
}
.mode-btn.active,
.direction-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ── Choice tiles ───────────────────────────────────────────────────────── */
#choice-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0.5rem auto;
  width: 100%;
}
.choice-tile {
  width: 100%;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.choice-tile:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f8f0ff;
  transform: translateY(-2px);
}
.choice-tile.choice-correct {
  background: #d4f5e2;
  border-color: #3a9e68;
  color: #1a6e40;
}
.choice-tile.choice-wrong {
  background: #fde8e8;
  border-color: #e05555;
  color: #a02020;
}
#browse-start-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
#browse-start-btn:hover { opacity: 0.88; }

/* Progress bar */
#progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
#progress-bar-fill {
  height: 100%;
  background: var(--primary-light);
  transition: width 0.35s ease;
  width: 0%;
}
#progress-text {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

/* Word card */
#word-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 1.2rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
#polish-word {
  font-size: 2.4rem;
  font-weight: 700;
}
#hint-text {
  font-size: 1rem;
  color: var(--muted);
  font-family: monospace;
  letter-spacing: 0.12em;
  min-height: 1.4rem;
}

/* Input area */
#input-area {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 0.9rem;
}
#letter-display {
  min-height: 2.4rem;
  font-size: 1.6rem;
  font-family: monospace;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  white-space: pre;
}
.letter-correct { color: var(--text); font-weight: 600; }
.letter-wrong   { color: var(--wrong);   font-weight: 700; }

#answer-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 1.15rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
#answer-input:focus  { border-color: var(--primary-light); }
#answer-input:disabled { background: var(--accent-bg); color: var(--muted); }

/* Accent bar */
#accent-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.accent-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.accent-btn:hover { background: var(--accent-bg); }

/* Input row z przyciskiem enter */
#input-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
#input-row #answer-input {
  flex: 1;
}
#enter-btn {
  flex-shrink: 0;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 2.2rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  touch-action: manipulation;
}
#enter-btn:active { transform: scale(0.93); }
#enter-btn.next { background: var(--success, #22c55e); }

/* Controls */
#controls { margin-bottom: 0.8rem; }
#hint-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.38rem 0.9rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
#hint-btn:hover:not(:disabled) { background: var(--accent-bg); color: var(--text); }
#hint-btn:disabled { opacity: 0.4; cursor: default; }

/* Feedback */
#feedback {
  min-height: 1.7rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.3rem 0;
}
#feedback.correct { color: var(--correct); }
#feedback.wrong   { color: var(--wrong); }

/* Conjugation box */
#conjugation-box {
  margin-top: 0.9rem;
  background: #f0f6ff;
  border: 1px solid #c5d9f7;
  border-radius: 10px;
  padding: 0.65rem 1rem 0.75rem;
  text-align: left;
}
.conj-title {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.conj-title strong {
  color: var(--primary);
  font-size: 0.95rem;
}
.conj-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
.conj-person {
  color: var(--muted);
  font-weight: 600;
  padding: 0.12rem 0.8rem 0.12rem 0;
  min-width: 7rem;
}
.conj-form {
  color: var(--text);
  font-weight: 500;
}

#instruction {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.6rem;
}

/* Results */
#results-screen { text-align: center; }
#results-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
#results-card h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 0.8rem; }
#score-display { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; }

#results-list {
  text-align: left;
  margin-bottom: 1.5rem;
  max-height: 280px;
  overflow-y: auto;
}
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  gap: 0.5rem;
}
.result-item .r-pl   { color: var(--muted); flex: 1; }
.result-item .r-es   { font-weight: 600; flex: 1; }
.result-item .r-ok   { color: var(--correct); font-size: 1.1rem; }
.result-item .r-bad  { color: var(--wrong);   font-size: 1.1rem; }

#results-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
#results-actions button {
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
#results-actions button:hover { opacity: 0.85; }
#retry-all-btn   { background: var(--primary); color: #fff; }
#retry-wrong-btn { background: var(--wrong);   color: #fff; }
#home-btn        { background: var(--accent-bg); color: var(--text); border: 1px solid var(--border); }

.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   BUBBLEGUM — Gabriel theme
═══════════════════════════════════════════════ */
body.bubblegum {
  background: #e8c8f8;
}

/* Watercolor blobs w tle */
body.bubblegum::before {
  content: '';
  position: fixed;
  inset: -60px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 18% 28%, rgba(190,80,230,0.62) 0%, transparent 70%),
    radial-gradient(ellipse 55% 65% at 78% 18%, rgba(80,150,255,0.58) 0%, transparent 70%),
    radial-gradient(ellipse 70% 45% at 48% 88%, rgba(255,90,180,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 48% 58% at 88% 68%, rgba(140,80,255,0.50) 0%, transparent 70%),
    radial-gradient(ellipse 58% 48% at 8%  72%, rgba(255,130,210,0.50) 0%, transparent 70%),
    radial-gradient(ellipse 42% 52% at 52% 48%, rgba(100,170,255,0.42) 0%, transparent 70%),
    radial-gradient(ellipse 35% 60% at 35% 12%, rgba(220,100,255,0.45) 0%, transparent 70%);
  filter: blur(38px) saturate(1.4);
  /* bez animacji - blur+animation to ogromne zuzycie CPU */
}

/* Sketch lines from image */
body.bubblegum::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('sketch-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  mix-blend-mode: multiply;
}

/* Warstwa kulek wstrzykiwato przez JS */
#bubble-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
@keyframes bubblePop {
  0%   { transform: scale(1);    opacity: 1; }
  40%  { transform: scale(1.5);  opacity: 0.7; }
  100% { transform: scale(2.2);  opacity: 0; }
}
@keyframes bubbleSpawn {
  0%   { transform: scale(0);   opacity: 0; }
  60%  { transform: scale(1.15); opacity: 0.9; }
  100% { transform: scale(1);   opacity: 1; }
}
.bubble-splash-dot {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9999;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(255,255,255,0.9), 0 0 10px 2px rgba(255,200,255,0.5);
  opacity: 1;
  animation: splashDot var(--dur, 0.55s) ease-out forwards;
}
@keyframes splashDot {
  0%   { transform: translate(-50%, -50%) rotate(var(--angle)) translate(0, 0)               scaleY(1);   opacity: 1; }
  60%  { opacity: 0.8; }
  100% { transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--tx), var(--ty)) scaleY(0.4); opacity: 0; }
}
.bubble-pop {
  animation: bubblePop 0.38s ease-out forwards !important;
  cursor: default;
  pointer-events: none;
}
.bubble-spawn {
  animation: bgBubbleFloat var(--dur, 9s) ease-in-out infinite alternate,
             bubbleSpawn 0.45s cubic-bezier(0.22,1.4,0.5,1) both;
}
.bg-bubble {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.65);
  box-shadow:
    inset 3px 4px 10px rgba(255,255,255,0.70),
    inset -4px -4px 14px rgba(180,120,255,0.22),
    0 6px 18px rgba(160,80,220,0.18);
  will-change: transform;
  animation: bgBubbleFloat var(--dur, 9s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
.bg-bubble::after {
  content: '';
  position: absolute;
  top: 12%;
  left: 18%;
  width: 30%;
  height: 18%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.95) 0%, transparent 100%);
  border-radius: 50%;
  transform: rotate(-28deg);
}
@keyframes bgBubbleFloat {
  0%   { transform: translateY(0px)   scale(1); }
  100% { transform: translateY(-28px) scale(1.06); }
}

body.bubblegum #home-screen { position: relative; z-index: 1; }
body.bubblegum #home-screen > * { position: relative; z-index: 2; }

/* Set cards in bubblegum mode */
body.bubblegum .set-card {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(255,255,255,0.80);
  box-shadow: 0 4px 20px rgba(180,80,220,0.15);
}
body.bubblegum .set-card:hover {
  border-color: #ff70b8;
  box-shadow: 0 8px 30px rgba(220,60,180,0.28);
}
body.bubblegum .course-tile {
  border-color: #c050f0 !important;
}
body.bubblegum .course-tile:hover {
  border-color: #c050f0 !important;
  box-shadow: 0 8px 30px rgba(180,60,220,0.35);
}
body.bubblegum .course-tile-es1000 {
  border-color: #e08020 !important;
}
body.bubblegum .course-tile-es1000:hover {
  border-color: #e08020 !important;
  box-shadow: 0 8px 30px rgba(220,120,20,0.35);
}
body.bubblegum .course-tile-podstawowe {
  border-color: #10b88a !important;
}
body.bubblegum .course-tile-podstawowe:hover {
  border-color: #10b88a !important;
  box-shadow: 0 8px 30px rgba(20,180,130,0.35);
}
body.bubblegum .category-label { color: #a040a0; }
body.bubblegum header h1       { color: #8820a0; text-shadow: 0 1px 10px rgba(255,130,220,0.5); }
body.bubblegum #header-sub     { color: #b060c0; }
body.bubblegum .set-card-bar-fill { background: linear-gradient(90deg, #ff70c0, #9070f8); }
