/* =========================================================
      Käyttäjäprofiili ja profiilikuvat sovelluksen näkymissä
      ========================================================= */

.topbar-profile-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  line-height: 1;
}

.topbar-profile-btn .material-symbols-outlined {
  font-size: 30px;
  line-height: 1;
}

body.theme-sammakkoluola .topbar-profile-btn .material-symbols-outlined {
  color: #ffffff;
  text-shadow: 0 0 9px rgba(180, 255, 151, 0.32);
}

body.theme-sammakkoluola .topbar-profile-btn:hover .material-symbols-outlined,
body.theme-sammakkoluola .topbar-profile-btn:focus-visible .material-symbols-outlined {
  text-shadow: none;
}

.user-profile-modal-content {
  border-radius: 7px;
}

.user-profile-loading {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: normal;
}

.user-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.user-profile-stat-card {
  min-width: 0;
  padding: 1rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(42, 104, 43, 0.13);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.user-profile-stat-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  color: #225c29;
}

.user-profile-stat-heading .material-symbols-outlined {
  font-size: 27px;
}

.user-profile-stat-heading h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: normal;
}

.user-profile-main-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.user-profile-main-metrics > div {
  padding: 0.72rem 0.6rem;
  border-radius: 7px;
  background: rgba(35, 99, 42, 0.07);
  text-align: center;
}

.user-profile-main-metrics strong {
  display: block;
  color: #204d25;
  font-family: "Lilita One", sans-serif;
  font-size: 1.42rem;
  line-height: 1;
  font-weight: normal;
}

.user-profile-main-metrics span {
  display: block;
  margin-top: 0.26rem;
  color: #60755f;
  font-size: 0.78rem;
}

.user-profile-substat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.72rem;
  padding: 0.68rem 0.75rem;
  border-radius: 7px;
  background: rgba(30, 82, 36, 0.055);
  color: #375f39;
}

.user-profile-substat > .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 24px;
}

.user-profile-substat > div {
  min-width: 0;
}

.user-profile-substat span,
.user-profile-substat strong {
  display: block;
}

.user-profile-substat > div > span {
  font-size: 0.78rem;
  color: #647764;
}

.user-profile-substat > div > strong {
  margin-top: 0.08rem;
  font-size: 0.88rem;
  color: #2a542e;
}

.user-profile-medal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.profile-medal {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.25rem 0.15rem;
  text-align: center;
  background: transparent;
  box-shadow: none;
}

.profile-medal strong {
  font-family: "Lilita One", sans-serif;
  font-size: 1.38rem;
  line-height: 1.1;
  font-weight: normal;
  color: #244c29;
}

.user-profile-stat-continuous {
  grid-column: 1 / -1;
}

.user-profile-happy-hour-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.user-profile-happy-hour-metrics strong {
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 7px;
  text-align: center;
  background: rgba(255, 255, 255, 0.07);
}

.profile-fairy-display {
  transform: scale(0.82);
  transform-origin: center;
}

.profile-fairy-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.profile-fairy-metrics > div {
  padding: 0.72rem 0.6rem;
  border-radius: 7px;
  background: rgba(35, 99, 42, 0.07);
  text-align: center;
}

.profile-fairy-metrics strong {
  display: block;
  color: #204d25;
  font-family: "Lilita One", sans-serif;
  font-size: 1.42rem;
  line-height: 1;
  font-weight: normal;
}

.profile-fairy-metrics span {
  display: block;
  margin-top: 0.26rem;
  color: #60755f;
  font-size: 0.78rem;
}

.user-profile-stat-bingo {
  grid-column: 1 / -1;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics strong,
body.theme-sammakkoluola #userProfileModal .user-profile-substat,
body.theme-sammakkoluola #userProfileModal .user-profile-substat > div > strong {
  color: #ffffff !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics span,
body.theme-sammakkoluola #userProfileModal .user-profile-substat > div > span {
  color: rgba(238, 255, 232, 0.76) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics > div,
body.theme-sammakkoluola #userProfileModal .user-profile-substat,
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics > div {
  background: rgba(239, 255, 232, 0.075);
  border: 1px solid rgba(193, 255, 160, 0.09);
}

body.theme-sammakkoluola #userProfileModal .profile-medal strong,
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics strong {
  color: #f4ffef;
}

body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics span {
  color: rgba(238, 255, 232, 0.76);
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous .user-profile-stat-heading {
  color: #a7ff86 !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-normal .user-profile-stat-heading {
  color: #d5ffb4 !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies .user-profile-stat-heading {
  color: #d4b5ff !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo .user-profile-stat-heading {
  color: #9fefff !important;
}

@media (max-width: 767.98px) {

  .user-profile-stats-grid {
    grid-template-columns: 1fr;
  }

  .user-profile-stat-continuous,
  .user-profile-stat-bingo {
    grid-column: auto;
  }
}

@media (max-width: 420px) {

  .user-profile-main-metrics,
  .profile-fairy-metrics,
  .user-profile-happy-hour-metrics {
    gap: 0.45rem;
  }
}

.user-profile-stat-heading,
.user-profile-substat-heading {
  justify-content: center;
  text-align: center;
}

.user-profile-substat-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  color: #375f39;
}

.user-profile-substat-heading h5 {
  margin: 0;
  font-weight: normal;
}

.user-profile-happy-hour {
  display: block;
  width: 100%;
  padding: 0.78rem;
}

.user-profile-happy-hour-metrics {
  width: 100%;
}

.user-profile-normal-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-profile-stat-normal {
  grid-column: 1 / -1;
}

.user-profile-stat-normal .user-profile-medal-row {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(42, 104, 43, 0.12);
}

.profile-medal-emoji {
  display: block;
  font-size: clamp(36px, 7vw, 50px);
  line-height: 1;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.23));
}

.profile-stick-or-carrot-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(42, 104, 43, 0.12);
}

.profile-stick-or-carrot-row[hidden] {
  display: none !important;
}

.profile-stick-or-carrot-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 86px;
  padding: 0.55rem 0.4rem;
  border: 1px solid rgba(42, 104, 43, 0.1);
  border-radius: 7px;
  background: rgba(35, 99, 42, 0.055);
  text-align: center;
}

.profile-stick-or-carrot-emoji {
  display: block;
  font-size: clamp(34px, 6vw, 46px);
  line-height: 1;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.2));
}

.profile-stick-or-carrot-stat strong {
  color: #244c29;
  font-family: "Lilita One", sans-serif;
  font-size: 1.38rem;
  line-height: 1.1;
  font-weight: normal;
}

.profile-stick-or-carrot-carrots {
  background: linear-gradient(135deg, rgba(255, 155, 56, 0.1), rgba(255, 205, 95, 0.07));
}

.profile-stick-or-carrot-sticks {
  background: linear-gradient(135deg, rgba(88, 68, 47, 0.09), rgba(121, 95, 62, 0.06));
}

body.theme-sammakkoluola #userProfileModal .profile-stick-or-carrot-row {
  border-top-color: rgba(193, 255, 160, 0.11);
}

body.theme-sammakkoluola #userProfileModal .profile-stick-or-carrot-stat {
  border-color: color-mix(in srgb, var(--profile-rank-primary) 18%, transparent);
  background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--profile-rank-primary) 9%, transparent),
        color-mix(in srgb, var(--profile-rank-secondary) 7%, transparent)
      );
}

body.theme-sammakkoluola #userProfileModal .profile-stick-or-carrot-stat strong {
  color: #f4ffef;
}

.profile-fairy-static {
  animation: none !important;
  filter: drop-shadow(0 0 10px var(--fairy-drop-shadow-1))
        drop-shadow(0 0 18px var(--fairy-drop-shadow-2));
}

.profile-fairy-static .fairy-wing,
.profile-fairy-static .fairy-core,
.profile-fairy-static .fairy-core::before,
.profile-fairy-static .fairy-core::after {
  animation: none !important;
}

.profile-fairy-static .fairy-wing-left {
  transform: translateY(-6px) rotate(25deg) scaleY(0.94) scaleX(1.18);
}

.profile-fairy-static .fairy-wing-right {
  transform: translateY(-6px) rotate(-25deg) scaleY(0.94) scaleX(1.18);
}

.profile-fairy-static .fairy-wing-lower-left {
  transform: translateY(4px) rotate(-24deg) scaleY(0.94) scaleX(0.98);
}

.profile-fairy-static .fairy-wing-lower-right {
  transform: translateY(4px) rotate(24deg) scaleY(0.94) scaleX(0.98);
}

.profile-fairy-static .fairy-core {
  transform: translate(-50%, -50%) scale(1);
}

body.theme-sammakkoluola #userProfileModal .user-profile-substat-heading {
  color: #ffffff;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-normal .user-profile-medal-row {
  border-top-color: rgba(193, 255, 160, 0.11);
}

@media (max-width: 420px) {
  .user-profile-normal-metrics {
    grid-template-columns: 1fr;
  }
}

.user-profile-substat-heading h5 {
  font-size: 1.08rem;
}

.user-profile-substat-heading .material-symbols-outlined {
  font-size: 27px;
}

.user-profile-fairy-heading {
  min-height: 46px;
}

.profile-fairy-heading-visual {
  width: 50px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  overflow: visible;
}

.profile-fairy-heading-icon {
  width: 96px;
  height: 78px;
  transform: scale(0.43) !important;
  transform-origin: center;
  margin: 0;
}

.profile-fairy-heading-icon .fairy-core,
.profile-fairy-heading-icon .fairy-wing,
.profile-fairy-heading-icon .fairy-core::before,
.profile-fairy-heading-icon .fairy-core::after {
  animation: none !important;
}

.user-profile-bingo-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-profile-stat-bingo.is-complete {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08),
        0 0 0 2px rgba(74, 181, 83, 0.15),
        0 0 24px rgba(95, 214, 104, 0.12);
}

body.theme-sammakkoluola #userProfileModal .profile-bingo-complete {
  color: #f4ffef;
  background: linear-gradient(135deg, rgba(133, 255, 102, 0.14), rgba(65, 184, 128, 0.1));
  border-color: rgba(169, 255, 143, 0.18);
}

body.theme-sammakkoluola #userProfileModal .profile-bingo-complete .material-symbols-outlined {
  color: #adff91;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo.is-complete {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28),
        inset 0 0 22px rgba(164, 255, 128, 0.025),
        0 0 0 2px rgba(155, 255, 127, 0.12),
        0 0 26px rgba(111, 255, 116, 0.11);
}

@media (max-width: 575.98px) {
  .user-profile-bingo-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
  }

  #userProfileModal .user-profile-bingo-metrics > div {
    min-width: 0;
    padding: 0.68rem 0.34rem;
  }

  #userProfileModal .user-profile-bingo-metrics strong {
    font-size: 1.28rem;
  }

  #userProfileModal .user-profile-bingo-metrics span {
    font-size: 0.7rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }
}

#userProfileModal .user-profile-happy-hour-heading h4,
#userProfileModal .user-profile-happy-hour-heading .material-symbols-outlined {
  margin: 0;
  font-size: inherit;
}

#userProfileModal .user-profile-fairy-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  margin-bottom: 0.85rem;
  text-align: center;
}

#userProfileModal .user-profile-fairy-heading h4 {
  margin: 0;
  line-height: 1.15;
}

#userProfileModal .profile-fairy-heading-visual {
  position: relative;
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 36px;
  overflow: visible;
}

#userProfileModal .profile-fairy-heading-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 78px;
  margin: 0;
  transform: translate(-50%, -50%) scale(0.38) !important;
  transform-origin: center center;
}

@media (max-width: 420px) {
  #userProfileModal .user-profile-happy-hour-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#userProfileModal .user-profile-happy-hour {
  display: block;
  width: 100%;
  margin-top: 0.72rem;
  padding: 0.78rem;
  border-radius: 13px;
}

#userProfileModal .user-profile-happy-hour-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0 0 0.85rem;
  text-align: center;
}

