/* ============================================================
   components.css — Komponenty pro Litera v2
   Karty, tlačítka, progress bary, badge, stat-card atd.
   ============================================================ */

/* ── Card ── */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: var(--sp-5);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(74, 111, 165, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(74, 111, 165, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--blue-50);
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border-color: var(--color-border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--blue-50);
  color: var(--color-primary);
}

.btn-sm {
  min-height: 36px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
}

.btn-block { width: 100%; }

/* ── Badge Pill ── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 600;
  font-size: var(--text-xs);
  padding: 4px var(--sp-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--blue-200);
}

.badge-pill.success {
  background: var(--success-light);
  color: var(--success);
  border-color: #a9dfbf;
}

.badge-pill.gold {
  background: #fef9e7;
  color: #b7950b;
  border-color: #f9e79f;
}

/* ── Progress Bar ── */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--blue-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-500));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.6s ease;
}

.progress-track.lg { height: 12px; }
.progress-track.xl { height: 16px; }

/* ── Stat Card ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

@media (min-width: 600px) {
  .stats-row {
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
  }
}

.stat-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (min-width: 600px) {
  .stat-card {
    padding: var(--sp-4) var(--sp-3);
  }
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.2rem;
  display: block;
  margin-bottom: var(--sp-1);
}

@media (min-width: 600px) {
  .stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--sp-2);
  }
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--blue-700);
  display: block;
  line-height: 1;
  margin-bottom: var(--sp-1);
}

@media (min-width: 600px) {
  .stat-value {
    font-size: var(--text-2xl);
  }
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 500;
}

/* ── Book List Item ── */
.book-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.book-item {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
}

.book-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-item:active {
  transform: scale(0.99);
}

/* ── Image fade-in ── */
.img-fade {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.img-fade.loaded {
  opacity: 1;
}

.book-thumb {
  width: 68px;
  height: 96px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: url(../img/logo/piktogram-colour-whiteBG.png) center/22px no-repeat, white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-sm);
}

.book-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-item-info {
  flex: 1;
  min-width: 0;
}

.book-item-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--blue-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-item-author {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-bottom: var(--sp-2);
}

/* Book tags row (period + genre) */
.book-item-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.period-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--blue-100);
  color: var(--blue-700);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.genre-tag {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-500);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* Score badge */
.score-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.score-badge.good { background: var(--success-light); color: var(--success); }
.score-badge.mid  { background: #fef9e7; color: #b7950b; }
.score-badge.low  { background: var(--error-light); color: var(--error); }

/* ── Author Cards (horizontal scroll) ── */
.author-scroll {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-2);
  margin: 0 calc(-1 * var(--sp-4));
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}

.author-scroll::-webkit-scrollbar { display: none; }

.author-card {
  flex-shrink: 0;
  width: 120px;
  scroll-snap-align: start;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.author-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.author-card:active { transform: scale(0.97); }

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto var(--sp-3);
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-900);
  line-height: 1.3;
}

.author-period {
  font-size: 0.65rem;
  color: var(--color-muted);
  margin-top: 2px;
}

/* Desktop: grid místo horizontal scroll */
@media (min-width: 768px) {
  .author-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    overflow-x: visible;
    margin: 0;
    padding: 0;
  }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Test Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 31, 46, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-overlay.active { display: flex; }

.modal-sheet {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--sp-6);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  animation: sheetSlideUp 0.3s ease-out;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-sheet {
    border-radius: var(--radius-xl);
    max-height: 85vh;
    padding: var(--sp-8);
    animation: modalFadeIn 0.25s ease-out;
  }
}

/* ── Test Question Styles ── */
.test-progress-bar {
  margin-bottom: var(--sp-5);
}

.test-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-bottom: var(--sp-2);
}

.question-text {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.answer-option {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.2s;
  min-height: 52px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.answer-option:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
}

.answer-option:active { transform: scale(0.99); }

.answer-option.correct {
  background: #1a9c4e;
  border-color: #1a9c4e;
  color: #fff;
  font-weight: 700;
  animation: bounceIn 0.35s ease;
}

.answer-option.incorrect {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  font-weight: 700;
  animation: shake 0.4s ease;
}

/* Fill input */
.fill-input {
  width: 100%;
  padding: var(--sp-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.2s;
  min-height: 52px;
}

.fill-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--white);
}

