:root {
  --bg: #020412;
  --text: #e7e7ea;
  --muted: #9aa3b2;
  --accent: #00f2ea;
  --accent-hover: #00c7b3;
  --border: #2a3142;
  --danger: #d9534f;
  --purple: #7a5af8;
  --viewport-height: 100vh;
}
* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body {
  margin:0;
  color:var(--text);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
  padding-top: 50px;
}
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.loading-overlay p {
  color: var(--muted);
  margin-top: 16px;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === PHASE 1 FIX: LOGIN CARD GLITCH === */
body.center-auth {
  display: flex;
  min-height: var(--viewport-height); /* Use the dynamic viewport height */
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}
body.center-auth .container {
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  min-width: 300px;
  padding: 0 20px;
  transition: none;
  box-sizing: border-box;
}
body.center-auth .card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  min-height: 300px;
}

#authSection.card {
  width: 100%;
  max-width: 450px;
  margin: 0 auto; /* Ensures it's centered within its parent */
}

.background-aurora {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.background-aurora::before,
.background-aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.4;
}
.background-aurora::before {
  width: 40vmax;
  height: 40vmax;
  top: -10%;
  right: -10%;
  background-color: var(--accent);
  animation: moveBlob 45s infinite alternate ease-in-out;
}
.background-aurora::after {
  width: 50vmax;
  height: 50vmax;
  bottom: -20%;
  left: -20%;
  background-color: var(--purple);
  animation: moveBlob 60s infinite alternate-reverse ease-in-out;
}
@keyframes moveBlob {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(40px, -60px) rotate(180deg); }
}
.container {
  max-width:1100px;
  margin:0 auto;
  padding:20px;
  position: relative;
  z-index: 1;
}
header {
  text-align:center;
  margin-bottom:12px;
}
h1 {
  color:var(--accent);
  margin:0;
  font-size:1.6rem;
}
h2 {
    margin-top: 0;
    margin-bottom: 0;
}
.tagline {
  color:var(--muted);
  margin-top:6px;
  font-size:0.95rem;
}
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(2, 4, 18, 0.37);
  padding: 20px;
  margin-bottom: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform:translateY(-5px);
  box-shadow: 0 16px 40px 0 rgba(2, 4, 18, 0.4);
}
.now-playing-card {
  animation: pulseGlow 5s infinite alternate;
}
@keyframes pulseGlow {
  from {
    box-shadow: 0 8px 32px 0 rgba(2, 4, 18, 0.37), 0 0 10px rgba(0, 242, 234, 0.1);
  }
  to {
    box-shadow: 0 12px 38px 0 rgba(2, 4, 18, 0.45), 0 0 25px rgba(0, 242, 234, 0.25);
  }
}
.row {
  display:flex;
  gap:8px;
  align-items:center;
  margin:8px 0;
  flex-wrap:wrap;
}