#userProfileModal .user-profile-happy-hour-heading h4 {
  margin: 0;
  max-width: 100%;
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: normal;
}

#userProfileModal .user-profile-happy-hour-heading .material-symbols-outlined {
  flex: 0 0 auto;
  margin: 0;
  font-size: 27px;
  line-height: 1;
}

#userProfileModal .user-profile-happy-hour-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  margin: 0;
}

#userProfileModal .user-profile-happy-hour-metrics > div {
  min-width: 0;
  padding: 0.72rem 0.6rem;
  border-radius: 7px;
  text-align: center;
  background: rgba(35, 99, 42, 0.07);
}

#userProfileModal .user-profile-happy-hour-metrics strong {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #204d25;
  font-family: "Lilita One", sans-serif;
  font-size: 1.42rem;
  line-height: 1;
  font-weight: normal;
}

#userProfileModal .user-profile-happy-hour-metrics span {
  display: block;
  margin-top: 0.26rem;
  color: #60755f;
  font-size: 0.78rem;
  line-height: 1.2;
}

body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics > div {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(193, 255, 160, 0.08);
}

body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics strong {
  color: #ffffff;
}

body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics span {
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-happy-hour-heading {
    align-items: flex-start;
  }

  #userProfileModal .user-profile-happy-hour-heading h4 {
    font-size: 1rem;
  }
}

#userProfileModal .user-profile-stat-fairies {
  grid-column: 1 / -1;
}

#userProfileModal .profile-fairy-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#userProfileModal .profile-fairy-metrics.has-luck-stat {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#userProfileModal #profileFairyLuckMetric[hidden] {
  display: none !important;
}

@media (max-width: 575.98px) {
  #userProfileModal .profile-fairy-metrics.has-luck-stat {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
  }

  #userProfileModal .profile-fairy-metrics.has-luck-stat > div {
    min-width: 0;
    padding: 0.68rem 0.34rem;
  }

  #userProfileModal .profile-fairy-metrics.has-luck-stat strong {
    font-size: 1.24rem;
  }

  #userProfileModal .profile-fairy-metrics.has-luck-stat span {
    font-size: 0.69rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }
}

#userProfileModal.is-stacked-over-scoreboard {
  z-index: 20040 !important;
}

.modal-backdrop.user-profile-stacked-backdrop {
  z-index: 20030 !important;
}

@keyframes profileMetricChromaticFlow {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

body.theme-sammakkoluola .user-profile-modal-content {
  border-radius: 7px !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-modal-content {
  --profile-rank-primary: #91e873;
  --profile-rank-secondary: #9565ff;
  --profile-rank-tertiary: #59dcca;
  --profile-rank-glow: rgba(139, 228, 112, 0.3);
  position: relative;
}

#userProfileModal .user-profile-stat-card,
#userProfileModal .user-profile-main-metrics > div,
#userProfileModal .user-profile-substat,
#userProfileModal .profile-fairy-metrics > div,
#userProfileModal .profile-bingo-complete,
#userProfileModal .user-profile-happy-hour,
#userProfileModal .user-profile-happy-hour-metrics > div {
  border-radius: 7px !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-card {
  --profile-section-primary: #8edb73;
  --profile-section-secondary: #8c64ff;
  background: radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--profile-section-primary) 15%, transparent), transparent 41%),
        radial-gradient(circle at 94% 90%, color-mix(in srgb, var(--profile-section-secondary) 13%, transparent), transparent 43%),
        linear-gradient(145deg, rgba(5, 24, 12, 0.71), rgba(34, 25, 52, 0.49));
  border-color: color-mix(in srgb, var(--profile-section-primary) 29%, transparent);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28),
        inset 0 0 22px color-mix(in srgb, var(--profile-section-secondary) 4%, transparent);
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous {
  --profile-section-primary: #83e66b;
  --profile-section-secondary: #4ed9c1;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-normal {
  --profile-section-primary: #b783ff;
  --profile-section-secondary: #8fe36a;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies {
  --profile-section-primary: #d377ff;
  --profile-section-secondary: #56d9f2;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo {
  --profile-section-primary: #66b8ff;
  --profile-section-secondary: #9a74ff;
}

body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour {
  --profile-section-primary: #ffb55e;
  --profile-section-secondary: #b56cff;
  border: 1px solid color-mix(in srgb, var(--profile-section-primary) 25%, transparent) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-substat-heading {
  color: color-mix(in srgb, var(--profile-section-primary) 78%, white) !important;
  text-shadow: 0 0 12px color-mix(in srgb, var(--profile-section-primary) 25%, transparent);
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics > div,
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics > div {
  background-image: linear-gradient(125deg,
          color-mix(in srgb, var(--profile-section-primary, var(--profile-rank-primary)) 19%, rgba(255,255,255,0.055)),
          color-mix(in srgb, var(--profile-rank-secondary) 15%, rgba(255,255,255,0.045)),
          color-mix(in srgb, var(--profile-section-secondary, var(--profile-rank-tertiary)) 17%, rgba(255,255,255,0.055))) !important;
  background-size: 240% 240% !important;
  border: 1px solid color-mix(in srgb, var(--profile-section-primary, var(--profile-rank-primary)) 22%, transparent) !important;
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.025),
        0 0 14px color-mix(in srgb, var(--profile-section-secondary, var(--profile-rank-tertiary)) 7%, transparent);
  animation: profileMetricChromaticFlow 13s ease-in-out infinite;
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics > div:nth-child(2),
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics > div:nth-child(2) {
  animation-direction: reverse;
  animation-delay: -4s;
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics > div:nth-child(3),
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics > div:nth-child(3) {
  animation-delay: -8s;
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics strong,
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics strong {
  color: #ffffff !important;
  text-shadow: 0 0 11px color-mix(in srgb, var(--profile-section-primary, var(--profile-rank-primary)) 30%, transparent);
}

body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics span,
body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics span {
  color: rgba(245, 241, 255, 0.82) !important;
}

@media (max-width: 575.98px) {
  body.theme-sammakkoluola .user-profile-modal-content {
    border-radius: 7px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-sammakkoluola #userProfileModal .user-profile-main-metrics > div,
  body.theme-sammakkoluola #userProfileModal .profile-fairy-metrics > div,
  body.theme-sammakkoluola #userProfileModal .profile-bingo-complete {
    animation: none !important;
  }
}

#userProfileModal {
  --drink-liquid-air-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
  --drink-liquid-highlight-path: polygon(0 37.8%, 100% 37.8%, 100% 43.2%, 0 43.2%);
}

.scoreboard-activity-fairy-icon.profile-fairy-heading-icon,
.scoreboard-activity-fairy-icon .profile-fairy-heading-icon {
  margin: 0;
}

#userProfileModal .profile-stick-or-carrot-row {
  width: min(68%, 25rem);
  margin: 0.35rem auto 0;
  padding: 0;
  border: 0;
  gap: 0.7rem;
}

#userProfileModal .profile-stick-or-carrot-stat,
body.theme-sammakkoluola #userProfileModal .profile-stick-or-carrot-stat {
  min-height: 0;
  padding: 0.25rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#userProfileModal .profile-stick-or-carrot-emoji {
  font-size: clamp(36px, 7vw, 50px);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.23));
}

#userProfileModal .profile-stick-or-carrot-stat strong {
  font-size: 1.38rem;
}

#userProfileModal .profile-bingo-complete,
body.theme-sammakkoluola #userProfileModal .profile-bingo-complete {
  --profile-bingo-complete-size: clamp(1rem, 2.8vw, 1.08rem);
  color: #ffffff !important;
  background-color: #278f4a !important;
  background-image: linear-gradient(135deg, #278f4a, #39ab5c) !important;
  background-size: 100% 100% !important;
  border-color: rgba(202, 255, 215, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 5px 14px rgba(20, 106, 53, 0.2) !important;
  animation: none !important;
}

#userProfileModal .profile-bingo-complete strong,
body.theme-sammakkoluola #userProfileModal .profile-bingo-complete strong {
  display: inline-flex;
  align-items: center;
  color: #ffffff !important;
  font-size: var(--profile-bingo-complete-size);
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

#userProfileModal .profile-bingo-complete .material-symbols-outlined,
body.theme-sammakkoluola #userProfileModal .profile-bingo-complete .material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  color: #ffffff !important;
  font-size: var(--profile-bingo-complete-size);
  line-height: 1;
  transform: translateY(-0.15em);
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

@media (max-width: 420px) {
  #userProfileModal .profile-stick-or-carrot-row {
    width: 78%;
  }
}

#userProfileModal .user-profile-category-points {
  padding: 1rem;
  border: 1px solid rgba(96, 201, 126, 0.2);
  border-radius: 7px;
  background: radial-gradient(circle at 12% 8%, rgba(177, 255, 145, 0.08), transparent 34%),
        linear-gradient(145deg, rgba(9, 25, 17, 0.92), rgba(29, 44, 52, 0.88));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18),
        inset 0 0 22px rgba(137, 255, 163, 0.025);
}

#userProfileModal .user-profile-category-points[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-category-points-heading {
  margin-bottom: 0.8rem;
  color: #ffffff;
}

#userProfileModal .user-profile-category-points-heading h4 {
  color: inherit;
}

#userProfileModal .user-profile-category-points-list {
  display: grid;
  gap: 0.58rem;
}

#userProfileModal .profile-category-points-card {
  --profile-category-accent: #74808d;
  --profile-category-accent-2: #313943;
  --profile-category-icon-color: #eff4f7;
  --profile-category-image: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.72rem;
  min-height: 66px;
  padding: 0.68rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--profile-category-accent) 42%, transparent);
  border-left: 4px solid var(--profile-category-accent);
  border-radius: 7px;
  background: linear-gradient(
          106deg,
          color-mix(in srgb, var(--profile-category-accent) 20%, transparent),
          color-mix(in srgb, var(--profile-category-accent-2) 12%, transparent) 47%,
          transparent 80%
        ),
        rgba(4, 13, 11, 0.86);
  color: #ffffff;
}

#userProfileModal .profile-category-points-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--profile-category-image);
  background-position: right center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.18;
  filter: saturate(0.95) contrast(1.08);
}

#userProfileModal .profile-category-points-card > * {
  position: relative;
  z-index: 1;
}

#userProfileModal .profile-category-points-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--profile-category-accent) 58%, transparent);
  border-radius: 50%;
  color: var(--profile-category-icon-color);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--profile-category-accent) 38%, transparent));
}

#userProfileModal .profile-category-points-icon > .material-symbols-outlined {
  font-size: 1.3rem;
  line-height: 1;
}

#userProfileModal .profile-category-points-content {
  min-width: 0;
  display: grid;
  gap: 0.42rem;
}

#userProfileModal .profile-category-points-title {
  overflow: hidden;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userProfileModal .profile-category-points-track {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

#userProfileModal .profile-category-points-fill {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--profile-category-accent), var(--profile-category-accent-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--profile-category-accent) 42%, transparent);
  transition: width 0.45s ease;
}

#userProfileModal .profile-category-points-value {
  min-width: 4.6rem;
  color: #ffffff;
  font-family: "Lilita One", sans-serif;
  font-size: 1.05rem;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

#userProfileModal .profile-category-karaoke {
  --profile-category-accent: #b66eff;
  --profile-category-accent-2: #8f54ff;
  --profile-category-icon-color: #ddc4ff;
  --profile-category-image: url("img/karaoke.png");
}

#userProfileModal .profile-category-yleinen {
  --profile-category-accent: #66717d;
  --profile-category-accent-2: #252d36;
  --profile-category-icon-color: #111820;
  --profile-category-image: url("img/yleinen.png");
}

#userProfileModal .profile-category-yleinen .profile-category-points-icon {
  background: rgba(238, 243, 247, 0.91);
}

#userProfileModal .profile-category-yleinen .profile-category-points-fill {
  background: linear-gradient(90deg, #f7f8fa, #aeb6bf);
  box-shadow: 0 0 10px rgba(221, 226, 231, 0.24);
}

