/* ==========================================================================
   profile-layout.css — two-column profile layout (profile.php)
   Loaded after profile.css. Left: compact sidebar. Right: dominant bio.
   ========================================================================== */

:root {
  --pl-gap: 14px;
  --pl-radius: 14px;
  --pl-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --pl-text: #2b2f33;
  --pl-muted: #6b7479;
  --pl-tile: #f3f5f6;
  --pl-sidebar: 444px;
}

/* ---------- Page grid ---------- */
#profile-layout {
  display: grid;
  grid-template-columns: var(--pl-sidebar) minmax(0, 1fr);
  gap: var(--pl-gap);
  align-items: stretch;
  margin-bottom: 24px;
}

.profile-col {
  display: flex;
  flex-direction: column;
  gap: var(--pl-gap);
  min-width: 0;
}

/* ---------- Shared card look ---------- */
#profile-layout .profile-card {
  background-color: #fff;
  border-radius: var(--pl-radius);
  padding: 14px 16px;
  box-shadow: var(--pl-shadow);
  box-sizing: border-box;
  color: var(--pl-text);
  font-family: 'Trebuchet MS', Lato, LatoExtended, sans-serif;
  margin: 0;
  min-width: 0;
  max-width: none;
  width: auto;
  flex: none;
  zoom: normal;
}

#profile-layout .profile-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pl-text);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

#profile-layout .section-header h3 {
  margin: 0;
}

#profile-container {
  display: block;
  margin: 0;
  min-width: 0;
}

/* ==========================================================================
   User card
   ========================================================================== */
#profile-layout #usercard {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  padding: 12px;
}

#profile-layout #usercard-left {
  flex: 0 0 195px;
  width: 195px;
  max-width: none;
  max-height: none;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef4f6, #dde8ec);
}

#profile-layout .avatar-frame {
  display: block;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 0;
}

/* Same 188:359 ratio as user2.php */
#profile-layout #ava {
  width: 100%;
  height: auto;
  aspect-ratio: 188 / 359;
  margin: 0;
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
}

#profile-layout #usercard-right {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  width: auto;
  padding: 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

#profile-layout .user-info-header {
  margin: 0;
  padding: 0;
  text-align: left;
  border: 0;
}

#profile-layout .username-rank-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 0;
}

.level-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

#profile-layout #usernamespan {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profile-layout .username-circle {
  margin: 0 2px;
  flex-shrink: 0;
}

#profile-layout #staffrank {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 10px;
}

#profile-layout #profilequote-in-card {
  margin: 5px 0 0;
  font-size: 13px;
  font-style: normal;
  color: #555;
  opacity: 1;
  line-height: 1.35;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Klique emblems */
.klique-emblems {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.klique-emblem {
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

.klique-emblem img,
.klique-emblem .klique-emblem-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
}

.klique-role {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Overflow menu (three dots) */
.card-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.card-menu summary {
  list-style: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}

.card-menu summary::-webkit-details-marker { display: none; }

.card-menu summary:hover,
.card-menu[open] summary {
  background: var(--pl-tile);
}

.card-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 150px;
  padding: 4px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-menu-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--pl-text);
  text-decoration: none;
  white-space: nowrap;
}

.card-menu-list a:hover { background: var(--pl-tile); }
.card-menu-list a.menu-danger { color: #c0392b; }

/* Stats panel */
#profile-layout #stats {
  margin: 0;
  padding: 4px 10px;
  border-radius: 10px;
  background: #eef6f7;
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
  text-align: left;
  font-size: 14px;
}

.stat-row {
  display: grid;
  grid-template-columns: 18px 66px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.stat-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.stat-label {
  font-size: 13px;
  color: var(--pl-muted);
  white-space: nowrap;
}

.stat-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-weight: 700;
  color: var(--pl-text);
  min-width: 0;
}

#profile-layout .rank-chip {
  display: inline-block;
  padding: 1px 5px;
  margin: 0;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.4;
}

