/* My Profile page (Phase 3 sub-step 2). Relies on the :root CSS variables
   and header.site styles already defined in player.css, loaded first. */

.profile-wrap{max-width:1000px; margin:0 auto; padding:32px 24px 80px;}
.profile-wrap h1{font-size:26px; margin:0 0 6px;}
.profile-wrap .sub{color:var(--muted); font-size:13.5px; margin:0 0 28px;}

.profile-view-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px;}
.profile-view-head h1{margin:0 0 6px;}
.profile-view-head .sub{margin:0;}
.profile-logout-btn{
  flex:none; padding:9px 18px; border-radius:999px; border:1px solid #333; background:transparent;
  color:var(--muted); font-size:12.5px; font-weight:700; cursor:pointer; font-family:inherit; white-space:nowrap;
}
.profile-logout-btn:hover{border-color:var(--beta-red); color:#fff;}

/* "Reachable close button" at the bottom of the profile content, so
   closing My Profile never requires reaching back up to the corner X —
   see .popup-bottom-close in player.css for the shared style. Sits below
   everything else in #profile-view, outside .profile-layout. */
#profile-view > .popup-bottom-close{max-width:320px; margin:32px auto 0;}

/* When this page is loaded inside the parent site's profile-overlay iframe
   (class set by the inline script in profile.html's <head>), hide the
   in-page header so its logo/"Back to Streaming" links can't re-navigate
   the iframe. A little extra top padding replaces the header's breathing
   room since the modal frame already has its own close button/chrome. */
html.embedded header.site{display:none;}
html.embedded .profile-wrap{padding-top:48px;}

.signin-card{
  background:var(--card); border:1px solid #1f1f1f; border-radius:14px;
  padding:36px; text-align:center; max-width:440px; margin:40px auto;
}
.signin-card p{color:var(--muted); font-size:13.5px; margin:0 0 20px;}
.btn-accent{
  background:var(--accent); color:#fff; border:none; border-radius:999px;
  padding:11px 24px; font-weight:700; font-size:13px; cursor:pointer;
}
.btn-accent:hover{opacity:.9;}

.profile-layout{
  display:grid; grid-template-columns:220px 1fr; gap:28px; align-items:start;
}
@media(max-width:760px){ .profile-layout{grid-template-columns:1fr;} }

.profile-avatar-card{
  background:var(--card); border:1px solid #1f1f1f; border-radius:14px;
  padding:22px 18px; text-align:center;
}
.avatar-circle{
  width:140px; height:140px; border-radius:50%; margin:0 auto 14px;
  background:#1c1c1c; border:2px solid #262626; overflow:hidden;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.avatar-circle img{width:100%; height:100%; object-fit:cover; display:block;}
/* Default profile picture (2026-08-24, Raz's call): the BKRSCLB chef-hat
   logo, white on black, instead of the old grey "+". Lives in the CSS
   rather than in each JS branch that shows/hides the placeholder, so every
   "no photo yet" state across the site picks it up from one place. The
   Change Photo button below is still what invites an upload. */
.avatar-circle #avatar-placeholder{
  width:100%; height:100%; display:block; font-size:0;
  background:#000 url('/assets/default-avatar.svg') center/cover no-repeat;
}
.profile-avatar-card button{
  display:block; width:100%; margin:6px 0 0; padding:9px 12px; border-radius:8px;
  border:1px solid #2a2a2a; background:#181818; color:var(--fg); font-size:12.5px;
  font-weight:600; cursor:pointer;
}
.profile-avatar-card button:hover{border-color:var(--accent);}
#avatar-remove-btn{background:transparent; color:var(--muted); border-color:transparent;}
.avatar-hint{color:var(--muted); font-size:11px; margin:12px 0 0; line-height:1.5;}

.profile-form-card, .profile-favorites-card{
  background:var(--card); border:1px solid #1f1f1f; border-radius:14px;
  padding:22px 24px; margin-bottom:20px;
}
.profile-form-card label{display:block; font-size:12px; font-weight:700; color:var(--muted); margin:0 0 16px; text-transform:uppercase; letter-spacing:.03em;}
.field-optional-hint{font-weight:400; text-transform:none; letter-spacing:normal; color:#777; font-size:11px;}
.profile-form-card input[type=text], .profile-form-card textarea{
  display:block; width:100%; margin-top:8px; background:#111; border:1px solid #262626;
  border-radius:8px; color:var(--fg); font-size:14px; padding:10px 12px; font-family:inherit;
  text-transform:none; letter-spacing:normal; font-weight:400; resize:vertical;
}
.profile-form-card input[type=text]:focus, .profile-form-card textarea:focus{outline:none; border-color:var(--accent);}
.word-count{display:block; text-align:right; font-size:11px; color:var(--muted); font-weight:600; margin-top:6px; text-transform:none;}
.word-count.at-limit{color:#e0a13a;}
#save-profile-btn{
  padding:11px 22px; border-radius:8px; border:none; background:var(--accent); color:#fff;
  font-size:13px; font-weight:700; cursor:pointer;
}
#save-profile-btn:hover{opacity:.9;}
.status-msg{font-size:12px; margin:10px 0 0; min-height:14px;}
.status-msg.ok{color:#4caf7d;}
.status-msg.error{color:#e05a5a;}

.favorites-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.favorites-header h2{font-size:15px; margin:0;}
#add-favorite-btn{
  padding:7px 14px; border-radius:999px; border:1px solid var(--accent); background:transparent;
  color:var(--accent); font-size:12px; font-weight:700; cursor:pointer;
}
#add-favorite-btn:disabled{opacity:.4; cursor:not-allowed;}
.favorites-list{display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:14px;}
.favorite-card{position:relative; text-align:left;}
.favorite-card .art{width:100%; aspect-ratio:1; border-radius:8px; background:#1c1c1c #262626 center/cover; overflow:hidden;}
.favorite-card .art img{width:100%; height:100%; object-fit:cover; display:block;}
.favorite-card .title{font-size:12px; font-weight:700; margin:8px 0 2px; line-height:1.3;}
.favorite-card .artist{font-size:11px; color:var(--muted);}
.favorite-card .remove-fav{
  position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%;
  background:rgba(0,0,0,.65); color:#fff; border:none; font-size:12px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.favorites-hint{color:var(--muted); font-size:11.5px; margin:14px 0 0;}

.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:2000;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.modal-box{
  background:var(--card); border:1px solid #262626; border-radius:14px;
  width:100%; max-width:460px; max-height:78vh; display:flex; flex-direction:column;
  padding:20px;
}
.modal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.modal-head h3{margin:0; font-size:16px;}
.modal-head button{background:none; border:none; color:var(--muted); font-size:16px; cursor:pointer;}
#picker-search{
  background:#111; border:1px solid #262626; border-radius:8px; color:var(--fg);
  font-size:13px; padding:9px 12px; margin-bottom:14px; width:100%;
}
#picker-search:focus{outline:none; border-color:var(--accent);}
.picker-results{overflow-y:auto; flex:1;}
.picker-row{
  display:flex; align-items:center; gap:10px; padding:8px 6px; border-radius:8px; cursor:pointer;
}
.picker-row:hover{background:#1c1c1c;}
.picker-row .art{width:38px; height:38px; border-radius:6px; background:#1c1c1c; overflow:hidden; flex:none;}
.picker-row .art img{width:100%; height:100%; object-fit:cover; display:block;}
.picker-row .meta{min-width:0;}
.picker-row .t{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.picker-row .a{font-size:11px; color:var(--muted);}
.picker-empty{color:var(--muted); font-size:12.5px; padding:16px 6px; text-align:center;}

/* ---- Member search (profile search) — reuses .modal-overlay/.modal-box/
   .picker-results/.picker-row from the favourite picker above for visual
   consistency; only the avatar-shaped thumb and the trigger button below
   are new. ---- */
.member-row .art{border-radius:50%;}
/* An inline background-image (the member's real photo) overrides the URL
   in this shorthand; with no photo the chef-hat default shows through. */
.member-avatar{width:100%; height:100%; border-radius:50%; background:#000 url('/assets/default-avatar.svg') center/cover no-repeat;}
.cm-search-trigger{
  display:flex; align-items:center; gap:8px; width:100%; text-align:left;
  background:#111; border:1px solid #262626; border-radius:10px; color:var(--muted);
  font-size:13px; padding:11px 14px; cursor:pointer; font-family:inherit;
}
.cm-search-trigger:hover{border-color:var(--accent); color:var(--fg);}
.member-row .meta{flex:1; min-width:0;}
.member-row .badges{display:flex; gap:4px; margin-top:3px; flex-wrap:wrap;}
.member-row .badge-icon{
  width:18px; height:18px; border-radius:4px; background:#1c1c1c center/cover no-repeat;
  border:1px solid #333; flex:none;
}

/* ---- Phase 3 sub-step 4: Member Badges + Badges drawer ---- */

.profile-badges-card{
  background:var(--card); border:1px solid #1f1f1f; border-radius:14px;
  padding:22px 24px; margin-bottom:20px;
}
#open-badges-tab-btn{
  padding:7px 14px; border-radius:999px; border:1px solid var(--accent); background:transparent;
  color:var(--accent); font-size:12px; font-weight:700; cursor:pointer;
}
.member-badge-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:14px;}
.member-badges-empty{color:var(--muted); font-size:12.5px; margin:4px 0 0; line-height:1.5;}

.badge-tile{cursor:pointer; text-align:center; border:none; background:none; padding:0; font-family:inherit; display:block;}
.badge-tile .thumb{
  width:100%; aspect-ratio:1; border-radius:10px; background:#0c0c0c;
  border:2px solid #c9a227; background-size:cover; background-position:center;
  display:flex; align-items:center; justify-content:center; color:#c9a227; font-size:9.5px; text-align:center;
  transition:opacity .15s;
}
.badge-tile .name{font-size:11px; font-weight:700; margin-top:8px; color:var(--fg); line-height:1.3;}
.badge-tile.locked .thumb{border-color:#4a4a4a; filter:grayscale(1) brightness(.55); color:#8a8a8a;}
.badge-tile.locked .name{color:var(--muted);}
.badge-tile:hover .thumb{opacity:.8;}

/* ---- Gold Badges tab + drawer — mirrors the Series Info drawer's cream/gold
   "special edition" look (same font imports/palette, already loaded via
   player.css), opening from the right edge instead of the left. ---- */
#badges-tab{
  position:fixed; right:0; top:50%; transform:translateY(-50%) rotate(90deg) translateX(50%);
  transform-origin:right top;
  background:#9c7a2e; color:#fff; font-weight:700; font-size:12.5px;
  letter-spacing:.06em; text-transform:uppercase; padding:10px 18px; border:none; border-radius:8px 8px 0 0;
  cursor:pointer; z-index:50; box-shadow:-2px 0 12px rgba(0,0,0,.4);
  display:flex; align-items:center; gap:8px;
}
#badges-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.55); opacity:0; pointer-events:none; transition:opacity .3s; z-index:60;
}
#badges-overlay.show{ opacity:1; pointer-events:auto; }
#badges-drawer{
  position:fixed; top:0; bottom:0; right:0; width:560px; max-width:92vw;
  background:#f6f1e7; color:#1b1712; z-index:70;
  transform:translateX(100%); transition:transform .35s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column; box-shadow:-12px 0 40px rgba(0,0,0,.5);
}
#badges-drawer.show{ transform:translateX(0); }
.bd-head{
  padding:22px 26px 16px 26px; border-bottom:1px solid #ddd2ae; display:flex; align-items:flex-start; justify-content:space-between;
}
.bd-eyebrow{ font-size:13.5px; letter-spacing:.26em; text-transform:uppercase; color:#9c7a2e; margin:0 0 8px 0; font-family:'EB Garamond',serif; }
.bd-head h3{ font-family:'Playfair Display',serif; font-size:30px; margin:0; font-weight:600; color:#1b1712; }
#badges-close{ background:none; border:none; font-size:26px; color:#5a5246; cursor:pointer; line-height:1; padding:4px; }
.bd-body{ padding:20px 26px; overflow-y:hidden; -webkit-overflow-scrolling:touch; transform:translateZ(0); flex:1; }
.bd-hint{ font-family:'EB Garamond',serif; font-size:14.5px; color:#5a5246; margin:0 0 18px; line-height:1.6; }
.bd-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:16px;}
.bd-grid .badge-tile .name{color:#1b1712;}
.bd-grid .badge-tile.locked .name{color:#8a7f68;}
.bd-empty{ font-family:'EB Garamond',serif; font-size:16px; color:#5a5246; text-align:center; padding:30px 0; }
.bd-foot{ padding:18px 26px; border-top:1px solid #ddd2ae; display:flex; gap:10px; }
#badges-close-2{
  flex:1; text-align:center; padding:13px; border-radius:8px; text-decoration:none; font-weight:700; font-size:16px;
  cursor:pointer; font-family:inherit; box-sizing:border-box; background:#1b1712; color:#f6f1e7; border:none;
}
@media(max-width:760px){ #badges-drawer{ width:100vw; max-width:100vw; } }

/* ---- Badge detail popup — same interaction pattern as the album-cover
   lightbox (centered, dims the rest of the page, click-away closes), styled
   for the gold badge aesthetic instead. Title + requirement always show
   below the image (not hidden behind hover). ---- */
#badge-popup-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:3000;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.badge-popup-card{
  position:relative; width:100%; max-width:340px;
  border-radius:16px; overflow:hidden; border:2px solid #c9a227;
  box-shadow:0 20px 60px rgba(0,0,0,.5); background:#0c0c0c;
  max-height:88vh; display:flex; flex-direction:column;
}
#badge-popup-close{
  position:absolute; top:10px; right:10px; background:rgba(0,0,0,.6); border:none; color:#fff;
  width:28px; height:28px; border-radius:50%; font-size:16px; cursor:pointer; z-index:2; line-height:1;
}
.badge-popup-img{
  width:100%; aspect-ratio:1; flex:none; background:#0c0c0c; background-size:cover; background-position:center;
}
.badge-popup-info{ padding:20px 22px 24px; overflow-y:auto; }
.badge-popup-status{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; font-weight:700; margin:0 0 8px; color:#c9a227;
}
.badge-popup-status.locked{ color:#9a9a9a; }
.badge-popup-info h3{ margin:0 0 10px; font-size:19px; color:#fff; }
.badge-popup-info p:last-child{ margin:0; font-size:13px; color:#ddd; line-height:1.6; white-space:pre-wrap; }

/* ---- Account deletion link (2026-09-07) ----
   Required to be reachable inside the app (App Store 5.1.1(v)) and from a
   public web page (Google Play User Data policy); /delete-account.html is
   both. Styled quiet-but-findable on purpose: Google asks for a "prominent"
   path, Apple only asks that it exists, and nobody benefits from a red
   button sitting above someone's profile photo waiting to be mis-tapped.
   The destination page carries the real warning and a type-DELETE gate. */
.profile-danger-link{
  margin: -4px 0 18px;
  font-size: 12.5px;
}
.profile-danger-link a{
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-danger-link a:hover,
.profile-danger-link a:focus-visible{
  color: #e0644b;
}