#userProfileModal .profile-category-rakkaus {
  --profile-category-accent: #ff8dc4;
  --profile-category-accent-2: #ff66b0;
  --profile-category-icon-color: #ffd0e8;
  --profile-category-image: url("img/rakkaus.png");
}

#userProfileModal .profile-category-juominen {
  --profile-category-accent: #ff9a40;
  --profile-category-accent-2: #ff7330;
  --profile-category-icon-color: #ffd1a0;
  --profile-category-image: url("img/juominen.png");
}

#userProfileModal .profile-category-pelit-ja-kilpailut {
  --profile-category-accent: #975dff;
  --profile-category-accent-2: #39edff;
  --profile-category-icon-color: #91fff2;
  --profile-category-image: url("img/pelit ja kilpailut.png");
  background: linear-gradient(
          110deg,
          rgba(151, 93, 255, 0.2),
          rgba(57, 237, 255, 0.13) 42%,
          rgba(123, 255, 148, 0.1) 70%,
          transparent 88%
        ),
        rgba(4, 12, 16, 0.86);
}

#userProfileModal .profile-category-pelit-ja-kilpailut .profile-category-points-fill {
  background: linear-gradient(90deg, #975dff, #39edff 56%, #7bff94);
}

#userProfileModal .profile-category-eheytyminen {
  --profile-category-accent: #67baff;
  --profile-category-accent-2: #3f87ff;
  --profile-category-icon-color: #b8e2ff;
  --profile-category-image: url("img/eheytyminen.png");
}

#userProfileModal .profile-category-points-fairy-icon {
  overflow: visible;
}

#userProfileModal .profile-category-fairy-display {
  width: 96px;
  height: 78px;
  margin: 0;
  transform: scale(0.42) !important;
  transform-origin: center;
}

#userProfileModal .profile-category-fairy-display,
#userProfileModal .profile-category-fairy-display *,
#userProfileModal .profile-category-fairy-display::before,
#userProfileModal .profile-category-fairy-display::after,
#userProfileModal .profile-category-fairy-display *::before,
#userProfileModal .profile-category-fairy-display *::after {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-category-points {
    padding: 0.72rem;
  }

  #userProfileModal .profile-category-points-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 0.56rem;
    min-height: 58px;
    padding: 0.58rem 0.62rem;
  }

  #userProfileModal .profile-category-points-icon {
    width: 32px;
    height: 32px;
  }

  #userProfileModal .profile-category-points-icon > .material-symbols-outlined {
    font-size: 1.1rem;
  }

  #userProfileModal .profile-category-points-title {
    font-size: 0.84rem;
  }

  #userProfileModal .profile-category-points-value {
    min-width: 3.9rem;
    font-size: 0.92rem;
  }

  #userProfileModal .profile-category-points-track {
    height: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #userProfileModal .profile-category-points-fill {
    transition: none;
  }
}

#userProfileModal .profile-category-juominen .profile-category-points-icon {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  background: transparent;
  border-color: transparent;
  color: #fff8ef;
  box-shadow: 0 0 10px rgba(255, 154, 64, 0.22);
}

#userProfileModal .profile-category-juominen .profile-category-points-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  box-sizing: border-box;
  border: 1px solid rgba(255, 142, 42, 0.98);
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055),
        inset 0 9px 12px rgba(255, 255, 255, 0.045);
}

#userProfileModal .profile-category-juominen .profile-category-points-icon > .material-symbols-outlined {
  position: relative;
  z-index: 3;
  color: #fff8ef;
  filter: drop-shadow(0 1px 2px rgba(71, 22, 0, 0.34));
}

#userProfileModal .user-profile-achievements {
  padding: 0.72rem 0.8rem 0.82rem;
  border: 1px solid rgba(42, 104, 43, 0.13);
  border-radius: 0.5rem;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 239, 0.78));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

#userProfileModal .user-profile-achievements[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-achievements-header {
  position: relative;
  min-height: 32px;
  margin-bottom: 0.65rem;
}

#userProfileModal .user-profile-achievements-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 32px;
  padding-inline: 3.8rem;
  color: #225c29;
  text-align: center;
}

#userProfileModal .user-profile-achievement-currency {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

#userProfileModal .user-profile-achievements-heading .material-symbols-outlined {
  font-size: 25px;
}

#userProfileModal .user-profile-achievements-heading h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: normal;
}

#userProfileModal .user-profile-achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  align-items: center;
  justify-items: center;
  gap: 0.55rem 0.48rem;
}

#userProfileModal .user-profile-achievements-grid.shows-descriptions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  justify-items: stretch;
  gap: 0.58rem;
}

#userProfileModal .user-profile-achievement-entry {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
  padding: 0.55rem 0.62rem;
  border: 1px solid rgba(42, 104, 43, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.5);
}

#userProfileModal .user-profile-achievement-text {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

#userProfileModal .user-profile-achievement-name {
  color: #225c29;
  font-size: 0.92rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

#userProfileModal .user-profile-achievement-description {
  color: rgba(24, 55, 31, 0.78);
  font-size: 0.78rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

#userProfileModal .user-profile-achievements-empty {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 0.7rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(28, 66, 35, 0.72);
  text-align: center;
}

#userProfileModal .user-profile-achievement-ball {
  --achievement-accent: #86da73;
  --achievement-accent-2: #8d68ff;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  flex: 0 0 54px;
  inline-size: 54px;
  block-size: 54px;
  min-inline-size: 54px;
  min-block-size: 54px;
  max-inline-size: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--achievement-accent) 68%, white);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 38%),
        linear-gradient(135deg, var(--achievement-accent), var(--achievement-accent-2));
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24),
        0 0 11px color-mix(in srgb, var(--achievement-accent) 28%, transparent);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

#userProfileModal .user-profile-achievement-ball:hover {
  transform: translateY(-2px) scale(1.045);
  filter: brightness(1.08);
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.28),
        0 0 16px color-mix(in srgb, var(--achievement-accent) 42%, transparent);
}

#userProfileModal .user-profile-achievement-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

#userProfileModal .user-profile-achievement-fallback {
  position: relative;
  z-index: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 27px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

#userProfileModal .user-profile-achievement-ball.is-special-image-icon {
  background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.26), transparent 38%),
        linear-gradient(135deg, rgba(54, 171, 87, 0.92), rgba(104, 220, 167, 0.88), rgba(112, 97, 255, 0.82));
}

#userProfileModal .user-profile-achievement-special-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.62))
        drop-shadow(0 0 11px rgba(91, 255, 138, 0.58));
}

#userProfileModal .achievement-category-karaoke {
  --achievement-accent: #b66eff;
  --achievement-accent-2: #8151ed;
}

#userProfileModal .achievement-category-yleinen {
  --achievement-accent: #d9e0e6;
  --achievement-accent-2: #69737e;
}

#userProfileModal .achievement-category-rakkaus {
  --achievement-accent: #ff8dc4;
  --achievement-accent-2: #f45da8;
}

#userProfileModal .achievement-category-juominen {
  --achievement-accent: #ffad55;
  --achievement-accent-2: #f06b24;
}

#userProfileModal .achievement-category-pelit-ja-kilpailut {
  --achievement-accent: #9b66ff;
  --achievement-accent-2: #43dfce;
}

#userProfileModal .achievement-category-eheytyminen {
  --achievement-accent: #6fc3ff;
  --achievement-accent-2: #487cff;
}

body.theme-sammakkoluola #userProfileModal .user-profile-achievements {
  border-color: color-mix(in srgb, var(--profile-rank-primary) 29%, transparent);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28),
        inset 0 0 22px color-mix(in srgb, var(--profile-rank-secondary) 4%, transparent);
}

body.theme-sammakkoluola #userProfileModal .user-profile-achievements-heading {
  color: color-mix(in srgb, var(--profile-rank-primary) 78%, white);
}

body.theme-sammakkoluola #userProfileModal .user-profile-achievement-entry,
body.theme-sammakkoluola #userProfileModal .user-profile-achievements-empty {
  border-color: rgba(218, 255, 218, 0.12);
  background: rgba(3, 15, 9, 0.34);
}

body.theme-sammakkoluola #userProfileModal .user-profile-achievement-name {
  color: color-mix(in srgb, var(--profile-rank-primary) 76%, white);
}

body.theme-sammakkoluola #userProfileModal .user-profile-achievement-description,
body.theme-sammakkoluola #userProfileModal .user-profile-achievements-empty {
  color: rgba(238, 255, 239, 0.76);
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-achievements {
    padding: 0.65rem 0.58rem 0.72rem;
  }

  #userProfileModal .user-profile-achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 0.48rem 0.34rem;
  }

  #userProfileModal .user-profile-achievements-heading {
    padding-inline: 3.25rem;
  }

  #userProfileModal .user-profile-achievements-grid.shows-descriptions {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  #userProfileModal .user-profile-achievement-entry {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.5rem 0.55rem;
  }

  #userProfileModal .user-profile-achievement-ball {
    flex-basis: 48px;
    inline-size: 48px;
    block-size: 48px;
    min-inline-size: 48px;
    min-block-size: 48px;
  }

  #userProfileModal .user-profile-achievement-fallback {
    font-size: 24px;
  }
}

#userProfileModal .profile-category-juominen .drink-liquid-icon {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767.98px) {
  #topBar .topbar-profile-btn {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    padding: 0 !important;
    border-radius: 999px !important;
    box-sizing: border-box;
  }
}

/* =========================================================
      Profiilikuvan näyttöintegraatio ja profiilimodaalin viimeistely
      ========================================================= */

.topbar-profile-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 2px 7px rgba(0, 0, 0, 0.3);
}

.topbar-profile-image[hidden],
.user-profile-picture[hidden] {
  display: none !important;
}

.user-profile-picture-cluster {
  position: relative;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
}

.user-profile-picture-frame {
  display: grid;
  width: 76px;
  height: 76px;
  overflow: hidden;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  color: #416342;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18), 0 0 18px var(--profile-rank-glow, rgba(80, 170, 65, 0.24));
}

.user-profile-picture-frame > .material-symbols-outlined {
  font-size: 3.3rem;
}

.user-profile-picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 420px) {
  .user-profile-picture-cluster,
  .user-profile-picture-frame {
    width: 58px;
    height: 58px;
  }

  .user-profile-picture-frame > .material-symbols-outlined {
    font-size: 2.65rem;
  }
}

.topbar-profile-image {
  transition: transform 140ms ease, filter 140ms ease;
}

#topBar .topbar-profile-btn:hover .topbar-profile-image,
#topBar .topbar-profile-btn:focus-visible .topbar-profile-image {
  transform: scale(1.08);
  filter: brightness(1.08) drop-shadow(0 0 5px rgba(151, 255, 120, 0.38));
}

#topBar .topbar-profile-btn .app-bar-action-icon-wrap {
  overflow: hidden;
  border-radius: 50%;
  color: #416342;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86), 0 2px 7px rgba(0, 0, 0, 0.24);
}

body.theme-sammakkoluola #topBar .topbar-profile-btn .app-bar-action-icon-wrap > .material-symbols-outlined {
  color: #416342;
  text-shadow: none;
}

.topbar-profile-image {
  background: #fff;
}

#userProfileModal .user-profile-modal-header .modal-title {
  grid-column: 1;
  justify-self: start;
}

.user-profile-image-edit-btn {
  grid-column: 2;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  justify-self: center;
  padding: 0.46rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7a43ad, #247443);
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.24);
  font: inherit;
  line-height: 1.15;
  white-space: nowrap;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.user-profile-image-edit-btn:hover,
.user-profile-image-edit-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.user-profile-image-edit-btn:focus-visible {
  outline: 2px solid rgba(204, 255, 163, 0.96);
  outline-offset: 2px;
}

.user-profile-image-edit-btn .material-symbols-outlined {
  font-size: 1.05rem;
}

.user-profile-image-edit-btn[hidden] {
  display: none !important;
}