.fill-input.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.fill-input.incorrect {
  border-color: #c0392b;
  background: #fce4e4;
  color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

/* Matching game */
.matching-container {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.match-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.match-item,
.match-target {
  background: var(--white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  cursor: pointer;
  transition: all 0.2s;
  font-size: var(--text-sm);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

.match-item:hover,
.match-target:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.match-item.selected {
  background: var(--blue-100);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.match-item.correct,
.match-target.correct {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
  font-weight: 600;
  cursor: not-allowed;
}

.match-item.incorrect-match,
.match-target.incorrect-match {
  animation: shake 0.4s ease;
  border-color: var(--error);
}

/* Order game */
.order-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.order-item {
  background: var(--white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  cursor: move;
  transition: all 0.2s;
  font-size: var(--text-sm);
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  touch-action: none;
}

.order-item:hover { border-color: var(--blue-400); }
.order-handle { color: var(--color-muted); font-size: 1.1rem; cursor: move; }
.order-item.dragging { opacity: 0.5; background: var(--blue-50); }
.order-item.correct { background: var(--success-light); border-color: var(--success); color: var(--success); cursor: not-allowed; }
.order-item.incorrect { background: var(--error-light); border-color: var(--error); color: var(--error); cursor: not-allowed; }

/* ── Test Result ── */
.result-hero {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  background: var(--theme-gradient, linear-gradient(135deg, var(--blue-600) 0%, var(--blue-900) 100%));
  border-radius: var(--radius-xl);
  color: var(--white);
  margin-bottom: var(--sp-5);
}

.result-score {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.result-grade { font-size: var(--text-xl); margin-bottom: var(--sp-4); }
.result-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
}
.result-stat { font-size: var(--text-sm); opacity: 0.85; }
.result-stat strong { display: block; font-size: var(--text-xl); font-weight: 700; opacity: 1; }

.result-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.result-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.result-item.correct { background: var(--success-light); border-color: #a9dfbf; }
.result-item.incorrect { background: var(--error-light); border-color: #f1948a; }

.result-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.result-item-q { font-size: var(--text-xs); font-weight: 600; color: var(--blue-900); margin-bottom: 3px; }
.result-item-ans { font-size: var(--text-xs); color: var(--color-muted); }
.result-item-correct { font-size: var(--text-xs); color: var(--success); font-weight: 600; }

/* ── Achievement Badge ── */
.badge-achievement {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--gold);
  transition: all 0.2s;
  position: relative;
}

.badge-achievement:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.badge-achievement.locked {
  border-color: var(--gray-300);
  opacity: 0.55;
}

.badge-achievement .badge-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: var(--sp-2);
}

.badge-achievement.locked .badge-icon {
  filter: grayscale(1);
}

.badge-achievement .badge-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-900);
  line-height: 1.3;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--color-muted);
}

@media (min-width: 600px) {
  .empty-state {
    padding: var(--sp-16) var(--sp-8);
  }
}

.empty-state-icon { font-size: 2.5rem; display: block; margin-bottom: var(--sp-3); }
@media (min-width: 600px) {
  .empty-state-icon { font-size: 4rem; margin-bottom: var(--sp-4); }
}
.empty-state-title { font-size: var(--text-lg); font-weight: 700; color: var(--blue-700); margin-bottom: var(--sp-2); }
@media (min-width: 600px) {
  .empty-state-title { font-size: var(--text-xl); }
}
.empty-state-text { font-size: var(--text-sm); line-height: 1.6; max-width: 320px; margin: 0 auto var(--sp-6); }

/* ── XP Toast ── */
.xp-toast {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--sp-4) + env(safe-area-inset-bottom));
  right: var(--sp-4);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  z-index: 300;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 220px;
}

.xp-toast.show { transform: translateX(0); }

.xp-toast-avatar { font-size: 1.8rem; }
.xp-toast-title { font-size: var(--text-sm); font-weight: 700; color: var(--blue-900); }
.xp-gain-text { color: var(--success); font-weight: 700; }
.xp-toast-level { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }

@media (min-width: 768px) {
  .xp-toast {
    bottom: var(--sp-6);
  }
}

/* ── Profile Hero ── */
.profile-hero {
  background: var(--theme-gradient, linear-gradient(135deg, var(--blue-600) 0%, var(--blue-900) 100%));
  border-radius: var(--radius-xl);
  padding: var(--sp-8) var(--sp-6);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-4);
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  .profile-hero {
    margin-bottom: var(--sp-6);
  }
}

.profile-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 250px; height: 250px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.25);
}

.profile-avatar-emoji {
  font-size: 3.8rem;
  line-height: 1;
  transform: translateY(6px);
}

/* ── Composite avatar layers (needed on all pages for nav avatar) ── */
.profile-avatar,
.top-nav-avatar {
  position: relative !important;
  overflow: hidden !important;
  clip-path: circle(50%) !important;
}

