/* Keep profile page styling aligned with the clan/dashboard panels (main.css) */

.profile-screen{
  /* Match dashboard "browser container" text rules */
  color: #ffffff;
  /* Profile container should have a bit of transparency (like browser panels) */
  background: var(--panel-glass) !important;
}

/* Profile page needs to clear the fixed navbar.
   Layout uses a globally centered flex wrapper; this wrapper anchors the profile to the top safely. */
.profile-page-wrap{
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  margin-top: 78px;   /* clears navbar */
  margin-bottom: 72px; /* clears footer */
  align-self: flex-start;
}

/* Project VX: Two-column layout INSIDE the panel */
.profile-with-sidebar {
  max-width: 1200px !important;
}
.profile-inner-split {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  width: 100%;
}
.profile-inner-split .profile-main {
  flex: 1 1 auto;
  min-width: 0;
}
.profile-inner-split .profile-sidebar {
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 900px) {
  .profile-inner-split {
    flex-direction: column;
  }
  .profile-inner-split .profile-sidebar {
    width: 100%;
  }
}

/* Weekly switch button */
.weekly-switch {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 3px;
}
.weekly-switch-btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.12s ease;
}
.weekly-switch-btn:hover {
  color: rgba(255,255,255,0.85);
}
.weekly-switch-btn.is-active {
  background: var(--accent-yellow);
  color: #1a1a1a;
}

/* Rewards sections */
.rewards-section {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 10px 12px;
}
.rewards-section-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin-bottom: 4px;
}
.rewards-section-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}

/* Weekly badge */
.weekly-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.weekly-badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  image-rendering: pixelated;
}

/* Empty row styling */
.weekly-row-empty {
  opacity: 0.5;
}

/* Room stats (likes/views) */
.profile-room-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.profile-room-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.profile-room-stat img {
  opacity: 0.8;
}

/* If the viewport is short, scale the whole profile card slightly so it doesn't creep under the navbar */
.profile-fit{
  transform-origin: top center;
}

/* Section titles + meta counts: bold + #1f2933 */
.profile-screen :is(
  .text-2xl.font-bold,
  .section-head h2
){
  color: #1f2933 !important;
}

.profile-screen .section-head > .opacity-70{
  color: #1f2933 !important;
  opacity: 1 !important;
  font-weight: 900;
}

/* Supporting/content text: white */
.profile-screen :is(
  .desc-view,
  .muted,
  .opacity-70,
  .opacity-80,
  .opacity-85,
  .text-sm,
  .text-xs,
  small
){
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Room results: white (same as dashboard browser results) */
.profile-screen :is(
  .profile-room-name,
  .profile-room-sub,
  .profile-room-desc
){
  color: #ffffff !important;
}

/* Clan link in header: keep consistent with rule (white) */
.profile-screen a[href^="/clan/"]{
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 900;
}

.profile-avatar-lg{
  width: 140px;
  height: 140px;
}

.profile-avatar-edit{
  position:absolute;
  right: 6px;
  bottom: 6px;
  z-index: 50;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

/* Profile big avatar: ensure layers are visible + never steal clicks from the pencil button */
.avatar.profile-avatar-lg img{
  pointer-events: none;
}
.avatar.profile-avatar-lg .skin{
  bottom: -40%;
  width: 85%;
  z-index: 0;
}
.avatar.profile-avatar-lg .body{
  bottom: -40%;
  width: 85%;
}
.avatar.profile-avatar-lg .head{
  width: 95%;
}

.xp-box{
  background: var(--bg-container);
  border:1px solid var(--text-muted);
  border-radius:4px;
  padding:12px;
}
.xp-bar{ height:12px; border-radius:4px; background: var(--bg-panel); overflow:hidden; }
.xp-fill{ height:100%; border-radius:4px; background: var(--accent-yellow); }

.profile-section{
  margin-top:14px;
  padding:14px;
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  border-radius:4px;
  overflow: visible;
}

.section-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.section-head h2{ margin:0; font-size:16px; font-weight:900; }

.desc-view{ font-size:14px; line-height:1.35; }
.desc-actions{ display:flex; gap:10px; margin-top:10px; }
.muted{ opacity: .65; }

.badge-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,74px);
  gap:10px;
  justify-items:center;
  align-items:center;
  overflow: visible;
}

.badge-tile{
  width:52px;height:52px;border-radius:4px;
  background: var(--bg-container);
  border:1px solid var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  position:relative;
  overflow: visible;
  z-index: 1;
}

.badge-img{
  width:48px;
  height:48px;
  object-fit:contain;
  display:block;
  margin:auto;
  image-rendering:pixelated;
}

