:root {
  --primary-bg: radial-gradient(ellipse at center, #1a2a3a 0%, #0d1a26 100%);
  --text-light: rgba(255, 255, 255, 0.9);
  --text-dim: rgba(255, 255, 255, 0.7);
  --glass-bg: linear-gradient(145deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px) saturate(180%);
  --discord-bg: linear-gradient(145deg, rgba(15, 20, 30, 0.85), rgba(10, 15, 25, 0.75));
  --discord-border: rgba(255, 255, 255, 0.08);
  --discord-height: 0px;
  --discord-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --discord-online: #3ba55c;
  --discord-idle: #faa61a;
  --discord-dnd: #ed4245;
  --discord-offline: #747f8d;
}

.discord-presence {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 300px; /* Reduced from 320px */
  background: var(--discord-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px;
  padding: 14px; /* Reduced from 18px */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
              0 2px 8px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid var(--discord-border);
  color: var(--text-light);
  opacity: 0;
  transform: translateY(15px);
  animation: discord-fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.3s;
  z-index: 10;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: var(--discord-font);
  overflow: hidden;
}

@keyframes discord-fadeIn {
  to { 
    opacity: 1; 
    transform: translateY(0); 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

@keyframes discord-spin {
  to { transform: rotate(360deg); }
}

.discord-presence::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2) 20%, 
    rgba(255, 255, 255, 0.2) 80%, 
    transparent);
  opacity: 0.3;
}

.discord-presence .presence-header {
  display: flex;
  align-items: center;
  gap: 12px; /* Reduced from 14px */
  margin-bottom: 12px; /* Reduced from 16px */
  position: relative;
}

.discord-presence .avatar-container {
  position: relative;
  flex-shrink: 0;
}

.discord-presence .avatar {
  width: 50px; /* Reduced from 60px */
  height: 50px; /* Reduced from 60px */
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.discord-presence .avatar:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.discord-presence .status-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px; /* Reduced from 18px */
  height: 16px; /* Reduced from 18px */
  border-radius: 50%;
  border: 3px solid var(--discord-bg);
  background: var(--discord-offline);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.discord-presence .status-badge.online { 
  background: var(--discord-online);
  box-shadow: 0 0 10px rgba(59, 165, 92, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.discord-presence .status-badge.idle { 
  background: var(--discord-idle);
  box-shadow: 0 0 10px rgba(250, 166, 26, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.discord-presence .status-badge.dnd { 
  background: var(--discord-dnd);
  box-shadow: 0 0 10px rgba(237, 66, 69, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.discord-presence .user-info {
  flex: 1;
  min-width: 0;
}

.discord-presence .username {
  font-size: 1.1rem; /* Reduced from 1.2rem */
  font-weight: 600;
  color: white;
  margin-bottom: 3px; /* Reduced from 4px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--discord-font);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.discord-presence .username #discord-display-name {
  color: #ffffff;
}

.discord-presence .username .secondary {
  font-size: 0.85rem; /* Reduced from 0.9rem */
  font-weight: normal;
  color: rgba(255, 255, 255, 0.6);
}

.discord-presence .username .discriminator {
  font-size: 0.8rem; /* Reduced from 0.85rem */
  font-weight: normal;
  color: rgba(255, 255, 255, 0.5);
}

.discord-presence .status {
  display: flex;
  align-items: center;
  gap: 6px; /* Reduced from 8px */
  font-size: 0.8rem; /* Reduced from 0.85rem */
  color: var(--text-dim);
  font-family: var(--discord-font);
  margin-bottom: 6px; /* Reduced from 8px */
}

.discord-presence .status-icon {
  width: 8px; /* Reduced from 10px */
  height: 8px; /* Reduced from 10px */
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.discord-presence .status-icon.online { 
  background: var(--discord-online);
  box-shadow: 0 0 6px rgba(59, 165, 92, 0.6);
}

.discord-presence .status-icon.idle { 
  background: var(--discord-idle);
  box-shadow: 0 0 6px rgba(250, 166, 26, 0.6);
}

.discord-presence .status-icon.dnd { 
  background: var(--discord-dnd);
  box-shadow: 0 0 6px rgba(237, 66, 69, 0.6);
}

/* Platform Indicators - Enhanced */
.discord-presence .platform-indicators {
  display: flex;
  gap: 6px; /* Reduced from 8px */
  margin-top: 4px; /* Reduced from 6px */
}

.discord-presence .platform-indicator {
  width: 24px; /* Reduced from 28px */
  height: 24px; /* Reduced from 28px */
  border-radius: 6px; /* Reduced from 8px */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.discord-presence .platform-indicator i {
  font-size: 12px; /* Reduced from 14px */
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.discord-presence .platform-indicator.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.discord-presence .platform-indicator.active i {
  color: #ffffff;
  text-shadow: 0 0 8px currentColor;
}

.discord-presence .activity-list {
  max-height: 180px; /* Reduced from 220px */
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 12px; /* Reduced from 16px */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.discord-presence .activity-list::-webkit-scrollbar {
  width: 4px;
}

.discord-presence .activity-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.discord-presence .activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.discord-presence .activity-block {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px; /* Reduced from 12px */
  padding: 10px; /* Reduced from 14px */
  margin-bottom: 8px; /* Reduced from 10px */
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.discord-presence .activity-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1) 30%, 
    rgba(255, 255, 255, 0.1) 70%, 
    transparent);
  opacity: 0.5;
}

.discord-presence .activity-block:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.discord-presence .activity-title {
  font-size: 0.85rem; /* Reduced from 0.9rem */
  font-weight: 600;
  color: white;
  margin-bottom: 6px; /* Reduced from 8px */
  display: flex;
  align-items: center;
  gap: 6px; /* Reduced from 8px */
  font-family: var(--discord-font);
  letter-spacing: -0.01em;
}

.discord-presence .activity-title i {
  font-size: 0.9em; /* Reduced from 1em */
  opacity: 0.9;
  flex-shrink: 0;
}

.discord-presence .activity-detail {
  font-size: 0.8rem; /* Reduced from 0.85rem */
  color: var(--text-dim);
  margin-bottom: 3px; /* Reduced from 4px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--discord-font);
}

.discord-presence .activity-state {
  font-size: 0.75rem; /* Reduced from 0.8rem */
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
  font-family: var(--discord-font);
}

/* Spotify Player Section - Enhanced */
.discord-presence .spotify-container {
  display: flex;
  gap: 12px; /* Reduced from 14px */
  margin-top: 10px; /* Reduced from 12px */
  padding: 12px; /* Reduced from 16px */
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px; /* Reduced from 12px */
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

.discord-presence .spotify-container.color-extracted {
  background: var(--spotify-bg-color, rgba(0, 0, 0, 0.3));
  box-shadow: 0 6px 20px var(--spotify-shadow-color, rgba(0, 0, 0, 0.3));
}

.discord-presence .spotify-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    var(--spotify-gradient-start, rgba(255, 255, 255, 0.05)) 0%, 
    transparent 50%, 
    var(--spotify-gradient-end, rgba(0, 0, 0, 0.02)) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.discord-presence .spotify-container.color-extracted::before {
  opacity: 1;
}

.discord-presence .spotify-container:hover,
.discord-presence .spotify-container:active {
  background: var(--spotify-bg-hover, rgba(0, 0, 0, 0.4));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--spotify-shadow-hover, rgba(0, 0, 0, 0.4));
  border-color: var(--spotify-border-color, rgba(255, 255, 255, 0.15));
}

.discord-presence .album-art-container {
  position: relative;
  flex-shrink: 0;
}

.discord-presence .album-art {
  width: 48px; /* Reduced from 56px */
  height: 48px; /* Reduced from 56px */
  border-radius: 6px; /* Reduced from 8px */
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.discord-presence .album-art:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.discord-presence .album-art-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; /* Reduced from 24px */
  height: 20px; /* Reduced from 24px */
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.discord-presence .album-art-container::before {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 52%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 8px; /* Reduced from 10px */
  z-index: 4;
  opacity: 0;
  transition: all 0.3s ease;
}

.discord-presence .album-art-container:hover::after,
.discord-presence .album-art-container:hover::before {
  opacity: 1;
}

.discord-presence .spotify-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.discord-presence .spotify-details .activity-detail {
  font-size: 0.9rem; /* Reduced from 0.95rem */
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px; /* Reduced from 6px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-family: var(--discord-font);
  letter-spacing: -0.01em;
}

.discord-presence .spotify-details .activity-state {
  font-size: 0.78rem; /* Reduced from 0.82rem */
  color: #b3b3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px; /* Reduced from 3px */
  font-weight: 400;
  font-family: var(--discord-font);
}

.discord-presence .spotify-details .activity-state:last-child {
  font-size: 0.75rem; /* Reduced from 0.8rem */
  color: #b3b3b3;
  font-style: normal;
  font-weight: 400;
  font-family: var(--discord-font);
}

.discord-presence .progress-container {
  margin-top: 8px; /* Reduced from 10px */
  padding: 0;
}

.discord-presence .progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem; /* Reduced from 0.72rem */
  color: #b3b3b3;
  font-weight: 400;
  margin-bottom: 4px; /* Reduced from 6px */
  font-family: var(--discord-font);
}

.discord-presence .progress-bar {
  width: 100%;
  height: 3px; /* Reduced from 4px */
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  touch-action: pan-x;
  position: relative;
}

.discord-presence .progress-bar:hover {
  background: rgba(255, 255, 255, 0.15);
}

.discord-presence .progress-bar:hover .progress {
  background: #1ed760;
}

/* Mobile-specific touch target for progress bar */
.discord-presence .progress-bar::after {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 0;
  right: 0;
  background: transparent;
}

.discord-presence .progress {
  height: 100%;
  background: #1db954;
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(29, 185, 84, 0.5);
}

.discord-presence .no-activity {
  text-align: center;
  padding: 16px 0; /* Reduced from 20px */
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem; /* Reduced from 0.9rem */
  font-family: var(--discord-font);
  font-style: italic;
}

.discord-presence .loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 16px 0; /* Reduced from 20px */
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--discord-font);
}

.discord-presence .loading-spinner {
  width: 16px; /* Reduced from 18px */
  height: 16px; /* Reduced from 18px */
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: discord-spin 1s linear infinite;
}

.discord-presence .error-message {
  text-align: center;
  padding: 16px 0; /* Reduced from 20px */
  color: #ff6b6b;
  font-size: 0.85rem; /* Reduced from 0.9rem */
  font-family: var(--discord-font);
  line-height: 1.5;
}

.discord-presence .refresh-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px; /* Reduced from 10px 20px */
  border-radius: 24px;
  margin-top: 10px; /* Reduced from 12px */
  font-size: 0.8rem; /* Reduced from 0.85rem */
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
  touch-action: manipulation;
  min-height: 40px; /* Reduced from 44px */
  transition: all 0.3s ease;
  font-family: var(--discord-font);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.discord-presence .refresh-btn:hover,
.discord-presence .refresh-btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.discord-presence .credits {
  text-align: center;
  margin-top: 12px; /* Reduced from 16px */
  padding-top: 10px; /* Reduced from 12px */
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.65rem; /* Reduced from 0.7rem */
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--discord-font);
}

.discord-presence .credits a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.discord-presence .credits a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Desktop View */
@media (min-width: 1200px) {
  .discord-presence {
    bottom: 30px;
    left: 30px;
    width: 320px; /* Reduced from 340px */
  }
}

@media (min-width: 769px) {
  .discord-presence {
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
    width: 300px; /* Reduced from 320px */
  }
  
  /* Desktop hover effects */
  .discord-presence .spotify-container:hover .album-art-container::after,
  .discord-presence .spotify-container:hover .album-art-container::before {
    opacity: 1;
  }
}

/* Mobile View */
@media (max-width: 768px) {
  .discord-presence {
    top: max(20px, env(safe-area-inset-top, 20px));
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translateX(-50%) translateY(15px);
    width: min(340px, calc(100vw - 30px)); /* Reduced from 360px */
    max-width: calc(100vw - 30px);
    z-index: 1500;
    padding: 16px; /* Reduced from 20px */
    border-radius: 18px; /* Reduced from 20px */
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    backdrop-filter: blur(24px) saturate(200%);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
  
  @keyframes discord-fadeIn {
    to { 
      opacity: 1; 
      transform: translateX(-50%) translateY(0); 
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                  inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
  }
  
  .discord-presence .presence-header {
    gap: 14px; /* Reduced from 16px */
    margin-bottom: 14px; /* Reduced from 18px */
  }
  
  .discord-presence .avatar {
    width: 56px; /* Reduced from 64px */
    height: 56px; /* Reduced from 64px */
    transition: none;
  }
  
  .discord-presence .avatar:hover {
    transform: none;
  }
  
  .discord-presence .status-badge {
    width: 18px; /* Reduced from 20px */
    height: 18px; /* Reduced from 20px */
    border-width: 3px;
  }
  
  .discord-presence .username {
    font-size: 1.15rem; /* Reduced from 1.25rem */
  }
  
  .discord-presence .status {
    font-size: 0.85rem; /* Reduced from 0.9rem */
  }
  
  .discord-presence .activity-list {
    max-height: 180px; /* Reduced from 200px */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .discord-presence .activity-list::-webkit-scrollbar {
    display: none;
  }
  
  .discord-presence .activity-block {
    padding: 12px; /* Reduced from 16px */
    margin-bottom: 10px; /* Reduced from 12px */
    border-radius: 12px; /* Reduced from 14px */
  }
  
  .discord-presence .activity-title {
    font-size: 0.9rem; /* Reduced from 0.95rem */
    margin-bottom: 8px; /* Reduced from 10px */
  }
  
  .discord-presence .activity-detail {
    font-size: 0.85rem; /* Reduced from 0.88rem */
    line-height: 1.4;
  }
  
  .discord-presence .activity-state {
    font-size: 0.78rem; /* Reduced from 0.82rem */
    margin-top: 3px; /* Reduced from 4px */
  }
  
  .discord-presence .spotify-container {
    padding: 14px; /* Reduced from 18px */
    gap: 14px; /* Reduced from 16px */
    margin-top: 12px; /* Reduced from 14px */
    border-radius: 12px; /* Reduced from 14px */
    transition: none;
  }
  
  .discord-presence .spotify-container:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  .discord-presence .album-art {
    width: 54px; /* Reduced from 60px */
    height: 54px; /* Reduced from 60px */
    border-radius: 8px; /* Reduced from 10px */
    transition: none;
  }
  
  .discord-presence .album-art:hover {
    transform: none;
  }
  
  /* Remove play button hover effects on mobile */
  .discord-presence .album-art-container::after,
  .discord-presence .album-art-container::before {
    display: none;
  }
  
  .discord-presence .spotify-details .activity-detail {
    font-size: 0.95rem; /* Reduced from 1rem */
  }
  
  .discord-presence .spotify-details .activity-state {
    font-size: 0.82rem; /* Reduced from 0.85rem */
    margin-bottom: 3px; /* Reduced from 4px */
  }
  
  .discord-presence .progress-container {
    margin-top: 10px; /* Reduced from 12px */
  }
  
  .discord-presence .progress-time {
    font-size: 0.72rem; /* Reduced from 0.75rem */
    margin-bottom: 6px; /* Reduced from 8px */
  }
  
  .discord-presence .progress-bar {
    height: 5px; /* Reduced from 6px */
    border-radius: 3px;
  }
  
  .discord-presence .progress {
    border-radius: 3px;
  }
  
  .discord-presence .no-activity {
    padding: 20px 0; /* Reduced from 24px */
    font-size: 0.9rem; /* Reduced from 0.95rem */
  }
  
  .discord-presence .loading {
    padding: 20px 0; /* Reduced from 24px */
  }
  
  .discord-presence .error-message {
    padding: 20px 0; /* Reduced from 24px */
    font-size: 0.9rem; /* Reduced from 0.95rem */
  }
  
  .discord-presence .refresh-btn {
    padding: 10px 20px; /* Reduced from 12px 24px */
    font-size: 0.85rem; /* Reduced from 0.9rem */
    min-height: 44px; /* Reduced from 48px */
    border-radius: 24px;
  }
  
  .discord-presence .credits {
    margin-top: 16px; /* Reduced from 20px */
    padding-top: 12px; /* Reduced from 14px */
    font-size: 0.68rem; /* Reduced from 0.72rem */
  }
  
  /* Platform indicators mobile */
  .discord-presence .platform-indicators {
    gap: 8px; /* Reduced from 10px */
    margin-top: 6px; /* Reduced from 8px */
  }
  
  .discord-presence .platform-indicator {
    width: 28px; /* Reduced from 32px */
    height: 28px; /* Reduced from 32px */
    border-radius: 8px; /* Reduced from 10px */
  }
  
  .discord-presence .platform-indicator i {
    font-size: 14px; /* Reduced from 16px */
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .discord-presence {
    top: max(15px, env(safe-area-inset-top, 15px));
    width: calc(100vw - 24px);
    padding: 14px; /* Reduced from 18px */
    border-radius: 16px; /* Reduced from 18px */
  }
  
  .discord-presence .presence-header {
    gap: 12px; /* Reduced from 14px */
    margin-bottom: 14px; /* Reduced from 16px */
  }
  
  .discord-presence .avatar {
    width: 50px; /* Reduced from 56px */
    height: 50px; /* Reduced from 56px */
  }
  
  .discord-presence .username {
    font-size: 1.1rem; /* Reduced from 1.15rem */
  }
  
  .discord-presence .status {
    font-size: 0.8rem; /* Reduced from 0.85rem */
  }
  
  .discord-presence .activity-block {
    padding: 12px; /* Reduced from 14px */
  }
  
  .discord-presence .spotify-container {
    padding: 12px; /* Reduced from 16px */
    gap: 12px; /* Reduced from 14px */
  }
  
  .discord-presence .album-art {
    width: 48px; /* Reduced from 54px */
    height: 48px; /* Reduced from 54px */
  }
  
  .discord-presence .spotify-details .activity-detail {
    font-size: 0.9rem; /* Reduced from 0.95rem */
  }
  
  .discord-presence .spotify-details .activity-state {
    font-size: 0.78rem; /* Reduced from 0.82rem */
  }
  
  .discord-presence .activity-title {
    font-size: 0.85rem; /* Reduced from 0.9rem */
  }
  
  .discord-presence .activity-detail {
    font-size: 0.8rem; /* Reduced from 0.85rem */
  }
  
  .discord-presence .activity-state {
    font-size: 0.75rem; /* Reduced from 0.78rem */
  }
}

/* Very Small Devices */
@media (max-width: 360px) {
  .discord-presence {
    width: calc(100vw - 20px);
    padding: 12px; /* Reduced from 16px */
  }
  
  .discord-presence .presence-header {
    gap: 10px; /* Reduced from 12px */
  }
  
  .discord-presence .avatar {
    width: 46px; /* Reduced from 52px */
    height: 46px; /* Reduced from 52px */
  }
  
  .discord-presence .album-art {
    width: 44px; /* Reduced from 48px */
    height: 44px; /* Reduced from 48px */
  }
  
  .discord-presence .spotify-container {
    padding: 10px; /* Reduced from 14px */
    gap: 10px; /* Reduced from 12px */
  }
  
  .discord-presence .platform-indicator {
    width: 24px; /* Reduced from 28px */
    height: 24px; /* Reduced from 28px */
  }
  
  .discord-presence .platform-indicator i {
    font-size: 12px; /* Reduced from 14px */
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .discord-presence {
    top: max(10px, env(safe-area-inset-top, 10px));
    width: min(320px, calc(100vw - 40px)); /* Reduced from 340px */
    padding: 14px; /* Reduced from 16px */
    border-radius: 14px; /* Reduced from 16px */
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .discord-presence .presence-header {
    margin-bottom: 12px; /* Reduced from 14px */
  }
  
  .discord-presence .avatar {
    width: 44px; /* Reduced from 48px */
    height: 44px; /* Reduced from 48px */
  }
  
  .discord-presence .username {
    font-size: 1.05rem; /* Reduced from 1.1rem */
  }
  
  .discord-presence .album-art {
    width: 46px; /* Reduced from 50px */
    height: 46px; /* Reduced from 50px */
  }
  
  .discord-presence .spotify-container {
    padding: 12px; /* Reduced from 14px */
    gap: 10px; /* Reduced from 12px */
  }
  
  .discord-presence .activity-list {
    max-height: 120px; /* Reduced from 140px */
  }
  
  .discord-presence .activity-block {
    padding: 10px; /* Reduced from 12px */
    margin-bottom: 6px; /* Reduced from 8px */
  }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .discord-presence {
    border: 0.5px solid rgba(255, 255, 255, 0.08);
  }
  
  .discord-presence .progress-bar {
    height: 3px;
  }
  
  @media (max-width: 768px) {
    .discord-presence .progress-bar {
      height: 4px; /* Reduced from 5px */
    }
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .discord-presence {
    animation: none;
    opacity: 1;
    transform: translateY(0);
  }
  
  @media (max-width: 768px) {
    .discord-presence {
      transform: translateX(-50%) translateY(0);
    }
  }
  
  .discord-presence .avatar,
  .discord-presence .album-art,
  .discord-presence .spotify-container,
  .discord-presence .refresh-btn,
  .discord-presence .activity-block,
  .discord-presence .platform-indicator {
    transition: none;
  }
  
  .discord-presence .loading-spinner {
    animation: none;
  }
}

/* Dark Mode Enhancement */
@media (prefers-color-scheme: dark) {
  .discord-presence {
    background: linear-gradient(145deg, rgba(10, 15, 25, 0.9), rgba(5, 10, 20, 0.85));
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    backdrop-filter: blur(24px) saturate(200%);
  }
}