@media (max-width: 575.98px) {
  .user-profile-image-edit-btn {
    min-height: 34px;
    padding: 0.4rem 0.58rem;
    font-size: 0.72rem;
  }

  .user-profile-image-edit-btn .material-symbols-outlined {
    font-size: 0.98rem;
  }
}

@media (max-width: 390px) {
  .user-profile-image-edit-btn > span:last-child {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-modal-header {
    column-gap: 0.45rem;
    row-gap: 0.55rem;
  }

  #userProfileModal .user-profile-modal-header .btn-close {
    grid-column: 2;
    grid-row: 1;
  }

  #userProfileModal .user-profile-image-edit-btn {
    justify-self: center;
  }
}

@media (max-width: 420px) {
  #userProfileModal .user-profile-image-edit-btn {
    padding: 0.38rem 0.58rem;
    font-size: 0.68rem;
  }
}

#userProfileModal .user-profile-modal-header {
  grid-template-columns: minmax(0, 1fr) auto;
}

#userProfileModal .user-profile-modal-header .btn-close {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}

#userProfileModal .user-profile-modal-header .modal-title {
  flex: 0 1 auto;
}

#userProfileModal .user-profile-image-edit-btn {
  grid-column: auto;
  grid-row: auto;
  flex: 0 0 auto;
  justify-self: auto;
  margin-left: 0.2rem;
  border-radius: 7px;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-modal-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame > .material-symbols-outlined {
    font-size: 2.45rem;
  }

  #userProfileModal .user-profile-image-edit-btn {
    grid-column: auto;
    grid-row: auto;
    min-height: 32px;
    margin-left: 0;
    padding: 0.34rem 0.48rem;
    font-size: 0.66rem;
  }

  #userProfileModal .user-profile-image-edit-btn .material-symbols-outlined {
    font-size: 0.92rem;
  }
}

@media (max-width: 390px) {

  #userProfileModal .user-profile-image-edit-btn > span:last-child {
    max-width: 94px;
  }
}

#userProfileModal .user-profile-modal-header {
  position: relative;
}

#userProfileModal .user-profile-header-layout {
  gap: 0.9rem;
}

#userProfileModal .user-profile-modal-header .btn-close {
  position: static;
  flex: 0 0 auto;
  margin: 0 !important;
}

#userProfileModal .user-profile-header-picture-cluster,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  flex: 0 0 100px;
}

#userProfileModal .user-profile-header-picture-cluster {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
}

#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  border-width: 3px;
}

#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame > .material-symbols-outlined {
  font-size: 4.7rem;
}

#userProfileModal .user-profile-image-edit-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  box-shadow: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  transition: opacity 140ms ease, background 140ms ease;
}

#userProfileModal .user-profile-image-edit-overlay:hover,
#userProfileModal .user-profile-image-edit-overlay:focus-visible {
  color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 22%, rgba(0, 0, 0, 0.34) 48%, rgba(0, 0, 0, 0.94) 100%);
  opacity: 1;
}

#userProfileModal .user-profile-image-edit-overlay[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-image-edit-overlay .material-symbols-outlined {
  flex: 0 0 auto;
}

#userProfileModal .user-profile-modal-header .modal-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-family: "Lilita One", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userProfileModal .user-profile-header-placement {
  gap: 0.38rem;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-modal-header {
    min-height: 0;
  }

  #userProfileModal .user-profile-header-layout {
    gap: 0.5rem;
  }

  #userProfileModal .user-profile-modal-header .modal-title {
    font-size: clamp(1.32rem, 6vw, 1.7rem);
  }

  #userProfileModal .user-profile-header-placement {
    gap: 0.24rem;
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-header-layout {
    gap: 0.38rem;
  }
}

#userProfileModal .user-profile-image-edit-overlay {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.68);
  opacity: 0;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}

#userProfileModal .user-profile-header-picture-cluster:hover .user-profile-image-edit-overlay,
#userProfileModal .user-profile-image-edit-overlay:hover,
#userProfileModal .user-profile-image-edit-overlay:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  opacity: 1;
}

#userProfileModal .user-profile-image-edit-overlay .material-symbols-outlined {
  font-size: 1.15rem;
}

#userProfileModal .user-profile-image-edit-overlay > span:last-child {
  max-width: none;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

#userProfileModal.is-profile-loading .user-profile-header-layout,
#userProfileModal.is-profile-loading #userProfileContent {
  visibility: hidden !important;
}

#userProfileModal.is-profile-loading .user-profile-modal-header {
  min-height: 50px;
}

#userProfileModal.is-profile-loading .modal-body {
  min-height: 150px;
}

@media (hover: none) {
  #userProfileModal .user-profile-image-edit-overlay {
    background: transparent;
    opacity: 0;
  }

  #userProfileModal .user-profile-image-edit-overlay:focus-visible,
  #userProfileModal .user-profile-image-edit-overlay:active {
    background: rgba(0, 0, 0, 0.72);
    opacity: 1;
  }
}

#userProfileModal .user-profile-header-copy {
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}

#userProfileModal .user-profile-header-copy .modal-title {
  grid-row: 1;
}

#userProfileModal .user-profile-header-placement {
  grid-row: 2;
}

#userProfileModal .user-profile-header-placement {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.38rem 0.72rem 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 5px 13px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

#userProfileModal .user-profile-placement-badge {
  color: inherit;
  font-family: "Lilita One", sans-serif;
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.68);
}

#userProfileModal .user-profile-header-placement.is-place-1,
#userProfileModal .user-profile-header-placement.is-place-2,
#userProfileModal .user-profile-header-placement.is-place-3 {
  background-repeat: no-repeat;
  background-size: 320% 4px, 100% 100%;
  background-position: 0% 100%, 0 0;
  animation: userProfilePlacementShimmer 20s ease-in-out infinite;
}

#userProfileModal .user-profile-header-placement.is-place-1 {
  border-color: rgba(255, 218, 88, 0.58);
  color: #fff0a1;
  background-image: linear-gradient(115deg, #6c4c00, #d4a719, #fff0a1, #b17600, #f2cb43),
        linear-gradient(rgba(83, 58, 7, 0.94), rgba(47, 33, 5, 0.96));
  box-shadow: inset 0 1px rgba(255, 244, 181, 0.18), 0 5px 15px rgba(212, 167, 25, 0.22);
}

#userProfileModal .user-profile-header-placement.is-place-2 {
  border-color: rgba(216, 226, 235, 0.58);
  color: #f2f6f9;
  background-image: linear-gradient(115deg, #51565c, #aeb8c2, #f2f6f9, #7a838d, #cdd5dc),
        linear-gradient(rgba(61, 68, 75, 0.95), rgba(32, 37, 42, 0.97));
  animation-direction: reverse;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 5px 15px rgba(174, 184, 194, 0.2);
}

#userProfileModal .user-profile-header-placement.is-place-3 {
  border-color: rgba(221, 145, 88, 0.58);
  color: #efbd8d;
  background-image: linear-gradient(115deg, #63341f, #b4693d, #efbd8d, #88472a, #d98a51),
        linear-gradient(rgba(76, 39, 24, 0.95), rgba(43, 24, 16, 0.97));
  box-shadow: inset 0 1px rgba(255, 220, 187, 0.16), 0 5px 15px rgba(180, 105, 61, 0.22);
}

@keyframes userProfilePlacementShimmer {
  0%,
  100% {
    background-position: 0% 100%, 0 0;
  }

  50% {
    background-position: 100% 100%, 0 0;
  }
}

/* =========================================================
   Profiiliotsikon alariville siirretty rank-edistyminen
   ========================================================= */

#userProfileModal.is-profile-loading .user-profile-header-layout {
  display: none !important;
}

/* Profiiliotsikon keskitys: sulkeminen omalla ylärivillään */
@media (max-width: 360px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-columns: 92px minmax(0, 1fr) 92px;
  }

  #userProfileModal .user-profile-header-picture-cluster,
  #userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
    width: 92px;
    height: 92px;
    min-width: 92px;
    flex-basis: 92px;
  }
}

/* =========================================================
   Top bar: profiilikuvan ylimääräinen ympyrä pois ja tarkka keskitys
   ========================================================= */
#topBar #userRankContainer .topbar-profile-btn,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-btn {
  place-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#topBar #userRankContainer .topbar-profile-image,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-image {
  display: block !important;
  margin: 0 !important;
  transform-origin: center !important;
}

#topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap > .material-symbols-outlined {
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 420px) {
  #topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap,
  #topBar #userRankContainer .topbar-profile-image {
    width: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
    height: 29px !important;
    min-height: 29px !important;
    max-height: 29px !important;
  }
}


/* =========================================================
   Top bar: profiilikuva vaakariville ja oikean kokoiseksi
   ========================================================= */
#topBar #userRankContainer .topbar-profile-btn,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.62rem !important;
  overflow: hidden !important;
}

#topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap {
  display: grid !important;
  place-items: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  flex: 0 0 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#topBar #userRankContainer .topbar-profile-image,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-image {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  border: 0 !important;
}

#topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap > .material-symbols-outlined {
  font-size: 2.45rem !important;
}

@media (max-width: 767.98px) {
  #topBar #userRankContainer .topbar-profile-btn {
    display: grid !important;
    place-items: center !important;
    gap: 0 !important;
  }

  #topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap,
  #topBar #userRankContainer .topbar-profile-image {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    flex-basis: 34px !important;
  }

  #topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap > .material-symbols-outlined {
    font-size: 2rem !important;
  }
}


/* =========================================================
   Top bar: profiilikuvattoman käyttäjän SVG-fallback
   ========================================================= */
#topBar #userRankContainer .topbar-profile-btn .app-bar-action-icon-wrap {
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
}

#topBar #userProfileBtnFallback.topbar-profile-fallback {
  box-sizing: border-box !important;
  place-items: center !important;
}

@media (max-width: 767.98px) {
  #topBar #userProfileBtnFallback.topbar-profile-fallback {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 3px !important;
  }
}


/* =========================================================
   Top bar: profiilikuvaton tila kuten Haku-painikkeen ikoni
   ========================================================= */
#topBar #userProfileBtnFallback.topbar-profile-fallback {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  font-size: 2.45rem !important;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24 !important;
  line-height: 1 !important;
  transform: none !important;
}

#topBar #userProfileBtnFallback.topbar-profile-fallback[hidden] {
  display: none !important;
}

#topBar #userProfileBtnFallback::before,
#topBar #userProfileBtnFallback::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 767.98px) {
  #topBar #userProfileBtnFallback.topbar-profile-fallback {
    font-size: 2rem !important;
  }
}

/* =========================================================
   Top bar: profiilikuvan ja fallbackin poissulkevat hidden-tilat
   =========================================================
   Tarkat topbar-säännöt asettavat profiilikuvan display:block !important,
   joten hidden-attribuutti täytyy vahvistaa samalla tai suuremmalla
   spesifisyydellä. Muuten tyhjä img-elementti renderöityy fallbackin lisäksi. */
#topBar #userRankContainer #userProfileBtnImage.topbar-profile-image[hidden],
#topBar #userRankContainer #userProfileBtnFallback.topbar-profile-fallback[hidden] {
  display: none !important;
}

/* =========================================================
   Profiili: top barin piste- ja rank-näkymä suurempana
   ========================================================= */

#userProfileModal .user-profile-score-rank-card {
  --profile-score-rank-color: #91e873;
  --profile-score-next-rank-color: #8f69ff;
  --profile-score-accent: #91e873;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

#userProfileModal .user-profile-score-rank-card[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-score-rank-main {
  display: flex;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  align-items: stretch;
  overflow: hidden;
}

#userProfileModal .user-profile-score-rank-segment {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  height: 100%;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #fff;
  background-color: rgba(29, 14, 56, 0.92);
  background-image: url("img/triangles.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: none;
  cursor: pointer;
}

body.theme-sammakkoluola #userProfileModal .user-profile-score-rank-segment {
  background-image: url("img/triangles.svg");
}

