/* A public profile (templates/profile_new.html): its banner, Most Played,
   songs, jams and friends, and the Share button. */
.profile-page {
  --tip-amber: #c8842a;
  --tip-amber-deep: #9b6418;
  --hero-ink: #fff9ec;
  --hero-gold: #f4d89f;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
.tip-jar { flex-shrink: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* The banner: who they are, what they play and their numbers, at a
   glance, the way a broadcast introduces a player. */
.profile-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 22px;
  color: var(--hero-ink);
  background:
    radial-gradient(circle at 10% 35%, rgba(244, 216, 159, 0.24), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 16px),
    linear-gradient(118deg, #0b2e27 0%, #155044 50%, #2b6b53 100%);
  box-shadow: 0 18px 48px rgba(16, 46, 39, 0.28);
}
.hero-watermark {
  position: absolute;
  right: -30px;
  top: -40px;
  width: 360px;
  height: 360px;
  object-fit: contain;
  opacity: 0.07;
  filter: brightness(0) invert(1);
  transform: rotate(-12deg);
  z-index: -1;
  pointer-events: none;
}
.hero-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  padding: 36px 40px 32px;
}
.hero-avatar {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1d5a4c;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}
/* A supporter's photo wears their level as its ring. */
.hero-avatar.referral-silver { border-color: #d3dde6; box-shadow: 0 0 0 8px rgba(211, 221, 230, 0.16), 0 14px 32px rgba(0, 0, 0, 0.32); }
.hero-avatar.referral-gold { border-color: #f2c14e; box-shadow: 0 0 0 8px rgba(242, 193, 78, 0.2), 0 14px 32px rgba(0, 0, 0, 0.32); }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-avatar .material-icons { font-size: 76px; color: rgba(255, 255, 255, 0.55); }
.hero-name {
  margin: 8px 0 16px;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  font-weight: 700;
  line-height: 1.02;
  color: white;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
  overflow-wrap: anywhere;
}
.hero-name:has(+ .hero-location) { margin-bottom: 6px; }
.hero-location {
  display: flex; align-items: center; gap: 4px; margin: 0 0 16px;
  font-size: 1.05rem; font-weight: 500; color: rgba(255, 255, 255, 0.85);
}
.hero-location .material-icons { font-size: 18px; color: var(--hero-gold); }
/* Instruments as the app shows them: white tiles, the icon over its name. */
.hero-instruments { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hero-instruments li {
  box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 54px; padding: 6px 8px 5px; border-radius: 8px;
  background: white; border: 1px solid #d1d5db; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.hero-instruments img { width: 27px; height: 27px; object-fit: contain; }
.hero-instruments li > .material-icons { font-size: 24px; color: #6b7280; }
.instrument-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 700; line-height: 1; color: var(--color-forest-main);
}
.hero-actions { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.hero-join, .friend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.hero-join { background: var(--hero-gold); color: #3f2d0c; border: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.hero-join:hover { background: #fbe4b4; transform: translateY(-1px); }
.friend-btn { background: rgba(255, 255, 255, 0.1); color: white; border: 1.5px solid rgba(255, 255, 255, 0.4); }
.friend-btn:hover { background: rgba(255, 255, 255, 0.18); }
.friend-btn.remove-friend { color: rgba(255, 255, 255, 0.8); }
.friend-btn:disabled { opacity: 0.55; cursor: default; }
.friend-btn .material-icons { font-size: 18px; }
/* Join is for someone signed out. Signed in, it is gone from your own
   profile (and the account page's Profile tab, always your own), and on
   someone else's Add/Remove Friend stands in its place, Add in its gold. */
.is-own-profile .hero-join, .is-signed-in-visitor .hero-join, .is-embedded .hero-join { display: none; }
/* The account page's Profile tab has Share beside Edit profile instead. */
.is-embedded .hero-actions [data-share-open] { display: none; }
#friendButtonContainer { display: none; }
.is-signed-in-visitor .profile-page:not(.is-embedded) #friendButtonContainer { display: contents; }
.friend-btn.add-friend { background: var(--hero-gold); color: #3f2d0c; border-color: transparent; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.friend-btn.add-friend:hover { background: #fbe4b4; transform: translateY(-1px); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-stat {
  padding: 16px 12px 18px;
  text-align: center;
  color: inherit;
  text-decoration: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s;
}
.hero-stat:first-child { border-left: none; }
a.hero-stat:hover { background: rgba(255, 255, 255, 0.06); }
.hero-stat-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.1;
  color: white;
  font-variant-numeric: tabular-nums;
}
.hero-stat-value .of { font-size: 1.1rem; font-weight: 700; color: rgba(255, 255, 255, 0.55); }
.hero-stat-value .tip-jar, .hero-stat-value .material-icons { color: var(--hero-gold); }
.hero-stat-value .material-icons { font-size: 26px; }
.hero-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 249, 236, 0.68);
}

/* Below the banner: achievements across, then songs beside jams and
   friends. */
.profile-trophies { margin-top: 24px; }
.profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.profile-body-solo { grid-template-columns: minmax(0, 1fr); }
.profile-main, .profile-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.section-card {
  background: white;
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 47, 53, 0.05), 0 8px 24px rgba(31, 47, 53, 0.05);
}
.played-card, .songs-card, .jams-card, .friends-card { padding: 18px 20px 20px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-head .material-icons { color: var(--color-forest-main); }
.card-head h2 { flex: 1; margin: 0; font-size: 1rem; font-weight: 800; color: var(--color-text-primary); }
.card-count { font-weight: 800; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.card-chip {
  flex: none; padding: 3px 10px; border-radius: 6px;
  background: var(--color-forest-main); color: white;
  font-size: 0.85rem; font-weight: 800; line-height: 1.4; white-space: nowrap;
}
.card-empty { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }

.song-group + .song-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-border-subtle); }
.song-group h3 {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px;
  font-family: 'Lora', Georgia, serif; font-size: 1.05rem; font-weight: 700; color: var(--color-text-primary);
}
.song-group h3 .count { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
/* Most Played: ranked by minutes or days, each panel a ranked bar list in its own color. */
.played-card .card-head { flex-wrap: wrap; }
.played-card .card-head h2 { flex: 1 0 auto; white-space: nowrap; }
.played-by { display: inline-flex; margin-left: auto; padding: 2px; border-radius: 8px; background: var(--color-parchment, #f3efe6); }
.played-by button {
  padding: 4px 12px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--color-text-secondary); cursor: pointer;
}
.played-by button[aria-pressed="true"] { background: white; color: var(--color-text-primary); box-shadow: 0 1px 2px rgba(31, 47, 53, 0.15); }
.played-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.played-panel { --played: #00799c; border-radius: 10px; padding: 14px 16px 14px 12px; background: #f7f9fa; background: color-mix(in srgb, var(--played) 7%, white); }
.played-practice { --played: #00799c; }
.played-demos { --played: #c8842a; }
.played-lessons { --played: #4f7a28; }
.played-instrument_lessons { --played: #7b4f9d; }
.played-panel h3 {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px 4px;
  font-family: 'Lora', Georgia, serif; font-size: 1.05rem; font-weight: 700; color: var(--color-text-primary);
}
.played-panel h3 .count {
  margin-left: auto; font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted);
}
.played-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.played-row { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr); gap: 6px 10px; align-items: center; }
.played-row.is-top { grid-template-columns: 22px 96px minmax(0, 1fr); }
.played-row[hidden] { display: none; }
.played-rank { font-size: 15px; font-weight: 800; line-height: 1.35; text-align: right; color: var(--color-text-light); font-variant-numeric: tabular-nums; }
.played-thumb, .played-thumb-none {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 6px;
  background: color-mix(in srgb, var(--played) 16%, white);
}
.played-thumb { cursor: pointer; }
.played-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.played-thumb::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(0, 0, 0, 0.18); transition: background 0.15s; }
.played-thumb:hover::before, .played-thumb:focus-visible::before { background: rgba(0, 0, 0, 0.34); }
.played-thumb .material-icons { position: relative; z-index: 2; font-size: 22px; color: white; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.played-row.is-top .played-thumb .material-icons { font-size: 30px; }
.played-thumb-none .material-icons { font-size: 20px; color: var(--color-text-light); }
.played-player { grid-column: 1 / -1; overflow: hidden; aspect-ratio: 16 / 9; margin-top: 4px; border-radius: 8px; background: #000; }
.played-player iframe { display: block; width: 100%; height: 100%; border: 0; }
.played-title { display: block; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--color-text-primary); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
a.played-title:hover { text-decoration: underline; }
.played-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.played-bar { flex: none; min-width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--played); transition: filter 0.15s; }
.played-row:hover .played-bar, .played-row:focus-within .played-bar { filter: brightness(1.18); }
.played-value { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.played-row.is-top .played-rank { font-size: 24px; line-height: 1.1; color: var(--color-text-primary); }
.played-row.is-top .played-title { font-size: 17px; font-weight: 800; }
.played-row.is-top .played-bar { height: 12px; }
.played-panel .played-more { margin: 12px 0 0 32px; }
.played-timeline {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 7px 14px; border-radius: 8px;
  background: var(--color-forest-main); color: white; font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.played-timeline[hidden] { display: none; }
.played-timeline:hover { background: var(--color-forest-light, #1d7f85); }
.played-timeline .material-icons { font-size: 18px; }
.played-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.played-name .played-title { flex: 0 1 auto; min-width: 0; }
.played-days-toggle { flex: none; display: inline-flex; margin: -2px -4px -2px auto; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--color-text-muted); cursor: pointer; }
.played-days-toggle[hidden] { display: none; }
.played-days-toggle:hover, .played-days-toggle:focus-visible { color: var(--color-text-primary); }
.played-days-toggle .material-icons { font-size: 20px; transition: transform 0.15s; }
.played-row.is-open .played-days-toggle .material-icons { transform: rotate(180deg); }
.played-card.is-owner .played-row { cursor: pointer; }
/* A row's days, for its owner: newest first, a bar each against the longest,
   solid for playing along and light for the page open. */
.played-days { grid-column: 1 / -1; margin: 2px 0 4px 32px; padding: 10px 12px 12px; border-radius: 8px; background: white; cursor: default; }
.played-days-note { margin: 0; font-size: 13px; color: var(--color-text-muted); }
.played-days-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; font-size: 12px; color: var(--color-text-secondary); }
.played-days-key span { display: inline-flex; align-items: center; gap: 5px; }
.played-days-key span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--src); }
.played-days-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.played-day { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.played-days-list.has-years .played-day { grid-template-columns: 6.4rem minmax(0, 1fr) auto; }
.played-day[hidden] { display: none; }
.played-day-date { color: var(--color-text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.played-day-bar { display: flex; gap: 2px; min-width: 3px; max-width: 100%; height: 10px; }
.played-day-bar span { min-width: 3px; height: 100%; background: var(--src); }
.played-day-bar span:last-child { border-radius: 0 4px 4px 0; }
.played-day-time { color: var(--color-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.played-days .played-src-track, .played-days .played-src-demo, .played-days .played-src-lesson,
.played-days .played-src-instrument_lesson { --src: var(--played); }
.played-days .played-src-page, .played-days .played-src-jam_along { --src: color-mix(in srgb, var(--played) 38%, white); }
.played-days .played-more { margin: 10px 0 0; }
.song-columns { columns: 3 190px; column-gap: 22px; margin: 0; padding: 0; list-style: none; }
.song-columns li { break-inside: avoid; }
.song-columns a, .song-columns .song-plain {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  text-decoration: none;
}
.song-columns a:hover { color: var(--color-forest-main); text-decoration: underline; }
.song-columns .song-type { font-size: 15px; color: var(--color-stone-light); flex-shrink: 0; }
.song-columns-collapsed li.more { display: none; }
.show-more {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.show-more:hover { background: var(--color-parchment); }

.jam-list { margin: 0; padding: 0; list-style: none; }
.jam-list li + li { border-top: 1px solid var(--color-border-subtle); }
.jam-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: inherit; text-decoration: none; }
.jam-list a:hover strong { color: var(--color-forest-main); }
.jam-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
}
.jam-icon .material-icons { font-size: 20px; color: var(--color-forest-main); }
.jam-list strong { display: block; font-size: 0.92rem; color: var(--color-text-primary); }
.jam-list small { display: block; font-size: 0.8rem; color: var(--color-text-muted); }

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 14px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.friend-grid a { display: flex; flex-direction: column; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.friend-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  box-shadow: 0 0 0 2px white, 0 0 0 3px var(--color-border);
  transition: box-shadow 0.15s;
}
.friend-grid a:hover .friend-avatar { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-forest-main); }
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-avatar .material-icons { font-size: 26px; color: var(--color-stone-light); }
.friend-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.friend-instruments { display: flex; gap: 3px; height: 15px; }
.friend-instruments img { width: 15px; height: 15px; object-fit: contain; opacity: 0.85; }

.error-container { text-align: center; padding: 64px 24px; }
.error-container h1 { color: var(--color-text-primary); margin-bottom: 12px; font-family: 'Lora', Georgia, serif; }
.error-container p { color: var(--color-text-muted); }

@media (max-width: 860px) {
  .hero-main { grid-template-columns: auto minmax(0, 1fr); padding: 28px 26px 24px; gap: 20px; }
  .hero-avatar { width: 112px; height: 112px; }
  .hero-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .profile-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .profile-trophies, .profile-body { margin-top: 20px; }
}
@media (max-width: 560px) {
  .profile-page { padding: 12px 12px 40px; }
  .profile-hero { border-radius: 18px; }
  .hero-main { padding: 22px 18px 18px; gap: 14px 16px; }
  .hero-avatar { width: 84px; height: 84px; border-width: 3px; }
  .hero-name { margin: 4px 0 10px; }
  .hero-location { font-size: 0.95rem; margin-bottom: 12px; }
  .hero-instruments { gap: 6px; }
  .hero-instruments li { min-width: 48px; padding: 5px 6px 4px; gap: 2px; }
  .hero-instruments img { width: 22px; height: 22px; }
  .hero-watermark { width: 220px; height: 220px; }
  /* Tips and achievements above (or achievements alone), the three counts below. */
  .hero-stats { grid-template-columns: repeat(6, 1fr); }
  .hero-stat { grid-column: span 2; padding: 12px 4px 14px; }
  .hero-stat-major { grid-column: span 3; }
  .hero-stats:not(.has-tips) .hero-stat-major { grid-column: span 6; }
  .hero-stats.has-major .hero-stat-major + .hero-stat:not(.hero-stat-major) { border-left: none; }
  .hero-stats.has-major .hero-stat:not(.hero-stat-major) { border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .hero-stat-value { font-size: 1.4rem; gap: 4px; }
  .hero-stat-value .of { font-size: 0.85rem; }
  .hero-stat-value .material-icons { font-size: 20px; }
  .hero-stat-value .tip-jar { width: 18px; height: 18px; }
  .hero-stat-label { font-size: 0.6rem; letter-spacing: 0.1em; }
  .songs-card, .jams-card, .friends-card { padding: 16px; }
}

/* The share window here: rounded rectangles, like the rest of the page. */
.share-action, .share-link, .share-close { border-radius: 8px; }
