:root{
  --bg:#16110F;
  --fg:#f3efe6;
  --card:#231a16;
  --muted:#2e2420;
  --muted-fg:#a89f90;
  --primary:#f5a208;
  --danger:#e14b4b;
  --accent:#2fbf8f;
  --radius:12px;
  --shadow:0 8px 32px rgba(0,0,0,.35);
  --shadow-glow:0 0 40px rgba(245,162,8,.15);
  --grad-warm:linear-gradient(135deg,#f5a208 0%,#d35a0b 100%);
  --font-display: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --font-body: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:var(--font-body);
  line-height:1.5;
}
a{color:inherit}

.container{max-width:480px;margin:0 auto;padding:16px}

.header{
  position:sticky;top:0;z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(22,17,15,.85);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:56px;gap:12px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none}
.brand-badge{width:32px;height:32px;border-radius:999px;background:var(--grad-warm);display:grid;place-items:center;color:#1a120f;font-weight:800}
.brand-title{font-family:var(--font-display);font-weight:800;font-size:18px}

.card{
  background:rgba(35,26,22,.85);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card.padded{padding:16px}

.section{display:flex;flex-direction:column;gap:12px}

.btn{
  appearance:none;border:1px solid transparent;
  background:var(--muted);color:var(--fg);
  padding:12px 14px;border-radius:12px;
  cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  font-weight:700;
}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn-primary{background:var(--grad-warm);color:#1a120f;box-shadow:0 4px 16px rgba(245,162,8,.25)}
.btn-secondary{background:transparent;border-color:#453E3B;color:#ffffff}
.btn-secondary:hover{background:rgba(245,162,8,.1);border-color:#453E3B}
.btn-secondary:focus{outline:2px solid #453E3B;outline-offset:2px}
.btn-outline{background:transparent;border-color:rgba(255,255,255,.16)}
.btn-ghost{background:transparent;border-color:transparent}
.btn-danger{border-color:rgba(225,75,75,.35);color:var(--danger)}
.btn-success{border-color:rgba(47,191,143,.35);color:var(--accent)}
.btn-wide{width:100%}

.input, .textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  color:var(--fg);
  padding:12px 14px;
  outline:none;
}
.textarea{min-height:120px;resize:none}

.muted{color:var(--muted-fg)}
.center{text-align:center}
.row{display:flex;align-items:center;gap:12px}
.row-between{display:flex;align-items:center;justify-content:space-between;gap:12px}

.avatar{
  width:44px;height:44px;border-radius:999px;
  background:var(--grad-warm);
  display:grid;place-items:center;
  color:#1a120f;font-weight:900;
}

.album-art{
  width:100%;
  aspect-ratio:1/1;
  border-radius:16px;
  overflow:hidden;
  box-shadow:var(--shadow-glow);
  background:rgba(0,0,0,.22);
}
.album-art img{width:100%;height:100%;object-fit:cover;display:block}

.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;border-radius:12px;
  font-weight:700;font-size:14px;line-height:1.4;
}
.badge-primary{background:rgba(245,162,8,.12);color:var(--primary)}
.badge-danger{background:rgba(225,75,75,.12);color:var(--danger)}

.list{display:flex;flex-direction:column;gap:10px}
.list-item{
  text-decoration:none;
  display:flex;align-items:center;gap:12px;
  padding:12px;border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.06);
}
.list-item:hover{background:rgba(255,255,255,.09)}

.fab{
  position:fixed;right:18px;bottom:18px;
  border-radius:999px;
  padding:14px 16px;
  box-shadow:0 12px 40px rgba(0,0,0,.4);
}

.modal-backdrop{
  position:fixed;inset:0;
  background:rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;
  padding:18px;
  z-index:50;
  overflow: hidden; /* Prevent backdrop from scrolling */
}
.modal{width:min(520px,100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;}
.modal.card.padded{
  background:#231a16 !important; /* Use solid card background instead of transparent */
  padding: 20px; /* Ensure padding doesn't cause overflow */
}
.modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px; flex-shrink: 0; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.1);}
.modal-container{display: flex; flex-direction: column; height: 100%; overflow: hidden;}
.modal-content-scrollable{flex: 1; overflow-y: auto; padding-right: 8px; min-height: 0; max-height: calc(90vh - 100px);} /* Account for header and padding */

/* Disable background scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

.toast-container{
  position:fixed;top:14px;left:50%;transform:translateX(-50%);
  width:min(520px,calc(100% - 24px));
  z-index:100;
}
.toast{
  margin-bottom:10px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(35,26,22,.95);
  box-shadow:var(--shadow);
}
.toast-title{font-weight:900;margin:0 0 4px 0}
.toast-desc{margin:0;color:var(--muted-fg);font-size:14px;line-height:1.5}
.toast.destructive{border-color:rgba(225,75,75,.35)}

.tabs{display:flex;gap:10px}
.tab-btn{flex:1}
.tab-btn.btn-primary{background:var(--grad-warm);color:#1a120f;box-shadow:0 4px 16px rgba(245,162,8,.25);border-color:transparent}
.tab-btn.btn-secondary{background:transparent;border-color:#453E3B;color:#ffffff}
.tab-btn.btn-secondary:hover{background:rgba(245,162,8,.1);border-color:#453E3B}
.tab-btn.btn-secondary:focus{outline:2px solid #453E3B;outline-offset:2px}
.hidden{display:none !important}

.emoji-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.emoji-btn{font-size:22px;padding:10px;border-radius:12px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.06);cursor:pointer}
.emoji-btn.selected{border-color:rgba(245,162,8,.55);background:rgba(245,162,8,.14)}

.small{font-size:14px;line-height:1.5}

.flex{display:flex}
.album-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px;margin-top:16px}
.album-card{display:flex;gap:12px;padding:12px;border-radius:12px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04)}
.album-art-small{width:60px;height:60px;border-radius:8px;overflow:hidden;flex-shrink:0}
.album-art-small img{width:100%;height:100%;object-fit:cover;display:block}
.album-art-small.clickable{position:relative}
.album-art-small.clickable:hover::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,.2);border-radius:8px;pointer-events:none}
.album-art-small.clickable:hover img{transform:scale(1.05);transition:transform 0.2s ease}
.clickable-card{transition:transform 0.2s ease,box-shadow 0.2s ease}
.clickable-card:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,0.15)}
.album-info{flex:1;min-width:0}
.album-info h4{margin:0 0 4px 0;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.album-info p{margin:2px 0;font-size:14px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Avatar loading optimization */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"]:not([src]) {
  opacity: 0;
}

/* Clickable participant names */
.clickable-participant {
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.clickable-participant:hover {
  color: rgba(245, 162, 8, 0.8);
}

/* Slide-over filter panel */
.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: #1a1a1a;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.filter-panel.active {
  transform: translateX(0);
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-panel-content {
  padding: 20px;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #fff;
}

.filter-section select,
.filter-section input {
  width: 100%;
  margin-bottom: 4px;
}

.filter-apply-button {
  margin-top: 24px;
  width: 100%;
}

/* Login page participant grid */
.participant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.participant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 85%;
  height: 85%;
  aspect-ratio: 1;
  position: relative;
}

.participant-card:hover {
  border-color: rgba(245, 162, 8, 0.5);
  background: rgba(245, 162, 8, 0.1);
  transform: translateY(-2px);
}

.participant-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.participant-avatar-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 12px;
}

.participant-name {
  font-weight: 600;
  color: #fff;
  text-align: center;
  font-size: 14px;
}

/* Home page current album adjustments */
.album-art-current {
  width: 90%;
  height: auto;
  margin: 0 auto;
}

.album-caption {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* Warning modal for missing reviews */
.warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.warning-overlay.active {
  opacity: 1;
  visibility: visible;
}

.warning-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  z-index: 1001;
}

.warning-modal-header {
  margin-bottom: 16px;
}

.warning-modal-content {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.warning-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Home page review improvements */
.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.review-avatar:hover {
  transform: scale(1.1);
}

.review-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.review-avatar-fallback:hover {
  transform: scale(1.1);
}

.review-content {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
}

.review-username {
  font-weight: 800;
  margin-bottom: 4px;
}

.review-emojis {
  font-size: 20px;
  margin-bottom: 8px;
}

.review-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin-top: 4px;
}

.review-list {
  margin-top: 16px;
}

.review-card {
  align-items: flex-start;
  padding: 12px 0 12px 12px;
  margin-bottom: 16px;
}

.review-card:last-child {
  margin-bottom: 0;
}

/* Current album container adjustments */
.album-info-section {
  padding: 8px 0;
}

.album-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.play-icon {
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.play-icon:hover {
  transform: scale(1.1);
}

/* Profile page favorites tab */
.favorite-song-card {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.favorite-song-card:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.favorite-song-artwork {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 12px;
}

.favorite-song-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-song-artwork-fallback {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  margin-right: 12px;
}

.favorite-song-content {
  flex: 1;
  min-width: 0;
}

.favorite-song-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: #fff;
}

.favorite-song-album-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.3;
}

/* Header user dropdown */
.user-dropdown {
  position: relative;
}

.user-avatar-container {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.user-avatar-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid rgba(245, 162, 8, 0.3);
  transition: border-color 0.2s ease, transform 0.2s ease;
  opacity: 1;
  background: var(--grad-warm);
}

.user-avatar-header:hover {
  border-color: rgba(245, 162, 8, 0.6);
  transform: scale(1.05);
}

.user-avatar-fallback-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #1a120f;
  cursor: pointer;
  border: 2px solid rgba(245, 162, 8, 0.3);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.user-avatar-fallback-header:hover {
  border-color: rgba(245, 162, 8, 0.6);
  transform: scale(1.05);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(35, 26, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 160px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  border-radius: 0;
}

.dropdown-item:first-child {
  border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
  background: rgba(245, 162, 8, 0.1);
}

.dropdown-item:active {
  background: rgba(245, 162, 8, 0.2);
}

/* Emoji count badges */
.emoji-count-container {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: #515151;
  border-radius: 99px;
  margin: 0 2px;
  font-size: 18px;
  color: #CCCCCC;
  font-weight: 500;
}

.emoji-count-emoji {
  font-size: 18px;
  line-height: 1;
}

.emoji-count-number {
  font-size: 14px;
  font-weight: 600;
  min-width: 12px;
  text-align: center;
}

/* Emoji filter section */
.emoji-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.emoji-filter-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}

.emoji-filter-item:hover {
  border-color: rgba(245, 162, 8, 0.5);
  background: rgba(245, 162, 8, 0.1);
}

.emoji-filter-item.selected {
  border-color: rgba(245, 162, 8, 0.8);
  background: rgba(245, 162, 8, 0.2);
  transform: scale(1.1);
}