.avatar-composite {
  position: absolute;
  height: 65%;
  width: calc(65% * 1314 / 983);
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
}

.avatar-composite img {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

/* Idle blink animation — applied globally to any avatar-composite eye layer */
.avatar-composite img.eye-layer {
  transform-origin: center center;
}
.avatar-composite img.eye-layer.blink {
  animation: avatarEyeBlink 0.18s ease-in-out;
}
@keyframes avatarEyeBlink {
  0%, 100% { transform: scaleY(1);    }
  45%, 55% { transform: scaleY(0.04); }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-composite img.eye-layer.blink { animation: none; }
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.profile-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.2);
  padding: 4px var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

/* ── Profile Stats Grid ── */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

@media (min-width: 600px) {
  .profile-stats-grid {
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
  }
}

@media (min-width: 600px) {
  .profile-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .profile-hero {
    gap: var(--sp-8);
  }
}

/* mobile profile hero handled in the new block below */

/* ── Badges Grid ── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-3);
}

/* ── Test History ── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.history-book { flex: 1; font-size: var(--text-sm); font-weight: 500; }
.history-score { font-size: var(--text-sm); font-weight: 700; }
.history-score.good { color: var(--success); }
.history-score.mid { color: #b7950b; }
.history-score.low { color: var(--error); }

/* ── Settings Modal ── */
.settings-form .form-group { margin-bottom: var(--sp-4); }
.settings-form label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: var(--sp-2);
}
.settings-form input[type="text"],
.settings-form input[type="date"] {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.2s;
  min-height: 44px;
  box-sizing: border-box;
}
.settings-form input[type="text"]:focus,
.settings-form input[type="date"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--white);
}
.settings-form input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

/* Avatar grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: var(--sp-3);
}

.avatar-option {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.avatar-option:hover { transform: scale(1.08); }
.avatar-option.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74,111,165,0.22);
  transform: scale(1.1);
}

/* ── Avatar modal preview ── */
.avatar-modal-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
  overflow: hidden;
  background: #dbeafe;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  background-size: cover;
  background-position: center;
}

/* ── Background color swatches ── */
.bg-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.bg-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  padding: 0;
  outline: none;
}

.bg-swatch:hover { transform: scale(1.18); }
.bg-swatch.active {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px rgba(74,111,165,0.3);
  transform: scale(1.12);
}

/* ── Custom photo upload button ── */
.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.avatar-upload-btn:hover {
  background: var(--blue-50, #eff6ff);
  border-color: var(--blue-300);
}

/* Avatar group heading inside picker */
.avatar-group-label {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-top: var(--sp-2);
  margin-bottom: calc(-1 * var(--sp-1));
}

/* Danger zone */
.danger-zone {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.btn-danger {
  background: transparent;
  border-color: var(--error);
  color: var(--error);
}
.btn-danger:hover:not(:disabled) { background: var(--error-light); }

/* ── Widget Toggle Panel ── */
.widget-toggle-wrap {
  position: relative;
  display: inline-block;
}

.widget-toggle-btn {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.widget-toggle-btn:hover {
  color: var(--color-primary);
  border-color: var(--blue-300);
}

.widget-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--sp-3) var(--sp-4);
  z-index: 50;
  min-width: 180px;
}

.widget-panel.open {
  display: block;
  animation: widgetPanelIn 0.2s ease-out forwards;
}

/* ── Apps dropdown panel ── */
.apps-btn-wrap {
  position: relative;
  display: inline-block;
}

.apps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
}
.apps-btn:hover {
  color: var(--color-primary);
  border-color: var(--blue-300);
  background: var(--blue-50, #eff6ff);
}

.apps-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-3);
  min-width: 220px;
  z-index: 400;
}
.apps-panel.open {
  display: block;
  animation: widgetPanelIn 0.2s ease-out forwards;
}

.apps-panel-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
  cursor: pointer;
}
.app-card:hover {
  background: var(--blue-50, #eff6ff);
  border-color: var(--blue-200);
}
.app-card-icon { font-size: 1.8rem; line-height: 1; }
.app-card-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-900);
  line-height: 1.3;
}

/* ── Apps page tile grid ── */
.apps-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.apps-page-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.apps-page-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-300);
}
.apps-page-tile-icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
.apps-page-tile-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--blue-900);
}
.apps-page-tile-desc {
  font-size: var(--text-xs);
  color: var(--color-muted);
  line-height: 1.4;
}

.widget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}

.widget-row:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.col-btns {
  display: flex;
  gap: 4px;
}