/* === BENTO GRID (DESKTOP) === */
@media (min-width: 901px) {
  .grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    grid-template-areas:
      "player   sidebar"
      "add-song sidebar"
      "queue    sidebar";
  }

  /* Assign grid areas to each card */
  .grid > .now-playing-card {
    grid-area: player;
  }
  .grid > .card:nth-of-type(2) { /* The "Add a Song" card */
    grid-area: add-song;
  }
  .grid > .card:nth-of-type(3) { /* The "Queue" card */
    grid-area: queue;
  }
  .grid > aside {
    grid-area: sidebar;
  }
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.hidden {
  display:none;
}
input[type=text], input[type=number], textarea {
  padding:12px 16px;
  border-radius:12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color:var(--text);
  flex:1;
  outline:none;
  transition: border-color .2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 16px;
  min-height: 48px;
  width: 100%;
}
input[type=text]:focus, input[type=number]:focus, textarea:focus {
  border-color: var(--accent);
}
button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all .2s ease;
  flex: 1;
  min-height: 48px;
  font-size: 16px;
}
button:hover, button:active {
  background: var(--accent);
  color: #071013;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 234, 0.3);
}
.small {
  font-size:0.8rem;
  padding:8px 12px;
  flex: 0;
  background: transparent;
  border: 1px solid var(--accent);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-height: 40px;
}
.small:hover, .small:active {
    background: var(--accent);
    color: #071013;
}
.badge {
  background:var(--accent);
  color:#071013;
  padding:4px 8px;
  border-radius:8px;
  font-weight:700;
}
.player {
  width:100%;
  height:100%;
  background:#000;
  border-radius:16px;
  overflow:hidden;
  position:absolute;
  top:0;
  left:0;
}
.player-wrapper {
  position:relative;
  border-radius: 16px;
  transition: box-shadow 0.4s ease-in-out;
  width: 100%;
  aspect-ratio: 16/9;
}
.now-playing-card .np-meta {
  margin-top:10px;
}
.dedication {
  font-style: italic;
  color: var(--accent);
  margin-top: 4px;
  font-size: 0.9rem;
}
.dedication::before {
  content: '"';
}
.dedication::after {
  content: '"';
}
.dedication-preview {
  font-style: italic;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.dedication-preview::before { content: '"'; }
.dedication-preview::after { content: '"'; }
.guest-thumb {
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#060607;
  overflow:hidden;
  border-radius:16px;
}
.guest-thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0.9;
  filter:grayscale(10%) contrast(90%);
  transform:scale(1.03);
  transition:transform .7s ease;
}
.guest-thumb:hover img {
  transform:scale(1.06);
}
.thumb-overlay {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:10px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 80%);
  color:var(--text);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.thumb-title {
  font-weight:700;
}
.wave {
  height:6px;
  background:linear-gradient(90deg, rgba(0,242,234,0.2), rgba(0,199,179,0.2));
  border-radius:6px;
  animation:wave 1.5s infinite;
}
@keyframes wave {
  0% { transform:scaleX(0.6); }
  50% { transform:scaleX(1.0); }
  100% { transform:scaleX(0.6); }
}
.controls .row button {
  flex:1;
}
.list {
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.list li {
  background: rgba(13, 16, 23, 0.5);
  border:1px solid rgba(255, 255, 255, 0.1);
  border-radius:10px;
  padding:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
}
.list li.empty-state {
  justify-content: center;
  background: transparent;
  border-style: dashed;
}
.list li .meta {
  color:var(--muted);
  font-size:0.9rem;
}
.list li > span {
  flex-grow: 1;
  min-width: 120px;
}
.list li .admin-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.muted {
  color:var(--muted);
}
.center {
  text-align:center;
}
.hint {
  font-size:0.9rem;
  color:var(--muted);
  margin-top:6px;
}
.chat-log {
  height:200px;
  overflow:auto;
  border-radius:8px;
  border:1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 13, 16, 0.5);
  padding:8px;
}
.vote-btn {
  margin:0 6px;
  padding:8px 10px;
  border-radius:8px;
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  cursor:pointer;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-height: 44px;
  font-size: 16px;
}
.vote-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255, 255, 255,0.2);
  color: var(--text);
  transform:translateY(-1px);
}
.vote-btn.voted {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.danger, .danger:hover, .danger:active {
  background:var(--danger);
  color:white;
  border-color: var(--danger);
  box-shadow: 0 4px 15px rgba(217, 83, 79, 0.4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.danger:hover, .danger:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 83, 79, 0.5);
}
#queueList li.new {
  animation: newItem 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes newItem {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.heading-with-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.info-icon-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    transform: translateY(-1px);
}
.info-icon {
    color: var(--muted);
    font-weight: bold;
    border: 1.5px solid var(--muted);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.info-icon-wrapper:hover .info-icon {
    background-color: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.info-tooltip {
    visibility: hidden;
    width: 220px;
    background-color: #111827;
    color: var(--text);
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 135%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}
.info-icon-wrapper:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}
.feedback-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #071013;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 242, 234, 0.15);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  min-height: 48px;
  border: none;
  cursor: pointer;
}
.feedback-btn:hover, .feedback-btn:focus {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 8px 25px rgba(0, 242, 234, 0.25);
  text-decoration: none;
}
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(2,4,18,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-content {
  min-width: 320px;
  max-width: calc(100vw - 40px);
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 rgba(2, 4, 18, 0.37);
}
#feedbackText {
  width: 100%;
  min-width: 220px;
  max-width: 100%;
  min-height: 80px;
  margin-top: 12px;
  margin-bottom: 8px;
  resize: vertical;
}
.scrolling-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}
.scrolling-banner span {
  display: inline-block;
  color: var(--text);
  animation: scroll-left 40s linear infinite;
}
.scrolling-banner:hover span {
  animation-play-state: paused;
}
@keyframes scroll-left {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-100%);
  }
}
.contact-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.contact-info p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
}
#reaction-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.reaction-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.reaction-bar button {
  flex: 0;
  padding: 8px 12px;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.2s ease;
  min-height: 44px;
  min-width: 44px;
}
.reaction-bar button:hover {
  transform: scale(1.15) translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
}
.reaction-bar button:active {
  transform: scale(1.05);
}
.reaction-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.floating-emoji {
  position: absolute;
  bottom: -50px;
  font-size: 2rem;
  animation: float-up 4s ease-out forwards;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
@keyframes float-up {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-80vh) scale(1.5);
    opacity: 0;
  }
}
.player-flash-🔥 { box-shadow: 0 0 25px 8px rgba(255, 107, 0, 0.7); }
.player-flash-❤️ { box-shadow: 0 0 25px 8px rgba(255, 20, 20, 0.7); }
.player-flash-👾 { box-shadow: 0 0 25px 8px rgba(138, 77, 255, 0.7); }
#uiPortalName {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1em;
}
.admin-contact {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.link-button:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
#searchResults img {
  width: 60px;
  height: 34px;
  border-radius: 4px;
  margin-right: 10px;
  object-fit: cover;
}
#searchResults .row {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  min-height: 50px;
  align-items: center;
}
#searchResults .row:hover {
  background: rgba(255,255,255,0.05);
}
#searchResults .muted {
  font-size: 0.85rem;
}
.mobile-portal-info {
  display: none;
  order: -1;
  margin-bottom: 16px;
}
.admin-score {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 10px;
  min-height: 40px;
}
/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 20000;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.error {
  background: rgba(217, 83, 79, 0.9);
}
.toast.success {
  background: rgba(40, 167, 69, 0.9);
}