#userProfileModal .user-profile-score-rank-segment:hover,
#userProfileModal .user-profile-score-rank-segment:focus-visible {
  filter: brightness(1.08);
}

#userProfileModal .user-profile-score-rank-segment:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: -3px;
}

#userProfileModal .user-profile-score-rank-segment:disabled {
  cursor: default;
  opacity: 1;
}

#userProfileModal .user-profile-score-rank-image {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.52))
          drop-shadow(0 0 9px color-mix(in srgb, var(--profile-score-accent) 34%, transparent));
}

#userProfileModal .user-profile-score-rank-image[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-score-points-segment {
  display: flex;
  height: 100%;
  flex: 1 1 auto;
  align-items: center;
  padding: 0.55rem 0.72rem;
  color: #15111d;
  background: #fff;
  text-align: center;
}

body.theme-sammakkoluola #userProfileModal .user-profile-score-points-segment {
  color: #15111d;
}

#userProfileModal .user-profile-score-stars {
  flex: 0 0 auto;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 32;
}

#userProfileModal .user-profile-score-points-segment > strong {
  color: #15111d;
  font-family: "Lilita One", sans-serif;
  line-height: 1;
}

#userProfileModal .user-profile-score-unit {
  flex: 0 0 auto;
  font-family: "Lilita One", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
}

#userProfileModal .user-profile-score-progress-track {
  position: relative;
  display: block;
  width: 100%;
  height: var(--profile-score-progress-height);
  min-height: var(--profile-score-progress-height);
  max-height: var(--profile-score-progress-height);
  flex: 0 0 var(--profile-score-progress-height);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(14, 10, 28, 0.38);
  box-shadow: none;
}

#userProfileModal .user-profile-score-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    var(--profile-score-rank-color),
    var(--profile-score-next-rank-color)
  );
  box-shadow: 0 0 7px color-mix(in srgb, var(--profile-score-accent) 58%, transparent);
}

@media (max-width: 390px) {

  #userProfileModal .user-profile-score-rank-card {
    width: 132px;
  }
}

@media (max-width: 350px) {

  #userProfileModal .user-profile-score-rank-card {
    width: 124px;
  }

  #userProfileModal .user-profile-score-rank-segment {
    width: 54px;
    min-width: 54px;
    flex-basis: 54px;
  }
}

/* =========================================================
   Profiili: rank- ja pistekortin responsiivinen viimeistely
   - työpöydällä pisteille enemmän tilaa
   - mobiilissa kortti omalle täydelle rivilleen
   ========================================================= */

@media (max-width: 575.98px) {

  #userProfileModal .user-profile-header-picture-cluster {
    grid-column: 1;
    grid-row: 1;
  }

  #userProfileModal .user-profile-header-copy {
    grid-column: 2;
    grid-row: 1;
  }

  #userProfileModal .user-profile-score-rank-card {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }
}

@media (max-width: 390px) {

  #userProfileModal .user-profile-score-rank-segment {
    width: 69px;
    min-width: 69px;
    flex-basis: 69px;
    padding: 0.3rem;
  }
}


/* Rank-osa pysyy tarkasti neliönä kortin korkeudesta riippumatta. */

/* =========================================================
   Profiili: kompakti otsikkorivi ja yhdelle riville mahtuva
   profiilikuva + nimi/sijoitus + täyttävä rank-pistekortti
   ========================================================= */
#userProfileModal .user-profile-modal-header {
  display: flex;
  min-height: 0;
  align-items: stretch;
  flex-direction: column;
}

#userProfileModal .user-profile-title-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#userProfileModal .user-profile-dialog-title {
  min-width: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Lilita One", sans-serif;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

#userProfileModal .user-profile-title-row .btn-close {
  position: static;
  flex: 0 0 auto;
  margin: 0 !important;
}

#userProfileModal .user-profile-header-layout {
  min-width: 0;
  margin: 0;
}

#userProfileModal .user-profile-score-points-segment {
  min-width: 0;
}

#userProfileModal .user-profile-score-points-segment > strong {
  min-width: 0;
}

@media (max-width: 575.98px) {

  #userProfileModal .user-profile-dialog-title {
    font-size: 0.98rem;
  }

  #userProfileModal .user-profile-header-copy {
    height: 78px;
  }

  #userProfileModal .user-profile-score-rank-card {
    width: 100%;
  }

  #userProfileModal .user-profile-score-rank-segment {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 390px) {

  #userProfileModal .user-profile-header-copy {
    max-width: 86px;
    height: 70px;
  }

  #userProfileModal .user-profile-header-placement {
    min-height: 27px;
    padding: 0.27rem 0.42rem 0.3rem;
  }

  #userProfileModal .user-profile-score-rank-card {
    --profile-score-progress-height: 6px;
  }

  #userProfileModal .user-profile-score-points-segment {
    gap: 0.22rem;
    padding-inline: 0.34rem;
  }
}

@media (max-width: 350px) {

  #userProfileModal .user-profile-header-layout {
    column-gap: 0.28rem;
  }

  #userProfileModal .user-profile-header-copy {
    max-width: 66px;
    height: 64px;
    gap: 0.26rem;
  }
}

/* =========================================================
   Profiili: nimimerkki priorisoidaan rank–pistekortin edelle
   ========================================================= */

#userProfileModal .user-profile-score-rank-card {
  container-type: inline-size;
}

#userProfileModal .user-profile-score-rank-segment {
  flex-basis: clamp(56px, 31cqi, 91px);
}

@media (max-width: 575.98px) {

  #userProfileModal .user-profile-header-copy {
    min-width: max-content;
  }

  #userProfileModal .user-profile-header-copy .modal-title {
    width: max-content;
    min-width: max-content;
    max-width: none;
  }

  #userProfileModal .user-profile-score-rank-segment {
    width: clamp(45px, 34cqi, 71px);
    min-width: clamp(45px, 34cqi, 71px);
    flex-basis: clamp(45px, 34cqi, 71px);
  }
}

/* =========================================================
   Profiili: otsikkoalueen väljyys, sisältöleveyden kohdistus
   ja stars-ikonin kontrasti
   ========================================================= */

#userProfileModal .user-profile-score-stars {
  color: color-mix(
    in srgb,
    var(--profile-score-accent, #91e873) 70%,
    #17121f 30%
  ) !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 8px color-mix(in srgb, var(--profile-score-accent, #91e873) 34%, transparent) !important;
}

#userProfileModal .user-profile-score-points-segment > strong,
body.theme-sammakkoluola #userProfileModal .user-profile-score-points-segment > strong {
  color: #15111d !important;
  text-shadow: none !important;
}

/* Oletusprofiilikuvan glyph keskitetään ilman fontin baseline-siirtymää. */
#userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined {
  color: #416342;
  font-size: 5.8rem;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 48;
}

#userProfileModal .user-profile-picture-frame > #userProfileImageFallback[hidden] {
  display: none !important;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined {
    font-size: 4.55rem;
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined {
    font-size: 4.05rem;
  }
}

@media (max-width: 350px) {
  #userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined {
    font-size: 3.65rem;
  }
}


/* =========================================================
   Profiili: nimi + sijoitus rank-kortin yläpuolelle,
   kortti matalammaksi ja tilaa profiilikuvan jälkeen 10 px.
   ========================================================= */
#userProfileModal .user-profile-modal-header {
  gap: 0.8rem;
  padding: 0.58rem 1rem 1rem;
}

#userProfileModal .user-profile-title-row {
  min-height: 40px;
}

#userProfileModal .user-profile-header-layout {
  width: min(100%, calc(100% - 0.5rem));
}

#userProfileModal .user-profile-header-picture-cluster {
  align-self: start;
}

#userProfileModal .user-profile-header-copy .modal-title {
  overflow: visible;
  text-overflow: clip;
}

#userProfileModal .user-profile-score-rank-card {
  --profile-score-progress-height: 6px;
}

#userProfileModal .user-profile-score-rank-main {
  min-height: 0;
}

#userProfileModal .user-profile-score-rank-segment {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
}

#userProfileModal .user-profile-score-points-segment {
  gap: 0.5rem;
  padding-inline: 0.9rem;
}

#userProfileModal .user-profile-score-points-segment > strong {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

#userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-align: center;
  transform: none;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-modal-header {
    gap: 0.64rem;
    padding: 0.48rem 0.82rem 0.88rem;
  }

  #userProfileModal .user-profile-title-row {
    min-height: 36px;
  }

  #userProfileModal .user-profile-header-layout {
    width: min(100%, calc(100% - 0.4rem));
  }

  #userProfileModal .user-profile-header-copy {
    width: 100%;
    max-width: none;
  }

  #userProfileModal .user-profile-score-rank-card {
    --profile-score-progress-height: 6px;
  }

  #userProfileModal .user-profile-score-rank-segment {
    padding: 0.26rem;
  }

  #userProfileModal .user-profile-score-points-segment {
    gap: 0.34rem;
    padding-inline: 0.58rem;
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-modal-header {
    padding-inline: 0.72rem;
  }

  #userProfileModal .user-profile-header-layout {
    width: 100%;
    column-gap: 10px;
    row-gap: 0.36rem;
  }
}

@media (max-width: 350px) {
  #userProfileModal .user-profile-modal-header {
    padding-inline: 0.62rem;
  }
}


/* =========================================================
   Profiili: sijoitus nimiriville oikeaan reunaan,
   suurempi profiilikuva ja kapeampi sisältöalue.
   ========================================================= */
#userProfileModal .user-profile-header-layout {
  grid-template-rows: auto 82px;
  column-gap: 10px;
  row-gap: 0.55rem;
  align-items: start;
}

#userProfileModal .user-profile-header-picture-cluster {
  grid-row: 1 / span 2;
}

#userProfileModal .user-profile-header-copy {
  grid-column: 2;
  grid-row: 1;
  overflow: visible;
}

#userProfileModal .user-profile-header-copy .modal-title {
  width: auto;
  max-width: none;
  font-size: clamp(2rem, 4.3vw, 2.75rem);
  line-height: 1;
}

#userProfileModal .user-profile-header-placement {
  margin-left: auto;
}

#userProfileModal .user-profile-score-rank-card {
  grid-column: 2;
  grid-row: 2;
}

#userProfileModal .user-profile-score-rank-segment {
  padding: 0.34rem;
}

#userProfileModal .user-profile-score-rank-image {
  width: 58px;
  height: 58px;
}

#userProfileModal .user-profile-score-stars {
  font-size: 1.8rem;
}

#userProfileModal .user-profile-score-points-segment > strong {
  font-size: clamp(1.85rem, 3.9vw, 2.5rem);
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-rows: auto 70px;
    column-gap: 10px;
    row-gap: 0.42rem;
  }

  #userProfileModal .user-profile-header-copy .modal-title {
    font-size: clamp(1.48rem, 5.8vw, 2rem);
  }

  #userProfileModal .user-profile-header-placement {
    min-height: 0;
    padding: 0.28rem 0.5rem 0.32rem;
  }

  #userProfileModal .user-profile-placement-badge {
    font-size: 0.98rem;
  }

  #userProfileModal .user-profile-score-rank-card {
    height: 70px;
  }

  #userProfileModal .user-profile-score-rank-image {
    width: 48px;
    height: 48px;
  }

  #userProfileModal .user-profile-score-stars {
    font-size: 1.5rem;
  }

  #userProfileModal .user-profile-score-points-segment > strong {
    font-size: clamp(1.5rem, 6.2vw, 2rem);
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-rows: auto 66px;
  }

  #userProfileModal .user-profile-header-copy .modal-title {
    font-size: clamp(1.26rem, 5.4vw, 1.7rem);
  }

  #userProfileModal .user-profile-placement-badge {
    font-size: 0.88rem;
  }

  #userProfileModal .user-profile-score-rank-card {
    height: 66px;
  }

  #userProfileModal .user-profile-score-rank-image {
    width: 44px;
    height: 44px;
  }

  #userProfileModal .user-profile-score-stars {
    font-size: 1.34rem;
  }

  #userProfileModal .user-profile-score-points-segment > strong {
    font-size: clamp(1.3rem, 5.6vw, 1.76rem);
  }
}