.col-btn {
  width: 28px;
  height: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.col-btn.active {
  background: var(--blue-600);
  color: #fff;
  border-color: var(--blue-600);
}

.col-btn:hover:not(.active) {
  border-color: var(--blue-300);
  color: var(--color-primary);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background 0.2s;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* ── Section header row ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.section-header .section-title {
  margin: 0;
}

/* ── Maturita Period Progress ── */
.maturita-progress {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4) var(--sp-5);
}

.maturita-period-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.maturita-period-row:last-child {
  margin-bottom: 0;
}

.period-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--blue-700);
  width: 20px;
  flex-shrink: 0;
}

.period-name {
  font-size: var(--text-xs);
  color: var(--color-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--blue-700);
  flex-shrink: 0;
}

/* ── Test page result panel ── */
.result-panel {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  z-index: 150;
  overflow-y: auto;
  padding: var(--sp-6) var(--sp-4);
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + var(--sp-6));
  animation: resultFadeIn 0.4s ease-out;
}

@media (min-width: 768px) {
  .result-panel {
    padding: calc(var(--topnav-h) + var(--sp-8)) var(--sp-8) var(--sp-8);
  }
}

.result-panel-inner {
  max-width: 600px;
  margin: 0 auto;
}

.result-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
  box-shadow: 0 8px 32px rgba(74, 111, 165, 0.35);
}

.result-score-num {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.result-grade-badge {
  display: inline-block;
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  color: var(--blue-900);
  margin-bottom: var(--sp-5);
  opacity: 0;
}

.result-grade-badge.animate {
  animation: gradeSpring 0.5s ease-out forwards;
}

.result-stat-nums {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
  opacity: 0;
}

.result-stat-nums.animate {
  animation: fadeSlideUp 0.35s ease-out forwards;
}

.result-stat-item {
  text-align: center;
}

.result-stat-item strong {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--blue-700);
  line-height: 1;
  margin-bottom: 3px;
}

.result-stat-item span {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.result-answers-section {
  opacity: 0;
}

.result-answers-section.animate {
  animation: fadeSlideUp 0.35s ease-out forwards;
}

/* ── Result hero card ── */
.result-hero-card {
  background: var(--theme-gradient, linear-gradient(135deg, var(--blue-600) 0%, var(--blue-900) 100%));
  border-radius: var(--radius-xl);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  color: var(--white);
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
}

.result-hero-card::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Book/Author detail page ── */
.detail-hero {
  background: var(--color-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}

/* Mobile: reduce cover, keep side-by-side */
@media (max-width: 480px) {
  .detail-cover {
    width: 72px;
    height: 100px;
  }
  .detail-author-avatar {
    width: 72px;
    height: 72px;
  }
  .detail-title {
    font-size: var(--text-lg);
  }
  .detail-actions {
    gap: var(--sp-2);
  }
  .detail-actions .btn {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-xs);
    min-height: 36px;
  }
}

.detail-cover {
  width: 90px;
  height: 125px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 var(--sp-2) 0;
  line-height: 1.3;
}

.detail-meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
}

.detail-meta a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.detail-meta a:hover { text-decoration: underline; }

.detail-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}

.detail-section {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.detail-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 var(--sp-3) 0;
}

.detail-desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
  margin: 0;
}

.detail-quote {
  border-left: 3px solid var(--blue-400);
  padding-left: var(--sp-4);
  font-style: italic;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin: 0;
}

/* Author detail avatar */
.detail-author-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.detail-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Vybrat page: checkbox book rows ── */
.period-group {
  margin-bottom: var(--sp-6);
}

.period-group-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(90deg, var(--blue-700), var(--blue-600));
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
  display: inline-block;
}

.book-check-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-card);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.book-check-item:hover {
  border-color: var(--blue-300);
}

.book-check-item.selected {
  border-color: var(--color-primary);
  background: var(--blue-50);
}

.book-check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.book-check-thumb {
  width: 112px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: white;
}

.book-check-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(../img/logo/piktogram-colour-whiteBG.png) center / 28px auto no-repeat;
  z-index: 0;
}

.book-check-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

.book-check-info {
  flex: 1;
  min-width: 0;
}

.book-check-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-check-author {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* Maturita panel — static on mobile, sticky top on desktop */
.maturita-sticky {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
}

@media (min-width: 768px) {
  .maturita-sticky {
    position: sticky;
    top: calc(var(--topnav-h) + var(--sp-4));
    z-index: 40;
  }
}

.maturita-period-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.maturita-period-bar:last-child {
  margin-bottom: 0;
}

/* Search bar */
.search-bar {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: var(--sp-5);
}

.search-bar:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15);
}

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
}

