.app {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.65rem 0.75rem 0.85rem;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface-color);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-glass);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  transform: translateY(-1px);
  letter-spacing: -0.02em;
}

.app-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-block;
  object-fit: contain;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.35);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  padding: 0.45rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-show-header {
  position: fixed;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  z-index: 1000;
  opacity: 0.5;
  transition: all 0.2s;
  padding: 0;
}

.btn-show-header:hover {
  opacity: 1;
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  transform: scale(1.1);
  color: var(--primary-color);
}

.btn-add {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-add:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.add-form {
  background: var(--surface-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--border-color);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.add-form input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: all 0.2s;
  background: var(--bg-color);
  color: var(--text-main);
}

.add-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.1);
  background: var(--surface-color);
}

.btn-submit {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--surface-color);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-glass);
  box-shadow: var(--shadow-sm);
  border: 1px dashed var(--glass-border);
}

.empty-state p {
  margin: 0.5rem 0;
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.empty-state .hint {
  color: var(--text-light);
  font-size: 0.875rem;
}

.logo-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.logo-hit:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.token-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 12, 22, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.token-gate-dialog {
  width: min(400px, 100%);
  background: var(--surface-color);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-md);
}

.token-gate-dialog h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--text-main);
}

.token-gate-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.token-gate-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.token-gate-error {
  color: #f87171;
  font-size: 0.8125rem;
  margin: 0 0 0.75rem;
}

.token-gate-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-cancel {
  background: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-cancel:hover {
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .app {
    padding: 1rem;
  }

  .app-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    text-align: center;
    padding: 1rem;
  }

  .app-header h1 {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
  }
}
