/* "Moje SW", the profile page. Builds on style.css (reset, colours, .account-join/.account-login). */

.profile-page { min-height: 100svh; background: linear-gradient(#4071b5, #5250a8); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.profile { position: relative; display: grid; place-items: center; min-height: 100svh; padding: 5rem 1.25rem 3rem; }
.profile-bar { position: absolute; inset: 1.25rem 1.25rem auto; display: flex; justify-content: space-between; gap: 1rem; }
.profile-bar a, .profile-bar button {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  background: rgb(0 0 0 / 0.15);
  font-size: 0.875rem;
  color: var(--blue-100);
  transition: background 0.15s, color 0.15s;
}
.profile-bar a:hover { background: rgb(255 255 255 / 0.15); color: white; }
.profile-bar button { font-weight: 600; }
.profile-bar button:hover { background: rgb(69 10 10 / 0.3); color: white; }

.profile-body { width: 100%; max-width: 42rem; min-width: 0; text-align: center; }
.profile-body h1 { font-size: clamp(2.5rem, 9vw, 3.75rem); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.profile-name { margin-top: 1rem; font-size: 1.25rem; }
.profile-status {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid #feea53;
  border-radius: 0.25rem;
  color: #feea53;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
/* A yellow hexagon: the hexes clicked on the logo, the workshops' own points. */
.profile-hex {
  width: 1.6rem;
  aspect-ratio: 0.866;
  background: #feea53;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter: drop-shadow(0 0 6px rgb(254 234 83 / 0.5));
}
.profile-signed-out { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.profile-found, .profile-missing {
  max-width: 30rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.95rem;
}
.profile-found { border: 1px solid rgb(167 243 208 / 0.35); background: rgb(2 44 34 / 0.3); color: rgb(209 250 229); }
.js .profile-found { animation: callout-in 0.7s 1.2s both; }
.profile-missing { background: rgb(0 0 0 / 0.15); color: var(--blue-100); }

.profile-card {
  margin-top: 1rem;
  padding: 1.75rem 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.5rem;
  background: rgb(0 0 0 / 0.15);
  box-shadow: 0 10px 15px -3px rgb(23 37 84 / 0.1);
  overflow: hidden;
}
.profile-body > .profile-card:first-of-type { margin-top: 3rem; }
.profile-columns { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; }
.profile-column { display: flex; flex-direction: column; min-width: 0; padding-inline: 0.5rem; }
.profile-column + .profile-column { border-left: 1px solid rgb(255 255 255 / 0.1); }
.profile-stat { display: flex; min-height: 2.5rem; align-items: center; justify-content: center; gap: 0.5rem; }
.profile-label { font-size: 0.75rem; line-height: 1.35; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-100); }
.profile-counter { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-caption { margin-top: auto; padding-top: 0.5rem; font-size: 0.75rem; color: var(--blue-100); }

/* A strip of icons: scrolls sideways when there are many, newest on the right. */
.profile-strip {
  margin-top: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(147 197 253 / 0.7) rgb(15 23 42 / 0.18);
}
.profile-strip:focus-visible { outline: 1px solid rgb(255 255 255 / 0.5); }
.profile-icon { display: grid; place-items: center; }
.profile-stays {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, 1.25rem);
  grid-auto-columns: 1.25rem;
  justify-content: safe center;
  gap: 0.125rem;
  width: max-content;
  min-width: 100%;
  height: 4.75rem;
  align-content: center;
  padding-inline: 0.25rem;
}
.profile-stays .profile-icon { border: 1px solid; border-radius: 50%; font-size: 0.6rem; }
.profile-stays .lato { border-color: rgb(254 243 199 / 0.35); background: rgb(252 211 77 / 0.2); }
.profile-stays .zima { border-color: rgb(207 250 254 / 0.35); background: rgb(165 243 252 / 0.15); }
/* A stay in the staff: a ring in the logo's yellow. */
.profile-stays .kadra { border-color: #feea53; box-shadow: 0 0 0 1px #feea53; }
.profile-strip-days { height: 5.5rem; padding: 0.25rem; border-radius: 0.25rem; background: rgb(0 0 0 / 0.1); }
.profile-days {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, 0.875rem);
  grid-auto-columns: 0.875rem;
  justify-content: safe center;
  align-content: center;
  gap: 0.125rem;
  width: max-content;
  min-width: 100%;
  height: 100%;
}
.profile-days .profile-icon { border-radius: 3px; font-size: 0.5rem; line-height: 1; }
.profile-days .lato { background: rgb(252 211 77 / 0.3); color: rgb(254 243 199); }
.profile-days .zima { background: rgb(165 243 252 / 0.25); color: rgb(236 254 255); }
.profile-days .weekend { background: rgb(196 181 253 / 0.3); color: var(--orange-100); }

.profile-weekends {
  padding: 0.75rem 1.25rem;
  border-color: rgb(221 214 254 / 0.2);
  background: linear-gradient(to bottom right, rgb(46 16 101 / 0.3), rgb(0 0 0 / 0.15), rgb(251 146 60 / 0.15));
}
.profile-weekends-title { font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange-100); }
.profile-weekends-head {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  max-width: 36rem;
  margin: 0.5rem auto 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-100);
}
.profile-weekends-head strong { font-size: 1.125rem; letter-spacing: normal; font-variant-numeric: tabular-nums; color: white; }
.profile-meetings { display: flex; justify-content: center; gap: 0.5rem; width: max-content; min-width: 100%; padding: 0.25rem 0.25rem 0.5rem; }
.profile-meetings .profile-icon { width: 2rem; height: 2rem; flex-shrink: 0; border: 1px solid; border-radius: 50%; font-weight: 700; }
.profile-meetings .byl { border-color: rgb(167 243 208 / 0.4); background: rgb(110 231 183 / 0.2); color: rgb(209 250 229); }
.profile-meetings .nie { border-color: rgb(254 205 211 / 0.35); background: rgb(253 164 175 / 0.15); color: rgb(255 228 230); }

/* Events someone took part in, each with the hexes earned there. */
.profile-events { padding: 0.75rem 1.25rem 1rem; border-color: rgb(254 234 83 / 0.2); }
.profile-events-title { font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #feea53; }
.profile-events-list { display: grid; gap: 0.75rem; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid rgb(255 255 255 / 0.1); }
.profile-event { display: grid; justify-items: center; gap: 0.15rem; }
.profile-event-hexes { display: flex; align-items: center; gap: 0.5rem; font-size: 1.125rem; }
.profile-event-hexes strong { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #feea53; }
.profile-event-name { font-weight: 600; }
.profile-event-details { font-size: 0.8rem; color: var(--blue-100); }

@media (min-width: 640px) {
  .profile-card { padding-inline: 1.5rem; }
  .profile-column { padding-inline: 1.25rem; }
  .profile-label { font-size: 0.875rem; letter-spacing: 0.16em; }
  .profile-counter { font-size: 1.875rem; }
  .profile-caption { font-size: 0.875rem; }
  .profile-stays { grid-template-rows: repeat(3, 1.625rem); grid-auto-columns: 1.625rem; gap: 0.25rem; height: 5.5rem; }
  .profile-stays .profile-icon { font-size: 0.8rem; }
}

/* The icons' tooltip (profil.js): the stay or meeting, then its details. */
.profile-icon { cursor: default; transition: outline-color 0.1s; outline: 1px solid transparent; outline-offset: 1px; }
.profile-icon.razem { outline-color: white; }
.profile-tip {
  position: fixed;
  z-index: 20;
  max-width: min(17rem, calc(100vw - 1rem));
  padding: 0.4rem 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.15);
  border-radius: 0.375rem;
  background: rgb(15 23 42 / 0.94);
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.3);
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
  color: white;
  pointer-events: none;
}
.profile-tip strong { display: block; font-weight: 600; }
.profile-tip span { display: block; font-size: 0.75rem; color: var(--blue-100); }
.profile-tip span:empty { display: none; }

/* ---- the avatar (avatar.css) above the nick; a tap opens the picker ---- */
.profile-avatar { display: inline-grid; margin-bottom: 0.75rem; border-radius: 50%; transition: transform 0.2s; }
.profile-avatar .avatar { font-size: 6rem; filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.25)); }
.profile-avatar:hover { transform: scale(1.06) rotate(-3deg); }
.profile-avatar:focus-visible { outline: 2px solid white; outline-offset: 4px; }
/* Not chosen yet: a small pencil says it can be changed. */
.profile-avatar.unchosen { position: relative; }
.profile-avatar.unchosen::after {
  content: "✎";
  position: absolute;
  right: -0.25rem;
  bottom: 0.25rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: white;
  color: #3d3a96;
  font-size: 0.9rem;
}