/* ══════════════════════════════════════════════
   BOOK GRID (homepage — landscape horizontal tiles)
   ══════════════════════════════════════════════ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}

@media (max-width: 359px) {
  .book-grid { grid-template-columns: 1fr; }
}

@media (min-width: 480px) {
  .book-grid { gap: var(--sp-3); }
}

@media (min-width: 540px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .book-grid { grid-template-columns: repeat(4, 1fr); }
}

.book-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  box-shadow: var(--shadow-sm);
  /* Landscape tile: wider than tall */
  aspect-ratio: 5/3;
}

.book-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.book-card:hover .book-card-cover img { transform: scale(1.08); }

.book-card:active { transform: scale(0.97); }

/* Cover fills the whole tile */
.book-card-cover {
  position: absolute;
  inset: 0;
  background: url(../img/logo/piktogram-colour-whiteBG.png) center/40px no-repeat, white;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.35s ease;
}

/* Gradient overlay at bottom for text legibility */
.book-card-cover::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(8,12,28,0.93) 0%, rgba(8,12,28,0) 100%);
  pointer-events: none;
}

/* Info overlaid at the bottom */
.book-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  z-index: 1;
}

.book-card-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.book-card-author {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Díla v aplikaci — portrait grid cards ── */
.dila-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
}
.dila-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dila-card:active { transform: scale(0.98); }

.dila-card-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--blue-100);
}
.dila-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.dila-card-info {
  padding: var(--sp-2) var(--sp-3);
}
.dila-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dila-card-meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   BOOK DETAIL — hero banner
   ══════════════════════════════════════════════ */
.book-detail-banner {
  background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-700) 100%);
  margin-left: calc(-1 * var(--sp-4));
  margin-right: calc(-1 * var(--sp-4));
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.book-detail-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

@media (min-width: 600px) {
  .book-detail-banner {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--sp-6);
    padding: var(--sp-6) var(--sp-8);
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--sp-5);
    border-radius: var(--radius-xl);
  }
}

.book-detail-cover {
  width: 160px;
  height: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: url(../img/logo/piktogram-colour-whiteBG.png) center/36px no-repeat, white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

@media (min-width: 600px) {
  .book-detail-cover {
    width: 220px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  }
}

.book-detail-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.book-detail-info {
  color: var(--white);
  flex: 1;
  min-width: 0;
}

.book-detail-title {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--sp-2) 0;
}

@media (min-width: 600px) {
  .book-detail-title { font-size: var(--text-2xl); }
}

.book-detail-meta {
  font-size: var(--text-xs);
  opacity: 0.85;
  line-height: 1.6;
}

@media (min-width: 600px) {
  .book-detail-meta {
    font-size: var(--text-sm);
    line-height: 1.9;
  }
}

.book-detail-meta a {
  color: var(--blue-200);
  text-decoration: none;
  font-weight: 600;
}

.book-detail-meta a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════
   AUTHOR DETAIL — hero banner
   ══════════════════════════════════════════════ */
.author-detail-banner {
  background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-600) 100%);
  margin-left: calc(-1 * var(--sp-4));
  margin-right: calc(-1 * var(--sp-4));
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.author-detail-banner::before {
  content: '';
  position: absolute;
  bottom: -40%; left: -10%;
  width: 250px; height: 250px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

@media (min-width: 600px) {
  .author-detail-banner {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--sp-6);
    padding: var(--sp-8) var(--sp-8) var(--sp-6);
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--sp-5);
    border-radius: var(--radius-xl);
  }
}

.author-detail-avatar {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: url(../img/logo/piktogram-colour-whiteBG.png) center/28px no-repeat, white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 4px 16px rgba(0,0,0,0.25);
}

@media (min-width: 600px) {
  .author-detail-avatar {
    width: 110px;
    height: 110px;
    font-size: 3rem;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.2), 0 8px 32px rgba(0,0,0,0.3);
  }
}

.author-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-detail-info {
  color: var(--white);
  flex: 1;
  min-width: 0;
}

.author-detail-name {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--sp-1) 0;
  line-height: 1.3;
}

@media (min-width: 600px) {
  .author-detail-name { font-size: var(--text-2xl); }
}

.author-detail-dates {
  font-size: var(--text-xs);
  opacity: 0.8;
  margin-bottom: 2px;
}

.author-detail-period {
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ══════════════════════════════════════════════
   ACTION TILES (book/author actions)
   ══════════════════════════════════════════════ */
.detail-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

@media (min-width: 600px) {
  .detail-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
  }
}

