:root {
  --paper: #fffdf9;
  --background: #f7f3ed;
  --beige: #f1e8dc;
  --brown: #76513d;
  --brown-dark: #503729;
  --brown-light: #a1846e;
  --ink: #29241f;
  --muted: #81776e;
  --border: #e5dbcf;
  --green: #387653;
  --shadow: 0 14px 40px rgba(55, 39, 26, 0.07);
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top right,
      rgba(225, 208, 187, 0.3),
      transparent 32rem
    ),
    var(--background);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  line-height: 1.6;
}

/* Horní navigace */

.client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100% - 40px, 1000px);
  margin: 0 auto;
  padding: 26px 0;
}

.brand {
  color: var(--brown-dark);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.brand span {
  color: #bd8757;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  color: var(--brown-dark);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.back-link:hover {
  background: var(--beige);
  transform: translateY(-1px);
}

.back-link:focus-visible,
.brand:focus-visible {
  outline: 3px solid var(--brown-light);
  outline-offset: 4px;
}

/* Hlavní karta */

.profile-card {
  width: min(100% - 40px, 860px);
  margin: 28px auto 64px;
  padding: clamp(24px, 5vw, 48px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  animation: profile-enter 0.45s ease both;
}

.profile-eyebrow {
  margin: 0 0 8px;
  color: var(--brown-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.profile-card h1 {
  margin: 0;
  color: var(--brown-dark);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.profile-description {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Poslední skóre */

.score-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 34px 0 20px;
  padding: clamp(28px, 6vw, 44px) 18px;
  background: linear-gradient(145deg, #f5eee4, #eee1d1);
  border: 1px solid #e8d9c7;
  border-radius: 22px;
  text-align: center;
}

.score-panel p {
  margin: 0;
  color: var(--brown);
  font-size: 0.95rem;
  font-weight: 650;
}

.score-panel strong {
  color: var(--brown-dark);
  font-size: clamp(3rem, 10vw, 4.7rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.score-panel span {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Statistika */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stats > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.stats > div:hover {
  border-color: var(--brown-light);
  transform: translateY(-2px);
}

.stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.stats strong {
  color: var(--brown-dark);
  font-size: 1.55rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

/* Stav načítání a chybové zprávy */

#profile-status {
  margin: 22px 0;
  padding: 13px 16px;
  color: var(--muted);
  background: #faf7f2;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* Historie testů */

.profile-card h2 {
  margin: 34px 0 16px;
  color: var(--brown-dark);
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

#profile-history {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#profile-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 17px 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

#profile-history li:hover {
  background: #fcf8f2;
  border-color: var(--brown-light);
}

#profile-history li span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

#profile-history li strong {
  flex-shrink: 0;
  color: var(--brown);
  font-size: 1.05rem;
  font-weight: 800;
}

/* Mobilní zařízení */

@media (max-width: 560px) {
  .client-header {
    width: calc(100% - 28px);
    padding: 18px 0;
  }

  .brand {
    font-size: 1.35rem;
  }

  .back-link {
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .profile-card {
    width: calc(100% - 28px);
    margin: 16px auto 36px;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats > div {
    padding: 18px;
  }

  #profile-history li {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
  }
}

/* Omezení animací podle nastavení zařízení */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes profile-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
