.command-browser {
  margin-top: 2rem;
}

.command-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.tab-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  font: inherit;
  font-size: 0.9rem;
}

.tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 29, 46, 0.25);
}

.command-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.command-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  transform: scaleY(0);
  transition: transform 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.command-item:hover {
  background: var(--surface-2);
  border-color: rgba(225, 29, 46, 0.25);
}

.command-item:hover::before {
  transform: scaleY(1);
}

.command-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.command-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

.command-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.command-desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.command-tag {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(225, 29, 46, 0.1);
  color: var(--primary);
  border: 1px solid rgba(225, 29, 46, 0.2);
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
  min-height: 280px;
}

.chat-message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(10px);
  animation: messagePop 0.5s ease forwards;
}

.chat-message.bot {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.chat-message.bot .chat-avatar {
  background: linear-gradient(135deg, var(--accent), #00d4ff);
}

.chat-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: rgba(225, 29, 46, 0.1);
  border: 1px solid rgba(225, 29, 46, 0.2);
  max-width: 80%;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}

.chat-message.bot .chat-bubble {
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: rgba(240, 91, 102, 0.08);
  border-color: rgba(240, 91, 102, 0.2);
}

.chat-author {
  font-weight: 800;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  color: var(--primary);
}

.chat-message.bot .chat-author {
  color: var(--accent);
  text-align: right;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-switch {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.toggle-switch::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  margin: 1rem 0 0.5rem;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(225, 29, 46, 0.3);
  transition: transform 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: toastIn 0.4s ease both;
  max-width: 320px;
  font-size: 0.92rem;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toast-icon {
  font-weight: 900;
}

.toast.success {
  border-left: 3px solid var(--accent);
}
.toast.error {
  border-left: 3px solid var(--danger);
}
.toast.info {
  border-left: 3px solid var(--primary);
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.4rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: var(--shadow);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

.tournament-panel {
  padding: 1.5rem;
  transition: border-color 160ms ease;
}

.tournament-panel:hover {
  border-color: rgba(225, 29, 46, 0.34);
}

.tournament-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.tournament-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tournament-meta {
  min-width: 0;
}

.tournament-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.tournament-id {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
}

.tournament-details {
  display: grid;
  gap: 0.6rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-row strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.tournament-actions {
  margin-top: 1rem;
}

/* Static login location map (no JavaScript) */
.admin-user-map--static {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  border-radius: 0.75rem;
  border: 1px solid #26262a;
  background: #101014;
}

.admin-user-map--static .admin-map-tiles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  filter: saturate(0.85) brightness(0.92);
}

.admin-user-map--static .admin-map-tiles img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-user-map--static .admin-login-map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.admin-user-map--static .admin-login-map-marker summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5555, #ff3333 52%, #b91c1c);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 120ms ease;
}

.admin-user-map--static .admin-login-map-marker summary::-webkit-details-marker {
  display: none;
}

.admin-user-map--static .admin-login-map-marker[open] summary,
.admin-user-map--static .admin-login-map-marker summary:hover {
  transform: scale(1.15);
}

.admin-user-map--static .admin-login-map-marker--cluster summary {
  width: 38px;
  height: 38px;
  background: linear-gradient(180deg, #ff7a7a, #e11d2e 52%, #86121a);
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

.admin-user-map--static .admin-login-map-marker .admin-map-popup {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  background: rgba(12, 12, 16, 0.96);
  border: 1px solid #32323a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  z-index: 3;
}

.admin-user-map--static .admin-map-popup .admin-map-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.18rem 0;
}

.admin-user-map--static .admin-map-popup .admin-map-popup-row span {
  color: #9a9aa5;
  white-space: nowrap;
}

.admin-user-map--static .admin-map-popup .admin-map-popup-row strong {
  color: #e8e8ef;
  text-align: right;
  overflow-wrap: anywhere;
}