.detail-action-tile {
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-2) var(--sp-3);
  text-align: center;
  text-decoration: none;
  color: var(--blue-700);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.3;
  transition: all 0.2s;
  cursor: pointer;
  min-height: 60px;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.detail-action-tile i {
  font-size: 1.2rem;
  color: var(--color-muted);
  display: block;
}

@media (min-width: 600px) {
  .detail-action-tile i {
    font-size: 1.5rem;
  }
  .detail-action-tile {
    min-height: 80px;
  }
}

.detail-action-tile:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.detail-action-tile:active { transform: scale(0.96); }

.detail-action-tile.primary {
  background: var(--theme-gradient, linear-gradient(135deg, var(--blue-600), var(--blue-700)));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(74,111,165,0.3);
}

.detail-action-tile.primary i { color: rgba(255,255,255,0.9); }

.detail-action-tile.primary:hover {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(74,111,165,0.45);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   AUTHOR QUOTE (featured)
   ══════════════════════════════════════════════ */
.author-quote-feature {
  background: linear-gradient(135deg, var(--blue-50), var(--white));
  border-left: 4px solid var(--blue-400);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}

@media (min-width: 600px) {
  .author-quote-feature {
    padding: var(--sp-5) var(--sp-5) var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-4);
  }
}

.author-quote-feature p {
  font-style: italic;
  color: var(--blue-900);
  font-size: var(--text-base);
  line-height: 1.8;
  margin: 0 0 var(--sp-2) 0;
}

.author-quote-attr {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 600;
  text-align: right;
}

/* ══════════════════════════════════════════════
   CONTENT SECTIONS (card style)
   ══════════════════════════════════════════════ */
.content-section {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}

@media (min-width: 600px) {
  .content-section {
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-4);
  }
}

.content-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0 0 var(--sp-2) 0;
}

.content-section-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.7;
  margin: 0;
}

/* ══════════════════════════════════════════════
   HERO XP LABEL ROW (profil)
   ══════════════════════════════════════════════ */
.hero-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.75);
  margin-bottom: var(--sp-2);
}

/* ══════════════════════════════════════════════
   MOBILE PROFILE HERO fix
   ══════════════════════════════════════════════ */
@media (max-width: 500px) {
  .profile-hero {
    flex-direction: column;
    text-align: center;
    padding: var(--sp-6) var(--sp-4) var(--sp-5);
    gap: var(--sp-3);
  }

  .profile-hero::before { display: none; }

  .profile-avatar {
    width: 76px;
    height: 76px;
    margin: 0 auto;
  }

  .profile-avatar-emoji {
    font-size: 3.2rem;
  }

  .profile-name {
    font-size: var(--text-xl);
  }

  .profile-level-badge {
    font-size: 0.72rem;
    margin-bottom: var(--sp-3);
    justify-content: center;
  }

  .hero-xp-label span:last-child {
    font-size: 0.65rem;
    text-align: right;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ══════════════════════════════════════════════
   FLASHKARTY
   ══════════════════════════════════════════════ */
.fc-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.fc-period-tabs {
  display: flex;
  gap: 2px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--color-border);
}

.fc-tab {
  padding: 5px 13px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fc-tab.active {
  background: var(--color-card);
  color: var(--blue-700);
  box-shadow: var(--shadow-sm);
}

.fc-selected-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.fc-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.fc-progress-text {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--blue-700);
  min-width: 40px;
  text-align: right;
}

/* 3-D flip card */
.flashcard-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  height: 280px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 480px) {
  .flashcard-scene { height: 300px; }
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.flashcard.flipped { transform: rotateY(180deg); }

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Front face — cover image with gradient overlay */
.flashcard-front {
  background: var(--theme-gradient, linear-gradient(145deg, var(--blue-700), var(--blue-900)));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}
.flashcard-front-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.flashcard-front-content {
  position: relative;
  z-index: 1;
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(to top, rgba(10,26,80,0.95) 0%, transparent 100%);
}
.flashcard-front-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: white;
  margin: 0 0 var(--sp-1) 0;
  line-height: 1.25;
}
.flashcard-front-author {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  margin: 0;
}

/* Back face */
.flashcard-back {
  background: var(--color-card);
  border: 2px solid var(--blue-200);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) var(--sp-5);
  gap: var(--sp-3);
  overflow-y: auto;
}
.fc-back-row {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.fc-back-thumb {
  width: 48px;
  height: 66px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.fc-back-info { flex: 1; min-width: 0; }
.fc-back-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 var(--sp-1) 0;
  line-height: 1.25;
}
.fc-back-meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
  line-height: 1.6;
  margin: 0;
}
.fc-back-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px var(--sp-3);
  font-size: var(--text-xs);
}
.fc-back-label {
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding-top: 2px;
}
.fc-back-value { color: var(--color-text); line-height: 1.5; }

