/* === Level badge (tier emblem + level number overlay) === */
.tier-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.tier-badge--sm { width: 32px; height: 32px; }
.tier-badge--md { width: 48px; height: 48px; }
.tier-badge--lg { width: 96px; height: 96px; }

.tier-badge__icon {
  width: 100%;
  height: 100%;
  display: block;
}

.tier-badge__level {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 6%));
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  line-height: 1;
}

.tier-badge--sm .tier-badge__level { font-size: 11px; }
.tier-badge--md .tier-badge__level { font-size: 16px; }
.tier-badge--lg .tier-badge__level { font-size: 32px; }

/* === Inline level pill (next to user names in feed/comments) === */
.level-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px 1px 2px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  vertical-align: middle;
}

.level-pill__icon {
  width: 18px;
  height: 18px;
}

/* === Dashboard XP widget === */
.xp-widget {
  background: linear-gradient(135deg, #ffffff 0%, #E3ECDB 100%);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.xp-widget__title {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.xp-widget__tier {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.xp-widget__progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.xp-widget__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #36B621 0%, #22d3ee 100%);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.xp-widget__details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

.xp-widget__details strong { color: #111; font-weight: 700; }

.xp-widget__hint {
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(54, 182, 33, 0.1);
  color: #1f7a14;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

/* === XP toast (custom, nezávislé na Notyf/Toastr) === */
.xp-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.xp-toast {
  pointer-events: auto;
  background: linear-gradient(135deg, #36B621 0%, #22d3ee 100%);
  color: #fff;
  padding: 12px 18px 12px 14px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  animation: xp-toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.xp-toast--levelup {
  background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
  color: #2a1f00;
}

.xp-toast--tierup {
  background: linear-gradient(135deg, #B5179E 0%, #E63946 100%);
  box-shadow: 0 16px 40px rgba(229, 57, 70, 0.45);
}

.xp-toast--badge {
  background: linear-gradient(135deg, #ffffff 0%, #E3ECDB 100%);
  color: #111;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  border: 2px solid #36B621;
}

.xp-toast--badge .xp-toast__amount { color: #1f7a14; }
.xp-toast--badge .xp-toast__msg { color: #4b5563; }

.xp-toast.fade-out {
  animation: xp-toast-out 0.4s ease-out forwards;
}

.xp-toast__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.xp-toast__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.xp-toast__amount {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}

.xp-toast__msg {
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.2;
}

@keyframes xp-toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes xp-toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* === Profile gamification section === */
.ci-profile-gamification {
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ci-profile-gamification__hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ci-profile-gamification__info { flex: 1; min-width: 0; }

.ci-profile-gamification__tier {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  margin: 0 0 2px 0;
  line-height: 1.1;
}

.ci-profile-gamification__meta {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.ci-profile-gamification__meta strong { color: #111; font-weight: 700; }

.ci-profile-gamification__progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ci-profile-gamification__progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

.ci-profile-gamification__progress-label strong { color: #111; }

.ci-profile-gamification__divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 0;
}

.ci-profile-gamification__section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.ci-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 12px;
}

.ci-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 10px;
  transition: transform 0.15s ease;
  cursor: help;
}

.ci-badge:hover { transform: translateY(-2px); }

.ci-badge__icon {
  width: 56px;
  height: 56px;
}

.ci-badge--locked .ci-badge__icon {
  filter: grayscale(100%);
  opacity: 0.32;
}

.ci-badge__name {
  font-size: 11px;
  font-weight: 600;
  color: #111;
  line-height: 1.2;
  word-break: break-word;
}

.ci-badge--locked .ci-badge__name { color: #9ca3af; font-weight: 500; }

.ci-badge__progress {
  font-size: 10px;
  color: #1f7a14;
  background: rgba(54, 182, 33, 0.12);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.ci-badges-empty {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  padding: 16px;
}

/* === Tier-up ceremony modal === */
.tier-up-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  animation: tierup-overlay-in 0.4s ease-out;
}

.tier-up-modal.is-open { display: flex; }

.tier-up-modal__card {
  background: linear-gradient(135deg, #ffffff 0%, #FFF6BE 100%);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: tierup-card-in 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.tier-up-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 10px;
}

.tier-up-modal__close:hover { color: #111; }

.tier-up-modal__emblem {
  width: 140px;
  height: 140px;
  margin: 8px auto 18px auto;
  position: relative;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
  animation: tierup-spin 0.9s cubic-bezier(0.5, 0, 0.5, 1);
}

.tier-up-modal__emblem img { width: 100%; height: 100%; }

.tier-up-modal__emblem .tier-badge__level {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -42%);
  font-weight: 800;
  font-size: 48px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.tier-up-modal__title {
  font-size: 26px;
  font-weight: 800;
  color: #111;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.tier-up-modal__subtitle {
  font-size: 15px;
  color: #4b5563;
  margin: 0 0 22px 0;
}

.tier-up-modal__share-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.tier-up-modal__share {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tier-up-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #111;
}

.tier-up-share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18); }
.tier-up-share-btn svg { width: 18px; height: 18px; }
.tier-up-share-btn--fb { background: #1877F2; color: #fff; }
.tier-up-share-btn--x { background: #000; color: #fff; }
.tier-up-share-btn--li { background: #0A66C2; color: #fff; }
.tier-up-share-btn--wa { background: #25D366; color: #fff; }

.tier-up-modal__primary {
  background: linear-gradient(135deg, #36B621 0%, #22d3ee 100%);
  color: #fff;
  border: 0;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 12px rgba(54, 182, 33, 0.3);
}

.tier-up-modal__primary:hover { filter: brightness(1.05); }

@keyframes tierup-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes tierup-card-in {
  from { transform: translateY(40px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

@keyframes tierup-spin {
  0%   { transform: rotate(-30deg) scale(0.6); opacity: 0; }
  60%  { transform: rotate(15deg)  scale(1.1); opacity: 1; }
  100% { transform: rotate(0)      scale(1); }
}

/* === Leaderboard === */
.ci-leaderboard tbody tr { transition: background 0.15s ease; }
.ci-leaderboard tbody tr:hover { background: rgba(54, 182, 33, 0.04); }

.ci-leaderboard__me {
  background: rgba(54, 182, 33, 0.1) !important;
  border-left: 3px solid #36B621;
}
.ci-leaderboard__me:hover { background: rgba(54, 182, 33, 0.16) !important; }
.ci-leaderboard__me td:first-child { padding-left: 9px; }