@media (max-width: 350px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-rows: auto 62px;
  }

  #userProfileModal .user-profile-header-copy .modal-title {
    font-size: 1.16rem;
  }

  #userProfileModal .user-profile-placement-badge {
    font-size: 0.8rem;
  }

  #userProfileModal .user-profile-score-rank-card {
    height: 62px;
  }

  #userProfileModal .user-profile-score-rank-image {
    width: 40px;
    height: 40px;
  }

  #userProfileModal .user-profile-score-stars {
    font-size: 1.18rem;
  }

  #userProfileModal .user-profile-score-points-segment > strong {
    font-size: 1.18rem;
  }
}


/* =========================================================
   Profiili: käyttäjänimi ja sijoitus varmasti samalle riville
   ========================================================= */
#userProfileModal .user-profile-header-copy {
  display: flex;
  align-self: end;
  justify-content: space-between;
  flex-direction: row;
  flex-wrap: nowrap;
}

#userProfileModal .user-profile-header-copy .modal-title {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  margin: 0;
  white-space: nowrap;
}

#userProfileModal .user-profile-header-placement {
  width: auto;
  min-width: max-content;
  margin: 0 0 0 auto;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-header-copy {
    flex-direction: row;
    flex-wrap: nowrap;
  }
}

/* =========================================================
   Profiili: mitalit, porkkanat ja kepit yhdelle riville
   ========================================================= */
#userProfileModal .user-profile-rewards-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: clamp(0.24rem, 1.2vw, 0.6rem);
  margin-top: 0.72rem;
  padding-top: 0.72rem;
  border-top: 1px solid rgba(42, 104, 43, 0.12);
}

#userProfileModal .user-profile-rewards-row > .user-profile-medal-row,
#userProfileModal .user-profile-rewards-row > .profile-stick-or-carrot-row {
  display: contents;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

#userProfileModal .user-profile-rewards-row > .user-profile-medal-row[hidden],
#userProfileModal .user-profile-rewards-row > .profile-stick-or-carrot-row[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-rewards-row .profile-medal,
#userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-stat,
body.theme-sammakkoluola #userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-stat {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.2rem 0.08rem;
  gap: 0.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#userProfileModal .user-profile-rewards-row .profile-medal-emoji,
#userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-emoji {
  font-size: clamp(30px, 5.4vw, 42px);
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22));
}

#userProfileModal .user-profile-rewards-row .profile-medal strong,
#userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-stat strong {
  font-size: clamp(1.08rem, 2.7vw, 1.28rem);
  line-height: 1;
}

body.theme-sammakkoluola #userProfileModal .user-profile-rewards-row {
  border-top-color: rgba(193, 255, 160, 0.11);
}

@media (max-width: 420px) {
  #userProfileModal .user-profile-rewards-row {
    gap: 0.16rem;
    margin-top: 0.62rem;
    padding-top: 0.62rem;
  }

  #userProfileModal .user-profile-rewards-row .profile-medal-emoji,
  #userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-emoji {
    font-size: clamp(27px, 9vw, 35px);
  }

  #userProfileModal .user-profile-rewards-row .profile-medal strong,
  #userProfileModal .user-profile-rewards-row .profile-stick-or-carrot-stat strong {
    font-size: clamp(0.98rem, 4.8vw, 1.16rem);
  }
}


/* =========================================================
   Profiilin pisteikoni: P-kirjain ympyrän sisällä
   ========================================================= */
#userProfileModal .user-profile-score-stars.point-p-icon {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: "Lilita One", sans-serif;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  font-variation-settings: normal;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-score-stars.point-p-icon {
    width: 1.72rem;
    height: 1.72rem;
    min-width: 1.72rem;
    font-size: 0.94rem;
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-score-stars.point-p-icon {
    width: 1.52rem;
    height: 1.52rem;
    min-width: 1.52rem;
    font-size: 0.84rem;
  }
}


/* =========================================================
   Profiilikuva: koko piirtoalue näkyviin ilman ympyrärajausta
   ========================================================= */
#userProfileModal .user-profile-header-picture-cluster,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame,
#userProfileModal .user-profile-image-edit-overlay {
  border-radius: 7px;
}

#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#userProfileModal .user-profile-picture {
  border-radius: inherit;
  object-fit: contain;
  background: transparent;
}

#topBar #userRankContainer .topbar-profile-image,
body.theme-sammakkoluola #topBar #userRankContainer .topbar-profile-image {
  border-color: transparent !important;
  border-radius: 7px !important;
  object-fit: contain !important;
  background: transparent !important;
  box-shadow: none !important;
}


/* =========================================================
   Profiili: kuva progress barin alareunaan ja oletuskuvalle
   valkoinen tausta
   ========================================================= */
#userProfileModal .user-profile-header-layout {
  grid-template-columns: 135px minmax(0, 1fr);
}

#userProfileModal .user-profile-header-picture-cluster,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  width: 135px;
  height: 135px;
  min-width: 135px;
  flex-basis: 135px;
}

#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  border: 0;
}

#userProfileModal .user-profile-picture-frame > #userProfileImageFallback.material-symbols-outlined:not([hidden]) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  border-radius: inherit;
  background: #fff;
}

#topBar #userRankContainer #userProfileBtnFallback.topbar-profile-fallback:not([hidden]),
body.theme-sammakkoluola #topBar #userRankContainer #userProfileBtnFallback.topbar-profile-fallback:not([hidden]) {
  display: grid !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  place-items: center !important;
  border-radius: 7px !important;
  color: #416342 !important;
  background: #fff !important;
  overflow: hidden !important;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  #userProfileModal .user-profile-header-picture-cluster,
  #userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
    width: 108px;
    height: 108px;
    min-width: 108px;
    flex-basis: 108px;
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  #userProfileModal .user-profile-header-picture-cluster,
  #userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
    width: 98px;
    height: 98px;
    min-width: 98px;
    flex-basis: 98px;
  }
}

@media (max-width: 350px) {
  #userProfileModal .user-profile-header-layout {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  #userProfileModal .user-profile-header-picture-cluster,
  #userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
    width: 90px;
    height: 90px;
    min-width: 90px;
    flex-basis: 90px;
  }
}


/* =========================================================
   Profiilin osioiden toimintokohtaiset värit
   ========================================================= */
#userProfileModal .user-profile-achievements,
body.theme-sammakkoluola #userProfileModal .user-profile-achievements {
  background: linear-gradient(135deg, rgba(132, 82, 35, 0.96), rgba(198, 145, 45, 0.94)) !important;
  border-color: rgba(255, 220, 124, 0.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 24px rgba(83, 45, 9, 0.24),
    0 0 20px rgba(230, 171, 55, 0.13) !important;
}

#userProfileModal .user-profile-achievements-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-achievements-heading {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(63, 31, 4, 0.66);
}

#userProfileModal .user-profile-stat-continuous,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous {
  --profile-section-primary: #7cc3b0;
  --profile-section-secondary: #536f89;
  background: linear-gradient(135deg, rgba(67, 101, 121, 0.97), rgba(78, 128, 113, 0.95)) !important;
  border-color: rgba(188, 235, 220, 0.3) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 8px 24px rgba(24, 57, 60, 0.22) !important;
}

#userProfileModal .user-profile-stat-continuous > .user-profile-stat-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous > .user-profile-stat-heading {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.48);
}

#userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics > div,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics > div {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
  animation: none !important;
}

#userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics strong,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics strong {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

#userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics span,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous > .user-profile-main-metrics span {
  color: rgba(255, 255, 255, 0.82) !important;
}

#userProfileModal .user-profile-happy-hour,
body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour {
  --profile-section-primary: #ffb06d;
  --profile-section-secondary: #c674ff;
  background:
    linear-gradient(135deg, rgba(255, 170, 96, 0.99), rgba(244, 109, 126, 0.97) 55%, rgba(186, 103, 255, 0.95)) !important;
  border: 1px solid rgba(255, 229, 213, 0.3) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px rgba(118, 48, 103, 0.22) !important;
}

#userProfileModal .user-profile-happy-hour-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-heading {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(72, 22, 55, 0.58) !important;
}

#userProfileModal .user-profile-happy-hour-metrics > div,
body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics > div {
  background: rgba(255, 255, 255, 0.13) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;
  animation: none !important;
}

#userProfileModal .user-profile-happy-hour-metrics strong,
body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics strong {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(72, 22, 55, 0.5);
}

#userProfileModal .user-profile-happy-hour-metrics span,
body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour-metrics span {
  color: rgba(255, 255, 255, 0.84) !important;
}

#userProfileModal .user-profile-stat-fairies,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies {
  --profile-section-primary: #d885ff;
  --profile-section-secondary: #51e6ff;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(230, 159, 255, 0.34), transparent 30%),
    radial-gradient(circle at 84% 22%, rgba(77, 236, 255, 0.24), transparent 34%),
    radial-gradient(circle at 70% 92%, rgba(255, 104, 224, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(66, 22, 111, 0.98), rgba(105, 37, 157, 0.96) 47%, rgba(20, 95, 126, 0.96)) !important;
  background-size: 150% 150%, 145% 145%, 150% 150%, 220% 220% !important;
  border-color: rgba(220, 160, 255, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 26px rgba(195, 96, 255, 0.1),
    0 8px 26px rgba(46, 17, 85, 0.3),
    0 0 24px rgba(152, 75, 255, 0.18) !important;
  animation: profileFairySectionGlow 10s ease-in-out infinite;
}

#userProfileModal .user-profile-stat-fairies::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.8px) 0 0 / 34px 34px,
    radial-gradient(circle, rgba(100, 232, 255, 0.52) 0 1px, transparent 1.8px) 12px 18px / 46px 46px;
  opacity: 0.2;
  transform: rotate(-8deg);
}

#userProfileModal .user-profile-stat-fairies .user-profile-stat-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies .user-profile-stat-heading {
  color: #ffffff !important;
  text-shadow:
    0 0 10px rgba(224, 158, 255, 0.76),
    0 1px 3px rgba(24, 5, 50, 0.7) !important;
}

#userProfileModal .user-profile-stat-fairies .profile-fairy-metrics > div,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies .profile-fairy-metrics > div {
  background: linear-gradient(135deg, rgba(220, 151, 255, 0.14), rgba(75, 221, 255, 0.1)) !important;
  border: 1px solid rgba(226, 182, 255, 0.17) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(155, 93, 255, 0.11) !important;
  animation: none !important;
}

#userProfileModal .user-profile-stat-fairies .profile-fairy-metrics strong,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies .profile-fairy-metrics strong {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(185, 105, 255, 0.42);
}

#userProfileModal .user-profile-stat-fairies .profile-fairy-metrics span,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies .profile-fairy-metrics span {
  color: rgba(244, 229, 255, 0.84) !important;
}

#userProfileModal .user-profile-stat-bingo,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo {
  --profile-section-primary: #69c8f2;
  --profile-section-secondary: #49a5a8;
  background: linear-gradient(135deg, rgba(43, 111, 157, 0.98), rgba(45, 135, 137, 0.96)) !important;
  border-color: rgba(166, 235, 244, 0.32) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 24px rgba(19, 70, 91, 0.24) !important;
}

#userProfileModal .user-profile-stat-bingo .user-profile-stat-heading,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo .user-profile-stat-heading {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(8, 46, 65, 0.58);
}

#userProfileModal .user-profile-stat-bingo .user-profile-main-metrics > div,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo .user-profile-main-metrics > div {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
  animation: none !important;
}

#userProfileModal .user-profile-stat-bingo .user-profile-main-metrics strong,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo .user-profile-main-metrics strong {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(8, 46, 65, 0.5);
}

#userProfileModal .user-profile-stat-bingo .user-profile-main-metrics span,
body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo .user-profile-main-metrics span {
  color: rgba(232, 251, 255, 0.84) !important;
}