.fc-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: var(--sp-3) 0 var(--sp-3);
  min-height: 1.5em;
}

/* ── Drag wrapper (handles slide-out animation) ── */
.flashcard-drag-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.35s ease, opacity 0.35s ease;
  will-change: transform;
}
.flashcard-drag-wrap.no-transition { transition: none !important; }

/* ── Swipe overlays — now inside flashcard-drag-wrap, move with card ── */
.fc-swipe-yes, .fc-swipe-no {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.fc-swipe-yes {
  background: rgba(22, 163, 74, 0.72);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.fc-swipe-no {
  background: rgba(220, 38, 38, 0.68);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ── Judge buttons ── */
.fc-judge {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.fc-judge.visible { display: flex; }
.fc-btn-no, .fc-btn-yes {
  flex: 1;
  max-width: 160px;
  min-height: 48px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}
.fc-btn-no {
  background: rgba(220,38,38,0.06);
  color: #dc2626;
  border-color: rgba(220,38,38,0.25);
}
.fc-btn-no:hover { background: rgba(220,38,38,0.13); border-color: rgba(220,38,38,0.5); }
.fc-btn-yes {
  background: rgba(22,163,74,0.06);
  color: #16a34a;
  border-color: rgba(22,163,74,0.25);
}
.fc-btn-yes:hover { background: rgba(22,163,74,0.13); border-color: rgba(22,163,74,0.5); }

/* ── Progress stats ── */
.fc-stat {
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 58px;
  white-space: nowrap;
}
.fc-stat-remaining { color: var(--blue-700); text-align: right; }
.fc-stat-mastered  { color: #16a34a; }

/* ══════════════════════════════════════════════
   LOSOVAČ
   ══════════════════════════════════════════════ */
.losovac-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-4) 0 var(--sp-2);
}
.losovac-filter-bar {
  display: flex;
  gap: var(--sp-2);
}
.losovac-filter-btn {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-card);
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.losovac-filter-btn.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}
.losovac-filter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.losovac-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.losovac-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-800));
  border: none;
  font-size: 2.8rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(37,99,235,0.38);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.losovac-btn:hover { transform: scale(1.07); box-shadow: 0 12px 36px rgba(37,99,235,0.48); }
.losovac-btn:active { transform: scale(0.95); }
.losovac-btn.spinning {
  animation: losovacSpin 0.12s linear infinite;
}
@keyframes losovacSpin {
  to { transform: rotate(360deg) scale(1.05); }
}
.losovac-subtitle {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 500;
}

.losovac-result {
  width: 100%;
  max-width: 400px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--blue-200);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.losovac-result.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.losovac-result-banner {
  position: relative;
  height: 110px;
  background: var(--theme-gradient, linear-gradient(135deg, var(--blue-700), var(--blue-900)));
  overflow: hidden;
}
.losovac-result-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.losovac-result-body { padding: var(--sp-4) var(--sp-5); }
.losovac-result-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 var(--sp-1) 0;
}
.losovac-result-meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: 0 0 var(--sp-4) 0;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════
   SETTINGS PAGE — Notion-style layout
   ══════════════════════════════════════════════ */
.settings-layout {
  display: flex;
  gap: var(--sp-6);
  align-items: flex-start;
}

.settings-sidebar {
  width: 190px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topnav-h) + var(--sp-6));
}

.settings-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
  margin-bottom: 2px;
}

.settings-sidebar-item:hover {
  background: var(--blue-100);
  color: var(--blue-900);
}

.settings-sidebar-item.active {
  background: var(--blue-600);
  color: var(--white);
  font-weight: 600;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 var(--sp-5) 0;
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Settings row */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-2);
  gap: var(--sp-4);
}

.settings-row-info { flex: 1; min-width: 0; }

.settings-row-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--blue-900);
}

.settings-row-desc {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--blue-600); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Settings avatar preview */
.settings-avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  overflow: hidden;
  clip-path: inset(0 round 50%);
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.9), 0 4px 16px rgba(74,111,165,0.25);
  flex-shrink: 0;
  position: relative;
}

/* Settings limits row */
.settings-limits-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-2);
}

.settings-limits-label {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--blue-900);
}

.settings-limits-sub {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 400;
  display: block;
  margin-top: 1px;
}