.buy-more {
  font-size: 11px;
  font-weight: 600;
  color: #b3882d;
  text-decoration: none;
}

.banned-row {
  display: block;
  color: #e00;
  font-weight: bold;
  text-align: center;
}

/* Actions: friend + mail on the first row, flames / gifts / boutique after */
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.user-actions:empty { display: none; }

#profile-layout .user-actions .buybtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

#profile-layout .user-actions .buybtn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#profile-layout .user-actions .icon-action { flex: 0 0 34px; min-width: 0; padding: 0; }
#profile-layout .user-actions .count-action,
#profile-layout .user-actions .friend-btn { flex: 0 0 auto; min-width: 34px; padding: 0 7px; gap: 3px; }
#profile-layout .user-actions .is-inactive { opacity: 0.55; }

/* ==========================================================================
   Friends
   ========================================================================== */
.friends-pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.friends-pagination .page-btn,
.friends-pagination button {
  margin: 0;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

#profile-layout .page-info { font-size: 11px; }

/* Friends + Game history — mirrors user2.css (#right-column cards) */
#profile-layout #friends-section {
  padding-top: 11px;
  padding-bottom: 11px;
}

#profile-layout #friends-section .section-header { margin-bottom: 8px; }

#profile-layout #friends-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 0;
}

#profile-layout .friend-item {
  background-color: var(--pl-tile);
  border-radius: 8px;
  padding: 3px 3px 2px;
  min-width: 0;
}

#profile-layout .friend-avatar {
  width: 36px;
  height: 40px;
  margin-bottom: 2px;
}

#profile-layout .friend-name {
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profile-layout #friends-section .edit-friends-wrap { margin-top: 8px; }
#profile-layout .edit-friends-wrap a { display: block; }

#profile-layout .edit-friends-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
}

#profile-layout .games-filters {
  margin: 0;
  gap: 2px;
}

#profile-layout .game-type-select {
  padding: 4px 26px 4px 10px;
  font-size: 0.8rem;
  border-radius: 7px;
  background-position: right 8px center;
}

#profile-layout #wins-badge {
  margin-left: 6px;
  font-size: 0.85rem;
}

#profile-layout #wins-badge svg { width: 16px; height: 16px; }
#profile-layout #wins-count { font-size: 0.85rem; }

#profile-layout #games-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

#profile-layout #games-section .section-header { margin-bottom: 9px; }

#profile-layout #games-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 6px 4px;
  min-height: 0;
  margin-bottom: 0;
}

#profile-layout .game-circle {
  width: 33px;
  height: 33px;
  margin-bottom: 2px;
}

#profile-layout .place-text { font-size: 9px; }
#profile-layout .game-info { font-size: 9.5px; }

#profile-layout .games-pagination { margin-top: 6px; gap: 8px; }
#profile-layout .games-pagination:empty { display: none; }
#profile-layout .games-pagination .page-btn { padding: 2px 8px; font-size: 12px; }

/* ==========================================================================
   Compact sidebar extras: boutique, mentions, spotify, celebs vote
   ========================================================================== */
#profile-layout #boutique-preview-section h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boutique-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.boutique-item {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 4px;
  border-radius: 8px;
  background: var(--pl-tile);
  transition: transform 0.15s;
}

.boutique-item:hover { transform: translateY(-2px); }

.boutique-item > div > img {
  width: 100%;
  max-width: 46px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.boutique-price {
  font-size: 10px;
  margin-top: 2px;
  color: #333;
}

.boutique-price img { width: 9px; display: inline; vertical-align: -1px; }

.boutique-visit { text-align: center; }

.boutique-visit .buybtn {
  width: 100%;
  margin: 0;
  padding: 6px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Mentions */
#profile-layout #mentions-section {
  padding: 0;
  overflow: hidden;
}

#profile-layout #mentions-section h3 {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 0;
}

#profile-layout #mentions-container {
  padding: 6px;
  max-height: 168px;
}