.avatar-picker {
  margin: auto;
  width: min(26rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: #2d2a7a;
  color: white;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.5);
}
.avatar-picker::backdrop { background: rgb(10 8 40 / 0.6); backdrop-filter: blur(3px); }
.avatar-picker-form { display: grid; justify-items: center; gap: 1rem; }
.avatar-picker-title { font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #feea53; }
.avatar-picker-preview .avatar { font-size: 6rem; }
.avatar-picker-colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; }
.avatar-picker-color {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--avatar);
  box-shadow: inset 0 -4px 0 var(--avatar-dark);
}
.avatar-picker-color[data-color="gold"]   { --avatar: #feea53; --avatar-dark: #d4a017; }
.avatar-picker-color[data-color="orange"] { --avatar: #fdba74; --avatar-dark: #ea580c; }
.avatar-picker-color[data-color="red"]    { --avatar: #fca5a5; --avatar-dark: #dc2626; }
.avatar-picker-color[data-color="pink"]   { --avatar: #f9a8d4; --avatar-dark: #db2777; }
.avatar-picker-color[data-color="violet"] { --avatar: #c4b5fd; --avatar-dark: #7c3aed; }
.avatar-picker-color[data-color="blue"]   { --avatar: #93c5fd; --avatar-dark: #2563eb; }
.avatar-picker-color[data-color="teal"]   { --avatar: #5eead4; --avatar-dark: #0d9488; }
.avatar-picker-color[data-color="green"]  { --avatar: #86efac; --avatar-dark: #16a34a; }
.avatar-picker-color[aria-checked="true"] { outline: 3px solid white; outline-offset: 2px; }
.avatar-picker-symbols { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.25rem; width: 100%; }
.avatar-picker-symbols button { aspect-ratio: 1; border-radius: 0.375rem; font-size: 1.35rem; transition: background 0.1s; }
.avatar-picker-symbols button:hover { background: rgb(255 255 255 / 0.1); }
.avatar-picker-symbols button[aria-checked="true"] { background: rgb(254 234 83 / 0.3); outline: 2px solid #feea53; }
.avatar-picker-letters { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--blue-100); }
.avatar-picker-letters input {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  background: rgb(0 0 0 / 0.25);
  color: white;
  font: inherit;
  text-align: center;
  text-transform: uppercase;
}
.avatar-picker-buttons { display: flex; gap: 0.75rem; }

/* ---- the next meeting ---- */
.profile-next {
  display: grid;
  gap: 0.15rem;
  max-width: 30rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(254 234 83 / 0.35);
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgb(254 234 83 / 0.12), rgb(0 0 0 / 0.1));
}
.profile-next-label { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: #feea53; }
.profile-next strong { font-size: 1.1rem; }
.profile-next span:last-child { font-size: 0.875rem; color: var(--blue-100); }
.profile-next span:last-child:empty { display: none; }
.profile-next.today { border-color: #6bffb3; box-shadow: 0 0 1.5rem rgb(107 255 179 / 0.25); }

/* ---- the flame: meetings in a row, hotter with each one ---- */
.profile-flame {
  --heat: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  font-size: 0.875rem;
  color: var(--blue-100);
}
.profile-flame strong { font-size: 1.5rem; color: #fdba74; font-variant-numeric: tabular-nums; }
.profile-flame-icon {
  display: inline-block;
  font-size: calc(1.4rem + var(--heat) * 1.2rem);
  filter: drop-shadow(0 0 calc(var(--heat) * 12px) rgb(251 146 60 / 0.9));
  animation: profile-flicker 1.6s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.profile-flame.cold .profile-flame-icon { filter: grayscale(1) opacity(0.5); animation: none; }
.profile-flame.cold strong { color: var(--blue-100); }
@keyframes profile-flicker { 25% { transform: scale(1.06, 0.96) rotate(-2deg); } 60% { transform: scale(0.97, 1.05) rotate(2deg); } }

/* ---- tasks ---- */
.profile-tasks { padding: 0.75rem 1rem 1rem; border-color: rgb(107 255 179 / 0.25); }
.profile-tasks-title, .profile-badges-title { font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--highlight); }
.profile-tasks-list { display: grid; gap: 0.75rem; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid rgb(255 255 255 / 0.1); text-align: left; }
.profile-task { display: grid; gap: 0.35rem; padding: 0.75rem; border-radius: 0.375rem; background: rgb(0 0 0 / 0.15); }
.profile-task.done { background: rgb(2 44 34 / 0.35); }
.profile-task-head { display: flex; align-items: center; gap: 0.5rem; }
.profile-task-icon { font-size: 1.4rem; }
.profile-task-title { flex: 1; font-size: 1.05rem; }
.profile-task-state { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #feea53; white-space: nowrap; }
.profile-task.done .profile-task-state { color: var(--highlight); }
.profile-task-desc { font-size: 0.9rem; color: var(--blue-100); white-space: pre-line; overflow-wrap: anywhere; }
.profile-task-desc:empty, .profile-task-due:empty, .profile-task-actions:empty { display: none; }
.profile-task-due { font-size: 0.8rem; color: var(--orange-200); }
.profile-task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.profile-task-actions .account-join, .profile-task-actions .account-login { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
.profile-task-note {
  flex: 1 1 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.25rem;
  background: rgb(0 0 0 / 0.25);
  color: white;
  font: inherit;
  font-size: 0.9rem;
}

/* ---- badges: earned ones in colour, the rest as shadows with how far they are ---- */
.profile-badges { padding: 0.75rem 1rem 1rem; border-color: rgb(254 234 83 / 0.2); }
.profile-badges-title { color: #feea53; }
.profile-badges-title span { margin-left: 0.25rem; font-variant-numeric: tabular-nums; color: var(--blue-100); letter-spacing: normal; }
.profile-badges-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}
.profile-badge { position: relative; display: grid; justify-items: center; align-content: start; gap: 0.25rem; padding: 0.5rem 0.25rem; border-radius: 0.375rem; }
.profile-badge-icon {
  display: grid;
  place-items: center;
  width: 2.9rem;
  aspect-ratio: 0.866;
  background: rgb(255 255 255 / 0.08);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-size: 1.35rem;
  filter: grayscale(1) opacity(0.45);
}
.profile-badge.earned .profile-badge-icon { background: linear-gradient(150deg, rgb(254 234 83 / 0.45), rgb(251 146 60 / 0.3)); filter: none; }
.profile-badge-name { font-size: 0.7rem; line-height: 1.2; color: var(--blue-100); opacity: 0.6; }
.profile-badge.earned .profile-badge-name { color: white; opacity: 1; }
.profile-badge-bar { width: 70%; height: 3px; border-radius: 2px; background: linear-gradient(to right, #feea53 calc(var(--done) * 100%), rgb(255 255 255 / 0.12) 0); }

/* "Wyniki" on "Moje SW" (the tasks card's look) and the page /ranking (ranking.html). */
.profile-results a.profile-task-title { color: inherit; text-decoration: none; }
.profile-results a.profile-task-title[href]:hover { text-decoration: underline; }
.profile-results-all, .ranking-play { display: inline-block; margin-top: 0.75rem; font-size: 0.9rem; color: var(--highlight); }
.profile-results-all:hover, .ranking-play:hover { color: white; }
.ranking-boards { display: grid; gap: 0.25rem; margin-top: 1.5rem; }
.ranking-wait, .ranking-empty { margin-top: 1rem; color: var(--blue-100); }
.ranking-card { padding: 1rem; text-align: left; }
.ranking-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.ranking-card-title { font-size: 1.25rem; font-weight: 600; }
.ranking-card-game { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--highlight); }
.ranking-card-game:empty { display: none; }
.ranking-stats { font-size: 0.75rem; color: var(--orange-200); }
.ranking-players { margin-top: 0.75rem; font-size: 0.85rem; }
.ranking-players summary { cursor: pointer; color: var(--orange-200); }
.ranking-players-scroll { overflow-x: auto; margin-top: 0.5rem; }
.ranking-players table { width: 100%; border-collapse: collapse; }
.ranking-players th, .ranking-players td { padding: 0.3rem 0.5rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgb(255 255 255 / 0.1); }
.ranking-players th { font-weight: 600; color: var(--blue-100); white-space: nowrap; }
.ranking-play { margin-top: 0; white-space: nowrap; }
.ranking-rows { display: grid; gap: 0.25rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgb(255 255 255 / 0.1); }
.ranking-row { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.4rem 0.6rem; border-radius: 0.375rem; background: rgb(0 0 0 / 0.15); }
.ranking-mine { outline: 2px solid var(--highlight); }
.ranking-place { width: 1.75rem; flex-shrink: 0; text-align: right; color: var(--blue-100); font-variant-numeric: tabular-nums; }
.ranking-top1 .ranking-place { color: #feea53; font-weight: 700; }
.ranking-top2 .ranking-place, .ranking-top3 .ranking-place { color: white; font-weight: 600; }
.ranking-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ranking-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-comment { font-size: 0.8rem; color: var(--blue-100); overflow-wrap: anywhere; }
.ranking-comment-hidden { opacity: 0.6; text-decoration: line-through; }
.ranking-hide { align-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: 0.75rem; color: var(--orange-200); text-decoration: underline; cursor: pointer; }
.ranking-hide:hover { color: white; }
.ranking-detail { font-size: 0.8rem; color: var(--blue-100); white-space: nowrap; }
.ranking-score { width: 3.25rem; text-align: right; font-weight: 600; color: var(--highlight); font-variant-numeric: tabular-nums; }
.ranking-join { margin-top: 1.5rem; }
.ranking-join .account-login { margin-left: 0.25rem; }
@media (max-width: 480px) { .ranking-detail { display: none; } }
.ranking-note { margin-top: 0.25rem; font-size: 0.85rem; color: var(--blue-100); }
.profile-results a.account-join { text-decoration: none; }
.profile-result-comment { display: grid; justify-items: start; gap: 0.25rem; font-size: 0.9rem; color: var(--blue-100); overflow-wrap: anywhere; }
.profile-result-hidden { font-size: 0.8rem; color: var(--orange-200); }
.profile-result-edit { padding: 0; border: 0; background: none; font: inherit; color: var(--highlight); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.profile-result-edit:hover { color: white; }
.profile-result-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; }
.profile-result-form input { flex: 1 1 14rem; min-width: 0; padding: 0.45rem 0.7rem; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 0.375rem; background: rgb(0 0 0 / 0.25); color: white; font: inherit; }
.profile-result-form .account-join, .profile-result-form .account-login { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