.settings-limits-control {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.settings-lim-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--blue-200);
  background: var(--white);
  color: var(--blue-700);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font);
}

.settings-lim-btn:hover {
  background: var(--blue-100);
  border-color: var(--blue-400);
}

.settings-lim-val {
  min-width: 32px;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--blue-900);
}

/* Mobile: horizontal tabs */
@media (max-width: 767px) {
  .settings-layout {
    flex-direction: column;
    gap: 0;
  }

  .settings-sidebar {
    width: 100%;
    position: static;
    display: flex;
    overflow-x: auto;
    gap: var(--sp-1);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--sp-4);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .settings-sidebar::-webkit-scrollbar { display: none; }

  .settings-sidebar-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: 0;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    gap: var(--sp-2);
    width: auto;
  }
}

/* ── Command list (nastavení – příkazy) ── */
.cmd-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cmd-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.cmd-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--blue-900);
  background: var(--blue-50);
  padding: 3px 10px;
  border-radius: var(--radius-md);
}

.cmd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.cmd-tag-coins  { background: #fef3c7; color: #92400e; }
.cmd-tag-xp     { background: #ede9fe; color: #5b21b6; }
.cmd-tag-unlock { background: #d1fae5; color: #065f46; }
.cmd-tag-danger { background: #fee2e2; color: #991b1b; }
.cmd-tag-info   { background: var(--blue-50); color: var(--blue-700); }

.cmd-desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: var(--sp-2) 0 var(--sp-2) 0;
}
.cmd-desc strong {
  color: var(--blue-700);
}

.cmd-example {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-xs);
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  width: fit-content;
}
.cmd-example::before {
  content: '> ';
  opacity: 0.5;
}

/* ── Badge Category Headers ── */
.badge-category-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--blue-700);
  margin: var(--sp-4) 0 var(--sp-3) 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.badge-category-title:first-child {
  margin-top: 0;
}

/* ── Recap Modal ── */
.recap-sheet {
  text-align: center;
}

.recap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.recap-card {
  background: var(--blue-50);
  border: 1.5px solid var(--blue-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-2);
}

.recap-card-icon {
  font-size: 1.6rem;
  margin-bottom: var(--sp-1);
}

.recap-card-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--blue-700);
  line-height: 1.1;
}

.recap-card-label {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 600;
  margin-top: 2px;
}

.recap-details {
  border-top: 1.5px solid var(--color-border);
  padding-top: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.recap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
  color: var(--blue-900);
}

.recap-row-icon {
  font-size: 1.1rem;
  margin-right: var(--sp-2);
  flex-shrink: 0;
}

.recap-row span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.recap-row strong {
  color: var(--blue-700);
  font-weight: 700;
}

.recap-message {
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--blue-700);
  font-weight: 600;
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}

/* ── Literární směry ── */

/* Clickable badge on autor/book detail */
.smer-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--smer-bg, var(--blue-50));
  border: 1.5px solid var(--smer-border, var(--blue-200));
  color: var(--smer-color, var(--blue-600));
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease;
  margin-top: var(--sp-2);
}

.smer-badge:hover {
  filter: brightness(0.92);
}

/* List on smery.html */
.smer-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.smer-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--smer-bg, #ffffff);
  border: 1.5px solid var(--smer-border, var(--blue-100));
  text-decoration: none;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.smer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.smer-card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

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

.smer-card-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--smer-color, var(--blue-700));
  line-height: 1.3;
}

.smer-card-period {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}

.smer-card-arrow {
  color: var(--smer-color, var(--color-muted));
  opacity: 0.6;
  flex-shrink: 0;
}

/* Hero strip on smer.html */
.smer-detail-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--smer-border, var(--blue-200));
  margin: var(--sp-4) 0 var(--sp-2) 0;
}

.smer-detail-hero-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  width: 52px;
  text-align: center;
}

.smer-detail-hero-info {
  flex: 1;
  min-width: 0;
}

.smer-detail-hero-name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.smer-detail-hero-period {
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 500;
}

/* Characteristic / representative list */
.smer-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.smer-detail-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--blue-900);
  line-height: 1.5;
}

.smer-detail-list-item::before {
  content: "•";
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Flashcard shuffle icon animation ── */
@keyframes fc-shuffle-spin {
  0%   { transform: rotate(0deg)   scale(1);    }
  35%  { transform: rotate(200deg) scale(1.25); }
  70%  { transform: rotate(330deg) scale(1.1);  }
  100% { transform: rotate(360deg) scale(1);    }
}
.fc-shuffle-spin {
  display: inline-block;
  animation: fc-shuffle-spin 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
