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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.app {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.app-header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  padding: 24px;
  text-align: center;
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.counter-section {
  padding: 32px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.counter-display {
  text-align: center;
  margin-bottom: 24px;
}

.counter-value {
  font-size: 48px;
  font-weight: 800;
  color: #1f2937;
  margin: 0;
}

.counter-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-increment {
  background: #10b981;
  color: white;
}

.btn-increment:hover {
  background: #059669;
}

.btn-decrement {
  background: #ef4444;
  color: white;
}

.btn-decrement:hover {
  background: #dc2626;
}

.btn-add {
  background: #3b82f6;
  color: white;
  padding: 12px 32px;
}

.btn-add:hover {
  background: #2563eb;
}

.btn-add:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.list-section {
  padding: 24px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.list-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.btn-sort {
  background: #8b5cf6;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-sort:hover {
  background: #7c3aed;
}

.btn-reset {
  background: #f59e0b;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  margin-left: 8px;
}

.btn-reset:hover {
  background: #d97706;
}

.numbers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.number-item {
  background: #f3f4f6;
  padding: 16px 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s ease;
}

.number-item.highest {
  background: linear-gradient(135deg, #fef3c7, #fcd34d);
  color: #92400e;
  transform: scale(1.05);
}

.number-item.lowest {
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
  color: #1e40af;
  transform: scale(1.05);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 16px;
  margin: 0;
}

@media (max-width: 480px) {
  .counter-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn {
    width: 100%;
    max-width: 200px;
  }
  
  .list-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .numbers-list {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }
}