/* === MOBILE SPLIT-SCREEN SWIPE UI === */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr; /* Ensure single column on mobile */
  }
  aside {
    display: none; /* Hide desktop sidebar on mobile */
  }

  .mobile-split-view {
    display: flex;
    flex-direction: column;
    height: calc(var(--viewport-height) - 120px); /* Full height minus headers/tabs */
  }

  .top-player-pane {
    height: 40%;
    overflow-y: auto; /* Allow scrolling if content is tall */
  }

  .bottom-swipe-pane {
    height: 60%;
    overflow: hidden; /* Crucial for swipe effect */
    position: relative;
  }

  .swipe-content {
    display: flex;
    width: 300%; /* 3 cards */
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .swipe-card {
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Allow each card to scroll independently */
    padding: 0 8px;
  }
}

@media (max-width: 900px) {
  .list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .background-aurora::before {
    width: 60vw;
    height: 60vw;
  }
  .background-aurora::after {
    width: 70vw;
    height: 70vw;
  }
}
@media (max-width: 768px) {
  .mobile-portal-info {
    display: block;
  }
  aside .card:first-child {
    display: none;
  }
  body {
    height: var(--viewport-height);
  }
  input[type="text"], 
  input[type="number"], 
  textarea {
    font-size: 16px;
    padding: 14px 18px;
    min-height: 52px;
    -webkit-appearance: none;
    appearance: none;
  }
  button {
    min-height: 52px;
    padding: 14px 18px;
    font-size: 16px;
    touch-action: manipulation;
  }
  .small {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 15px;
  }
  .row input {
    min-width: 0;
    flex: 1;
  }
  #searchResults {
    position: relative;
    z-index: 10;
  }
  body.center-auth {
    padding: 10px;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    overflow: hidden;
  }
  body.center-auth .card {
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px 20px;
  }
  body.center-auth input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 56px;
    font-size: 18px;
    padding: 16px 20px;
    border-radius: 16px;
    text-align: center;
    letter-spacing: 2px;
  }
}
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .container {
    padding: 8px;
  }
  .card {
    padding: 16px 12px;
    margin-bottom: 12px;
  }
  h1 {
    font-size: 1.2rem;
  }
  .player-wrapper {
    aspect-ratio: 16/9;
    min-height: 180px;
  }
  .controls .row {
    flex-direction: column;
    gap: 8px;
  }
  .controls .row button {
    width: 100%;
    min-height: 48px;
  }
  .vote-btn {
    padding: 8px 12px;
    font-size: 16px;
    min-height: 44px;
    min-width: 44px;
  }
  #searchResults {
    max-height: 150px;
  }
  .chat-log {
    height: 150px;
  }
  body.center-auth {
    padding: 8px;
    padding-top: 70px;
  }
  body.center-auth .card {
    border-radius: 16px;
    padding: 20px 16px;
  }
  body.center-auth input[type="text"],
  body.center-auth input[type="number"] {
    font-size: 20px;
    min-height: 60px;
    padding: 18px 20px;
    margin: 8px 0;
  }
  #portalCodeInput {
    text-transform: uppercase;
    font-weight: 600;
    font-family: 'Courier New', monospace;
  }
}
@media (max-width: 375px) {
  .reaction-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .reaction-bar button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
  }
  .list li .controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .list li .controls button {
    min-width: 80px;
  }
  .list li .meta {
    font-size: 0.8rem;
  }
  .hint {
    font-size: 0.8rem;
  }
  body.center-auth input[type="text"],
  body.center-auth input[type="number"] {
    font-size: 22px;
    min-height: 64px;
    padding: 20px;
    margin: 8px 0;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .row button {
    width: 100%;
    margin: 4px 0;
  }
}
@media (max-width: 768px) and (orientation: landscape) {
  .player-wrapper {
    aspect-ratio: 16/9;
    max-height: 30vh;
  }
  .chat-log {
    height: 120px;
  }
  .modal-content {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  body.center-auth {
    padding-top: 60px;
  }
}
.list li strong,
.list li .meta,
#userList li span {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
input[type=text], input[type=number], textarea {
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 769px) {
  body.center-auth {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  body.center-auth .container {
    margin-top: 0;
    margin-bottom: 0;
    width: auto;
    max-width: 1100px;
  }
  body.center-auth .card {
    padding: 20px;
    margin: 0 auto;
    max-width: 500px;
  }
  #authSection input[type="text"],
  #authSection input[type="number"] {
    padding: 10px 12px;
    min-height: auto;
    font-size: 1rem;
    width: auto;
  }
  #authSection button {
    padding: 10px 12px;
    min-height: auto;
    font-size: 1rem;
  }
  #authSection .small {
    padding: 6px 8px;
    min-height: auto;
    font-size: 0.8rem;
  }
}
.mobile-portal-name {
  display: none;
  background: linear-gradient(135deg, rgba(0, 242, 234, 0.1), rgba(122, 90, 248, 0.1));
  border: 1px solid rgba(0, 242, 234, 0.3);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 12px 0 0 0;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: pulseGlow 4s infinite alternate;
}
.mobile-portal-name strong {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 0 8px rgba(0, 242, 234, 0.5);
}
.mobile-portal-name span {
  font-size: 1.5rem;
  margin-right: 8px;
  vertical-align: middle;
}
@media (max-width: 768px) {
  .mobile-portal-name {
    display: block;
  }
}
/* === PINNED MESSAGE === */
.pinned-message {
  background: rgba(0, 242, 234, 0.1);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--text);
}