@keyframes profileFairySectionGlow {
  0%,
  100% {
    background-position: 0% 50%, 100% 20%, 20% 100%, 0% 50%;
    filter: saturate(1);
  }
  50% {
    background-position: 55% 20%, 42% 70%, 85% 35%, 100% 50%;
    filter: saturate(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  #userProfileModal .user-profile-stat-fairies,
  body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies {
    animation: none !important;
  }
}

/* =========================================================
   Pisteet kategorioittain: taustakuva ilman overlayta
   ========================================================= */
#userProfileModal .profile-category-points-card {
  background-color: #101717 !important;
  background-image: var(--profile-category-image) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 5px 14px rgba(0, 0, 0, 0.16) !important;
}

#userProfileModal .profile-category-points-card::before {
  display: none !important;
  content: none !important;
}

#userProfileModal .profile-category-points-title,
#userProfileModal .profile-category-points-value {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#userProfileModal .profile-category-points-icon,
#userProfileModal .profile-category-points-icon > .material-symbols-outlined {
  text-shadow: none !important;
  filter: none;
}

#userProfileModal .profile-category-points-icon {
  background: rgba(4, 8, 10, 0.68) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 10px rgba(0, 0, 0, 0.3) !important;
}

#userProfileModal .profile-category-points-track {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.58);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.28);
}

#userProfileModal .profile-category-yleinen .profile-category-points-icon,
#userProfileModal .profile-category-rakkaus .profile-category-points-icon {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.82) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 2px 8px rgba(0, 0, 0, 0.28) !important;
}

#userProfileModal .profile-category-rakkaus .profile-category-points-icon {
  color: #e83b91;
}

#userProfileModal .profile-category-saavutukset {
  --profile-category-accent: #e1ad4d;
  --profile-category-accent-2: #9a5f24;
  --profile-category-icon-color: #fff0bd;
  --profile-category-image: none;
  background: linear-gradient(135deg, rgba(132, 82, 35, 0.96), rgba(198, 145, 45, 0.94)) !important;
}

#userProfileModal .profile-category-saavutukset .profile-category-points-icon {
  background: rgba(92, 49, 10, 0.55) !important;
}

#userProfileModal .profile-category-bingo {
  --profile-category-accent: #55b8df;
  --profile-category-accent-2: #328789;
  --profile-category-icon-color: #d5f8ff;
  --profile-category-image: none;
  background: linear-gradient(135deg, rgba(43, 111, 157, 0.98), rgba(45, 135, 137, 0.96)) !important;
}

#userProfileModal .profile-category-bingo .profile-category-points-icon {
  background: rgba(12, 66, 90, 0.56) !important;
}

#userProfileModal .profile-category-keijut {
  --profile-category-accent: #d885ff;
  --profile-category-accent-2: #51e6ff;
  --profile-category-icon-color: #f5dcff;
  --profile-category-image: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(235, 169, 255, 0.32), transparent 31%),
    radial-gradient(circle at 86% 22%, rgba(77, 236, 255, 0.25), transparent 35%),
    linear-gradient(135deg, rgba(66, 22, 111, 0.98), rgba(105, 37, 157, 0.96) 48%, rgba(20, 95, 126, 0.96)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px rgba(148, 69, 255, 0.15) !important;
}

#userProfileModal .profile-category-keijut .profile-category-points-icon {
  background: rgba(56, 15, 95, 0.56) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 13px rgba(183, 96, 255, 0.34) !important;
}

/* Pisteet kategorioittain: vaaleiden kategoriataustojen tekstivärit */
#userProfileModal .profile-category-yleinen .profile-category-points-title,
#userProfileModal .profile-category-yleinen .profile-category-points-value {
  color: #111820;
  text-shadow: none;
}

#userProfileModal .profile-category-rakkaus .profile-category-points-title,
#userProfileModal .profile-category-rakkaus .profile-category-points-value {
  color: #e83b91;
  text-shadow: none;
}

/* =========================================================
   Sammakkoluolan profiili: profile_bg.jpg näkyväksi kehykseksi
   ========================================================= */
body.theme-sammakkoluola #userProfileModal .user-profile-modal-content {
  background-color: #050913 !important;
  background-image: url("img/profile_bg.jpg") !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  border-color: rgba(153, 209, 255, 0.34) !important;
  box-shadow:
    0 0 26px rgba(106, 87, 255, 0.2),
    0 0 50px rgba(50, 211, 255, 0.1),
    0 24px 70px rgba(0, 0, 0, 0.68) !important;
  animation: none !important;
}

/* Taustakuvan päälle ei aseteta koko profiilin kattavaa väripintaa. */
body.theme-sammakkoluola #userProfileModal .user-profile-modal-header,
body.theme-sammakkoluola #userProfileModal .modal-body {
  background-image: none !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-modal-header {
  background-color: rgba(3, 8, 17, 0.5) !important;
  border-bottom-color: rgba(188, 222, 255, 0.18) !important;
}

body.theme-sammakkoluola #userProfileModal .modal-body {
  background-color: transparent !important;
}

/* Yläosan tiedot muodostavat kevyet lasipinnat kuvan päälle. */
body.theme-sammakkoluola #userProfileModal .user-profile-score-rank-card {
  border-color: rgba(211, 231, 255, 0.24);
  background: rgba(4, 10, 22, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.3);
}

body.theme-sammakkoluola #userProfileModal .user-profile-score-rank-segment {
  background-color: rgba(10, 33, 31, 0.74);
}

body.theme-sammakkoluola #userProfileModal .user-profile-score-points-segment {
  background: rgba(255, 255, 255, 0.86);
}

body.theme-sammakkoluola #userProfileModal .user-profile-picture-frame,
body.theme-sammakkoluola #userProfileModal .user-profile-placement-badge {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 7px 18px rgba(0, 0, 0, 0.28);
}

/* Osioiden omat värit säilyvät, mutta kuva kuultaa niistä maltillisesti läpi. */
body.theme-sammakkoluola #userProfileModal .user-profile-achievements {
  background: linear-gradient(135deg, rgba(132, 82, 35, 0.82), rgba(198, 145, 45, 0.76)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-continuous {
  background: linear-gradient(135deg, rgba(67, 101, 121, 0.82), rgba(78, 128, 113, 0.78)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-normal {
  background:
    radial-gradient(circle at 8% 8%, rgba(183, 131, 255, 0.12), transparent 41%),
    radial-gradient(circle at 94% 90%, rgba(143, 227, 106, 0.1), transparent 43%),
    linear-gradient(145deg, rgba(8, 21, 15, 0.76), rgba(40, 27, 57, 0.68)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-happy-hour {
  background: linear-gradient(135deg, rgba(255, 170, 96, 0.84), rgba(244, 109, 126, 0.8) 55%, rgba(186, 103, 255, 0.78)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-fairies {
  background:
    radial-gradient(circle at 16% 18%, rgba(230, 159, 255, 0.29), transparent 30%),
    radial-gradient(circle at 84% 22%, rgba(77, 236, 255, 0.21), transparent 34%),
    radial-gradient(circle at 70% 92%, rgba(255, 104, 224, 0.17), transparent 36%),
    linear-gradient(135deg, rgba(66, 22, 111, 0.82), rgba(105, 37, 157, 0.78) 47%, rgba(20, 95, 126, 0.78)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-stat-bingo {
  background: linear-gradient(135deg, rgba(43, 111, 157, 0.82), rgba(45, 135, 137, 0.78)) !important;
}

body.theme-sammakkoluola #userProfileModal .user-profile-category-points {
  background:
    radial-gradient(circle at 12% 8%, rgba(177, 255, 145, 0.06), transparent 34%),
    linear-gradient(145deg, rgba(5, 15, 13, 0.72), rgba(22, 28, 43, 0.66)) !important;
  border-color: rgba(150, 218, 225, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.24);
}

@media (max-width: 575.98px) {
  body.theme-sammakkoluola #userProfileModal .user-profile-modal-content {
    background-position: center top !important;
  }
}


/* =========================================================
   Profiili: otsikkoalueen rajaviiva ja taustan sumennukset pois
   ========================================================= */
#userProfileModal .user-profile-modal-header {
  border-bottom: 0 !important;
}

#userProfileModal .modal-body {
  border-top: 0 !important;
}

#userProfileModal,
#userProfileModal *,
#userProfileModal *::before,
#userProfileModal *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* =========================================================
   Profiilikuva: poista kehyksen yläreunaan jäävä valojuova
   ========================================================= */
#userProfileModal .user-profile-header-picture-cluster,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  border: 0 !important;
  border-top: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

#userProfileModal .user-profile-header-picture-cluster::before,
#userProfileModal .user-profile-header-picture-cluster::after,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame::before,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame::after {
  content: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* =========================================================
   Profiili: osio-otsikot vasemmalle ja valkoisiksi
   ========================================================= */
#userProfileModal .user-profile-achievements-heading,
#userProfileModal .user-profile-stat-heading,
#userProfileModal .user-profile-category-points-heading {
  justify-content: flex-start !important;
  text-align: left !important;
  color: #ffffff !important;
}

/* Saavutusten oikean reunan vihjepistemerkille jätetään oma tila. */
#userProfileModal .user-profile-achievements-heading {
  padding-inline: 0 3.8rem !important;
}

#userProfileModal .user-profile-achievements-heading h4,
#userProfileModal .user-profile-stat-heading h4,
#userProfileModal .user-profile-category-points-heading h4,
#userProfileModal .user-profile-achievements-heading .material-symbols-outlined,
#userProfileModal .user-profile-stat-heading .material-symbols-outlined,
#userProfileModal .user-profile-category-points-heading .material-symbols-outlined {
  color: #ffffff !important;
}

/* =========================================================
   Profiili: aktiivisen Happy Hourin liikkuva tausta
   ========================================================= */
body.happy-hour-active #userProfileModal .user-profile-happy-hour,
body.happy-hour-active.theme-sammakkoluola #userProfileModal .user-profile-happy-hour {
  background-image: linear-gradient(
    120deg,
    #35b96f 0%,
    #35b96f 18%,
    #f2d322 48%,
    #8c5bff 72%,
    #35b96f 100%
  ) !important;
  background-size: 300% 300% !important;
  background-position: 0% 50%;
  animation: happyHourGradientFlow 8s ease-in-out infinite !important;
}

@media (prefers-reduced-motion: reduce) {
  body.happy-hour-active #userProfileModal .user-profile-happy-hour,
  body.happy-hour-active.theme-sammakkoluola #userProfileModal .user-profile-happy-hour {
    animation: none !important;
    background-position: 50% 50% !important;
  }
}

/* =========================================================
   Profiili: rank-ikoni aina kokonaan näkyviin
   =========================================================
   Rank-otsikko ja ikoni ovat omilla riveillään. Ikonikuori saa vain
   otsikon jälkeen jäljelle jäävän korkeuden, jolloin kuva ei voi valua
   kortin alareunan etenemispalkin alle. */
#userProfileModal .user-profile-score-rank-segment {
  grid-template-rows: max-content minmax(0, 1fr);
  align-items: stretch;
  justify-items: center;
  align-content: stretch;
  row-gap: 0.08rem;
  overflow: hidden;
}

#userProfileModal .user-profile-score-rank-segment > .user-profile-score-metric-label {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  line-height: 1;
}

#userProfileModal .user-profile-score-rank-icon-shell {
  display: grid;
  grid-row: 2;
  place-items: center;
  overflow: hidden;
}

#userProfileModal .user-profile-score-rank-image,
#userProfileModal .user-profile-score-rank-icon-shell .user-profile-score-rank-image {
  max-width: 100%;
  max-height: 100%;
}

/* =========================================================
   Profiili: rankin nimi käyttäjänimen viereen
   =========================================================
   Rank-kortissa näytetään vain ikoni. Sanallinen rank tulee nimimerkin
   viereen ja käyttää samaa rank-kohtaista pääväriä kuin rank-modaali. */
#userProfileModal .user-profile-header-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
}