.badge-toggle{
  position:absolute; top:6px; right:6px;
  width:26px;height:26px;border-radius:4px;
  border:1px solid var(--text-muted);
  background: var(--bg-panel);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.badge-toggle img{ width:16px;height:16px; }

.badge-fav{
  position:absolute; top:6px; left:6px;
  width:26px;height:26px;border-radius:4px;
  border:1px solid var(--text-muted);
  background: var(--bg-panel);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  color: var(--accent-yellow);
  font-weight:900;
}

.badge-tile[data-is-public="0"]{
  opacity:.35;
}

/* Sorting panel (badge inventory) */
.badge-sort-card{
  width: min(980px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 120px));
  overflow: hidden;
}
.badge-sort-wrap{
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px 14px;
}
.badge-sort-head{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content:space-between;
  padding-right: 44px;
}
.badge-sort-actions{ display:flex; gap:8px; align-items:center; }
.badge-sort-body{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.badge-sort-col{
  display:flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.badge-inv-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, 70px);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--text-muted);
  background: var(--bg-container);
  border-radius: 4px;
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-gutter: stable;
}

.badge-inv-item{
  width: 64px;
  height: 64px;
  border-radius: 4px;
  border: 1px solid var(--text-muted);
  background: var(--bg-container);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  cursor: grab;
}
.badge-inv-item img{
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
  object-fit: contain;
}
.badge-inv-item:active{ cursor: grabbing; }

.badge-inv-tip{
  position:absolute;
  left:50%;
  bottom:-56px;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  padding:8px 10px;
  border-radius:4px;
  width:max-content;
  max-width:220px;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  z-index: 9999;
  box-shadow:0 2px 0 rgba(0,0,0,.12);
}
.badge-inv-item:hover{ z-index: 200; }
.badge-inv-item:hover .badge-inv-tip{ opacity: 1; }

/* Organizer inventory tooltips must not be clipped by overflow:auto containers */
.badge-inv-grid.tt-portaled .badge-inv-tip{
  display:none;
}

.badge-org-tooltip-portal{
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-9999px, -9999px);
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  padding:8px 10px;
  border-radius:4px;
  width:max-content;
  max-width:240px;
  box-shadow:0 2px 0 rgba(0,0,0,.12);
  z-index: 999999;
  pointer-events: none;
}
.badge-org-tooltip-portal .t-title{ font-weight:900; font-size:12px; }
.badge-org-tooltip-portal .t-desc{ font-size:12px; opacity:.85; margin-top:2px; }

.badge-slots{
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--text-muted);
  background: var(--bg-container);
  border-radius: 4px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.badge-sort-footer{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--text-muted);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.badge-sort-footer #badgeSortMsg{
  min-height: 18px;
}

.badge-slot-label{
  font-size: 12px;
  opacity: .75;
  font-weight: 800;
  margin-bottom: 6px;
}

.badge-slot-box{
  height: 74px;
  border-radius: 4px;
  border: 1px dashed var(--text-muted);
  background: var(--bg-container);
  display:flex;
  align-items:center;
  justify-content:center;
}
.badge-slot-box img{
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--text-muted);
}
.badge-slot.fav .badge-slot-box{
  border-color: var(--accent-yellow);
}

.badge-tooltip{
  position:absolute;
  left:50%;
  bottom:-54px;
  transform:translateX(-50%);
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  padding:8px 10px;
  border-radius:4px;
  width:max-content;
  max-width:220px;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  z-index:9999;
  box-shadow:0 2px 0 rgba(0,0,0,.12);
}

.badge-tile:hover{ z-index: 200; }
.badge-tile:hover .badge-tooltip{ opacity:1; }

.badge-tooltip .t-title{ font-weight:900; font-size:12px; }
.badge-tooltip .t-desc{ font-size:12px; opacity:.85; margin-top:2px; }

.badge-grid.tt-portaled .badge-tooltip{
  display:none;
}

.badge-tooltip-portal{
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-9999px, -9999px);
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  padding:8px 10px;
  border-radius:4px;
  width:max-content;
  max-width:220px;
  box-shadow:0 2px 0 rgba(0,0,0,.12);
  z-index: 999999;
  pointer-events: none;
}

.badge-tooltip-portal .t-title{ font-weight:900; font-size:12px; }
.badge-tooltip-portal .t-desc{ font-size:12px; opacity:.85; margin-top:2px; }

.badge-tile.dragging{ opacity:.6; }

.badge-tile[draggable="true"]{ cursor: grab; }
.badge-tile.dragging{ cursor: grabbing; }

/* Rarity visuals are centralized in style/main.css (keeps glows inside tile bounds). */

.profile-rooms-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.profile-room-card{
  display:flex;
  gap:12px;
  align-items:stretch;
  padding:14px;
  border:1px solid var(--text-muted);
  border-radius:4px;
  background: var(--bg-container);
}

.profile-room-prev{
  width:96px;
  height:96px;
  border-radius:4px;
  background: var(--bg-panel);
  border:1px solid var(--text-muted);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  overflow:hidden;
}

.profile-room-canvas{
  width:64px;
  height:64px;
  image-rendering: pixelated;
}

.profile-room-meta{
  flex:1;
  min-width:0;
}

.profile-room-name{
  font-weight:900;
}

.profile-room-desc{
  margin-top:4px;
  line-height:1.25;
}