/* === MOBILE TAB BAR & STICKY PLAYER === */
@media (max-width: 900px) {
  /* Show mobile tab bar */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    z-index: 999;
  }
  .mobile-tab-bar button {
    flex: 1;
    padding: 12px;
    background: transparent;
    color: var(--muted);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
  }
  .mobile-tab-bar button.active {
    color: var(--accent);
  }
  /* Sticky mini-player */
  .sticky-mini-player {
    display: flex;
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 998;
    padding: 8px 16px;
    align-items: center;
    gap: 12px;
  }
  .sticky-mini-player.hidden {
    display: none;
  }
  #stickyThumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
  }
  .sticky-info {
    flex: 1;
    min-width: 0;
  }
  #stickyTitle {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #stickyUser {
    font-size: 0.75rem;
  }
  #stickyUnmuteBtn {
    flex: 0;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  /* Ensure main content has bottom padding */
  #mainSection {
    padding-bottom: 60px;
  }
}
/* === GLOWING BANNER === */
.scrolling-banner {
  box-shadow: 0 0 10px rgba(0, 242, 234, 0.2);
}
.scrolling-banner:hover {
  box-shadow: 0 0 20px rgba(0, 242, 234, 0.4);
}

/* === PORTAL RECAP STYLING === */
#recapTopSongs .song {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  background: rgba(255,255,255,0.05); padding: 8px; border-radius: 8px;
}
#recapTopSongs .song-rank { font-size: 1.5rem; font-weight: bold; color: var(--accent); }
#recapTopSongs .song-title { font-weight: 600; text-align: left; }
#recapTopContributor strong { color: var(--accent); font-size: 1.2rem; }