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

body {
  font-family: var(--font-primary);
  background: var(--background-base-lowest);
  color: var(--text-default);
  min-height: 100vh;
  line-height: 1.2;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

.error-msg {
  color: var(--text-danger);
  font-size: 13px;
  min-height: 18px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--background-accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); }

button { font-family: inherit; cursor: pointer; }

.text-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.text-btn:hover {
  background: var(--background-mod-strong);
  color: var(--text-default);
}

.accent-btn {
  background: var(--brand-500);
  border: none;
  color: var(--white);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.accent-btn:hover { background: #7983f5; }
.accent-btn:disabled { opacity: 0.4; cursor: default; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}

.icon-btn:hover {
  color: var(--text-default);
  background: var(--background-mod-strong);
}

input[type="text"] {
  background: var(--background-base-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-default);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.12s;
  font-family: inherit;
}

input[type="text"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus { border-color: var(--brand-500); }
input[type="text"]:disabled { opacity: 0.5; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: var(--background-base-lower);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card h3 {
  color: var(--text-default);
  font-size: 16px;
}

.modal-card input { width: 100%; }

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

.friends-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
}

.friends-panel {
  position: fixed;
  bottom: 56px;
  right: 16px;
  width: 240px;
  background: var(--background-base-lower);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}

.friends-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 4px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.friends-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.friend-row:hover { background: var(--background-mod-strong); }

.friend-row .friend-name { color: var(--text-subtle); }

.friend-row .friend-status {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--background-base-low);
}

.friend-accept {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--brand-500);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background 0.12s;
}

.friend-accept:hover { background: #7983f5; }

.friend-remove {
  font-size: 11px;
  padding: 3px 6px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s;
}

.friend-remove:hover { color: var(--text-danger); }