#userProfileModal .user-profile-name-rank {
  align-items: baseline;
  gap: clamp(0.5rem, 1.4vw, 0.85rem);
}

#userProfileModal .user-profile-rank-name {
  color: var(--profile-rank-primary, #91e873);
  font-size: clamp(1rem, 2vw, 1.35rem);
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.72),
    0 0 9px var(--profile-rank-glow, rgba(123, 241, 119, 0.28));
}

/* RANK-otsikon poistuttua ikoni käyttää koko rank-segmentin korkeuden. */
#userProfileModal .user-profile-score-rank-segment {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  row-gap: 0;
}

#userProfileModal .user-profile-score-rank-icon-shell {
  grid-column: 1;
  grid-row: 1;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-header-copy {
    gap: 0.45rem;
  }

  #userProfileModal .user-profile-name-rank {
    gap: 0.42rem;
  }

  #userProfileModal .user-profile-rank-name {
    font-size: clamp(0.82rem, 3.3vw, 1.05rem);
  }
}

@media (max-width: 390px) {
  #userProfileModal .user-profile-header-copy {
    gap: 0.34rem;
  }

  #userProfileModal .user-profile-name-rank {
    gap: 0.3rem;
  }

  #userProfileModal .user-profile-rank-name {
    font-size: clamp(0.72rem, 3.1vw, 0.9rem);
  }
}

/* =========================================================
   Profiili: kuva vasemmalla, tiedot kahdella rivillä oikealla
   =========================================================
   Profiilikuva muodostaa vasemman sarakkeen. Oikeanpuoleinen,
   samankorkuinen sisältöalue sisältää ylärivillä nimen, rank-badgen
   ja sijoituksen sekä alarivillä rank-kuvakkeen ja pisteet. */
#userProfileModal .user-profile-header-layout {
  --profile-header-block-size: 135px;
  display: grid;
  grid-template-columns: var(--profile-header-block-size) minmax(0, 1fr);
  grid-template-rows: var(--profile-header-block-size);
  column-gap: clamp(0.9rem, 2vw, 1.35rem);
}

#userProfileModal .user-profile-header-picture-cluster,
#userProfileModal .user-profile-header-picture-cluster .user-profile-picture-frame {
  width: var(--profile-header-block-size);
  height: var(--profile-header-block-size);
  min-width: var(--profile-header-block-size);
  min-height: var(--profile-header-block-size);
}

#userProfileModal .user-profile-header-picture-cluster {
  grid-column: 1;
  grid-row: 1;
  justify-self: stretch;
}

#userProfileModal .user-profile-header-info {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  min-height: 0;
  height: var(--profile-header-block-size);
}

#userProfileModal .user-profile-header-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
}

#userProfileModal .user-profile-header-copy {
  display: block;
  width: 100%;
  padding: 0;
}

#userProfileModal .user-profile-name-rank {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 1.3vw, 0.95rem);
  min-width: 0;
  overflow: hidden;
  text-align: left;
}

#userProfileModal .user-profile-name-rank .modal-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userProfileModal .user-profile-rank-name {
  display: inline-flex;
  min-height: 2rem;
  max-width: 42%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.82rem 0.39rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--profile-rank-primary, #91e873) 72%, white 28%);
  border-radius: 7px;
  color: #ffffff;
  background:
    linear-gradient(
      128deg,
      color-mix(in srgb, var(--profile-rank-primary, #91e873) 70%, #101318 30%) 0%,
      var(--profile-rank-primary, #91e873) 52%,
      color-mix(
        in srgb,
        var(--profile-rank-primary, #91e873) 82%,
        var(--profile-rank-secondary, #9565ff) 18%
      ) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -3px 0 color-mix(in srgb, var(--profile-rank-secondary, #9565ff) 32%, rgba(0, 0, 0, 0.2)),
    0 5px 13px rgba(0, 0, 0, 0.24),
    0 0 19px color-mix(in srgb, var(--profile-rank-primary, #91e873) 54%, transparent),
    0 0 9px var(--profile-rank-glow, rgba(123, 241, 119, 0.28));
  font-family: "Lilita One", sans-serif;
  font-size: clamp(0.86rem, 1.35vw, 1.05rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.025em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.68);
  white-space: nowrap;
}

#userProfileModal .user-profile-rank-name[data-rank="silver"] {
  color: #27313b;
  border-color: color-mix(in srgb, var(--profile-rank-primary, #e3edf7) 70%, #687888 30%);
  background:
    linear-gradient(
      128deg,
      color-mix(in srgb, var(--profile-rank-primary, #e3edf7) 76%, #81909e 24%) 0%,
      var(--profile-rank-primary, #e3edf7) 54%,
      color-mix(
        in srgb,
        var(--profile-rank-primary, #e3edf7) 88%,
        var(--profile-rank-tertiary, #61d7ed) 12%
      ) 100%
    );
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -3px 0 rgba(79, 96, 111, 0.18),
    0 5px 13px rgba(0, 0, 0, 0.2),
    0 0 20px color-mix(in srgb, var(--profile-rank-primary, #e3edf7) 62%, transparent),
    0 0 9px var(--profile-rank-glow, rgba(181, 205, 232, 0.36));
}

#userProfileModal .user-profile-rank-name[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-header-placement {
  position: static;
  grid-column: 2;
  justify-self: end;
}

#userProfileModal .user-profile-header-placement[hidden] {
  display: none !important;
}

#userProfileModal .user-profile-score-rank-card {
  grid-column: auto;
  grid-row: auto;
  max-width: none;
  height: 82px;
  justify-self: stretch;
}

#userProfileModal .user-profile-score-rank-segment {
  width: 82px;
  min-width: 82px;
  flex: 0 0 82px;
}

#userProfileModal .user-profile-score-rank-icon-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

#userProfileModal .user-profile-score-rank-image,
#userProfileModal .user-profile-score-rank-icon-shell .user-profile-score-rank-image {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 760px) {
  #userProfileModal .user-profile-header-layout {
    --profile-header-block-size: 108px;
    column-gap: clamp(0.58rem, 2.5vw, 0.82rem);
  }

  #userProfileModal .user-profile-header-topline {
    gap: 0.42rem;
  }

  #userProfileModal .user-profile-name-rank {
    gap: 0.42rem;
  }

  #userProfileModal .user-profile-name-rank .modal-title {
    font-size: clamp(1.18rem, 4.7vw, 1.7rem);
  }

  #userProfileModal .user-profile-rank-name {
    min-height: 1.7rem;
    max-width: 38%;
    padding: 0.27rem 0.55rem 0.31rem;
    font-size: clamp(0.7rem, 2.7vw, 0.88rem);
  }

  #userProfileModal .user-profile-header-placement {
    min-height: 1.85rem;
    padding: 0.28rem 0.48rem 0.32rem;
    font-size: clamp(0.78rem, 2.9vw, 0.98rem);
  }

  #userProfileModal .user-profile-score-rank-card {
    height: 66px;
  }

  #userProfileModal .user-profile-score-rank-segment {
    width: 66px;
    min-width: 66px;
    flex-basis: 66px;
  }
}

@media (max-width: 430px) {
  #userProfileModal .user-profile-header-layout {
    --profile-header-block-size: 96px;
    column-gap: 0.52rem;
  }

  #userProfileModal .user-profile-header-topline {
    gap: 0.3rem;
  }

  #userProfileModal .user-profile-name-rank {
    gap: 0.3rem;
  }

  #userProfileModal .user-profile-name-rank .modal-title {
    font-size: clamp(1.02rem, 4.6vw, 1.35rem);
  }

  #userProfileModal .user-profile-rank-name {
    min-height: 1.48rem;
    max-width: 34%;
    padding: 0.22rem 0.42rem 0.25rem;
    font-size: clamp(0.62rem, 2.5vw, 0.76rem);
  }

  #userProfileModal .user-profile-header-placement {
    min-height: 1.62rem;
    padding: 0.23rem 0.34rem 0.27rem;
    font-size: clamp(0.68rem, 2.7vw, 0.82rem);
  }

  #userProfileModal .user-profile-score-rank-card {
    --profile-score-progress-height: 5px;
    height: 58px;
  }

  #userProfileModal .user-profile-score-rank-segment {
    width: 58px;
    min-width: 58px;
    flex-basis: 58px;
  }

  #userProfileModal .user-profile-score-points-segment {
    gap: 0.22rem;
    padding-inline: 0.38rem;
  }
}

@media (max-width: 360px) {
  #userProfileModal .user-profile-header-layout {
    --profile-header-block-size: 88px;
    column-gap: 0.42rem;
  }

  #userProfileModal .user-profile-name-rank .modal-title {
    font-size: clamp(0.96rem, 4.5vw, 1.15rem);
  }

  #userProfileModal .user-profile-rank-name {
    max-width: 31%;
    padding-inline: 0.34rem;
    font-size: 0.6rem;
  }

  #userProfileModal .user-profile-header-placement {
    padding-inline: 0.28rem;
    font-size: 0.65rem;
  }

  #userProfileModal .user-profile-score-rank-card {
    height: 54px;
  }

  #userProfileModal .user-profile-score-rank-segment {
    width: 54px;
    min-width: 54px;
    flex-basis: 54px;
  }
}

/* =========================================================
   Profiili: identiteetti heti kuvan jälkeen, sijoitus samalla rivillä
   ========================================================= */
#userProfileModal .user-profile-header-layout {
  display: flex !important;
  width: min(100%, 1180px);
  max-width: 100%;
  align-items: stretch;
  justify-content: flex-start !important;
  gap: clamp(0.9rem, 2vw, 1.35rem);
  margin-inline: auto;
}

#userProfileModal .user-profile-header-picture-cluster {
  flex: 0 0 var(--profile-header-block-size, 135px);
  align-self: stretch;
}

#userProfileModal .user-profile-header-info {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 82px;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: var(--profile-header-block-size, 135px);
  align-self: stretch;
  gap: 0.55rem;
}

#userProfileModal .user-profile-header-topline {
  display: flex !important;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.65rem, 1.4vw, 1rem);
}

#userProfileModal .user-profile-header-copy {
  display: flex !important;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  margin: 0;
  overflow: hidden;
}

#userProfileModal .user-profile-name-rank {
  width: 100%;
  justify-content: flex-start;
}

#userProfileModal .user-profile-header-placement {
  flex: 0 0 auto;
  align-self: center;
  justify-self: auto;
  margin: 0;
}

#userProfileModal .user-profile-score-rank-card {
  width: 100%;
  min-width: 0;
  align-self: stretch;
}

@media (max-width: 760px) {
  #userProfileModal .user-profile-header-layout {
    gap: clamp(0.58rem, 2.5vw, 0.82rem);
  }

  #userProfileModal .user-profile-header-info {
    grid-template-rows: minmax(0, 1fr) 66px;
    gap: 0.38rem;
  }
}

@media (max-width: 430px) {
  #userProfileModal .user-profile-header-layout {
    gap: 0.52rem;
  }

  #userProfileModal .user-profile-header-info {
    grid-template-rows: minmax(0, 1fr) 58px;
    gap: 0.32rem;
  }
}

@media (max-width: 360px) {
  #userProfileModal .user-profile-header-layout {
    gap: 0.42rem;
  }

  #userProfileModal .user-profile-header-info {
    grid-template-rows: minmax(0, 1fr) 54px;
    gap: 0.26rem;
  }
}


/* Profiili: pisteet luonnollisessa lukujärjestyksessä, esim. "1 234 pistettä". */
#userProfileModal .user-profile-score-points-segment {
  justify-content: center;
  gap: 0.42rem;
}

#userProfileModal .user-profile-score-unit {
  color: #15111d;
  font-size: clamp(1.05rem, 2.25vw, 1.4rem);
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  #userProfileModal .user-profile-score-points-segment {
    gap: 0.3rem;
    padding-inline: 0.65rem;
  }

  #userProfileModal .user-profile-score-unit {
    font-size: clamp(0.88rem, 3.5vw, 1.08rem);
  }
}
