*, *::before, *::after { box-sizing: border-box; }

/* === Navigation === */
.site-nav {
  background: var(--text-color);
  color: #fff;
  padding: 0.75rem 2rem;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.nav-links a {
  color: var(--accent-color);
  text-decoration: none;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ccc;
  font-size: 0.9rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}
.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.nav-sign-out {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.nav-sign-in {
  border: 1px solid var(--accent-color);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
}

/* === Flash Messages === */
.flash {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.flash-notice { background: #d4edda; color: #155724; }
.flash-alert  { background: #f8d7da; color: #721c24; }

/* === Listening Room === */
.listening-room {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Now Playing */
.now-playing-section {
  margin-bottom: 1.5rem;
}
#now-playing {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
}
.now-playing-art img {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  object-fit: cover;
}
.now-playing-art-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  background: var(--accent-color);
  opacity: 0.3;
}
.now-playing-info {
  flex: 1;
}
.now-playing-title {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
  color: var(--text-color);
}
.now-playing-artist {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: var(--text-color);
  opacity: 0.8;
}
.now-playing-album {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.6;
}
.now-playing-empty {
  text-align: center;
  padding: 3rem;
  background: var(--card-bg);
  border-radius: 12px;
}

/* Player Connect */
.player-connect {
  margin-bottom: 1.5rem;
  text-align: center;
}
/* SoundCloud Widget */
.player-connect iframe {
  border-radius: 8px;
}

/* Auth Form */
.auth-form-container {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 12px;
  text-align: center;
}
.auth-form-container h2 {
  margin: 0 0 0.5rem;
}
.auth-form-container p {
  margin: 0 0 1.5rem;
  opacity: 0.7;
}
.auth-form .form-group {
  margin-bottom: 1rem;
}
.auth-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--card-bg);
  border-radius: 8px;
  font-size: 1rem;
}
.auth-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Timeline */
.timeline-section {
  margin-bottom: 2rem;
}
.timeline-container {
  position: relative;
  height: 6px;
  background: var(--card-bg);
  border-radius: 3px;
  cursor: pointer;
}
.timeline-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 3px;
  width: 0%;
  transition: width 1s linear;
}
.timeline-markers {
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
}
.comment-marker {
  position: absolute;
  top: 2px;
  width: 8px;
  height: 8px;
  background: var(--text-color);
  border-radius: 50%;
  transform: translateX(-50%);
  opacity: 0.5;
  pointer-events: auto;
}
.comment-marker:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.3);
}
.timeline-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.6;
  margin-top: 0.3rem;
}

/* Room Columns */
.room-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .room-columns { grid-template-columns: 1fr; }
}

/* Comments */
.comments-section h3,
.voting-section h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
}
.comments-list {
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.comment {
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--card-bg);
  transition: background 0.3s;
}
.comment-active {
  background: rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 0 2px var(--accent-color);
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.comment-username {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-color);
}
.comment-time-badge {
  font-size: 0.75rem;
  background: var(--accent-color);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
.comment-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.comments-empty, .voting-empty {
  text-align: center;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 0.9rem;
  padding: 2rem;
}

/* Comment Form */
.comment-form-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.comment-form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.comment-form-time-badge {
  font-size: 0.8rem;
  background: var(--accent-color);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  min-width: 3rem;
  text-align: center;
}
.comment-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--card-bg);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
}
.comment-input:focus {
  outline: none;
  border-color: var(--accent-color);
}
.comment-error {
  color: #e74c3c;
  font-size: 0.8rem;
  margin: 0;
}
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent-color);
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* Sign In Prompt */
.sign-in-prompt {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  padding: 1rem;
}
.sign-in-prompt a {
  color: var(--accent-color);
  font-weight: 600;
}

/* Voting */
.voting-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.vote-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
}
.vote-track-info {
  display: flex;
  flex-direction: column;
}
.vote-track-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.vote-track-artist {
  font-size: 0.8rem;
  opacity: 0.7;
}
.vote-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.vote-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  min-width: 1.5rem;
  text-align: center;
}
.vote-form {
  display: inline;
}
.vote-btn {
  cursor: pointer;
}
.vote-btn.voted {
  background: none;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: default;
}
