/* ═══════════════════════════════════════════════════════
   Friends Panel (Steam-style slide-out)
   ═══════════════════════════════════════════════════════ */
#friends-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  z-index: 100;
  transition: background 0.25s, backdrop-filter 0.25s;
}
#friends-panel-backdrop.open {
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#friends-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: linear-gradient(180deg, #1a1611 0%, #0e0c08 100%);
  border-left: 2px solid #4a3f2e;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.9), inset 1px 0 0 rgba(255, 200, 120, 0.1);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Roboto Condensed', sans-serif;
  color: #f0e6d2;
}
#friends-panel.open {
  transform: translateX(0);
}

/* Header */
#friends-panel .fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid #3a3327;
  background: linear-gradient(180deg, #2a251c 0%, #1a1611 100%);
  flex-shrink: 0;
}
#friends-panel .fp-header h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffb833;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(255, 184, 51, 0.4);
}
#friends-panel #friends-panel-close {
  width: 36px;
  height: 36px;
  background: linear-gradient(180deg, #3a3327 0%, #1a1611 100%);
  border: 1px solid #4a3f2e;
  color: #cc3b1f;
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 200, 120, 0.1);
}
#friends-panel #friends-panel-close:hover {
  border-color: #cc3b1f;
  box-shadow: inset 0 1px 0 rgba(255, 200, 120, 0.1), 0 0 12px rgba(204, 59, 31, 0.4);
}

/* Tabs */
#friends-panel .tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #3a3327;
  flex-shrink: 0;
}
#friends-panel .tabs button {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  color: #8a7f66;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
#friends-panel .tabs button:hover {
  color: #c4b795;
  background: rgba(255, 255, 255, 0.02);
}
#friends-panel .tabs button.active {
  color: #ffb833;
  border-bottom-color: #ffb833;
  background: rgba(255, 184, 51, 0.05);
}
#friends-panel .tabs button .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  background: #cc3b1f;
  color: #fff;
  border-radius: 9px;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
}

/* Content */
#friends-panel .tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
#friends-panel .tab-content.active {
  display: block;
}
#friends-panel .card {
  padding: 0;
}

/* Friend row */
#friends-panel .friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(58, 51, 39, 0.5);
  transition: background 0.15s;
  position: relative;
}
#friends-panel .friend-row:last-child {
  border-bottom: none;
}
#friends-panel .friend-row:hover {
  background: rgba(255, 184, 51, 0.03);
}
#friends-panel .friend-row:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffb833;
  opacity: 0.6;
}

#friends-panel .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #444;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
#friends-panel .status-dot.online {
  background: #7ab648;
  border-color: rgba(122, 182, 72, 0.4);
  box-shadow: 0 0 10px rgba(122, 182, 72, 0.8);
}
#friends-panel .status-dot.in_game {
  background: #cc3b1f;
  border-color: rgba(204, 59, 31, 0.4);
  box-shadow: 0 0 10px rgba(204, 59, 31, 0.8);
  animation: fp-pulse-red 2s infinite;
}
#friends-panel .status-dot.offline {
  background: #444;
}
@keyframes fp-pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#friends-panel .friend-info {
  flex: 1;
  min-width: 0;
}
#friends-panel .friend-name {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #f0e6d2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#friends-panel .friend-meta {
  font-size: 11px;
  color: #8a7f66;
  margin-top: 3px;
}

/* Buttons */
#friends-panel .btn-sm {
  padding: 7px 14px;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 200, 120, 0.1);
}
#friends-panel .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#friends-panel .btn-primary {
  background: linear-gradient(180deg, #ffb833 0%, #cc5f10 100%);
  border: 1px solid #ffb833;
  color: #0e0c08;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 8px rgba(255, 140, 26, 0.3);
}
#friends-panel .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffc94a 0%, #e07020 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 12px rgba(255, 140, 26, 0.5);
}
#friends-panel .btn-secondary {
  background: linear-gradient(180deg, #3a3327 0%, #1a1611 100%);
  border: 1px solid #4a3f2e;
  color: #c4b795;
}
#friends-panel .btn-secondary:hover:not(:disabled) {
  border-color: #ffb833;
  color: #ffb833;
  box-shadow: inset 0 1px 0 rgba(255, 200, 120, 0.1), 0 0 8px rgba(255, 184, 51, 0.2);
}
#friends-panel .btn-danger {
  background: rgba(204, 59, 31, 0.15);
  color: #ff5a3a;
  border: 1px solid rgba(204, 59, 31, 0.4);
}
#friends-panel .btn-danger:hover:not(:disabled) {
  background: rgba(204, 59, 31, 0.3);
  border-color: #cc3b1f;
  box-shadow: 0 0 12px rgba(204, 59, 31, 0.4);
}

/* Search */
#friends-panel .search-bar {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(58, 51, 39, 0.5);
}
#friends-panel .search-bar input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #4a3f2e;
  border-radius: 2px;
  color: #f0e6d2;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: all 0.15s;
}
#friends-panel .search-bar input:focus {
  border-color: #ffb833;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 184, 51, 0.3);
}
#friends-panel .search-bar input::placeholder {
  color: #5a5142;
}

/* Empty/Loading */
#friends-panel .empty,
#friends-panel .loading {
  text-align: center;
  padding: 40px 20px;
  color: #5a5142;
  font-size: 13px;
}
#friends-panel .empty-icon {
  font-size: 42px;
  opacity: 0.35;
  margin-bottom: 10px;
  filter: grayscale(0.5);
}
#friends-panel .loading {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: fp-load-pulse 1.5s infinite;
}
@keyframes fp-load-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Section headers */
#friends-panel .section-header {
  padding: 10px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #ffb833;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-bottom: 1px solid rgba(58, 51, 39, 0.5);
  background: rgba(0, 0, 0, 0.2);
}

/* ═══ Toasts (глобально, не в панели) ═══ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Roboto Condensed', sans-serif;
  z-index: 1100;
  animation: toast-in 0.2s ease-out;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  border: 1px solid;
  border-left-width: 3px;
}
.toast.ok {
  background: rgba(122, 182, 72, 0.15);
  color: #bbf7d0;
  border-color: rgba(122, 182, 72, 0.4);
  border-left-color: #7ab648;
}
.toast.err {
  background: rgba(204, 59, 31, 0.15);
  color: #fecaca;
  border-color: rgba(204, 59, 31, 0.4);
  border-left-color: #cc3b1f;
}
.toast.info {
  background: rgba(77, 139, 191, 0.15);
  color: #93c5fd;
  border-color: rgba(77, 139, 191, 0.4);
  border-left-color: #4d8bbf;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  #friends-panel {
    width: 100%;
    max-width: 100%;
    border-left: none;
    border-top: 2px solid #4a3f2e;
  }
}