#profile-layout .mention-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 8px;
}

#profile-layout .mention-item:hover { transform: translateX(2px); }

#profile-layout .mention-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

#profile-layout .mention-header { margin-bottom: 1px; }
#profile-layout .mention-username { font-size: 12px; margin-right: 5px; }
#profile-layout .mention-type { font-size: 12px; }
#profile-layout .mention-blog-title { font-size: 12px; margin-bottom: 1px; }
#profile-layout .mention-time { font-size: 10px; }
#profile-layout .no-mentions { padding: 10px; font-size: 12px; margin: 0; }

/* Spotify (compact 80px player) */
#profile-layout #spotify-embed-container {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
}

#profile-layout #spotify-embed-container iframe[src*="spotify"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 80px;
  border-radius: 12px;
}

/* Celebrities vote */
#profile-layout #celebs-section {
  margin: 0;
  padding: 12px 14px;
}

#profile-layout .celeb-nominees { margin: 8px 0; }
#profile-layout .nominee-avatar { width: 52px; height: 52px; margin-bottom: 4px; }
#profile-layout .nominee-name { font-size: 11px; }
#profile-layout .vote-celebs-btn { padding: 6px 24px; font-size: 13px; }

/* ==========================================================================
   Bio (dominant right column)
   ========================================================================== */
#profile-layout .profile-col-right #profiledesc {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  font-size: 16px;
  line-height: 1.55;
}

#profilecontent { flex: 1 1 auto; }

#profilecontent img,
#profilecontent iframe {
  max-width: 100%;
  border-radius: 8px;
}

.profile-visits {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  font-style: italic;
  font-size: 13px;
  color: #bababa;
}

/* ---------- Blogs ---------- */
.blog-toggle { margin-bottom: 12px; }
#recentblogs { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  :root { --pl-sidebar: 408px; }
  #profile-layout #usercard-left { flex-basis: 177px; width: 177px; }
}

@media (max-width: 860px) {
  /* Single column: bio follows the user card, sidebar panels after it */
  #profile-layout {
    display: flex;
    flex-direction: column;
  }
  .profile-col { display: contents; }
  .profile-col-left > * { order: 3; }
  #profile-layout #profile-container { order: 1; }
  #profile-layout #profiledesc { order: 2; }
}

@media (max-width: 380px) {
  #profile-layout #usercard-left { flex-basis: 130px; width: 130px; }
  .stat-row { grid-template-columns: 16px 58px minmax(0, 1fr); gap: 6px; }
}

/* ==========================================================================
   Static styles moved from the inline <style> block in user.php
   ========================================================================== */
.game-circle.hysteria {
    background: #808080;
}
.game-item.hysteria:hover .game-circle {
    box-shadow: 0 0 15px #808080;
}

.game-circle.arena {
    background: #ff9800;
}
.game-item.arena:hover .game-circle {
    box-shadow: 0 0 15px #ff9800;
}

.game-circle.race {
    background: #e4d612ff;
}

.game-circle.royale {
    background: #1c28d3;
}


.game-item.race:hover .game-circle {
    box-shadow: 0 0 15px #e4d612ff;
}

.game-circle.celebrities {
    background: #ca1407ff;
}
.game-item.celebrities:hover .game-circle {
    box-shadow: 0 0 15px #ca1407ff;
}

#celebs-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.celeb-nominees {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
}

.celeb-nominee {
    text-align: center;
}

.nominee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: 150%;
    background-position: top;
    margin: 0 auto 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nominee-name {
    font-size: 0.9em;
    color: #333;
}

.vote-celebs-btn {
    background: #ca1407;
    color: white;
    border: none;
    padding: 8px 30px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-celebs-btn:hover {
    background: #a31206;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(202, 20, 7, 0.3);
}

.avatar-background-container {
    background-size: cover;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}
.avatar-background-container #ava {
    position: relative;
    z-index: 1;
}

.banned-user-avatar {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}
